bump product version to 7.2.5.1
[LibreOffice.git] / svx / inc / sdr / primitive2d / sdrmeasureprimitive2d.hxx
blobaa3bd67ff317ec34ee47da522f7e4e605003e27c
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_SVX_INC_SDR_PRIMITIVE2D_SDRMEASUREPRIMITIVE2D_HXX
21 #define INCLUDED_SVX_INC_SDR_PRIMITIVE2D_SDRMEASUREPRIMITIVE2D_HXX
23 #include <drawinglayer/primitive2d/baseprimitive2d.hxx>
24 #include <sdr/attribute/sdrlineeffectstextattribute.hxx>
27 // predefines
29 namespace drawinglayer::primitive2d {
30 enum MeasureTextPosition
32 MEASURETEXTPOSITION_AUTOMATIC,
33 MEASURETEXTPOSITION_NEGATIVE,
34 MEASURETEXTPOSITION_CENTERED,
35 MEASURETEXTPOSITION_POSITIVE
39 namespace drawinglayer::attribute {
40 class SdrLineAttribute;
44 namespace drawinglayer::primitive2d
46 class SdrMeasurePrimitive2D final : public BufferedDecompositionPrimitive2D
48 private:
49 attribute::SdrLineEffectsTextAttribute maSdrLSTAttribute;
50 basegfx::B2DPoint maStart;
51 basegfx::B2DPoint maEnd;
52 MeasureTextPosition meHorizontal;
53 MeasureTextPosition meVertical;
54 double mfDistance;
55 double mfUpper;
56 double mfLower;
57 double mfLeftDelta;
58 double mfRightDelta;
60 bool mbBelow : 1;
61 bool mbTextRotation : 1;
62 bool mbTextAutoAngle : 1;
64 // internal decomposition helper
65 Primitive2DReference impCreatePart(
66 const attribute::SdrLineAttribute& rLineAttribute,
67 const basegfx::B2DHomMatrix& rObjectMatrix,
68 const basegfx::B2DPoint& rStart,
69 const basegfx::B2DPoint& rEnd,
70 bool bLeftActive,
71 bool bRightActive) const;
73 // local decomposition.
74 virtual void create2DDecomposition(Primitive2DContainer& rContainer, const geometry::ViewInformation2D& aViewInformation) const override;
76 public:
77 SdrMeasurePrimitive2D(
78 const attribute::SdrLineEffectsTextAttribute& rSdrLSTAttribute,
79 const basegfx::B2DPoint& rStart,
80 const basegfx::B2DPoint& rEnd,
81 MeasureTextPosition eHorizontal,
82 MeasureTextPosition eVertical,
83 double fDistance,
84 double fUpper,
85 double fLower,
86 double fLeftDelta,
87 double fRightDelta,
88 bool bBelow,
89 bool bTextRotation,
90 bool bTextAutoAngle);
92 // data access
93 const attribute::SdrLineEffectsTextAttribute& getSdrLSTAttribute() const { return maSdrLSTAttribute; }
94 const basegfx::B2DPoint& getStart() const { return maStart; }
95 const basegfx::B2DPoint& getEnd() const { return maEnd; }
96 MeasureTextPosition getHorizontal() const { return meHorizontal; }
97 MeasureTextPosition getVertical() const { return meVertical; }
98 double getDistance() const { return mfDistance; }
99 double getUpper() const { return mfUpper; }
100 double getLower() const { return mfLower; }
101 double getLeftDelta() const { return mfLeftDelta; }
102 double getRightDelta() const { return mfRightDelta; }
103 bool getBelow() const { return mbBelow; }
104 bool getTextRotation() const { return mbTextRotation; }
105 bool getTextAutoAngle() const { return mbTextAutoAngle; }
107 // compare operator
108 virtual bool operator==(const BasePrimitive2D& rPrimitive) const override;
110 // provide unique ID
111 virtual sal_uInt32 getPrimitive2DID() const override;
113 } // end of namespace drawinglayer::primitive2d
116 #endif // INCLUDED_SVX_INC_SDR_PRIMITIVE2D_SDRMEASUREPRIMITIVE2D_HXX
118 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */