/src/libreoffice/svx/inc/sdr/contact/viewobjectcontactofunocontrol.hxx
Line | Count | Source |
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 | | |
20 | | #ifndef INCLUDED_SVX_INC_SDR_CONTACT_VIEWOBJECTCONTACTOFUNOCONTROL_HXX |
21 | | #define INCLUDED_SVX_INC_SDR_CONTACT_VIEWOBJECTCONTACTOFUNOCONTROL_HXX |
22 | | |
23 | | #include <svx/sdr/contact/viewobjectcontactofsdrobj.hxx> |
24 | | |
25 | | #include <com/sun/star/uno/Reference.hxx> |
26 | | #include <rtl/ref.hxx> |
27 | | |
28 | | namespace vcl { class Window; } |
29 | | class SdrUnoObj; |
30 | | namespace com::sun::star { |
31 | | namespace awt { |
32 | | class XControl; |
33 | | class XControlContainer; |
34 | | } |
35 | | } |
36 | | |
37 | | |
38 | | namespace sdr::contact { |
39 | | |
40 | | |
41 | | class ViewContactOfUnoControl; |
42 | | class ObjectContactOfPageView; |
43 | | |
44 | | //= ViewObjectContactOfUnoControl |
45 | | |
46 | | class ViewObjectContactOfUnoControl_Impl; |
47 | | class ViewObjectContactOfUnoControl : public ViewObjectContactOfSdrObj |
48 | | { |
49 | | protected: |
50 | | ::rtl::Reference< ViewObjectContactOfUnoControl_Impl > m_pImpl; |
51 | | |
52 | | public: |
53 | | ViewObjectContactOfUnoControl( ObjectContact& _rObjectContact, ViewContactOfUnoControl& _rViewContact ); |
54 | | |
55 | | /// returns the ->XControl instance belonging to the instance, creates it if necessary |
56 | | css::uno::Reference< css::awt::XControl > |
57 | | getControl(); |
58 | | |
59 | | /** retrieves a temporary XControl instance, whose parent is the given device |
60 | | @seealso SdrUnoObj::GetTemporaryControlForWindow |
61 | | */ |
62 | | static css::uno::Reference< css::awt::XControl > |
63 | | getTemporaryControlForWindow( |
64 | | const vcl::Window& _rWindow, |
65 | | css::uno::Reference< css::awt::XControlContainer >& _inout_ControlContainer, |
66 | | const SdrUnoObj& _rUnoObject |
67 | | ); |
68 | | |
69 | | /// ensures that the control belonging to this instance has a given visibility |
70 | | void ensureControlVisibility( bool _bVisible ) const; |
71 | | |
72 | | /** sets the design/alive mode of the control |
73 | | */ |
74 | | void setControlDesignMode( bool _bDesignMode ) const; |
75 | | |
76 | | /** callback from impl class to react on changes of properties from the XControlModel |
77 | | */ |
78 | | void propertyChange(); |
79 | | |
80 | | /** React on changes of the object of this ViewContact |
81 | | */ |
82 | | virtual void ActionChanged() override; |
83 | | |
84 | | /** to be called when any aspect of the control which requires view updates changed |
85 | | */ |
86 | 0 | struct ImplAccess { friend class ViewObjectContactOfUnoControl_Impl; friend class ViewObjectContactOfUnoControl; private: ImplAccess() { } }; |
87 | 0 | void onControlChangedOrModified( ImplAccess ) { impl_onControlChangedOrModified(); } |
88 | | |
89 | | protected: |
90 | | virtual ~ViewObjectContactOfUnoControl() override; |
91 | | |
92 | | // support for Primitive2D |
93 | | virtual void createPrimitive2DSequence(const DisplayInfo& rDisplayInfo, drawinglayer::primitive2d::Primitive2DDecompositionVisitor& rVisitor) const override; |
94 | | |
95 | | // visibility check |
96 | | virtual bool isPrimitiveVisible( const DisplayInfo& _rDisplayInfo ) const override; |
97 | | /// to be called when any aspect of the control which requires view updates changed |
98 | | void impl_onControlChangedOrModified(); |
99 | | |
100 | | private: |
101 | | ViewObjectContactOfUnoControl( const ViewObjectContactOfUnoControl& ) = delete; |
102 | | ViewObjectContactOfUnoControl& operator=( const ViewObjectContactOfUnoControl& ) = delete; |
103 | | }; |
104 | | |
105 | | class UnoControlPrintOrPreviewContact final : public ViewObjectContactOfUnoControl |
106 | | { |
107 | | public: |
108 | | UnoControlPrintOrPreviewContact( ObjectContactOfPageView& _rObjectContact, ViewContactOfUnoControl& _rViewContact ); |
109 | | virtual ~UnoControlPrintOrPreviewContact() override; |
110 | | |
111 | | private: |
112 | | UnoControlPrintOrPreviewContact( const UnoControlPrintOrPreviewContact& ) = delete; |
113 | | UnoControlPrintOrPreviewContact& operator=( const UnoControlPrintOrPreviewContact& ) = delete; |
114 | | |
115 | | virtual void createPrimitive2DSequence(const DisplayInfo& rDisplayInfo, drawinglayer::primitive2d::Primitive2DDecompositionVisitor& rVisitor) const override; |
116 | | }; |
117 | | |
118 | | |
119 | | } // namespace sdr::contact |
120 | | |
121 | | |
122 | | #endif // INCLUDED_SVX_INC_SDR_CONTACT_VIEWOBJECTCONTACTOFUNOCONTROL_HXX |
123 | | |
124 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |