1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24 #ifndef _SDRPAGEWINDOW_HXX 25 #define _SDRPAGEWINDOW_HXX 26 27 #include <tools/debug.hxx> 28 #include <com/sun/star/awt/XWindowListener.hpp> 29 #include <com/sun/star/beans/XPropertyChangeListener.hpp> 30 #include <com/sun/star/awt/XControlContainer.hpp> 31 #include <com/sun/star/util/XModeChangeListener.hpp> 32 #include <cppuhelper/implbase4.hxx> 33 #include <svx/svdtypes.hxx> // fuer SdrLayerID 34 #include <svl/svarray.hxx> 35 #include <tools/contnr.hxx> 36 #include <svx/sdrpagewindow.hxx> 37 #include "svx/svxdllapi.h" 38 39 #include <vector> 40 41 //////////////////////////////////////////////////////////////////////////////////////////////////// 42 // predeclarations 43 44 class Region; 45 class SdrUnoObj; 46 class SdrPageView; 47 48 // #110094# 49 namespace sdr 50 { 51 namespace contact 52 { 53 class ObjectContact; 54 class ViewObjectContactRedirector; 55 } // end of namespace contact 56 57 namespace overlay 58 { 59 class OverlayManager; 60 } // end of namespace overlay 61 } // end of namespace sdr 62 63 namespace basegfx 64 { 65 class B2DRange; 66 } // end of namespace basegfx 67 68 class SdrUnoControlList; 69 class SdrPaintWindow; 70 class Link; 71 72 //////////////////////////////////////////////////////////////////////////////////////////////////// 73 74 class SVX_DLLPUBLIC SdrPageWindow 75 { 76 // #110094# ObjectContact section 77 sdr::contact::ObjectContact* mpObjectContact; 78 79 // the SdrPageView this window belongs to 80 SdrPageView& mrPageView; 81 82 // the PaintWindow to paint on. Here is access to OutDev etc. 83 // #i72752# change to pointer to allow patcing it in DrawLayer() if necessary 84 SdrPaintWindow* mpPaintWindow; 85 SdrPaintWindow* mpOriginalPaintWindow; 86 87 // UNO stuff for xControls 88 void* mpDummy; 89 ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlContainer > mxControlContainer; 90 91 // #110094# ObjectContact section 92 sdr::contact::ObjectContact* CreateViewSpecificObjectContact(); 93 94 public: 95 SdrPageWindow(SdrPageView& rNewPageView, SdrPaintWindow& rPaintWindow); 96 ~SdrPageWindow(); 97 98 // data read accesses GetPageView() const99 SdrPageView& GetPageView() const { return mrPageView; } GetPaintWindow() const100 SdrPaintWindow& GetPaintWindow() const { return *mpPaintWindow; } GetOriginalPaintWindow() const101 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 ::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 void PostPaint(); 117 118 // Invalidate call, used from ObjectContact(OfPageView) in InvalidatePartOfView(...) 119 void InvalidatePageWindow(const basegfx::B2DRange& rRange); 120 121 // #110094# ObjectContact section 122 sdr::contact::ObjectContact& GetObjectContact() const; 123 /// determines whether there already exists an ObjectContact 124 bool HasObjectContact() const; 125 126 // #i26631# 127 void ResetObjectContact(); 128 129 /** sets all elements in the view which support a design and a alive mode into the given mode 130 */ 131 void SetDesignMode( bool _bDesignMode ) const; 132 }; 133 134 // typedefs for a list of SdrPageWindow 135 typedef ::std::vector< SdrPageWindow* > SdrPageWindowVector; 136 137 //////////////////////////////////////////////////////////////////////////////////////////////////// 138 139 #endif //_SDRPAGEWINDOW_HXX 140