1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 <svx/sdr/attribute/sdrlineshadowtextattribute.hxx>
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
;
44 namespace drawinglayer
48 class SdrMeasurePrimitive2D
: public BufferedDecompositionPrimitive2D
51 attribute::SdrLineShadowTextAttribute
const maSdrLSTAttribute
;
52 basegfx::B2DPoint
const maStart
;
53 basegfx::B2DPoint
const maEnd
;
54 MeasureTextPosition
const meHorizontal
;
55 MeasureTextPosition
const meVertical
;
56 double const mfDistance
;
59 double const mfLeftDelta
;
60 double const mfRightDelta
;
62 bool const mbBelow
: 1;
63 bool const mbTextRotation
: 1;
64 bool const mbTextAutoAngle
: 1;
66 // internal decomposition helper
67 Primitive2DReference
impCreatePart(
68 const attribute::SdrLineAttribute
& rLineAttribute
,
69 const basegfx::B2DHomMatrix
& rObjectMatrix
,
70 const basegfx::B2DPoint
& rStart
,
71 const basegfx::B2DPoint
& rEnd
,
73 bool bRightActive
) const;
76 // local decomposition.
77 virtual void create2DDecomposition(Primitive2DContainer
& rContainer
, const geometry::ViewInformation2D
& aViewInformation
) const override
;
80 SdrMeasurePrimitive2D(
81 const attribute::SdrLineShadowTextAttribute
& rSdrLSTAttribute
,
82 const basegfx::B2DPoint
& rStart
,
83 const basegfx::B2DPoint
& rEnd
,
84 MeasureTextPosition eHorizontal
,
85 MeasureTextPosition eVertical
,
96 const attribute::SdrLineShadowTextAttribute
& getSdrLSTAttribute() const { return maSdrLSTAttribute
; }
97 const basegfx::B2DPoint
& getStart() const { return maStart
; }
98 const basegfx::B2DPoint
& getEnd() const { return maEnd
; }
99 MeasureTextPosition
getHorizontal() const { return meHorizontal
; }
100 MeasureTextPosition
getVertical() const { return meVertical
; }
101 double getDistance() const { return mfDistance
; }
102 double getUpper() const { return mfUpper
; }
103 double getLower() const { return mfLower
; }
104 double getLeftDelta() const { return mfLeftDelta
; }
105 double getRightDelta() const { return mfRightDelta
; }
106 bool getBelow() const { return mbBelow
; }
107 bool getTextRotation() const { return mbTextRotation
; }
108 bool getTextAutoAngle() const { return mbTextAutoAngle
; }
111 virtual bool operator==(const BasePrimitive2D
& rPrimitive
) const override
;
114 DeclPrimitive2DIDBlock()
116 } // end of namespace primitive2d
117 } // end of namespace drawinglayer
120 #endif // INCLUDED_SVX_INC_SDR_PRIMITIVE2D_SDRMEASUREPRIMITIVE2D_HXX
122 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */