LanguageTool: don't crash if REST protocol isn't set
[LibreOffice.git] / sc / inc / SparklineAttributes.hxx
blobe89e15bc1a1b6423e789a8e9caf6244e920bee89
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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/.
9 */
11 #pragma once
13 #include "scdllapi.h"
14 #include <sal/types.h>
15 #include <tools/color.hxx>
16 #include <optional>
17 #include <o3tl/cow_wrapper.hxx>
19 namespace sc
21 /** Supported sparkline types */
22 enum class SparklineType
24 Line,
25 Column,
26 Stacked
29 /** The method of calculating the axis min or max value */
30 enum class AxisType
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
40 Span,
41 Gap,
42 Zero // empty cell equals zero
45 /** Common properties for a group of sparklines */
46 class SC_DLLPUBLIC SparklineAttributes
48 private:
49 class Implementation;
50 o3tl::cow_wrapper<Implementation> m_aImplementation;
52 public:
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);
112 bool isHigh() const;
113 void setHigh(bool bValue);
115 bool isLow() const;
116 void setLow(bool bValue);
118 bool isFirst() const;
119 void setFirst(bool bValue);
121 bool isLast() const;
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);
143 } // end sc
145 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */