/src/libreoffice/sc/inc/SparklineAttributes.hxx
Line | Count | Source |
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 | | |
11 | | #pragma once |
12 | | |
13 | | #include "scdllapi.h" |
14 | | #include <docmodel/color/ComplexColor.hxx> |
15 | | #include <optional> |
16 | | #include <o3tl/cow_wrapper.hxx> |
17 | | |
18 | | namespace sc |
19 | | { |
20 | | /** Supported sparkline types */ |
21 | | enum class SparklineType |
22 | | { |
23 | | Line, |
24 | | Column, |
25 | | Stacked |
26 | | }; |
27 | | |
28 | | /** The method of calculating the axis min or max value */ |
29 | | enum class AxisType |
30 | | { |
31 | | Individual, // calculate the min/max of a sparkline |
32 | | Group, // calculate the min or max of the whole sparkline group |
33 | | Custom // user defined |
34 | | }; |
35 | | |
36 | | /** Determines how to display the empty cells */ |
37 | | enum class DisplayEmptyCellsAs |
38 | | { |
39 | | Span, |
40 | | Gap, |
41 | | Zero // empty cell equals zero |
42 | | }; |
43 | | |
44 | | /** Common properties for a group of sparklines */ |
45 | | class SC_DLLPUBLIC SparklineAttributes |
46 | | { |
47 | | private: |
48 | | class Implementation; |
49 | | o3tl::cow_wrapper<Implementation> m_aImplementation; |
50 | | |
51 | | public: |
52 | | SparklineAttributes(); |
53 | | ~SparklineAttributes(); |
54 | | SparklineAttributes(const SparklineAttributes& rOther); |
55 | | SparklineAttributes(SparklineAttributes&& rOther); |
56 | | SparklineAttributes& operator=(const SparklineAttributes& rOther); |
57 | | SparklineAttributes& operator=(SparklineAttributes&& rOther); |
58 | | |
59 | | bool operator==(const SparklineAttributes& rOther) const; |
60 | | bool operator!=(const SparklineAttributes& rOther) const |
61 | 0 | { |
62 | 0 | return !(SparklineAttributes::operator==(rOther)); |
63 | 0 | } |
64 | | |
65 | | void resetColors(); |
66 | | |
67 | | const model::ComplexColor& getColorSeries() const; |
68 | | void setColorSeries(model::ComplexColor const& rColorSeries); |
69 | | |
70 | | const model::ComplexColor& getColorNegative() const; |
71 | | void setColorNegative(model::ComplexColor const& rColorSeries); |
72 | | |
73 | | const model::ComplexColor& getColorAxis() const; |
74 | | void setColorAxis(model::ComplexColor const& rColorSeries); |
75 | | |
76 | | const model::ComplexColor& getColorMarkers() const; |
77 | | void setColorMarkers(model::ComplexColor const& rColorSeries); |
78 | | |
79 | | const model::ComplexColor& getColorFirst() const; |
80 | | void setColorFirst(model::ComplexColor const& rColorSeries); |
81 | | |
82 | | const model::ComplexColor& getColorLast() const; |
83 | | void setColorLast(model::ComplexColor const& rColorSeries); |
84 | | |
85 | | const model::ComplexColor& getColorHigh() const; |
86 | | void setColorHigh(model::ComplexColor const& rColorSeries); |
87 | | |
88 | | const model::ComplexColor& getColorLow() const; |
89 | | void setColorLow(model::ComplexColor const& rColorSeries); |
90 | | |
91 | | AxisType getMinAxisType() const; |
92 | | void setMinAxisType(AxisType eAxisType); |
93 | | |
94 | | AxisType getMaxAxisType() const; |
95 | | void setMaxAxisType(AxisType eAxisType); |
96 | | |
97 | | /** Line weight or width in points */ |
98 | | double getLineWeight() const; |
99 | | void setLineWeight(double nWeight); |
100 | | |
101 | | SparklineType getType() const; |
102 | | void setType(SparklineType eType); |
103 | | |
104 | | bool isDateAxis() const; |
105 | | void setDateAxis(bool bValue); |
106 | | |
107 | | DisplayEmptyCellsAs getDisplayEmptyCellsAs() const; |
108 | | void setDisplayEmptyCellsAs(DisplayEmptyCellsAs eValue); |
109 | | |
110 | | bool isMarkers() const; |
111 | | void setMarkers(bool bValue); |
112 | | |
113 | | bool isHigh() const; |
114 | | void setHigh(bool bValue); |
115 | | |
116 | | bool isLow() const; |
117 | | void setLow(bool bValue); |
118 | | |
119 | | bool isFirst() const; |
120 | | void setFirst(bool bValue); |
121 | | |
122 | | bool isLast() const; |
123 | | void setLast(bool bValue); |
124 | | |
125 | | bool isNegative() const; |
126 | | void setNegative(bool bValue); |
127 | | |
128 | | bool shouldDisplayXAxis() const; |
129 | | void setDisplayXAxis(bool bValue); |
130 | | |
131 | | bool shouldDisplayHidden() const; |
132 | | void setDisplayHidden(bool bValue); |
133 | | |
134 | | bool isRightToLeft() const; |
135 | | void setRightToLeft(bool bValue); |
136 | | |
137 | | std::optional<double> getManualMax() const; |
138 | | void setManualMax(std::optional<double> aValue); |
139 | | |
140 | | std::optional<double> getManualMin() const; |
141 | | void setManualMin(std::optional<double> aValue); |
142 | | }; |
143 | | |
144 | | } // end sc |
145 | | |
146 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |