LibreOffice Module sc (master)  1
extlstcontext.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
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  */
9 
10 #ifndef INCLUDED_SC_SOURCE_FILTER_INC_EXTLSTCONTEXT_HXX
11 #define INCLUDED_SC_SOURCE_FILTER_INC_EXTLSTCONTEXT_HXX
12 
13 #include "excelhandlers.hxx"
15 #include "condformatbuffer.hxx"
16 
17 #include <vector>
18 #include <memory>
19 
20 extern sal_Int32 rStyleIdx; // Holds index of the <extlst> <cfRule> style (Will be reset by finalize import)
21 
22 struct ScDataBarFormatData;
23 namespace oox { class AttributeList; }
24 namespace oox::xls { class WorkbookFragment; }
25 namespace oox::xls { class WorksheetFragment; }
26 
27 namespace oox::xls {
28 
30 {
31 public:
32  explicit ExtCfRuleContext( WorksheetContextBase& rFragment, ScDataBarFormatData* pDataBar );
33 
34  virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) override;
35  virtual void onStartElement( const AttributeList& rAttribs ) override;
36 
37 private:
39 
41 };
42 
44 {
45 public:
47 
48  virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) override;
49  virtual void onStartElement( const AttributeList& rAttribs ) override;
50  virtual void onCharacters(const OUString& rCharacters) override;
51  virtual void onEndElement() override;
52 
53 private:
54  sal_Int32 nFormulaCount;
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;
64 };
65 
75 {
76 public:
77  explicit ExtLstLocalContext( WorksheetContextBase& rFragment, ScDataBarFormatData* pTarget ); // until now a ExtLst always extends an existing entry
78 
79 protected:
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;
83 
84 private:
86 };
87 
92 {
93 public:
94  explicit ExtGlobalContext( WorksheetContextBase& rFragment );
95 
96 protected:
97  virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) override;
98  virtual void onStartElement( const AttributeList& rAttribs ) override;
99 
100 private:
101 };
102 
108 {
109 public:
110  explicit ExtLstGlobalContext( WorksheetFragment& rFragment );
111 
112 protected:
113  virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) override;
114 };
115 
117 {
118 public:
119  explicit ExtGlobalWorkbookContext( WorkbookContextBase& rFragment );
120 
121 protected:
122  virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) override;
123  virtual void onStartElement( const AttributeList& rAttribs ) override;
124 
125 private:
126 };
127 
129 {
130 public:
131  explicit ExtLstGlobalWorkbookContext( WorkbookFragment& rFragment );
132 
133 protected:
134  virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) override;
135 };
136 
137 } //namespace oox::xls
138 
139 #endif
140 
141 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void onCharacters(const OUString &rChars) override
std::vector< std::unique_ptr< ScFormatEntry > > maEntries
virtual void onStartElement(const AttributeList &rAttribs) override
ScDataBarFormatData * mpTarget
ScDataBarFormatData * mpTarget
Handle ExtLst entries in xlsx.
A single ext entry.
virtual void onStartElement(const AttributeList &rAttribs) override
virtual ::oox::core::ContextHandlerRef onCreateContext(sal_Int32 nElement, const AttributeList &rAttribs) override
virtual ::oox::core::ContextHandlerRef onCreateContext(sal_Int32 nElement, const AttributeList &rAttribs) override
Used for the actual ExtLst containing the new extended definition.
ScConditionMode
Definition: conditio.hxx:61
ExtCfRuleContext(WorksheetContextBase &rFragment, ScDataBarFormatData *pDataBar)
ExtLstGlobalContext(WorksheetFragment &rFragment)
sal_Int32 rStyleIdx
virtual ::oox::core::ContextHandlerRef onCreateContext(sal_Int32 nElement, const AttributeList &rAttribs) override
virtual void onCharacters(const OUString &rCharacters) override
virtual void onStartElement(const AttributeList &rAttribs) override
ExtLstGlobalWorkbookContext(WorkbookFragment &rFragment)
virtual ::oox::core::ContextHandlerRef onCreateContext(sal_Int32 nElement, const AttributeList &rAttribs) override
virtual ::oox::core::ContextHandlerRef onCreateContext(sal_Int32 nElement, const AttributeList &rAttribs) override
virtual ::oox::core::ContextHandlerRef onCreateContext(sal_Int32 nElement, const AttributeList &rAttribs) override
Context handler derived from the WorkbookHelper helper class.
ExtGlobalContext(WorksheetContextBase &rFragment)
ExtConditionalFormattingContext(WorksheetContextBase &rFragment)
virtual ::oox::core::ContextHandlerRef onCreateContext(sal_Int32 nElement, const AttributeList &rAttribs) override
Context handler derived from the WorksheetHelper helper class.
ExtLstLocalContext(WorksheetContextBase &rFragment, ScDataBarFormatData *pTarget)
std::unique_ptr< IconSetRule > mpCurrentRule
virtual void onStartElement(const AttributeList &rAttribs) override
ExtGlobalWorkbookContext(WorkbookContextBase &rFragment)
virtual void onStartElement(const AttributeList &rAttribs) override