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_SDRFRAMEBORDERPRIMITIVE2D_HXX
21 #define INCLUDED_SVX_INC_SDR_PRIMITIVE2D_SDRFRAMEBORDERPRIMITIVE2D_HXX
23 #include <drawinglayer/primitive2d/BufferedDecompositionPrimitive2D.hxx>
24 #include <svx/framelink.hxx>
28 namespace drawinglayer::primitive2d
30 class SVXCORE_DLLPUBLIC SdrFrameBorderData
33 basegfx::B2DPoint maOrigin
; /// start point of borderline
34 basegfx::B2DVector maX
; /// X-Axis of borderline with length
35 svx::frame::Style maStyle
; /// Style of borderline
39 class SdrConnectStyleData
42 svx::frame::Style maStyle
;
43 basegfx::B2DVector maNormalizedPerpendicular
;
48 const svx::frame::Style
& rStyle
,
49 const basegfx::B2DVector
& rNormalizedPerpendicular
,
52 const svx::frame::Style
& getStyle() const { return maStyle
; }
53 const basegfx::B2DVector
& getNormalizedPerpendicular() const { return maNormalizedPerpendicular
; }
54 bool getStyleMirrored() const { return mbStyleMirrored
; }
55 bool operator==(const SdrConnectStyleData
& rCompare
) const;
58 std::vector
<SdrConnectStyleData
> maStart
;
59 std::vector
<SdrConnectStyleData
> maEnd
;
63 const basegfx::B2DPoint
& rOrigin
,
64 const basegfx::B2DVector
& rX
,
65 const svx::frame::Style
& rStyle
,
66 const Color
* pForceColor
);
68 void addSdrConnectStyleData(
70 const svx::frame::Style
& rStyle
,
71 const basegfx::B2DVector
& rNormalizedPerpendicular
,
74 void create2DDecomposition(
75 Primitive2DContainer
& rContainer
,
76 double fMinDiscreteUnit
) const;
78 double getMinimalNonZeroBorderWidth() const;
79 bool operator==(const SdrFrameBorderData
& rCompare
) const;
82 typedef std::vector
<SdrFrameBorderData
> SdrFrameBorderDataVector
;
84 } // end of namespace drawinglayer::primitive2d
86 namespace drawinglayer::primitive2d
88 class SVXCORE_DLLPUBLIC SdrFrameBorderPrimitive2D final
: public BufferedDecompositionPrimitive2D
91 SdrFrameBorderDataVector maFrameBorders
;
92 double mfMinimalNonZeroBorderWidth
;
93 double mfMinimalNonZeroBorderWidthUsedForDecompose
;
94 bool mbForceToSingleDiscreteUnit
;
96 // local decomposition.
97 virtual Primitive2DReference
create2DDecomposition(
98 const geometry::ViewInformation2D
& aViewInformation
) const override
;
101 SdrFrameBorderPrimitive2D(
102 SdrFrameBorderDataVector
&& rFrameBorders
,
103 bool bForceToSingleDiscreteUnit
);
106 virtual bool operator==(const BasePrimitive2D
& rPrimitive
) const override
;
108 // override to get view-dependent
109 virtual void get2DDecomposition(
110 Primitive2DDecompositionVisitor
& rVisitor
,
111 const geometry::ViewInformation2D
& rViewInformation
) const override
;
114 const SdrFrameBorderDataVector
& getFrameBorders() const { return maFrameBorders
; }
115 bool doForceToSingleDiscreteUnit() const { return mbForceToSingleDiscreteUnit
; }
118 virtual sal_uInt32
getPrimitive2DID() const override
;
121 } // end of namespace drawinglayer::primitive2d
124 #endif // INCLUDED_SVX_INC_SDR_PRIMITIVE2D_SDRFRAMEBORDERPRIMITIVE2D_HXX
126 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */