Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #ifndef _SDRPAGEWINDOW_HXX
30 : : #define _SDRPAGEWINDOW_HXX
31 : :
32 : : #include <com/sun/star/awt/XWindowListener.hpp>
33 : : #include <com/sun/star/beans/XPropertyChangeListener.hpp>
34 : : #include <com/sun/star/awt/XControlContainer.hpp>
35 : : #include <com/sun/star/util/XModeChangeListener.hpp>
36 : : #include <cppuhelper/implbase4.hxx>
37 : : #include <svx/sdr/overlay/overlaymanager.hxx>
38 : : #include <svx/svdtypes.hxx> // for SdrLayerID
39 : : #include <svx/sdrpagewindow.hxx>
40 : : #include "svx/svxdllapi.h"
41 : :
42 : : #include <vector>
43 : :
44 : : ////////////////////////////////////////////////////////////////////////////////////////////////////
45 : : // predeclarations
46 : :
47 : : class Region;
48 : : class SdrUnoObj;
49 : : class SdrPageView;
50 : :
51 : : // #110094#
52 : : namespace sdr
53 : : {
54 : : namespace contact
55 : : {
56 : : class ObjectContact;
57 : : class ViewObjectContactRedirector;
58 : : } // end of namespace contact
59 : :
60 : : namespace overlay
61 : : {
62 : : class OverlayManager;
63 : : } // end of namespace overlay
64 : : } // end of namespace sdr
65 : :
66 : : namespace basegfx
67 : : {
68 : : class B2DRange;
69 : : } // end of namespace basegfx
70 : :
71 : : class SdrPaintWindow;
72 : : class Link;
73 : :
74 : : ////////////////////////////////////////////////////////////////////////////////////////////////////
75 : :
76 : : class SVX_DLLPUBLIC SdrPageWindow
77 : : {
78 : : // #110094# ObjectContact section
79 : : sdr::contact::ObjectContact* mpObjectContact;
80 : :
81 : : // the SdrPageView this window belongs to
82 : : SdrPageView& mrPageView;
83 : :
84 : : // the PaintWindow to paint on. Here is access to OutDev etc.
85 : : // #i72752# change to pointer to allow patcing it in DrawLayer() if necessary
86 : : SdrPaintWindow* mpPaintWindow;
87 : : SdrPaintWindow* mpOriginalPaintWindow;
88 : :
89 : : // UNO stuff for xControls
90 : : ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlContainer > mxControlContainer;
91 : :
92 : : sdr::contact::ObjectContact* CreateViewSpecificObjectContact();
93 : :
94 : : public:
95 : : SdrPageWindow(SdrPageView& rNewPageView, SdrPaintWindow& rPaintWindow);
96 : : ~SdrPageWindow();
97 : :
98 : : // data read accesses
99 : : SdrPageView& GetPageView() const { return mrPageView; }
100 : 0 : SdrPaintWindow& GetPaintWindow() const { return *mpPaintWindow; }
101 : : const SdrPaintWindow* GetOriginalPaintWindow() const { return mpOriginalPaintWindow; }
102 : : ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlContainer > GetControlContainer( bool _bCreateIfNecessary = true ) const;
103 : :
104 : : // OVERLAYMANAGER
105 : : rtl::Reference< ::sdr::overlay::OverlayManager > GetOverlayManager() const;
106 : :
107 : : // #i72752# allow patcing SdrPaintWindow from SdrPageView::DrawLayer if needed
108 : : void patchPaintWindow(SdrPaintWindow& rPaintWindow);
109 : : void unpatchPaintWindow();
110 : :
111 : : // the repaint method. For migration from pPaintProc, use one more parameter
112 : : void PrePaint();
113 : : void PrepareRedraw(const Region& rReg);
114 : : void RedrawAll(sdr::contact::ViewObjectContactRedirector* pRedirector) const;
115 : : void RedrawLayer(const SdrLayerID* pId, sdr::contact::ViewObjectContactRedirector* pRedirector) const;
116 : :
117 : : // Invalidate call, used from ObjectContact(OfPageView) in InvalidatePartOfView(...)
118 : : void InvalidatePageWindow(const basegfx::B2DRange& rRange);
119 : :
120 : : // #110094# ObjectContact section
121 : : sdr::contact::ObjectContact& GetObjectContact() const;
122 : : /// determines whether there already exists an ObjectContact
123 : : bool HasObjectContact() const;
124 : :
125 : : // #i26631#
126 : : void ResetObjectContact();
127 : :
128 : : /** sets all elements in the view which support a design and a alive mode into the given mode
129 : : */
130 : : void SetDesignMode( bool _bDesignMode ) const;
131 : : };
132 : :
133 : : // typedefs for a list of SdrPageWindow
134 : : typedef ::std::vector< SdrPageWindow* > SdrPageWindowVector;
135 : :
136 : : ////////////////////////////////////////////////////////////////////////////////////////////////////
137 : :
138 : : #endif //_SDRPAGEWINDOW_HXX
139 : :
140 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|