Version 6.4.0.3, tag libreoffice-6.4.0.3
[LibreOffice.git] / sc / source / filter / inc / xeextlst.hxx
blob9eff88ec3fb0d77e25cb2a7985377508b542b864
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 #ifndef INCLUDED_SC_SOURCE_FILTER_INC_XEEXTLST_HXX
11 #define INCLUDED_SC_SOURCE_FILTER_INC_XEEXTLST_HXX
13 #include "xerecord.hxx"
14 #include "xeroot.hxx"
16 #include <colorscale.hxx>
18 #include <memory>
20 enum XclExpExtType
22 XclExpExtDataBarType,
23 XclExpExtDataFooType
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 const meType;
55 OString maValue;
56 bool const mbFirst;
59 class XclExpExtNegativeColor
61 public:
62 XclExpExtNegativeColor( const Color& rColor );
63 void SaveXml( XclExpXmlStream& rStrm);
65 private:
66 Color const maColor;
69 class XclExpExtAxisColor
71 public:
72 XclExpExtAxisColor( const Color& maColor );
73 void SaveXml( XclExpXmlStream& rStrm );
75 private:
76 Color const 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 const 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, const OString& rId, sal_Int32 nPriority );
140 virtual void SaveXml( XclExpXmlStream& rStrm ) override;
142 private:
143 XclExpRecordRef mxEntry;
144 OString const maId;
145 const char* pType;
146 sal_Int32 const mnPriority;
147 const char* mOperator;
150 typedef std::shared_ptr<XclExpExt> XclExpExtRef;
152 class XclExpExtConditionalFormatting : public XclExpRecordBase, protected XclExpRoot
154 public:
155 explicit XclExpExtConditionalFormatting( const XclExpRoot& rRoot, std::vector<XclExpExtCondFormatData>& rData, const ScRangeList& rRange);
156 virtual void SaveXml( XclExpXmlStream& rStrm ) override;
158 private:
159 XclExpRecordList<XclExpExtCfRule> maCfRules;
160 ScRangeList maRange;
163 typedef std::shared_ptr<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( const XclExpExtConditionalFormattingRef& aFormat );
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( const XclExpExtRef& aEntry );
199 XclExpExtRef GetItem( XclExpExtType eType );
201 private:
202 XclExpRecordList< XclExpExt > maExtEntries;
205 typedef std::shared_ptr< XclExtLst > XclExtLstRef;
207 #endif
209 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */