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 _SDR_CONTACT_OBJECTCONTACTOFPAGEVIEW_HXX
25 #define _SDR_CONTACT_OBJECTCONTACTOFPAGEVIEW_HXX
26 
27 #include <svx/sdr/contact/objectcontact.hxx>
28 #include <tools/gen.hxx>
29 
30 //////////////////////////////////////////////////////////////////////////////
31 // predeclarations
32 
33 class SdrPageWindow;
34 class SdrPage;
35 
36 //////////////////////////////////////////////////////////////////////////////
37 
38 namespace sdr
39 {
40 	namespace contact
41 	{
42 		class ObjectContactOfPageView : public ObjectContact, public Timer
43 		{
44 		protected:
45 			// the owner of this ObjectContactOfPageView. Set from constructor and not
46 			// to be changed in any way.
47 			SdrPageWindow&										mrPageWindow;
48 
49 			// Process the whole displaying, the real version
50 			void DoProcessDisplay(DisplayInfo& rDisplayInfo);
51 
52 		public:
53 			// access to SdrPageWindow
GetPageWindow() const54 			SdrPageWindow& GetPageWindow() const { return mrPageWindow; }
55 
56 			// access to SdrPage of PageView
57 			SdrPage* GetSdrPage() const;
58 
59 			// basic constructor, used from SdrPageView.
60 			ObjectContactOfPageView(SdrPageWindow& rPageWindow);
61 			virtual ~ObjectContactOfPageView();
62 
63 			// LazyInvalidate request. This is used from the VOCs to mark that they
64 			// got invalidated by an ActionCanged() call. An active view needs to remember
65 			// this and take action on it. Default implementation directly calls back
66 			// triggerLazyInvalidate() wich promptly handles the request
67 			virtual void setLazyInvalidate(ViewObjectContact& rVOC);
68 
69 			// call this to support evtl. preparations for repaint
70 			virtual void PrepareProcessDisplay();
71 
72 			// From baseclass Timer, the timeout call triggered by te LazyInvalidate mechanism
73 			virtual void Timeout();
74 
75 			// Process the whole displaying
76 			virtual void ProcessDisplay(DisplayInfo& rDisplayInfo);
77 
78 			// test if visualizing of entered groups is switched on at all
79 			virtual bool DoVisualizeEnteredGroup() const;
80 
81 			// get active group's (the entered group) ViewContact
82 			virtual const ViewContact* getActiveViewContact() const;
83 
84 			// Invalidate given rectangle at the window/output which is represented by
85 			// this ObjectContact.
86 			virtual void InvalidatePartOfView(const basegfx::B2DRange& rRange) const;
87 
88 			// Get info if given Rectangle is visible in this view
89 			virtual bool IsAreaVisible(const basegfx::B2DRange& rRange) const;
90 
91 			// Get info about the need to visualize GluePoints. The default
92 			// is that it is not necessary.
93 			virtual bool AreGluePointsVisible() const;
94 
95 			// check if text animation is allowed.
96 			virtual bool IsTextAnimationAllowed() const;
97 
98 			// check if graphic animation is allowed.
99 			virtual bool IsGraphicAnimationAllowed() const;
100 
101 			// check if asynchronious graphis loading is allowed. Default is sal_False.
102 			virtual bool IsAsynchronGraphicsLoadingAllowed() const;
103 
104 			// check if buffering of MasterPages is allowed. Default is sal_False.
105 			virtual bool IsMasterPageBufferingAllowed() const;
106 
107 			// print? Default is false
108 			virtual bool isOutputToPrinter() const;
109 
110 			// window? Default is true
111 			virtual bool isOutputToWindow() const;
112 
113 			// VirtualDevice? Default is false
114 			virtual bool isOutputToVirtualDevice() const;
115 
116 			// recording MetaFile? Default is false
117 			virtual bool isOutputToRecordingMetaFile() const;
118 
119 			// pdf export? Default is false
120 			virtual bool isOutputToPDFFile() const;
121 
122 			// gray display mode
123 			virtual bool isDrawModeGray() const;
124 
125 			// gray display mode
126 			virtual bool isDrawModeBlackWhite() const;
127 
128 			// high contrast display mode
129 			virtual bool isDrawModeHighContrast() const;
130 
131             // overloaded access to SdrPageView
132 			virtual SdrPageView* TryToGetSdrPageView() const;
133 
134 			// access to OutputDevice. May return 0L like the default implementations do. Needs to be overloaded as needed.
135 			virtual OutputDevice* TryToGetOutputDevice() const;
136 
137 			/** sets all UNO controls which are associated with this ObjectContact to
138                 design or alive mode.
139             */
140             void    SetUNOControlsDesignMode( bool _bDesignMode ) const;
141 		};
142 	} // end of namespace contact
143 } // end of namespace sdr
144 
145 //////////////////////////////////////////////////////////////////////////////
146 
147 #endif //_SDR_CONTACT_OBJECTCONTACTOFPAGEVIEW_HXX
148 
149 // eof
150