Version 7.5.1.1, tag libreoffice-7.5.1.1
[LibreOffice.git] / sc / source / filter / inc / xeextlst.hxx
blob1a33b5106e2c2a072c78a1f1767c6d2b218524e6
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/.
8 */
10 #pragma once
12 #include "xerecord.hxx"
13 #include "xeroot.hxx"
15 #include <colorscale.hxx>
17 #include <memory>
19 enum XclExpExtType
21 XclExpExtDataBarType,
22 XclExpExtDataFooType,
23 XclExpExtSparklineType,
26 struct XclExpExtCondFormatData
28 // -1 means don't write priority
29 sal_Int32 nPriority;
30 OString aGUID;
31 const ScFormatEntry* pEntry;
34 /**
35 * Base class for ext entries. Extend this class to provide the needed functionality
37 class XclExpExt : public XclExpRecordBase, public XclExpRoot
39 public:
40 explicit XclExpExt( const XclExpRoot& rRoot );
41 virtual XclExpExtType GetType() = 0;
43 protected:
44 OString maURI;
47 class XclExpExtCfvo : public XclExpRecordBase, protected XclExpRoot
49 public:
50 XclExpExtCfvo( const XclExpRoot& rRoot, const ScColorScaleEntry& rEntry, const ScAddress& rPos, bool bFirst );
51 virtual void SaveXml( XclExpXmlStream& rStrm ) override;
53 private:
54 ScColorScaleEntryType meType;
55 OString maValue;
56 bool mbFirst;
59 class XclExpExtNegativeColor
61 public:
62 XclExpExtNegativeColor( const Color& rColor );
63 void SaveXml( XclExpXmlStream& rStrm);
65 private:
66 Color maColor;
69 class XclExpExtAxisColor
71 public:
72 XclExpExtAxisColor( const Color& maColor );
73 void SaveXml( XclExpXmlStream& rStrm );
75 private:
76 Color maAxisColor;
79 class XclExpExtIcon : public XclExpRecordBase, protected XclExpRoot
81 public:
82 explicit XclExpExtIcon( const XclExpRoot& rRoot, const std::pair<ScIconSetType, sal_Int32>& rCustomEntry);
83 virtual void SaveXml( XclExpXmlStream& rStrm ) override;
85 private:
86 const char* pIconSetName;
87 sal_Int32 nIndex;
90 class XclExpExtCF : public XclExpRecordBase, protected XclExpRoot
92 public:
93 explicit XclExpExtCF( const XclExpRoot& rRoot, const ScCondFormatEntry& rFormat );
94 virtual void SaveXml( XclExpXmlStream& rStrm ) override;
96 private:
97 OUString aFormula;
98 ScCondFormatEntry mrFormat;
101 class XclExpExtDataBar : public XclExpRecordBase, protected XclExpRoot
103 public:
104 explicit XclExpExtDataBar( const XclExpRoot& rRoot, const ScDataBarFormat& rFormat, const ScAddress& rPos );
105 virtual void SaveXml( XclExpXmlStream& rStrm ) override;
107 private:
108 databar::ScAxisPosition meAxisPosition;
109 bool mbGradient;
110 double mnMinLength;
111 double mnMaxLength;
113 std::unique_ptr<XclExpExtCfvo> mpLowerLimit;
114 std::unique_ptr<XclExpExtCfvo> mpUpperLimit;
115 std::unique_ptr<XclExpExtNegativeColor> mpNegativeColor;
116 std::unique_ptr<XclExpExtAxisColor> mpAxisColor;
120 class XclExpExtIconSet : public XclExpRecordBase, protected XclExpRoot
122 public:
123 explicit XclExpExtIconSet(const XclExpRoot& rRoot, const ScIconSetFormat& rFormat, const ScAddress& rPos);
124 virtual void SaveXml( XclExpXmlStream& rStrm ) override;
126 private:
127 XclExpRecordList<XclExpExtCfvo> maCfvos;
128 XclExpRecordList<XclExpExtIcon> maCustom;
129 bool mbCustom;
130 bool mbReverse;
131 bool mbShowValue;
132 const char* mpIconSetName;
136 class XclExpExtCfRule : public XclExpRecordBase, protected XclExpRoot
138 public:
139 XclExpExtCfRule( const XclExpRoot& rRoot, const ScFormatEntry& rFormat, const ScAddress& rPos, OString aId, sal_Int32 nPriority );
140 virtual void SaveXml( XclExpXmlStream& rStrm ) override;
142 private:
143 XclExpRecordRef mxEntry;
144 OString maId;
145 const char* pType;
146 sal_Int32 mnPriority;
147 const char* mOperator;
150 typedef rtl::Reference<XclExpExt> XclExpExtRef;
152 class XclExpExtConditionalFormatting : public XclExpRecordBase, protected XclExpRoot
154 public:
155 explicit XclExpExtConditionalFormatting( const XclExpRoot& rRoot, std::vector<XclExpExtCondFormatData>& rData, ScRangeList aRange);
156 virtual void SaveXml( XclExpXmlStream& rStrm ) override;
158 private:
159 XclExpRecordList<XclExpExtCfRule> maCfRules;
160 ScRangeList maRange;
163 typedef rtl::Reference<XclExpExtConditionalFormatting> XclExpExtConditionalFormattingRef;
165 class XclExpExtCondFormat : public XclExpExt
167 public:
168 XclExpExtCondFormat( const XclExpRoot& rRoot );
169 virtual void SaveXml( XclExpXmlStream& rStrm ) override;
171 virtual XclExpExtType GetType() override { return XclExpExtDataBarType; }
173 void AddRecord( XclExpExtConditionalFormatting* pFormat );
175 private:
176 XclExpRecordList< XclExpExtConditionalFormatting > maCF;
179 class XclExpExtCalcPr : public XclExpExt
181 public:
182 XclExpExtCalcPr( const XclExpRoot& rRoot, formula::FormulaGrammar::AddressConvention eConv );
183 virtual void SaveXml( XclExpXmlStream& rStrm ) override;
185 virtual XclExpExtType GetType() override { return XclExpExtDataFooType; }
187 private:
188 OString maSyntax;
191 class XclExtLst : public XclExpRecordBase, public XclExpRoot
193 public:
194 explicit XclExtLst( const XclExpRoot& rRoot);
195 virtual void SaveXml( XclExpXmlStream& rStrm ) override;
197 void AddRecord( XclExpExt* pEntry );
198 void AddRecord( const XclExpExtRef& aEntry ) { AddRecord(aEntry.get()); }
200 XclExpExt* GetItem( XclExpExtType eType );
202 private:
203 XclExpRecordList< XclExpExt > maExtEntries;
206 typedef rtl::Reference< XclExtLst > XclExtLstRef;
208 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */