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 INCLUDED_SDR_PRIMITIVE2D_SDCUSTOMSHAPEPRIMITIVE2D_HXX
25 #define INCLUDED_SDR_PRIMITIVE2D_SDCUSTOMSHAPEPRIMITIVE2D_HXX
26 
27 #include <drawinglayer/primitive2d/baseprimitive2d.hxx>
28 #include <basegfx/matrix/b2dhommatrix.hxx>
29 #include <svx/sdr/attribute/sdrshadowtextattribute.hxx>
30 
31 //////////////////////////////////////////////////////////////////////////////
32 // predefines
33 
34 //////////////////////////////////////////////////////////////////////////////
35 
36 namespace drawinglayer
37 {
38 	namespace primitive2d
39 	{
40 		class SdrCustomShapePrimitive2D : public BufferedDecompositionPrimitive2D
41 		{
42 		private:
43 			attribute::SdrShadowTextAttribute			maSdrSTAttribute;
44 			Primitive2DSequence							maSubPrimitives;
45 			basegfx::B2DHomMatrix						maTextBox;
46 
47             // bitfield
48             // defines if SdrTextWordWrapItem was set at SdrObjCustomShape which means
49             // that the text needs to be block formatted
50             unsigned                                    mbWordWrap : 1;
51 
52 			// defines that the object contains/is a 3D AutoShape. Needed for
53 			// making exceptions with shadow generation
54 			unsigned                                    mb3DShape : 1;
55 
56 			// #SJ# Allow text clipping against TextBox in special cases (used for SC)
57 			unsigned                                    mbForceTextClipToTextRange : 1;
58 
59         protected:
60 			// local decomposition.
61 			virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& aViewInformation) const;
62 
63 		public:
64 			SdrCustomShapePrimitive2D(
65 				const attribute::SdrShadowTextAttribute& rSdrSTAttribute,
66 				const Primitive2DSequence& rSubPrimitives,
67 				const basegfx::B2DHomMatrix& rTextBox,
68                 bool bWordWrap,
69 				bool b3DShape,
70 				bool bForceTextClipToTextRange);
71 
72 			// data access
getSdrSTAttribute() const73 			const attribute::SdrShadowTextAttribute& getSdrSTAttribute() const { return maSdrSTAttribute; }
getSubPrimitives() const74 			const Primitive2DSequence& getSubPrimitives() const { return maSubPrimitives; }
getTextBox() const75 			const basegfx::B2DHomMatrix& getTextBox() const { return maTextBox; }
getWordWrap() const76             bool getWordWrap() const { return mbWordWrap; }
get3DShape() const77 			bool get3DShape() const { return mb3DShape; }
isForceTextClipToTextRange() const78 			bool isForceTextClipToTextRange() const { return mbForceTextClipToTextRange; }
79 
80 			// compare operator
81 			virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
82 
83 			// provide unique ID
84 			DeclPrimitrive2DIDBlock()
85 		};
86 	} // end of namespace primitive2d
87 } // end of namespace drawinglayer
88 
89 //////////////////////////////////////////////////////////////////////////////
90 
91 #endif //INCLUDED_SDR_PRIMITIVE2D_SDCUSTOMSHAPEPRIMITIVE2D_HXX
92 
93 // eof
94