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/baseprimitive2d.hxx>
24 #include <svx/framelink.hxx>
28 namespace drawinglayer
32 class SVX_DLLPUBLIC SdrFrameBorderData
35 basegfx::B2DPoint maOrigin
; /// start point of borderline
36 basegfx::B2DVector maX
; /// X-Axis of borderline with length
37 svx::frame::Style maStyle
; /// Style of borderline
41 class SdrConnectStyleData
44 svx::frame::Style maStyle
;
45 basegfx::B2DVector maNormalizedPerpendicular
;
50 const svx::frame::Style
& rStyle
,
51 const basegfx::B2DVector
& rNormalizedPerpendicular
,
54 const svx::frame::Style
& getStyle() const { return maStyle
; }
55 const basegfx::B2DVector
& getNormalizedPerpendicular() const { return maNormalizedPerpendicular
; }
56 bool getStyleMirrored() const { return mbStyleMirrored
; }
59 std::vector
<SdrConnectStyleData
> maStart
;
60 std::vector
<SdrConnectStyleData
> maEnd
;
64 const basegfx::B2DPoint
& rOrigin
,
65 const basegfx::B2DVector
& rX
,
66 const svx::frame::Style
& rStyle
,
67 const Color
* pForceColor
);
69 void addSdrConnectStyleData(
71 const svx::frame::Style
& rStyle
,
72 const basegfx::B2DVector
& rNormalizedPerpendicular
,
75 void create2DDecomposition(
76 Primitive2DContainer
& rContainer
,
77 double fMinDiscreteUnit
) const;
79 double getMinimalNonZeroBorderWidth() const;
82 typedef std::vector
<SdrFrameBorderData
> SdrFrameBorderDataVector
;
84 } // end of namespace primitive2d
85 } // end of namespace drawinglayer
87 namespace drawinglayer
91 class SVX_DLLPUBLIC SdrFrameBorderPrimitive2D final
: public BufferedDecompositionPrimitive2D
94 std::shared_ptr
<SdrFrameBorderDataVector
> maFrameBorders
;
95 double mfMinimalNonZeroBorderWidth
;
96 double mfMinimalNonZeroBorderWidthUsedForDecompose
;
98 bool mbForceToSingleDiscreteUnit
;
100 // local decomposition.
101 virtual void create2DDecomposition(
102 Primitive2DContainer
& rContainer
,
103 const geometry::ViewInformation2D
& aViewInformation
) const override
;
106 SdrFrameBorderPrimitive2D(
107 std::shared_ptr
<SdrFrameBorderDataVector
>& rFrameBorders
,
109 bool bForceToSingleDiscreteUnit
);
112 virtual bool operator==(const BasePrimitive2D
& rPrimitive
) const override
;
114 // override to get view-dependent
115 virtual void get2DDecomposition(
116 Primitive2DDecompositionVisitor
& rVisitor
,
117 const geometry::ViewInformation2D
& rViewInformation
) const override
;
120 const std::shared_ptr
<SdrFrameBorderDataVector
>& getFrameBorders() const { return maFrameBorders
; }
121 bool doMergeResult() const { return mbMergeResult
; }
122 bool doForceToSingleDiscreteUnit() const { return mbForceToSingleDiscreteUnit
; }
125 DeclPrimitive2DIDBlock()
127 } // end of namespace primitive2d
128 } // end of namespace drawinglayer
131 #endif // INCLUDED_SVX_INC_SDR_PRIMITIVE2D_SDRFRAMEBORDERPRIMITIVE2D_HXX
133 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */