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_EXTLSTCONTEXT_HXX
11 #define INCLUDED_SC_SOURCE_FILTER_INC_EXTLSTCONTEXT_HXX
13 #include "excelhandlers.hxx"
14 #include <oox/core/contexthandler.hxx>
15 #include "condformatbuffer.hxx"
20 extern sal_Int32 rStyleIdx
; // Holds index of the <extlst> <cfRule> style (Will be reset by finalize import)
22 struct ScDataBarFormatData
;
23 namespace oox
{ class AttributeList
; }
24 namespace oox
{ namespace xls
{ class WorkbookFragment
; } }
25 namespace oox
{ namespace xls
{ class WorksheetFragment
; } }
30 class ExtCfRuleContext
: public WorksheetContextBase
33 explicit ExtCfRuleContext( WorksheetContextBase
& rFragment
, ScDataBarFormatData
* pDataBar
);
35 virtual ::oox::core::ContextHandlerRef
onCreateContext( sal_Int32 nElement
, const AttributeList
& rAttribs
) override
;
36 virtual void onStartElement( const AttributeList
& rAttribs
) override
;
39 ScDataBarFormatData
* const mpTarget
;
44 class ExtConditionalFormattingContext
: public WorksheetContextBase
47 explicit ExtConditionalFormattingContext(WorksheetContextBase
& rFragment
);
49 virtual ::oox::core::ContextHandlerRef
onCreateContext( sal_Int32 nElement
, const AttributeList
& rAttribs
) override
;
50 virtual void onStartElement( const AttributeList
& rAttribs
) override
;
51 virtual void onCharacters(const OUString
& rCharacters
) override
;
52 virtual void onEndElement() override
;
55 OUString aChars
; // Characters of between xml elements.
56 OUString rStyle
; // Style of the corresponding condition
57 sal_Int32 nPriority
; // Priority of last cfRule element.
58 ScConditionMode eOperator
; // Used only when cfRule type is "cellIs"
59 bool isPreviousElementF
; // Used to distinguish alone <sqref> from <f> and <sqref>
60 std::vector
<std::unique_ptr
<ScFormatEntry
> > maEntries
;
61 std::vector
< OUString
> rFormulas
; // It holds formulas for a range, there can be more formula for same range.
62 std::unique_ptr
<IconSetRule
> mpCurrentRule
;
63 std::vector
<sal_Int32
> maPriorities
;
67 * Handle ExtLst entries in xlsx. These entries are a way to extend the standard
68 * without actually changing it
70 * Needed right now for data bars
72 * ExtLstLocalContext is for the entry in the datastructure that needs to be extended
74 class ExtLstLocalContext
: public WorksheetContextBase
77 explicit ExtLstLocalContext( WorksheetContextBase
& rFragment
, ScDataBarFormatData
* pTarget
); // until now a ExtLst always extends an existing entry
80 virtual ::oox::core::ContextHandlerRef
onCreateContext( sal_Int32 nElement
, const AttributeList
& rAttribs
) override
;
81 virtual void onStartElement( const AttributeList
& rAttribs
) override
;
82 virtual void onCharacters( const OUString
& rChars
) override
;
85 ScDataBarFormatData
* mpTarget
;
89 * A single ext entry. Will be skipped until the actual entry with the correct uri is found
91 class ExtGlobalContext
: public WorksheetContextBase
94 explicit ExtGlobalContext( WorksheetContextBase
& rFragment
);
97 virtual ::oox::core::ContextHandlerRef
onCreateContext( sal_Int32 nElement
, const AttributeList
& rAttribs
) override
;
98 virtual void onStartElement( const AttributeList
& rAttribs
) override
;
104 * Used for the actual ExtLst containing the new extended definition.
105 * Uses the saved data from the ExtLstLocalContext
107 class ExtLstGlobalContext
: public WorksheetContextBase
110 explicit ExtLstGlobalContext( WorksheetFragment
& rFragment
);
113 virtual ::oox::core::ContextHandlerRef
onCreateContext( sal_Int32 nElement
, const AttributeList
& rAttribs
) override
;
116 class ExtGlobalWorkbookContext
: public WorkbookContextBase
119 explicit ExtGlobalWorkbookContext( WorkbookContextBase
& rFragment
);
122 virtual ::oox::core::ContextHandlerRef
onCreateContext( sal_Int32 nElement
, const AttributeList
& rAttribs
) override
;
123 virtual void onStartElement( const AttributeList
& rAttribs
) override
;
128 class ExtLstGlobalWorkbookContext
: public WorkbookContextBase
131 explicit ExtLstGlobalWorkbookContext( WorkbookFragment
& rFragment
);
134 virtual ::oox::core::ContextHandlerRef
onCreateContext( sal_Int32 nElement
, const AttributeList
& rAttribs
) override
;
142 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */