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_DISPLAYINFO_HXX
25 #define _SDR_CONTACT_DISPLAYINFO_HXX
26 
27 #include <sal/types.h>
28 #include <svx/svdsob.hxx>
29 #include <svtools/colorcfg.hxx>
30 #include <vcl/region.hxx>
31 #include <vector>
32 #include "svx/svxdllapi.h"
33 
34 //////////////////////////////////////////////////////////////////////////////
35 // predeclarations
36 
37 class SdrPage;
38 
39 namespace sdr { namespace contact {
40 	class ViewObjectContact;
41 }}
42 
43 //////////////////////////////////////////////////////////////////////////////
44 
45 namespace sdr
46 {
47 	namespace contact
48 	{
49 		class SVX_DLLPUBLIC DisplayInfo
50 		{
51 		protected:
52 			// The Layers which shall be processed (visible)
53 			SetOfByte										maProcessLayers;
54 
55 			// The redraw area, in logical coordinates of OutputDevice. If Region
56 			// is empty, everything needs to be redrawn
57 			Region											maRedrawArea;
58 
59 			// bitfield
60 
61 			// Internal flag to know when the control layer is painted. Default is
62 			// false. If set to true, painting of the page, page borders and
63 			// the rasters will be suppressed as if mbPageProcessingActive is set (see there).
64             // This flag is set internally from the processing mechanism to avoid double page
65 			// painting when the control layer needs to be painted as last layer
66 			unsigned										mbControlLayerProcessingActive : 1;
67 
68 			// Internal flag to decide if page stuff (background, border, MasterPage, grid, etc...)
69             // will be processed at all. This flag is user-defined and will not be changed from the
70             // processing mechanism. Default is true, thus set to false if PagePainting should be suppressed.
71             // For more granular switching page stuff painting on and off, use the according flags at the
72             // view (->Is*Visible())
73 			unsigned										mbPageProcessingActive : 1;
74 
75 			// Internal flag to remember if EnteredGroupDrawMode is active. Default is true
76 			// since this mode starts activated and gets switched off when reacing
77 			// the current group level. Should only be changed by instances which do
78             // primitive processing
79 			unsigned										mbGhostedDrawModeActive : 1;
80 
81 			// Internal flag to know if a MasterPage is processed as SubContent of another
82             // page. Initialized to false, this should only be changed from the instance which
83             // is processing the MasterPage asSubContent and knows what it does
84 			unsigned										mbSubContentActive : 1;
85 
86 		public:
87 			// basic constructor.
88 			DisplayInfo();
89 
90 			// destructor
91 			virtual ~DisplayInfo();
92 
93 			// access to ProcessLayers
94 			void SetProcessLayers(const SetOfByte& rSet);
GetProcessLayers() const95 			const SetOfByte& GetProcessLayers() const { return maProcessLayers; }
96 
97             // access to RedrawArea
98 			void SetRedrawArea(const Region& rRegion);
GetRedrawArea() const99 			const Region& GetRedrawArea() const { return maRedrawArea; }
100 
101             // Access to ControlLayerProcessingActive flag
102 			void SetControlLayerProcessingActive(bool bDoPaint);
GetControlLayerProcessingActive() const103 			bool GetControlLayerProcessingActive() const { return mbControlLayerProcessingActive; }
104 
105 			// Access to PageProcessingActive flag
106 			void SetPageProcessingActive(bool bDoPaint);
GetPageProcessingActive() const107 			bool GetPageProcessingActive() const { return mbPageProcessingActive; }
108 
109 			// Save the original DrawMode from outdev
110 			void ClearGhostedDrawMode();
111 			void SetGhostedDrawMode();
IsGhostedDrawModeActive() const112 			bool IsGhostedDrawModeActive() const { return mbGhostedDrawModeActive; }
113 
114 			// access to master page painting flag
GetSubContentActive() const115 			bool GetSubContentActive() const { return mbSubContentActive; }
116 			void SetSubContentActive(bool bNew);
117 		};
118 	} // end of namespace contact
119 } // end of namespace sdr
120 
121 //////////////////////////////////////////////////////////////////////////////
122 
123 #endif //_SDR_CONTACT_DISPLAYINFO_HXX
124 
125 // eof
126