1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef INCLUDED_SDR_PRIMITIVE2D_SDCUSTOMSHAPEPRIMITIVE2D_HXX
29 #define INCLUDED_SDR_PRIMITIVE2D_SDCUSTOMSHAPEPRIMITIVE2D_HXX
30 
31 #include <drawinglayer/primitive2d/baseprimitive2d.hxx>
32 #include <basegfx/matrix/b2dhommatrix.hxx>
33 #include <svx/sdr/attribute/sdrshadowtextattribute.hxx>
34 
35 //////////////////////////////////////////////////////////////////////////////
36 // predefines
37 
38 //////////////////////////////////////////////////////////////////////////////
39 
40 namespace drawinglayer
41 {
42 	namespace primitive2d
43 	{
44 		class SdrCustomShapePrimitive2D : public BufferedDecompositionPrimitive2D
45 		{
46 		private:
47 			attribute::SdrShadowTextAttribute			maSdrSTAttribute;
48 			Primitive2DSequence							maSubPrimitives;
49 			basegfx::B2DHomMatrix						maTextBox;
50 
51             // bitfield
52             // defines if SdrTextWordWrapItem was set at SdrObjCustomShape which means
53             // that the text needs to be block formatted
54             unsigned                                    mbWordWrap : 1;
55 
56 			// defines that the object contains/is a 3D AutoShape. Needed for
57 			// making exceptions with shadow generation
58 			unsigned                                    mb3DShape : 1;
59 
60 			// #SJ# Allow text clipping against TextBox in special cases (used for SC)
61 			unsigned                                    mbForceTextClipToTextRange : 1;
62 
63         protected:
64 			// local decomposition.
65 			virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& aViewInformation) const;
66 
67 		public:
68 			SdrCustomShapePrimitive2D(
69 				const attribute::SdrShadowTextAttribute& rSdrSTAttribute,
70 				const Primitive2DSequence& rSubPrimitives,
71 				const basegfx::B2DHomMatrix& rTextBox,
72                 bool bWordWrap,
73 				bool b3DShape,
74 				bool bForceTextClipToTextRange);
75 
76 			// data access
77 			const attribute::SdrShadowTextAttribute& getSdrSTAttribute() const { return maSdrSTAttribute; }
78 			const Primitive2DSequence& getSubPrimitives() const { return maSubPrimitives; }
79 			const basegfx::B2DHomMatrix& getTextBox() const { return maTextBox; }
80             bool getWordWrap() const { return mbWordWrap; }
81 			bool get3DShape() const { return mb3DShape; }
82 			bool isForceTextClipToTextRange() const { return mbForceTextClipToTextRange; }
83 
84 			// compare operator
85 			virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
86 
87 			// provide unique ID
88 			DeclPrimitrive2DIDBlock()
89 		};
90 	} // end of namespace primitive2d
91 } // end of namespace drawinglayer
92 
93 //////////////////////////////////////////////////////////////////////////////
94 
95 #endif //INCLUDED_SDR_PRIMITIVE2D_SDCUSTOMSHAPEPRIMITIVE2D_HXX
96 
97 // eof
98