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_OVERLAY_OVERLAYSELECTION_HXX
25 #define _SDR_OVERLAY_OVERLAYSELECTION_HXX
26 
27 #include <svx/sdr/overlay/overlayobject.hxx>
28 #include <vcl/region.hxx>
29 
30 //////////////////////////////////////////////////////////////////////////////
31 
32 namespace sdr
33 {
34 	namespace overlay
35 	{
36 		// overlay type definition
37 		enum OverlayType
38 		{
39 			OVERLAY_INVERT,
40 			OVERLAY_SOLID,
41 			OVERLAY_TRANSPARENT
42 		};
43 
44 		class SVX_DLLPUBLIC OverlaySelection : public OverlayObject
45 		{
46 		protected:
47 			// type of overlay
48             OverlayType							meOverlayType;
49 
50 			// geometry of overlay
51 			std::vector< basegfx::B2DRange >	maRanges;
52 
53             // Values of last primitive creation. These are checked in getOverlayObjectPrimitive2DSequence
54             // to evtl. get rid of last Primitive2DSequence. This ensures that these values are up-to-date
55             // and are usable when creating primitives
56             OverlayType							maLastOverlayType;
57             sal_uInt16                          mnLastTransparence;
58 
59             // bitfield
60             unsigned                            mbBorder : 1;
61 
62             // geometry creation for OverlayObject, can use local *Last* values
63 			virtual drawinglayer::primitive2d::Primitive2DSequence createOverlayObjectPrimitive2DSequence();
64 
65 		public:
66 			OverlaySelection(
67 				OverlayType eType,
68 				const Color& rColor,
69 				const std::vector< basegfx::B2DRange >& rRanges,
70                 bool bBorder);
71 			virtual ~OverlaySelection();
72 
73 			// data read access
getOverlayType() const74 			OverlayType getOverlayType() const { return meOverlayType; }
getRanges() const75 			const std::vector< basegfx::B2DRange >& getRanges() const { return maRanges; }
getBorder() const76             bool getBorder() const { return mbBorder; }
77 
78 			// overloaded to check conditions for last createOverlayObjectPrimitive2DSequence
79 			virtual drawinglayer::primitive2d::Primitive2DSequence getOverlayObjectPrimitive2DSequence() const;
80 
81             // data write access
82 			void setRanges(const std::vector< basegfx::B2DRange >& rNew);
83 		};
84 	} // end of namespace overlay
85 } // end of namespace sdr
86 
87 //////////////////////////////////////////////////////////////////////////////
88 
89 #endif //_SDR_OVERLAY_OVERLAYSELECTION_HXX
90 
91 // eof
92