Bump version to 6.4-15
[LibreOffice.git] / include / svx / sdr / primitive2d / sdrframeborderprimitive2d.hxx
blobc7355a296b7246449e4c236ccd6db6675a3186f0
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_SDRFRAMEBORDERPRIMITIVE2D_HXX
21 #define INCLUDED_SVX_INC_SDR_PRIMITIVE2D_SDRFRAMEBORDERPRIMITIVE2D_HXX
23 #include <drawinglayer/primitive2d/baseprimitive2d.hxx>
24 #include <svx/framelink.hxx>
26 // predefines
28 namespace drawinglayer
30 namespace primitive2d
32 class SVX_DLLPUBLIC SdrFrameBorderData
34 private:
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
38 Color maColor;
39 bool mbForceColor;
41 class SdrConnectStyleData
43 private:
44 svx::frame::Style maStyle;
45 basegfx::B2DVector maNormalizedPerpendicular;
46 bool mbStyleMirrored;
48 public:
49 SdrConnectStyleData(
50 const svx::frame::Style& rStyle,
51 const basegfx::B2DVector& rNormalizedPerpendicular,
52 bool bStyleMirrored);
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;
62 public:
63 SdrFrameBorderData(
64 const basegfx::B2DPoint& rOrigin,
65 const basegfx::B2DVector& rX,
66 const svx::frame::Style& rStyle,
67 const Color* pForceColor);
69 void addSdrConnectStyleData(
70 bool bStart,
71 const svx::frame::Style& rStyle,
72 const basegfx::B2DVector& rNormalizedPerpendicular,
73 bool bStyleMirrored);
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
89 namespace primitive2d
91 class SVX_DLLPUBLIC SdrFrameBorderPrimitive2D final : public BufferedDecompositionPrimitive2D
93 private:
94 std::shared_ptr<SdrFrameBorderDataVector> maFrameBorders;
95 double mfMinimalNonZeroBorderWidth;
96 double mfMinimalNonZeroBorderWidthUsedForDecompose;
97 bool mbMergeResult;
98 bool mbForceToSingleDiscreteUnit;
100 // local decomposition.
101 virtual void create2DDecomposition(
102 Primitive2DContainer& rContainer,
103 const geometry::ViewInformation2D& aViewInformation) const override;
105 public:
106 SdrFrameBorderPrimitive2D(
107 std::shared_ptr<SdrFrameBorderDataVector>& rFrameBorders,
108 bool bMergeResult,
109 bool bForceToSingleDiscreteUnit);
111 // compare operator
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;
119 // data access
120 const std::shared_ptr<SdrFrameBorderDataVector>& getFrameBorders() const { return maFrameBorders; }
121 bool doMergeResult() const { return mbMergeResult; }
122 bool doForceToSingleDiscreteUnit() const { return mbForceToSingleDiscreteUnit; }
124 // provide unique ID
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: */