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"
17 #include "formulaopt.hxx"
27 struct XclExpExtCondFormatData
29 // -1 means don't write priority
32 const ScFormatEntry
* pEntry
;
36 * Base class for ext entries. Extend this class to provide the needed functionality
38 class XclExpExt
: public XclExpRecordBase
, public XclExpRoot
41 explicit XclExpExt( const XclExpRoot
& rRoot
);
42 virtual XclExpExtType
GetType() = 0;
48 class XclExpExtCfvo
: public XclExpRecordBase
, protected XclExpRoot
51 XclExpExtCfvo( const XclExpRoot
& rRoot
, const ScColorScaleEntry
& rEntry
, const ScAddress
& rPos
, bool bFirst
);
52 virtual void SaveXml( XclExpXmlStream
& rStrm
) SAL_OVERRIDE
;
55 ScColorScaleEntryType meType
;
60 class XclExpExtNegativeColor
63 XclExpExtNegativeColor( const Color
& rColor
);
64 void SaveXml( XclExpXmlStream
& rStrm
);
70 class XclExpExtAxisColor
73 XclExpExtAxisColor( const Color
& maColor
);
74 void SaveXml( XclExpXmlStream
& rStrm
);
80 class XclExpExtIcon
: public XclExpRecordBase
, protected XclExpRoot
83 explicit XclExpExtIcon( const XclExpRoot
& rRoot
, const std::pair
<ScIconSetType
, sal_Int32
>& rCustomEntry
);
84 virtual void SaveXml( XclExpXmlStream
& rStrm
) SAL_OVERRIDE
;
87 const char* pIconSetName
;
91 class XclExpExtDataBar
: public XclExpRecordBase
, protected XclExpRoot
94 explicit XclExpExtDataBar( const XclExpRoot
& rRoot
, const ScDataBarFormat
& rFormat
, const ScAddress
& rPos
);
95 virtual void SaveXml( XclExpXmlStream
& rStrm
) SAL_OVERRIDE
;
98 databar::ScAxisPosition meAxisPosition
;
103 std::unique_ptr
<XclExpExtCfvo
> mpLowerLimit
;
104 std::unique_ptr
<XclExpExtCfvo
> mpUpperLimit
;
105 std::unique_ptr
<XclExpExtNegativeColor
> mpNegativeColor
;
106 std::unique_ptr
<XclExpExtAxisColor
> mpAxisColor
;
110 class XclExpExtIconSet
: public XclExpRecordBase
, protected XclExpRoot
113 explicit XclExpExtIconSet(const XclExpRoot
& rRoot
, const ScIconSetFormat
& rFormat
, const ScAddress
& rPos
);
114 virtual void SaveXml( XclExpXmlStream
& rStrm
) SAL_OVERRIDE
;
117 XclExpRecordList
<XclExpExtCfvo
> maCfvos
;
118 XclExpRecordList
<XclExpExtIcon
> maCustom
;
122 const char* mpIconSetName
;
125 typedef std::shared_ptr
<XclExpExtDataBar
> XclExpExtDataBarRef
;
127 class XclExpExtCfRule
: public XclExpRecordBase
, protected XclExpRoot
130 XclExpExtCfRule( const XclExpRoot
& rRoot
, const ScFormatEntry
& rFormat
, const ScAddress
& rPos
, const OString
& rId
, sal_Int32 nPriority
);
131 virtual void SaveXml( XclExpXmlStream
& rStrm
) SAL_OVERRIDE
;
134 XclExpRecordRef mxEntry
;
137 sal_Int32 mnPriority
;
140 typedef std::shared_ptr
<XclExpExt
> XclExpExtRef
;
141 typedef std::shared_ptr
<XclExpExtCfRule
> XclExpExtCfRuleRef
;
143 class XclExpExtConditionalFormatting
: public XclExpRecordBase
, protected XclExpRoot
146 explicit XclExpExtConditionalFormatting( const XclExpRoot
& rRoot
, std::vector
<XclExpExtCondFormatData
>& rData
, const ScRangeList
& rRange
);
147 virtual void SaveXml( XclExpXmlStream
& rStrm
) SAL_OVERRIDE
;
150 XclExpRecordList
<XclExpExtCfRule
> maCfRules
;
154 typedef std::shared_ptr
<XclExpExtConditionalFormatting
> XclExpExtConditionalFormattingRef
;
156 class XclExpExtCondFormat
: public XclExpExt
159 XclExpExtCondFormat( const XclExpRoot
& rRoot
);
160 virtual void SaveXml( XclExpXmlStream
& rStrm
) SAL_OVERRIDE
;
162 virtual XclExpExtType
GetType() SAL_OVERRIDE
{ return XclExpExtDataBarType
; }
164 void AddRecord( XclExpExtConditionalFormattingRef aFormat
);
167 XclExpRecordList
< XclExpExtConditionalFormatting
> maCF
;
170 class XclExpExtCalcPr
: public XclExpExt
173 XclExpExtCalcPr( const XclExpRoot
& rRoot
, formula::FormulaGrammar::AddressConvention eConv
);
174 virtual void SaveXml( XclExpXmlStream
& rStrm
) SAL_OVERRIDE
;
176 virtual XclExpExtType
GetType() SAL_OVERRIDE
{ return XclExpExtDataFooType
; }
179 formula::FormulaGrammar::AddressConvention meConv
;
183 class XclExtLst
: public XclExpRecordBase
, public XclExpRoot
186 explicit XclExtLst( const XclExpRoot
& rRoot
);
187 virtual void SaveXml( XclExpXmlStream
& rStrm
) SAL_OVERRIDE
;
189 void AddRecord( XclExpExtRef aEntry
);
191 XclExpExtRef
GetItem( XclExpExtType eType
);
194 XclExpRecordList
< XclExpExt
> maExtEntries
;
197 typedef std::shared_ptr
< XclExtLst
> XclExtLstRef
;
201 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */