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/.
10 #ifndef INCLUDED_SC_SOURCE_FILTER_INC_XEEXTLST_HXX
11 #define INCLUDED_SC_SOURCE_FILTER_INC_XEEXTLST_HXX
13 #include "xerecord.hxx"
16 #include <colorscale.hxx>
26 struct XclExpExtCondFormatData
28 // -1 means don't write priority
31 const ScFormatEntry
* pEntry
;
35 * Base class for ext entries. Extend this class to provide the needed functionality
37 class XclExpExt
: public XclExpRecordBase
, public XclExpRoot
40 explicit XclExpExt( const XclExpRoot
& rRoot
);
41 virtual XclExpExtType
GetType() = 0;
47 class XclExpExtCfvo
: public XclExpRecordBase
, protected XclExpRoot
50 XclExpExtCfvo( const XclExpRoot
& rRoot
, const ScColorScaleEntry
& rEntry
, const ScAddress
& rPos
, bool bFirst
);
51 virtual void SaveXml( XclExpXmlStream
& rStrm
) override
;
54 ScColorScaleEntryType
const meType
;
59 class XclExpExtNegativeColor
62 XclExpExtNegativeColor( const Color
& rColor
);
63 void SaveXml( XclExpXmlStream
& rStrm
);
69 class XclExpExtAxisColor
72 XclExpExtAxisColor( const Color
& maColor
);
73 void SaveXml( XclExpXmlStream
& rStrm
);
76 Color
const maAxisColor
;
79 class XclExpExtIcon
: public XclExpRecordBase
, protected XclExpRoot
82 explicit XclExpExtIcon( const XclExpRoot
& rRoot
, const std::pair
<ScIconSetType
, sal_Int32
>& rCustomEntry
);
83 virtual void SaveXml( XclExpXmlStream
& rStrm
) override
;
86 const char* pIconSetName
;
90 class XclExpExtCF
: public XclExpRecordBase
, protected XclExpRoot
93 explicit XclExpExtCF( const XclExpRoot
& rRoot
, const ScCondFormatEntry
& rFormat
);
94 virtual void SaveXml( XclExpXmlStream
& rStrm
) override
;
98 const ScCondFormatEntry mrFormat
;
101 class XclExpExtDataBar
: public XclExpRecordBase
, protected XclExpRoot
104 explicit XclExpExtDataBar( const XclExpRoot
& rRoot
, const ScDataBarFormat
& rFormat
, const ScAddress
& rPos
);
105 virtual void SaveXml( XclExpXmlStream
& rStrm
) override
;
108 databar::ScAxisPosition meAxisPosition
;
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
123 explicit XclExpExtIconSet(const XclExpRoot
& rRoot
, const ScIconSetFormat
& rFormat
, const ScAddress
& rPos
);
124 virtual void SaveXml( XclExpXmlStream
& rStrm
) override
;
127 XclExpRecordList
<XclExpExtCfvo
> maCfvos
;
128 XclExpRecordList
<XclExpExtIcon
> maCustom
;
132 const char* mpIconSetName
;
136 class XclExpExtCfRule
: public XclExpRecordBase
, protected XclExpRoot
139 XclExpExtCfRule( const XclExpRoot
& rRoot
, const ScFormatEntry
& rFormat
, const ScAddress
& rPos
, const OString
& rId
, sal_Int32 nPriority
);
140 virtual void SaveXml( XclExpXmlStream
& rStrm
) override
;
143 XclExpRecordRef mxEntry
;
146 sal_Int32
const mnPriority
;
147 const char* mOperator
;
150 typedef std::shared_ptr
<XclExpExt
> XclExpExtRef
;
152 class XclExpExtConditionalFormatting
: public XclExpRecordBase
, protected XclExpRoot
155 explicit XclExpExtConditionalFormatting( const XclExpRoot
& rRoot
, std::vector
<XclExpExtCondFormatData
>& rData
, const ScRangeList
& rRange
);
156 virtual void SaveXml( XclExpXmlStream
& rStrm
) override
;
159 XclExpRecordList
<XclExpExtCfRule
> maCfRules
;
163 typedef std::shared_ptr
<XclExpExtConditionalFormatting
> XclExpExtConditionalFormattingRef
;
165 class XclExpExtCondFormat
: public XclExpExt
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
);
176 XclExpRecordList
< XclExpExtConditionalFormatting
> maCF
;
179 class XclExpExtCalcPr
: public XclExpExt
182 XclExpExtCalcPr( const XclExpRoot
& rRoot
, formula::FormulaGrammar::AddressConvention eConv
);
183 virtual void SaveXml( XclExpXmlStream
& rStrm
) override
;
185 virtual XclExpExtType
GetType() override
{ return XclExpExtDataFooType
; }
191 class XclExtLst
: public XclExpRecordBase
, public XclExpRoot
194 explicit XclExtLst( const XclExpRoot
& rRoot
);
195 virtual void SaveXml( XclExpXmlStream
& rStrm
) override
;
197 void AddRecord( const XclExpExtRef
& aEntry
);
199 XclExpExtRef
GetItem( XclExpExtType eType
);
202 XclExpRecordList
< XclExpExt
> maExtEntries
;
205 typedef std::shared_ptr
< XclExtLst
> XclExtLstRef
;
209 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */