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_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 //////////////////////////////////////////////////////////////////////////////
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
49 class SdrMeasurePrimitive2D
: public BufferedDecompositionPrimitive2D
52 attribute::SdrLineShadowTextAttribute maSdrLSTAttribute
;
53 basegfx::B2DPoint maStart
;
54 basegfx::B2DPoint maEnd
;
55 MeasureTextPosition meHorizontal
;
56 MeasureTextPosition meVertical
;
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
,
75 bool bRightActive
) const;
78 // local decomposition.
79 virtual Primitive2DSequence
create2DDecomposition(const geometry::ViewInformation2D
& aViewInformation
) const;
82 SdrMeasurePrimitive2D(
83 const attribute::SdrLineShadowTextAttribute
& rSdrLSTAttribute
,
84 const basegfx::B2DPoint
& rStart
,
85 const basegfx::B2DPoint
& rEnd
,
86 MeasureTextPosition eHorizontal
,
87 MeasureTextPosition eVertical
,
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
; }
113 virtual bool operator==(const BasePrimitive2D
& rPrimitive
) const;
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: */