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