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_DRAWINGLAYER_PRIMITIVE2D_TEXTLINEPRIMITIVE2D_HXX
25 #define INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TEXTLINEPRIMITIVE2D_HXX
26 
27 #include <drawinglayer/drawinglayerdllapi.h>
28 #include <drawinglayer/primitive2d/baseprimitive2d.hxx>
29 #include <drawinglayer/primitive2d/textenumsprimitive2d.hxx>
30 #include <basegfx/matrix/b2dhommatrix.hxx>
31 #include <basegfx/color/bcolor.hxx>
32 
33 //////////////////////////////////////////////////////////////////////////////
34 
35 namespace drawinglayer
36 {
37 	namespace primitive2d
38 	{
39         class DRAWINGLAYER_DLLPUBLIC TextLinePrimitive2D : public BufferedDecompositionPrimitive2D
40 		{
41 		private:
42             /// geometric definitions
43             basegfx::B2DHomMatrix                       maObjectTransformation;
44             double                                      mfWidth;
45             double                                      mfOffset;
46             double                                      mfHeight;
47 
48             /// decoration definitions
49             TextLine                                    meTextLine;
50             basegfx::BColor                             maLineColor;
51 
52         protected:
53 			/// local decomposition.
54 			virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& rViewInformation) const;
55 
56 		public:
57             /// constructor
58 			TextLinePrimitive2D(
59                 const basegfx::B2DHomMatrix& rObjectTransformation,
60                 double fWidth,
61                 double fOffset,
62                 double fHeight,
63                 TextLine eTextLine,
64                 const basegfx::BColor& rLineColor);
65 
66 			/// data read access
getObjectTransformation() const67             const basegfx::B2DHomMatrix& getObjectTransformation() const { return maObjectTransformation; }
getWidth() const68             double getWidth() const { return mfWidth; }
getOffset() const69             double getOffset() const { return mfOffset; }
getHeight() const70             double getHeight() const { return mfHeight; }
getTextLine() const71             TextLine getTextLine() const { return meTextLine; }
getLineColor() const72             const basegfx::BColor& getLineColor() const { return maLineColor; }
73 
74 			/// compare operator
75 			virtual bool operator==( const BasePrimitive2D& rPrimitive ) const;
76 
77             /// provide unique ID
78 			DeclPrimitrive2DIDBlock()
79 		};
80 	} // end of namespace primitive2d
81 } // end of namespace drawinglayer
82 
83 //////////////////////////////////////////////////////////////////////////////
84 
85 #endif //INCLUDED_DRAWINGLAYER_PRIMITIVE2D_TEXTLINEPRIMITIVE2D_HXX
86 
87 //////////////////////////////////////////////////////////////////////////////
88 // eof
89