/src/libreoffice/include/sfx2/ipclient.hxx
Line | Count | Source (jump to first uncovered line) |
1 | | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
2 | | /* |
3 | | * This file is part of the LibreOffice project. |
4 | | * |
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/. |
8 | | * |
9 | | * This file incorporates work covered by the following license notice: |
10 | | * |
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 . |
18 | | */ |
19 | | #ifndef INCLUDED_SFX2_IPCLIENT_HXX |
20 | | #define INCLUDED_SFX2_IPCLIENT_HXX |
21 | | |
22 | | #include <sal/config.h> |
23 | | #include <sfx2/dllapi.h> |
24 | | #include <sal/types.h> |
25 | | #include <rtl/ref.hxx> |
26 | | |
27 | | #include <tools/gen.hxx> |
28 | | |
29 | | #include <comphelper/errcode.hxx> |
30 | | #include <vcl/vclptr.hxx> |
31 | | |
32 | | namespace com::sun::star::embed { class XEmbeddedObject; } |
33 | | namespace com::sun::star::uno { template <typename > class Reference; } |
34 | | namespace vcl { class Window; } |
35 | | |
36 | | class SfxInPlaceClient_Impl; |
37 | | class SfxViewShell; |
38 | | class SfxObjectShell; |
39 | | class Fraction; |
40 | | |
41 | | |
42 | | class SFX2_DLLPUBLIC SfxInPlaceClient |
43 | | { |
44 | | friend class SfxInPlaceClient_Impl; |
45 | | |
46 | | rtl::Reference<SfxInPlaceClient_Impl> m_xImp; |
47 | | SfxViewShell* m_pViewSh; |
48 | | VclPtr<vcl::Window> m_pEditWin; |
49 | | |
50 | | // called after the requested new object area was negotiated |
51 | | SAL_DLLPRIVATE virtual void ObjectAreaChanged(); |
52 | | |
53 | | // an active object was resized by the user and now asks for the new space |
54 | | SAL_DLLPRIVATE virtual void RequestNewObjectArea( tools::Rectangle& ); |
55 | | |
56 | | // notify the client that an active object has changed its VisualAreaSize |
57 | | SAL_DLLPRIVATE virtual void ViewChanged(); |
58 | | |
59 | | public: |
60 | | SfxInPlaceClient( SfxViewShell* pViewShell, vcl::Window* pDraw, sal_Int64 nAspect ); |
61 | | virtual ~SfxInPlaceClient(); |
62 | | |
63 | | SfxInPlaceClient(const SfxInPlaceClient &) = delete; |
64 | | SfxInPlaceClient& operator=(const SfxInPlaceClient &) = delete; |
65 | | |
66 | 0 | SfxViewShell* GetViewShell() const { return m_pViewSh; } |
67 | 0 | vcl::Window* GetEditWin() const { return m_pEditWin; } |
68 | | const css::uno::Reference < css::embed::XEmbeddedObject >& GetObject() const; |
69 | | void SetObject( const css::uno::Reference < css::embed::XEmbeddedObject >& rObject ); |
70 | | void SetObjectState( sal_Int32 ); |
71 | | bool IsObjectUIActive() const; |
72 | | bool IsObjectInPlaceActive() const; |
73 | | void DeactivateObject(); |
74 | | bool SetObjArea( const tools::Rectangle & ); |
75 | | const tools::Rectangle& GetObjArea() const; |
76 | | tools::Rectangle GetScaledObjArea() const; |
77 | | void SetSizeScale( const Fraction & rScaleWidth, const Fraction & rScaleHeight ); |
78 | | void SetObjAreaAndScale( const tools::Rectangle&, const Fraction&, const Fraction& ); |
79 | | const Fraction& GetScaleWidth() const; |
80 | | const Fraction& GetScaleHeight() const; |
81 | | void Invalidate(); |
82 | | static SfxInPlaceClient* GetClient( SfxObjectShell const * pDoc, const css::uno::Reference < css::embed::XEmbeddedObject >& xObject ); |
83 | | sal_Int64 GetAspect() const; |
84 | | sal_Int64 GetObjectMiscStatus() const; |
85 | | ErrCodeMsg DoVerb(sal_Int32 nVerb); |
86 | | void VisAreaChanged(); |
87 | | void ResetObject(); |
88 | | bool IsUIActive() const; |
89 | | |
90 | | /// To indicate that negated document X coordinates are used |
91 | | void SetNegativeX(bool bSet); |
92 | | bool IsNegativeX() const; |
93 | | |
94 | | virtual void FormatChanged(); // object format was changed (used for StarMath formulas aligning) |
95 | | |
96 | | virtual bool IsProtected() const; |
97 | | }; |
98 | | |
99 | | #endif |
100 | | |
101 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |