LibreOffice Module drawinglayer (master) 1
borderlineprimitive2d.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#pragma once
21
23
27
28enum class SvxBorderLineStyle : sal_Int16;
29
31{
40{
41private:
42 // line attribute containing Width, Color and others
44
45 // line extends
48 double mfEndLeft;
49 double mfEndRight;
50
51 // if this is a gap, this is set to true
52 bool mbIsGap;
53
54public:
55 // Constructor for visible BorderLine segments
57 double fStartLeft = 0.0, double fStartRight = 0.0, double fEndLeft = 0.0,
58 double fEndRight = 0.0);
59
60 // Constructor for gap BorderLine segments
61 BorderLine(double fWidth);
62
64
65 BorderLine(BorderLine const&) = default;
66 BorderLine(BorderLine&&) = default;
67 BorderLine& operator=(BorderLine const&) = default;
69
71 {
72 return maLineAttribute;
73 }
74 double getStartLeft() const { return mfStartLeft; }
75 double getStartRight() const { return mfStartRight; }
76 double getEndLeft() const { return mfEndLeft; }
77 double getEndRight() const { return mfEndRight; }
78 bool isGap() const { return mbIsGap; }
79
81 bool operator==(const BorderLine& rBorderLine) const;
82};
83
93{
94private:
98
100 std::vector<BorderLine> maBorderLines;
101
104
106 virtual void
107 create2DDecomposition(Primitive2DContainer& rContainer,
108 const geometry::ViewInformation2D& rViewInformation) const override;
109
111 double getFullWidth() const;
112
113public:
116 std::vector<BorderLine>&& rBorderLines,
118
120 const basegfx::B2DPoint& getStart() const { return maStart; }
121 const basegfx::B2DPoint& getEnd() const { return maEnd; }
122 const std::vector<BorderLine>& getBorderLines() const { return maBorderLines; }
124 {
125 return maStrokeAttribute;
126 }
127
129 bool isHorizontalOrVertical(const geometry::ViewInformation2D& rViewInformation) const;
130
132 virtual bool operator==(const BasePrimitive2D& rPrimitive) const override;
133
135 virtual sal_uInt32 getPrimitive2DID() const override;
136};
137
142 const BorderLinePrimitive2D* pCandidateA, const BorderLinePrimitive2D* pCandidateB);
143
144} // end of namespace drawinglayer::primitive2d
145
146/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Point maStart
const Point maEnd
SvxBorderLineStyle
std::vector< BorderLine > maBorderLines
the single BorderLine style definition(s), one or three mostly used
const std::vector< BorderLine > & getBorderLines() const
const drawinglayer::attribute::StrokeAttribute & getStrokeAttribute() const
const drawinglayer::attribute::StrokeAttribute maStrokeAttribute
common style definitions
const basegfx::B2DPoint & getStart() const
data read access
BorderLine class Helper class holding the style definition for a single part of a full BorderLine def...
BorderLine(BorderLine const &)=default
BorderLine & operator=(BorderLine const &)=default
drawinglayer::attribute::LineAttribute maLineAttribute
const drawinglayer::attribute::LineAttribute & getLineAttribute() const
BorderLine(BorderLine &&)=default
BorderLine & operator=(BorderLine &&)=default
#define DRAWINGLAYER_DLLPUBLIC
rtl::Reference< BasePrimitive2D > Primitive2DReference
Definition: CommonTypes.hxx:27
Primitive2DReference tryMergeBorderLinePrimitive2D(const BorderLinePrimitive2D *pCandidateA, const BorderLinePrimitive2D *pCandidateB)
helper to try to merge two instances of BorderLinePrimitive2D.
bool operator==(const XclFontData &rLeft, const XclFontData &rRight)