LibreOffice Module svx (master)  1
sdrframeborderprimitive2d.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
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/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
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 .
18  */
19 
20 #ifndef INCLUDED_SVX_INC_SDR_PRIMITIVE2D_SDRFRAMEBORDERPRIMITIVE2D_HXX
21 #define INCLUDED_SVX_INC_SDR_PRIMITIVE2D_SDRFRAMEBORDERPRIMITIVE2D_HXX
22 
24 #include <svx/framelink.hxx>
25 
26 // predefines
27 
28 namespace drawinglayer
29 {
30  namespace primitive2d
31  {
33  {
34  private:
40 
42  {
43  private:
47 
48  public:
50  const svx::frame::Style& rStyle,
51  const basegfx::B2DVector& rNormalizedPerpendicular,
52  bool bStyleMirrored);
53 
54  const svx::frame::Style& getStyle() const { return maStyle; }
55  const basegfx::B2DVector& getNormalizedPerpendicular() const { return maNormalizedPerpendicular; }
56  bool getStyleMirrored() const { return mbStyleMirrored; }
57  };
58 
59  std::vector<SdrConnectStyleData> maStart;
60  std::vector<SdrConnectStyleData> maEnd;
61 
62  public:
64  const basegfx::B2DPoint& rOrigin,
65  const basegfx::B2DVector& rX,
66  const svx::frame::Style& rStyle,
67  const Color* pForceColor);
68 
69  void addSdrConnectStyleData(
70  bool bStart,
71  const svx::frame::Style& rStyle,
72  const basegfx::B2DVector& rNormalizedPerpendicular,
73  bool bStyleMirrored);
74 
75  void create2DDecomposition(
76  Primitive2DContainer& rContainer,
77  double fMinDiscreteUnit) const;
78 
79  double getMinimalNonZeroBorderWidth() const;
80  };
81 
82  typedef std::vector<SdrFrameBorderData> SdrFrameBorderDataVector;
83 
84  } // end of namespace primitive2d
85 } // end of namespace drawinglayer
86 
87 namespace drawinglayer
88 {
89  namespace primitive2d
90  {
92  {
93  private:
94  std::shared_ptr<SdrFrameBorderDataVector> maFrameBorders;
99 
100  // local decomposition.
101  virtual void create2DDecomposition(
102  Primitive2DContainer& rContainer,
103  const geometry::ViewInformation2D& aViewInformation) const override;
104 
105  public:
107  std::shared_ptr<SdrFrameBorderDataVector>& rFrameBorders,
108  bool bMergeResult,
109  bool bForceToSingleDiscreteUnit);
110 
111  // compare operator
112  virtual bool operator==(const BasePrimitive2D& rPrimitive) const override;
113 
114  // override to get view-dependent
115  virtual void get2DDecomposition(
117  const geometry::ViewInformation2D& rViewInformation) const override;
118 
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; }
123 
124  // provide unique ID
126  };
127  } // end of namespace primitive2d
128 } // end of namespace drawinglayer
129 
130 
131 #endif // INCLUDED_SVX_INC_SDR_PRIMITIVE2D_SDRFRAMEBORDERPRIMITIVE2D_HXX
132 
133 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
std::vector< SdrFrameBorderData > SdrFrameBorderDataVector
const std::shared_ptr< SdrFrameBorderDataVector > & getFrameBorders() const
#define DeclPrimitive2DIDBlock()
std::shared_ptr< SdrFrameBorderDataVector > maFrameBorders
#define SVX_DLLPUBLIC
Definition: svxdllapi.h:28
basegfx::B2DVector maX
start point of borderline
svx::frame::Style maStyle
X-Axis of borderline with length.
Contains the widths of primary and secondary line of a frame style.
Definition: framelink.hxx:101
bool operator==(const ScCsvLayoutData &rData1, const ScCsvLayoutData &rData2)