update credits
[LibreOffice.git] / include / svx / sdr / primitive2d / sdrmeasureprimitive2d.hxx
bloba8812caaa84d73ebb9897917905d8dceab7e0a9f
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_SDR_PRIMITIVE2D_SDRMEASUREPRIMITIVE2D_HXX
21 #define INCLUDED_SDR_PRIMITIVE2D_SDRMEASUREPRIMITIVE2D_HXX
23 #include <drawinglayer/primitive2d/baseprimitive2d.hxx>
24 #include <svx/sdr/attribute/sdrlineshadowtextattribute.hxx>
26 //////////////////////////////////////////////////////////////////////////////
27 // predefines
29 namespace drawinglayer { namespace primitive2d {
30 enum MeasureTextPosition
32 MEASURETEXTPOSITION_AUTOMATIC,
33 MEASURETEXTPOSITION_NEGATIVE,
34 MEASURETEXTPOSITION_CENTERED,
35 MEASURETEXTPOSITION_POSITIVE
39 namespace drawinglayer { namespace attribute {
40 class SdrLineAttribute;
43 //////////////////////////////////////////////////////////////////////////////
45 namespace drawinglayer
47 namespace primitive2d
49 class SdrMeasurePrimitive2D : public BufferedDecompositionPrimitive2D
51 private:
52 attribute::SdrLineShadowTextAttribute maSdrLSTAttribute;
53 basegfx::B2DPoint maStart;
54 basegfx::B2DPoint maEnd;
55 MeasureTextPosition meHorizontal;
56 MeasureTextPosition meVertical;
57 double mfDistance;
58 double mfUpper;
59 double mfLower;
60 double mfLeftDelta;
61 double mfRightDelta;
63 // bitfield
64 unsigned mbBelow : 1;
65 unsigned mbTextRotation : 1;
66 unsigned mbTextAutoAngle : 1;
68 // internal decomposition helper
69 Primitive2DReference impCreatePart(
70 const attribute::SdrLineAttribute& rLineAttribute,
71 const basegfx::B2DHomMatrix& rObjectMatrix,
72 const basegfx::B2DPoint& rStart,
73 const basegfx::B2DPoint& rEnd,
74 bool bLeftActive,
75 bool bRightActive) const;
77 protected:
78 // local decomposition.
79 virtual Primitive2DSequence create2DDecomposition(const geometry::ViewInformation2D& aViewInformation) const;
81 public:
82 SdrMeasurePrimitive2D(
83 const attribute::SdrLineShadowTextAttribute& rSdrLSTAttribute,
84 const basegfx::B2DPoint& rStart,
85 const basegfx::B2DPoint& rEnd,
86 MeasureTextPosition eHorizontal,
87 MeasureTextPosition eVertical,
88 double fDistance,
89 double fUpper,
90 double fLower,
91 double fLeftDelta,
92 double fRightDelta,
93 bool bBelow,
94 bool bTextRotation,
95 bool bTextAutoAngle);
97 // data access
98 const attribute::SdrLineShadowTextAttribute& getSdrLSTAttribute() const { return maSdrLSTAttribute; }
99 const basegfx::B2DPoint& getStart() const { return maStart; }
100 const basegfx::B2DPoint& getEnd() const { return maEnd; }
101 MeasureTextPosition getHorizontal() const { return meHorizontal; }
102 MeasureTextPosition getVertical() const { return meVertical; }
103 double getDistance() const { return mfDistance; }
104 double getUpper() const { return mfUpper; }
105 double getLower() const { return mfLower; }
106 double getLeftDelta() const { return mfLeftDelta; }
107 double getRightDelta() const { return mfRightDelta; }
108 bool getBelow() const { return mbBelow; }
109 bool getTextRotation() const { return mbTextRotation; }
110 bool getTextAutoAngle() const { return mbTextAutoAngle; }
112 // compare operator
113 virtual bool operator==(const BasePrimitive2D& rPrimitive) const;
115 // provide unique ID
116 DeclPrimitive2DIDBlock()
118 } // end of namespace primitive2d
119 } // end of namespace drawinglayer
121 //////////////////////////////////////////////////////////////////////////////
123 #endif //INCLUDED_SDR_PRIMITIVE2D_SDRMEASUREPRIMITIVE2D_HXX
125 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */