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 #pragma once
11 
12 #include "excelhandlers.hxx"
14 #include "condformatbuffer.hxx"
15 
16 #include <vector>
17 #include <memory>
18 
19 extern sal_Int32 rStyleIdx; // Holds index of the <extlst> <cfRule> style (Will be reset by finalize import)
20 
21 struct ScDataBarFormatData;
22 namespace oox { class AttributeList; }
23 namespace oox::xls { class WorkbookFragment; }
24 namespace oox::xls { class WorksheetFragment; }
25 
26 namespace oox::xls {
27 
29 {
30 public:
31  explicit ExtCfRuleContext( WorksheetContextBase& rFragment, ScDataBarFormatData* pDataBar );
32 
33  virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) override;
34  virtual void onStartElement( const AttributeList& rAttribs ) override;
35 
36 private:
38 
40 };
41 
43 {
44  sal_Int32 nPriority;
46  OUString aFormula;
47  OUString aStyle;
48 };
49 
51 {
52 public:
54 
55  virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) override;
56  virtual void onStartElement( const AttributeList& rAttribs ) override;
57  virtual void onCharacters(const OUString& rCharacters) override;
58  virtual void onEndElement() override;
59 
60 private:
62  sal_Int32 nFormulaCount;
63  OUString aChars; // Characters of between xml elements.
64  sal_Int32 nPriority; // Priority of last cfRule element.
65  ScConditionMode eOperator; // Used only when cfRule type is "cellIs"
66  bool isPreviousElementF; // Used to distinguish alone <sqref> from <f> and <sqref>
67  std::vector<std::unique_ptr<ScFormatEntry> > maEntries;
68  std::unique_ptr<IconSetRule> mpCurrentRule;
69  std::vector<sal_Int32> maPriorities;
70  std::vector<ExtCondFormatRuleModel> maModels;
71 };
72 
82 {
83 public:
84  explicit ExtLstLocalContext( WorksheetContextBase& rFragment, ScDataBarFormatData* pTarget ); // until now a ExtLst always extends an existing entry
85 
86 protected:
87  virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) override;
88  virtual void onStartElement( const AttributeList& rAttribs ) override;
89  virtual void onCharacters( const OUString& rChars ) override;
90 
91 private:
93 };
94 
99 {
100 public:
101  explicit ExtGlobalContext( WorksheetContextBase& rFragment );
102 
103 protected:
104  virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) override;
105  virtual void onStartElement( const AttributeList& rAttribs ) override;
106 
107 private:
108 };
109 
115 {
116 public:
117  explicit ExtLstGlobalContext( WorksheetFragment& rFragment );
118 
119 protected:
120  virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) override;
121 };
122 
124 {
125 public:
126  explicit ExtGlobalWorkbookContext( WorkbookContextBase& rFragment );
127 
128 protected:
129  virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) override;
130  virtual void onStartElement( const AttributeList& rAttribs ) override;
131 
132 private:
133 };
134 
136 {
137 public:
138  explicit ExtLstGlobalWorkbookContext( WorkbookFragment& rFragment );
139 
140 protected:
141  virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) override;
142 };
143 
144 } //namespace oox::xls
145 
146 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void onCharacters(const OUString &rChars) override
std::vector< ExtCondFormatRuleModel > maModels
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:60
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