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 .
20 #ifndef INCLUDED_SVX_INC_SDR_CONTACT_VIEWOBJECTCONTACTOFUNOCONTROL_HXX
21 #define INCLUDED_SVX_INC_SDR_CONTACT_VIEWOBJECTCONTACTOFUNOCONTROL_HXX
23 #include <svx/sdr/contact/viewobjectcontactofsdrobj.hxx>
25 #include <com/sun/star/uno/Reference.hxx>
26 #include <rtl/ref.hxx>
27 #include <svx/svxdllapi.h>
30 namespace vcl
{ class Window
; }
32 namespace com
{ namespace sun
{ namespace star
{
35 class XControlContainer
;
40 namespace sdr
{ namespace contact
{
43 class ViewContactOfUnoControl
;
44 class ObjectContactOfPageView
;
46 //= ViewObjectContactOfUnoControl
48 class ViewObjectContactOfUnoControl_Impl
;
49 class ViewObjectContactOfUnoControl
: public ViewObjectContactOfSdrObj
52 ::rtl::Reference
< ViewObjectContactOfUnoControl_Impl
> m_pImpl
;
55 ViewObjectContactOfUnoControl( ObjectContact
& _rObjectContact
, ViewContactOfUnoControl
& _rViewContact
);
57 /// returns the ->XControl instance belonging to the instance, creates it if necessary
58 css::uno::Reference
< css::awt::XControl
>
61 /** retrieves a temporary XControl instance, whose parent is the given device
62 @seealso SdrUnoObj::GetTemporaryControlForWindow
64 static css::uno::Reference
< css::awt::XControl
>
65 getTemporaryControlForWindow(
66 const vcl::Window
& _rWindow
,
67 css::uno::Reference
< css::awt::XControlContainer
>& _inout_ControlContainer
,
68 const SdrUnoObj
& _rUnoObject
71 /// ensures that the control belonging to this instances has a given visibility
72 void ensureControlVisibility( bool _bVisible
) const;
74 /** sets the design/alive mode of the control
76 void setControlDesignMode( bool _bDesignMode
) const;
78 /** callback from impl class to react on changes of properties form the XControlModel
80 void propertyChange();
82 /** React on changes of the object of this ViewContact
84 virtual void ActionChanged() override
;
86 /** to be called when any aspect of the control which requires view updates changed
88 struct ImplAccess
{ friend class ViewObjectContactOfUnoControl_Impl
; friend class ViewObjectContactOfUnoControl
; private: ImplAccess() { } };
89 void onControlChangedOrModified( ImplAccess
) { impl_onControlChangedOrModified(); }
92 virtual ~ViewObjectContactOfUnoControl() override
;
94 // support for Primitive2D
95 virtual drawinglayer::primitive2d::Primitive2DContainer
createPrimitive2DSequence(const DisplayInfo
& rDisplayInfo
) const override
;
98 virtual bool isPrimitiveVisible( const DisplayInfo
& _rDisplayInfo
) const override
;
99 /// to be called when any aspect of the control which requires view updates changed
100 void impl_onControlChangedOrModified();
103 ViewObjectContactOfUnoControl( const ViewObjectContactOfUnoControl
& ) = delete;
104 ViewObjectContactOfUnoControl
& operator=( const ViewObjectContactOfUnoControl
& ) = delete;
107 class UnoControlPrintOrPreviewContact
: public ViewObjectContactOfUnoControl
110 UnoControlPrintOrPreviewContact( ObjectContactOfPageView
& _rObjectContact
, ViewContactOfUnoControl
& _rViewContact
);
111 virtual ~UnoControlPrintOrPreviewContact() override
;
114 UnoControlPrintOrPreviewContact( const UnoControlPrintOrPreviewContact
& ) = delete;
115 UnoControlPrintOrPreviewContact
& operator=( const UnoControlPrintOrPreviewContact
& ) = delete;
117 virtual drawinglayer::primitive2d::Primitive2DContainer
createPrimitive2DSequence(const DisplayInfo
& rDisplayInfo
) const override
;
121 } } // namespace sdr::contact
124 #endif // INCLUDED_SVX_INC_SDR_CONTACT_VIEWOBJECTCONTACTOFUNOCONTROL_HXX
126 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */