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_SDRCAPTIONPRIMITIVE2D_HXX
25 #define INCLUDED_SDR_PRIMITIVE2D_SDRCAPTIONPRIMITIVE2D_HXX
26 
27 #include <drawinglayer/primitive2d/baseprimitive2d.hxx>
28 #include <basegfx/matrix/b2dhommatrix.hxx>
29 #include <svx/sdr/attribute/sdrlinefillshadowtextattribute.hxx>
30 #include <basegfx/polygon/b2dpolygon.hxx>
31 
32 //////////////////////////////////////////////////////////////////////////////
33 // predefines
34 
35 //////////////////////////////////////////////////////////////////////////////
36 
37 namespace drawinglayer
38 {
39 	namespace primitive2d
40 	{
41 		class SdrCaptionPrimitive2D : public BufferedDecompositionPrimitive2D
42 		{
43 		private:
44 			::basegfx::B2DHomMatrix						maTransform;
45 			attribute::SdrLineFillShadowTextAttribute	maSdrLFSTAttribute;
46 			::basegfx::B2DPolygon						maTail;
47 			double										mfCornerRadiusX;	// [0.0..1.0] relative to 1/2 width
48 			double										mfCornerRadiusY;	// [0.0..1.0] relative to 1/2 height
49 
50 		protected:
51 			// local decomposition.
52 			virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& aViewInformation) const;
53 
54 		public:
55 			SdrCaptionPrimitive2D(
56 				const ::basegfx::B2DHomMatrix& rTransform,
57 				const attribute::SdrLineFillShadowTextAttribute& rSdrLFSTAttribute,
58 				const ::basegfx::B2DPolygon& rTail,
59 				double fCornerRadiusX = 0.0,
60 				double fCornerRadiusY = 0.0);
61 
62 			// compare operator
63 			virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
64 
65 			// data access
getTransform() const66 			const ::basegfx::B2DHomMatrix& getTransform() const { return maTransform; }
getSdrLFSTAttribute() const67 			const attribute::SdrLineFillShadowTextAttribute& getSdrLFSTAttribute() const { return maSdrLFSTAttribute; }
getTail() const68 			const ::basegfx::B2DPolygon& getTail() const { return maTail; }
getCornerRadiusX() const69 			double getCornerRadiusX() const { return mfCornerRadiusX; }
getCornerRadiusY() const70 			double getCornerRadiusY() const { return mfCornerRadiusY; }
isCornerRadiusUsed() const71 			bool isCornerRadiusUsed() const { return (0.0 != mfCornerRadiusX || 0.0 != mfCornerRadiusY); }
72 
73 			// provide unique ID
74 			DeclPrimitrive2DIDBlock()
75 		};
76 	} // end of namespace primitive2d
77 } // end of namespace drawinglayer
78 
79 //////////////////////////////////////////////////////////////////////////////
80 
81 #endif //INCLUDED_SDR_PRIMITIVE2D_SDRCAPTIONPRIMITIVE2D_HXX
82 
83 // eof
84