1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #ifndef _SFX_IPCLIENT_HXX
20 #define _SFX_IPCLIENT_HXX
22 #include "sal/config.h"
23 #include "sfx2/dllapi.h"
24 #include "sal/types.h"
25 #include <com/sun/star/uno/Reference.h>
26 #include <com/sun/star/embed/Aspects.hpp>
27 #include <com/sun/star/embed/XEmbeddedObject.hpp>
29 #include <tools/gen.hxx>
31 #include <sfx2/objsh.hxx>
33 class SfxInPlaceClient_Impl
;
39 //=========================================================================
41 class SFX2_DLLPUBLIC SfxInPlaceClient
43 friend class SfxInPlaceClient_Impl
;
45 SfxInPlaceClient_Impl
* m_pImp
;
46 SfxViewShell
* m_pViewSh
;
49 // called after the requested new object area was negotiated
50 SAL_DLLPRIVATE
virtual void ObjectAreaChanged();
52 // an active object was resized by the user and now asks for the new space
53 SAL_DLLPRIVATE
virtual void RequestNewObjectArea( Rectangle
& );
55 // notify the client that an active object has changed its VisualAreaSize
56 SAL_DLLPRIVATE
virtual void ViewChanged();
58 // an object wants to become visible
59 SAL_DLLPRIVATE
virtual void MakeVisible();
62 SfxInPlaceClient( SfxViewShell
* pViewShell
, Window
* pDraw
, sal_Int64 nAspect
= com::sun::star::embed::Aspects::MSOLE_CONTENT
);
63 virtual ~SfxInPlaceClient();
65 SfxViewShell
* GetViewShell() const { return m_pViewSh
; }
66 Window
* GetEditWin() const { return m_pEditWin
; }
67 com::sun::star::uno::Reference
< com::sun::star::embed::XEmbeddedObject
> GetObject() const;
68 void SetObject( const com::sun::star::uno::Reference
< com::sun::star::embed::XEmbeddedObject
>& rObject
);
69 void SetObjectState( sal_Int32
);
70 Size
GetObjectVisAreaSize() const;
71 sal_Bool
IsObjectUIActive() const;
72 sal_Bool
IsObjectInPlaceActive() const;
73 void DeactivateObject();
74 sal_Bool
SetObjArea( const Rectangle
& );
75 Rectangle
GetObjArea() const;
76 Rectangle
GetScaledObjArea() const;
77 void SetSizeScale( const Fraction
& rScaleWidth
, const Fraction
& rScaleHeight
);
78 sal_Bool
SetObjAreaAndScale( const Rectangle
&, const Fraction
&, const Fraction
& );
79 const Fraction
& GetScaleWidth() const;
80 const Fraction
& GetScaleHeight() const;
82 static SfxInPlaceClient
* GetClient( SfxObjectShell
* pDoc
, const com::sun::star::uno::Reference
< com::sun::star::embed::XEmbeddedObject
>& xObject
);
83 sal_Int64
GetAspect() const;
84 sal_Int64
GetObjectMiscStatus() const;
85 ErrCode
DoVerb( long nVerb
);
86 void VisAreaChanged();
88 sal_Bool
IsUIActive();
90 virtual void FormatChanged(); // object format was changed (used for StarMath formulas aligning)
95 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */