LibreOffice Module sc (master) 1
SparklineAttributes.cxx
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 */
10
12
13namespace sc
14{
17{
18public:
27
30
31 double m_fLineWeight; // In pt
32
34
36
38
40 bool m_bHigh;
41 bool m_bLow;
43 bool m_bLast;
48
49 std::optional<double> m_aManualMax;
50 std::optional<double> m_aManualMin;
51
52 static constexpr ::Color COL_STANDARD_RED = 0xff0000;
53 static constexpr ::Color COL_STANDARD_BLUE = 0x2a6099;
54
66 , m_fLineWeight(0.75)
68 , m_bDateAxis(false)
70 , m_bMarkers(false)
71 , m_bHigh(false)
72 , m_bLow(false)
73 , m_bFirst(false)
74 , m_bLast(false)
75 , m_bNegative(false)
76 , m_bDisplayXAxis(false)
77 , m_bDisplayHidden(false)
78 , m_bRightToLeft(false)
79 {
80 }
81
90 , m_aColorLow(pOther.m_aColorLow)
94 , m_eType(pOther.m_eType)
95 , m_bDateAxis(pOther.m_bDateAxis)
97 , m_bMarkers(pOther.m_bMarkers)
98 , m_bHigh(pOther.m_bHigh)
99 , m_bLow(pOther.m_bLow)
100 , m_bFirst(pOther.m_bFirst)
101 , m_bLast(pOther.m_bLast)
102 , m_bNegative(pOther.m_bNegative)
106 , m_aManualMax(pOther.m_aManualMax)
107 , m_aManualMin(pOther.m_aManualMin)
108 {
109 }
110
111 bool operator==(const Implementation& rImpl) const
112 {
113 return (m_aColorSeries == rImpl.m_aColorSeries)
115 && (m_aColorAxis == rImpl.m_aColorAxis) && (m_aColorMarkers == rImpl.m_aColorMarkers)
116 && (m_aColorFirst == rImpl.m_aColorFirst) && (m_aColorLast == rImpl.m_aColorLast)
117 && (m_aColorHigh == rImpl.m_aColorHigh) && (m_aColorLow == rImpl.m_aColorLow)
118 && (m_eMinAxisType == rImpl.m_eMinAxisType)
119 && (m_eMaxAxisType == rImpl.m_eMaxAxisType) && (m_fLineWeight == rImpl.m_fLineWeight)
120 && (m_eType == rImpl.m_eType) && (m_bDateAxis == rImpl.m_bDateAxis)
122 && (m_bMarkers == rImpl.m_bMarkers) && (m_bHigh == rImpl.m_bHigh)
123 && (m_bLow == rImpl.m_bLow) && (m_bFirst == rImpl.m_bFirst)
124 && (m_bLast == rImpl.m_bLast) && (m_bNegative == rImpl.m_bNegative)
125 && (m_bDisplayXAxis == rImpl.m_bDisplayXAxis)
127 && (m_bRightToLeft == rImpl.m_bRightToLeft) && (m_aManualMax == rImpl.m_aManualMax)
128 && (m_aManualMin == rImpl.m_aManualMin);
129 }
130};
131
133
135
137
139
141
143
145{
146 return m_aImplementation == rOther.m_aImplementation;
147}
148
150
152{
153 m_aImplementation->m_aColorSeries = aColor;
154}
155
157
159{
160 m_aImplementation->m_aColorNegative = aColor;
161}
162
164
165void SparklineAttributes::setColorAxis(Color aColor) { m_aImplementation->m_aColorAxis = aColor; }
166
169{
170 m_aImplementation->m_aColorMarkers = aColor;
171}
172
174void SparklineAttributes::setColorFirst(Color aColor) { m_aImplementation->m_aColorFirst = aColor; }
175
177void SparklineAttributes::setColorLast(Color aColor) { m_aImplementation->m_aColorLast = aColor; }
178
180void SparklineAttributes::setColorHigh(Color aColor) { m_aImplementation->m_aColorHigh = aColor; }
181
183void SparklineAttributes::setColorLow(Color aColor) { m_aImplementation->m_aColorLow = aColor; }
184
187{
188 m_aImplementation->m_eMinAxisType = eAxisType;
189}
190
193{
194 m_aImplementation->m_eMaxAxisType = eAxisType;
195}
196
197double SparklineAttributes::getLineWeight() const { return m_aImplementation->m_fLineWeight; }
199{
200 m_aImplementation->m_fLineWeight = nWeight;
201}
202
205
206bool SparklineAttributes::isDateAxis() const { return m_aImplementation->m_bDateAxis; }
207void SparklineAttributes::setDateAxis(bool bValue) { m_aImplementation->m_bDateAxis = bValue; }
208
210{
211 return m_aImplementation->m_eDisplayEmptyCellsAs;
212}
214{
215 m_aImplementation->m_eDisplayEmptyCellsAs = eValue;
216}
217
218bool SparklineAttributes::isMarkers() const { return m_aImplementation->m_bMarkers; }
219void SparklineAttributes::setMarkers(bool bValue) { m_aImplementation->m_bMarkers = bValue; }
220
221bool SparklineAttributes::isHigh() const { return m_aImplementation->m_bHigh; }
222void SparklineAttributes::setHigh(bool bValue) { m_aImplementation->m_bHigh = bValue; }
223
224bool SparklineAttributes::isLow() const { return m_aImplementation->m_bLow; }
225void SparklineAttributes::setLow(bool bValue) { m_aImplementation->m_bLow = bValue; }
226
227bool SparklineAttributes::isFirst() const { return m_aImplementation->m_bFirst; }
228void SparklineAttributes::setFirst(bool bValue) { m_aImplementation->m_bFirst = bValue; }
229
230bool SparklineAttributes::isLast() const { return m_aImplementation->m_bLast; }
231void SparklineAttributes::setLast(bool bValue) { m_aImplementation->m_bLast = bValue; }
232
233bool SparklineAttributes::isNegative() const { return m_aImplementation->m_bNegative; }
234void SparklineAttributes::setNegative(bool bValue) { m_aImplementation->m_bNegative = bValue; }
235
236bool SparklineAttributes::shouldDisplayXAxis() const { return m_aImplementation->m_bDisplayXAxis; }
238{
239 m_aImplementation->m_bDisplayXAxis = bValue;
240}
241
243{
244 return m_aImplementation->m_bDisplayHidden;
245}
247{
248 m_aImplementation->m_bDisplayHidden = bValue;
249}
250
251bool SparklineAttributes::isRightToLeft() const { return m_aImplementation->m_bRightToLeft; }
253{
254 m_aImplementation->m_bRightToLeft = bValue;
255}
256
257std::optional<double> SparklineAttributes::getManualMax() const
258{
259 return m_aImplementation->m_aManualMax;
260}
261void SparklineAttributes::setManualMax(std::optional<double> aValue)
262{
263 m_aImplementation->m_aManualMax = aValue;
264}
265
266std::optional<double> SparklineAttributes::getManualMin() const
267{
268 return m_aImplementation->m_aManualMin;
269}
270void SparklineAttributes::setManualMin(std::optional<double> aValue)
271{
272 m_aImplementation->m_aManualMin = aValue;
273}
274
275} // end sc
276
277/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
bool operator==(const Implementation &rImpl) const
Implementation(Implementation const &pOther)
Common properties for a group of sparklines.
DisplayEmptyCellsAs getDisplayEmptyCellsAs() const
std::optional< double > getManualMax() const
SparklineType getType() const
void setType(SparklineType eType)
bool operator==(const SparklineAttributes &rOther) const
SparklineAttributes & operator=(const SparklineAttributes &rOther)
void setDisplayHidden(bool bValue)
void setColorLast(Color aColorSeries)
void setManualMax(std::optional< double > aValue)
void setColorSeries(Color aColorSeries)
void setColorFirst(Color aColorSeries)
void setColorLow(Color aColorSeries)
void setMaxAxisType(AxisType eAxisType)
void setDisplayEmptyCellsAs(DisplayEmptyCellsAs eValue)
void setLineWeight(double nWeight)
void setRightToLeft(bool bValue)
void setMinAxisType(AxisType eAxisType)
void setManualMin(std::optional< double > aValue)
std::optional< double > getManualMin() const
double getLineWeight() const
Line weight or width in points.
void setColorAxis(Color aColorSeries)
o3tl::cow_wrapper< Implementation > m_aImplementation
void setColorMarkers(Color aColorSeries)
void setDisplayXAxis(bool bValue)
void setColorNegative(Color aColorSeries)
void setColorHigh(Color aColorSeries)
DocumentType eType
CAUTION! The following defines must be in the same namespace as the respective type.
SparklineType
Supported sparkline types.
DisplayEmptyCellsAs
Determines how to display the empty cells.
AxisType
The method of calculating the axis min or max value.