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