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/.
14 #include <sal/types.h>
15 #include <tools/color.hxx>
17 #include <o3tl/cow_wrapper.hxx>
21 /** Supported sparkline types */
22 enum class SparklineType
29 /** The method of calculating the axis min or max value */
32 Individual
, // calculate the min/max of a sparkline
33 Group
, // calculate the min or max of the whole sparkline group
34 Custom
// user defined
37 /** Determines how to display the empty cells */
38 enum class DisplayEmptyCellsAs
42 Zero
// empty cell equals zero
45 /** Common properties for a group of sparklines */
46 class SC_DLLPUBLIC SparklineAttributes
50 o3tl::cow_wrapper
<Implementation
> m_aImplementation
;
53 SparklineAttributes();
54 ~SparklineAttributes();
55 SparklineAttributes(const SparklineAttributes
& rOther
);
56 SparklineAttributes(SparklineAttributes
&& rOther
);
57 SparklineAttributes
& operator=(const SparklineAttributes
& rOther
);
58 SparklineAttributes
& operator=(SparklineAttributes
&& rOther
);
60 bool operator==(const SparklineAttributes
& rOther
) const;
61 bool operator!=(const SparklineAttributes
& rOther
) const
63 return !(SparklineAttributes::operator==(rOther
));
66 Color
getColorSeries() const;
67 void setColorSeries(Color aColorSeries
);
69 Color
getColorNegative() const;
70 void setColorNegative(Color aColorSeries
);
72 Color
getColorAxis() const;
73 void setColorAxis(Color aColorSeries
);
75 Color
getColorMarkers() const;
76 void setColorMarkers(Color aColorSeries
);
78 Color
getColorFirst() const;
79 void setColorFirst(Color aColorSeries
);
81 Color
getColorLast() const;
82 void setColorLast(Color aColorSeries
);
84 Color
getColorHigh() const;
85 void setColorHigh(Color aColorSeries
);
87 Color
getColorLow() const;
88 void setColorLow(Color aColorSeries
);
90 AxisType
getMinAxisType() const;
91 void setMinAxisType(AxisType eAxisType
);
93 AxisType
getMaxAxisType() const;
94 void setMaxAxisType(AxisType eAxisType
);
96 /** Line weigth or width in points */
97 double getLineWeight() const;
98 void setLineWeight(double nWeight
);
100 SparklineType
getType() const;
101 void setType(SparklineType eType
);
103 bool isDateAxis() const;
104 void setDateAxis(bool bValue
);
106 DisplayEmptyCellsAs
getDisplayEmptyCellsAs() const;
107 void setDisplayEmptyCellsAs(DisplayEmptyCellsAs eValue
);
109 bool isMarkers() const;
110 void setMarkers(bool bValue
);
113 void setHigh(bool bValue
);
116 void setLow(bool bValue
);
118 bool isFirst() const;
119 void setFirst(bool bValue
);
122 void setLast(bool bValue
);
124 bool isNegative() const;
125 void setNegative(bool bValue
);
127 bool shouldDisplayXAxis() const;
128 void setDisplayXAxis(bool bValue
);
130 bool shouldDisplayHidden() const;
131 void setDisplayHidden(bool bValue
);
133 bool isRightToLeft() const;
134 void setRightToLeft(bool bValue
);
136 std::optional
<double> getManualMax() const;
137 void setManualMax(std::optional
<double> aValue
);
139 std::optional
<double> getManualMin() const;
140 void setManualMin(std::optional
<double> aValue
);
145 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */