LibreOffice Module sc (master)  1
xmldrani.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  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 #ifndef INCLUDED_SC_SOURCE_FILTER_XML_XMLDRANI_HXX
20 #define INCLUDED_SC_SOURCE_FILTER_XML_XMLDRANI_HXX
21 
22 #include <com/sun/star/sheet/DataImportMode.hpp>
23 #include <com/sun/star/sheet/SubTotalColumn.hpp>
24 #include <com/sun/star/beans/PropertyValue.hpp>
25 
26 #include <dbdata.hxx>
27 #include "importcontext.hxx"
28 
29 #include <memory>
30 
31 namespace sax_fastparser { class FastAttributeList; }
32 
33 struct ScQueryParam;
34 
36 {
37 public:
38 
40 
41  virtual ~ScXMLDatabaseRangesContext() override;
42 
43  virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(
44  sal_Int32 nElement,
45  const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) override;
46 };
47 
49 {
51  css::uno::Sequence <css::sheet::SubTotalColumn> aSubTotalColumns;
52 };
53 
55 {
56  std::unique_ptr<ScQueryParam> mpQueryParam;
60  OUString sDatabaseName;
61  OUString sSourceObject;
62  css::uno::Sequence <css::beans::PropertyValue> aSortSequence;
63  std::vector < ScSubTotalRule > aSubTotalRules;
65  css::sheet::DataImportMode nSourceType;
66  sal_Int32 nRefresh;
71  bool bNative;
72  bool bIsSelection; // TODO: import to document core
74  bool bMoveCells;
75  bool bStripData;
84  bool bHasHeader;
85  bool bByRow;
87 
88  std::unique_ptr<ScDBData> ConvertToDBData(const OUString& rName);
89 
90 public:
91 
94 
95  virtual ~ScXMLDatabaseRangeContext() override;
96 
97  virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(
98  sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) override;
99 
100  virtual void SAL_CALL endFastElement( sal_Int32 nElement ) override;
101 
102  void SetDatabaseName(const OUString& sTempDatabaseName) { sDatabaseName = sTempDatabaseName; }
103  void SetConnectionResource(const OUString& sTempConRes) { sConnectionResource = sTempConRes; }
104  void SetSourceObject(const OUString& sTempSourceObject) { sSourceObject = sTempSourceObject; }
105  void SetSourceType(const css::sheet::DataImportMode nTempSourceType) { nSourceType = nTempSourceType; }
106  void SetNative(const bool bTempNative) { bNative = bTempNative; }
107  void SetSubTotalsBindFormatsToContent(const bool bTemp ) { bSubTotalsBindFormatsToContent = bTemp; }
108  void SetSubTotalsIsCaseSensitive(const bool bTemp) { bSubTotalsIsCaseSensitive = bTemp; }
109  void SetSubTotalsInsertPageBreaks(const bool bTemp) { bSubTotalsInsertPageBreaks = bTemp; }
110  void SetSubTotalsEnabledUserList(const bool bTemp) { bSubTotalsEnabledUserList = bTemp; }
111  void SetSubTotalsUserListIndex(const sal_Int16 nTemp) { nSubTotalsUserListIndex = nTemp; }
112  void SetSubTotalsAscending(const bool bTemp) { bSubTotalsAscending = bTemp; }
113  void SetSubTotalsSortGroups(const bool bTemp) { bSubTotalsSortGroups = bTemp; }
114  void AddSubTotalRule(const ScSubTotalRule& rRule) { aSubTotalRules.push_back(rRule); }
115  void SetSortSequence(const css::uno::Sequence <css::beans::PropertyValue>& aTempSortSequence) { aSortSequence = aTempSortSequence; }
116  void SetFilterConditionSourceRangeAddress(const ScRange& aRange) { aFilterConditionSourceRangeAddress = aRange;
117  bFilterConditionSourceRange = true; }
118 };
119 
121 {
123  OUString sDBName;
124 
125 public:
126 
129  ScXMLDatabaseRangeContext* pTempDatabaseRangeContext);
130 
131  virtual ~ScXMLSourceSQLContext() override;
132 
133  virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(
134  sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) override;
135 
136  virtual void SAL_CALL endFastElement( sal_Int32 nElement ) override;
137 };
138 
140 {
142  OUString sDBName;
143 
144 public:
145 
148  ScXMLDatabaseRangeContext* pTempDatabaseRangeContext);
149 
150  virtual ~ScXMLSourceTableContext() override;
151 
152  virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(
153  sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) override;
154 
155  virtual void SAL_CALL endFastElement( sal_Int32 nElement ) override;
156 };
157 
159 {
161  OUString sDBName;
162 
163 public:
164 
167  ScXMLDatabaseRangeContext* pTempDatabaseRangeContext);
168 
169  virtual ~ScXMLSourceQueryContext() override;
170 
171  virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(
172  sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) override;
173 
174  virtual void SAL_CALL endFastElement( sal_Int32 nElement ) override;
175 };
176 
178 {
179 public:
180 
183  ScXMLDatabaseRangeContext* pTempDatabaseRangeContext);
184 
185  virtual ~ScXMLConResContext() override;
186 };
187 
189 {
191 
192 public:
193 
196  ScXMLDatabaseRangeContext* pTempDatabaseRangeContext);
197 
198  virtual ~ScXMLSubTotalRulesContext() override;
199 
200  virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(
201  sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) override;
202 };
203 
205 {
206 public:
207 
210  ScXMLDatabaseRangeContext* pTempDatabaseRangeContext);
211 
212  virtual ~ScXMLSortGroupsContext() override;
213 };
214 
216 {
219 
220 public:
221 
224  ScXMLDatabaseRangeContext* pTempDatabaseRangeContext);
225 
226  virtual ~ScXMLSubTotalRuleContext() override;
227 
228  virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(
229  sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) override;
230 
231  virtual void SAL_CALL endFastElement( sal_Int32 nElement ) override;
232 
233  void AddSubTotalColumn(const css::sheet::SubTotalColumn& rSubTotalColumn)
234  {
235  aSubTotalRule.aSubTotalColumns.realloc(aSubTotalRule.aSubTotalColumns.getLength() + 1);
236  aSubTotalRule.aSubTotalColumns[aSubTotalRule.aSubTotalColumns.getLength() - 1] = rSubTotalColumn;
237  }
238 };
239 
241 {
243  OUString sFieldNumber;
244  OUString sFunction;
245 
246 public:
247 
250  ScXMLSubTotalRuleContext* pSubTotalRuleContext);
251 
252  virtual ~ScXMLSubTotalFieldContext() override;
253 
254  virtual void SAL_CALL endFastElement( sal_Int32 nElement ) override;
255 };
256 
257 #endif
258 
259 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void SetSubTotalsAscending(const bool bTemp)
Definition: xmldrani.hxx:112
ScXMLSubTotalRuleContext(ScXMLImport &rImport, const rtl::Reference< sax_fastparser::FastAttributeList > &rAttrList, ScXMLDatabaseRangeContext *pTempDatabaseRangeContext)
Definition: xmldrani.cxx:726
ScXMLDatabaseRangeContext * pDatabaseRangeContext
Definition: xmldrani.hxx:122
virtual ~ScXMLDatabaseRangeContext() override
Definition: xmldrani.cxx:191
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
Definition: xmldrani.cxx:523
std::unique_ptr< ScDBData > ConvertToDBData(const OUString &rName)
Definition: xmldrani.cxx:242
ScXMLDatabaseRangeContext * pDatabaseRangeContext
Definition: xmldrani.hxx:217
ScXMLSourceQueryContext(ScXMLImport &rImport, const rtl::Reference< sax_fastparser::FastAttributeList > &rAttrList, ScXMLDatabaseRangeContext *pTempDatabaseRangeContext)
Definition: xmldrani.cxx:544
void AddSubTotalColumn(const css::sheet::SubTotalColumn &rSubTotalColumn)
Definition: xmldrani.hxx:233
virtual ~ScXMLSourceSQLContext() override
Definition: xmldrani.cxx:469
std::unique_ptr< ScQueryParam > mpQueryParam
Definition: xmldrani.hxx:56
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
Definition: xmldrani.cxx:802
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
Definition: xmldrani.cxx:769
void SetSubTotalsBindFormatsToContent(const bool bTemp)
Definition: xmldrani.hxx:107
void SetSubTotalsSortGroups(const bool bTemp)
Definition: xmldrani.hxx:113
ScXMLSubTotalFieldContext(ScXMLImport &rImport, const rtl::Reference< sax_fastparser::FastAttributeList > &rAttrList, ScXMLSubTotalRuleContext *pSubTotalRuleContext)
Definition: xmldrani.cxx:775
virtual ~ScXMLSubTotalFieldContext() override
Definition: xmldrani.cxx:798
void SetSubTotalsInsertPageBreaks(const bool bTemp)
Definition: xmldrani.hxx:109
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
Definition: xmldrani.cxx:572
ScSubTotalRule aSubTotalRule
Definition: xmldrani.hxx:218
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
Definition: xmldrani.cxx:538
ScXMLDatabaseRangeContext * pDatabaseRangeContext
Definition: xmldrani.hxx:141
css::sheet::DataImportMode nSourceType
Definition: xmldrani.hxx:65
ScXMLSortGroupsContext(ScXMLImport &rImport, const rtl::Reference< sax_fastparser::FastAttributeList > &rAttrList, ScXMLDatabaseRangeContext *pTempDatabaseRangeContext)
Definition: xmldrani.cxx:667
ScRange aFilterConditionSourceRangeAddress
Definition: xmldrani.hxx:64
void SetSubTotalsIsCaseSensitive(const bool bTemp)
Definition: xmldrani.hxx:108
ScXMLSubTotalRulesContext(ScXMLImport &rImport, const rtl::Reference< sax_fastparser::FastAttributeList > &rAttrList, ScXMLDatabaseRangeContext *pTempDatabaseRangeContext)
Definition: xmldrani.cxx:613
ScXMLDatabaseRangeContext(ScXMLImport &rImport, const rtl::Reference< sax_fastparser::FastAttributeList > &rAttrList)
Definition: xmldrani.cxx:81
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
Definition: xmldrani.cxx:587
This class exists only to provide GetScImport() to its derived classes.
virtual ~ScXMLSourceQueryContext() override
Definition: xmldrani.cxx:568
ScXMLConResContext(ScXMLImport &rImport, const rtl::Reference< sax_fastparser::FastAttributeList > &rAttrList, ScXMLDatabaseRangeContext *pTempDatabaseRangeContext)
Definition: xmldrani.cxx:593
css::uno::Sequence< css::beans::PropertyValue > aSortSequence
Definition: xmldrani.hxx:62
void SetSourceObject(const OUString &sTempSourceObject)
Definition: xmldrani.hxx:104
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
Definition: xmldrani.cxx:488
virtual ~ScXMLDatabaseRangesContext() override
Definition: xmldrani.cxx:56
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
Definition: xmldrani.cxx:394
ScXMLDatabaseRangeContext * pDatabaseRangeContext
Definition: xmldrani.hxx:190
ScXMLDatabaseRangeContext * pDatabaseRangeContext
Definition: xmldrani.hxx:160
ScXMLSubTotalRuleContext * pSubTotalRuleContext
Definition: xmldrani.hxx:242
ScXMLSourceTableContext(ScXMLImport &rImport, const rtl::Reference< sax_fastparser::FastAttributeList > &rAttrList, ScXMLDatabaseRangeContext *pTempDatabaseRangeContext)
Definition: xmldrani.cxx:494
virtual ~ScXMLSortGroupsContext() override
Definition: xmldrani.cxx:722
void SetDatabaseName(const OUString &sTempDatabaseName)
Definition: xmldrani.hxx:102
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
Definition: xmldrani.cxx:195
virtual ~ScXMLSubTotalRulesContext() override
Definition: xmldrani.cxx:639
virtual ~ScXMLSubTotalRuleContext() override
Definition: xmldrani.cxx:746
sal_Int16 nSubTotalRuleGroupFieldNumber
Definition: xmldrani.hxx:50
void SetConnectionResource(const OUString &sTempConRes)
Definition: xmldrani.hxx:103
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
Definition: xmldrani.cxx:61
css::uno::Sequence< css::sheet::SubTotalColumn > aSubTotalColumns
Definition: xmldrani.hxx:51
void SetFilterConditionSourceRangeAddress(const ScRange &aRange)
Definition: xmldrani.hxx:116
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
Definition: xmldrani.cxx:473
virtual ~ScXMLConResContext() override
Definition: xmldrani.cxx:609
std::vector< ScSubTotalRule > aSubTotalRules
Definition: xmldrani.hxx:63
void AddSubTotalRule(const ScSubTotalRule &rRule)
Definition: xmldrani.hxx:114
ScDBCollection::RangeType meRangeType
Definition: xmldrani.hxx:86
void SetSubTotalsEnabledUserList(const bool bTemp)
Definition: xmldrani.hxx:110
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
Definition: xmldrani.cxx:750
ScXMLDatabaseRangesContext(ScXMLImport &rImport)
Definition: xmldrani.cxx:49
void SetSortSequence(const css::uno::Sequence< css::beans::PropertyValue > &aTempSortSequence)
Definition: xmldrani.hxx:115
virtual ~ScXMLSourceTableContext() override
Definition: xmldrani.cxx:519
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
Definition: xmldrani.cxx:643
sal_Int16 nSubTotalsUserListIndex
Definition: xmldrani.hxx:67
void SetNative(const bool bTempNative)
Definition: xmldrani.hxx:106
ScXMLSourceSQLContext(ScXMLImport &rImport, const rtl::Reference< sax_fastparser::FastAttributeList > &rAttrList, ScXMLDatabaseRangeContext *pTempDatabaseRangeContext)
Definition: xmldrani.cxx:442
void SetSubTotalsUserListIndex(const sal_Int16 nTemp)
Definition: xmldrani.hxx:111
void SetSourceType(const css::sheet::DataImportMode nTempSourceType)
Definition: xmldrani.hxx:105