LibreOffice Module sc (master) 1
xmlfilti.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
20#pragma once
21
22#include "importcontext.hxx"
23#include <queryentry.hxx>
24#include <queryparam.hxx>
25
26#include <stack>
27#include <vector>
28
29class ScXMLImport;
32namespace sax_fastparser { class FastAttributeList; }
33
35{
37 {
38 bool mbOr;
40 explicit ConnStackItem(bool bOr);
41 };
44
50 std::vector<ConnStackItem> maConnStack;
51
52public:
53
56 ScQueryParam& rParam,
57 ScXMLDatabaseRangeContext* pTempDatabaseRangeContext);
58
59 virtual ~ScXMLFilterContext() override;
60
61 virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(
62 sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) override;
63
64 virtual void SAL_CALL endFastElement( sal_Int32 nElement ) override;
65
66 void OpenConnection(bool b);
67 void CloseConnection();
68 bool GetConnection();
69};
70
72{
75
76public:
77
79 ScQueryParam& rParam,
80 ScXMLFilterContext* pTempFilterContext);
81
82 virtual ~ScXMLAndContext() override;
83
84 virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(
85 sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) override;
86
87 virtual void SAL_CALL endFastElement( sal_Int32 nElement ) override;
88};
89
91{
94
95public:
96
98 ScQueryParam& rParam,
99 ScXMLFilterContext* pTempFilterContext);
100
101 virtual ~ScXMLOrContext() override;
102
103 virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(
104 sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) override;
105
106 virtual void SAL_CALL endFastElement( sal_Int32 nElement ) override;
107};
108
110{
113
115 OUString sDataType;
117 OUString sOperator;
118 sal_Int32 nField;
120
121public:
122
123 ScXMLConditionContext( ScXMLImport& rImport, sal_Int32 nElement,
125 ScQueryParam& rParam,
126 ScXMLFilterContext* pTempFilterContext);
127
128 virtual ~ScXMLConditionContext() override;
129
130 virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(
131 sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) override;
132
133 virtual void SAL_CALL endFastElement( sal_Int32 nElement ) override;
134
135 static void GetOperator(std::u16string_view aOpStr, ScQueryParam& rParam, ScQueryEntry& rEntry);
136 void AddSetItem(const ScQueryEntry::Item& rItem);
137};
138
140{
141public:
142 ScXMLSetItemContext(ScXMLImport& rImport, sal_Int32 nElement,
144 ScXMLConditionContext& rParent);
145
146 virtual ~ScXMLSetItemContext() override;
147};
148
149// Datapilot (Core)
150
152{
154
162 ::std::stack<bool> aConnectionOrStack;
163
164public:
165
168 ScXMLDataPilotTableContext* pTempDataPilotTableContext);
169
170 virtual ~ScXMLDPFilterContext() override;
171
172 virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(
173 sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) override;
174
175 virtual void SAL_CALL endFastElement( sal_Int32 nElement ) override;
176
177 void SetIsCaseSensitive(const bool bTemp) { bIsCaseSensitive = bTemp; }
179 {
181 eSearchType = eTemp;
182 }
183
184 void OpenConnection(const bool bVal)
185 {
186 bool bTemp = bConnectionOr;
188 bNextConnectionOr = bVal;
189 aConnectionOrStack.push(bTemp);
190 }
191
193 {
194 bool bTemp;
195 if (aConnectionOrStack.empty())
196 bTemp = false;
197 else
198 {
199 bTemp = aConnectionOrStack.top();
200 aConnectionOrStack.pop();
201 }
202 bConnectionOr = bTemp;
203 bNextConnectionOr = bTemp;
204 }
205
206 bool GetConnection() { bool bTemp = bConnectionOr; bConnectionOr = bNextConnectionOr; return bTemp; }
207 void AddFilterField (const ScQueryEntry& aFilterField);
208};
209
211{
213public:
214
216 ScXMLDPFilterContext* pTempFilterContext);
217
218 virtual ~ScXMLDPAndContext() override;
219
220 virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(
221 sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) override;
222
223 virtual void SAL_CALL endFastElement( sal_Int32 nElement ) override;
224};
225
227{
229public:
230
232 ScXMLDPFilterContext* pTempFilterContext);
233
234 virtual ~ScXMLDPOrContext() override;
235
236 virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(
237 sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList ) override;
238
239 virtual void SAL_CALL endFastElement( sal_Int32 nElement ) override;
240};
241
243{
245
246 OUString sDataType;
248 OUString sOperator;
249 sal_Int32 nField;
251
252public:
253
254 ScXMLDPConditionContext( ScXMLImport& rImport, sal_Int32 nElement,
256 ScXMLDPFilterContext* pTempFilterContext);
257
258 virtual ~ScXMLDPConditionContext() override;
259
260 static void getOperatorXML(
261 std::u16string_view sTempOperator, ScQueryOp& aFilterOperator, utl::SearchParam::SearchType& rSearchType);
262 virtual void SAL_CALL endFastElement( sal_Int32 nElement ) override;
263};
264
265/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
ScQueryParam & mrQueryParam
Definition: xmlfilti.hxx:73
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
Definition: xmlfilti.cxx:227
virtual ~ScXMLAndContext() override
Definition: xmlfilti.cxx:198
ScXMLFilterContext * pFilterContext
Definition: xmlfilti.hxx:74
ScXMLAndContext(ScXMLImport &rImport, ScQueryParam &rParam, ScXMLFilterContext *pTempFilterContext)
Definition: xmlfilti.cxx:188
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: xmlfilti.cxx:202
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
Definition: xmlfilti.cxx:408
static void GetOperator(std::u16string_view aOpStr, ScQueryParam &rParam, ScQueryEntry &rEntry)
Definition: xmlfilti.cxx:351
void AddSetItem(const ScQueryEntry::Item &rItem)
Definition: xmlfilti.cxx:403
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: xmlfilti.cxx:331
ScXMLFilterContext * pFilterContext
Definition: xmlfilti.hxx:112
ScXMLConditionContext(ScXMLImport &rImport, sal_Int32 nElement, const rtl::Reference< sax_fastparser::FastAttributeList > &rAttrList, ScQueryParam &rParam, ScXMLFilterContext *pTempFilterContext)
Definition: xmlfilti.cxx:277
OUString sConditionValue
Definition: xmlfilti.hxx:116
ScQueryParam & mrQueryParam
Definition: xmlfilti.hxx:111
virtual ~ScXMLConditionContext() override
Definition: xmlfilti.cxx:327
ScQueryEntry::QueryItemsType maQueryItems
Definition: xmlfilti.hxx:114
virtual ~ScXMLDPAndContext() override
Definition: xmlfilti.cxx:584
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: xmlfilti.cxx:588
ScXMLDPAndContext(ScXMLImport &rImport, ScXMLDPFilterContext *pTempFilterContext)
Definition: xmlfilti.cxx:576
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
Definition: xmlfilti.cxx:612
ScXMLDPFilterContext * pFilterContext
Definition: xmlfilti.hxx:212
static void getOperatorXML(std::u16string_view sTempOperator, ScQueryOp &aFilterOperator, utl::SearchParam::SearchType &rSearchType)
Definition: xmlfilti.cxx:709
ScXMLDPFilterContext * pFilterContext
Definition: xmlfilti.hxx:244
ScXMLDPConditionContext(ScXMLImport &rImport, sal_Int32 nElement, const rtl::Reference< sax_fastparser::FastAttributeList > &rAttrList, ScXMLDPFilterContext *pTempFilterContext)
Definition: xmlfilti.cxx:658
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
Definition: xmlfilti.cxx:745
virtual ~ScXMLDPConditionContext() override
Definition: xmlfilti.cxx:705
ScXMLDataPilotTableContext * pDataPilotTable
Definition: xmlfilti.hxx:153
void SetIsCaseSensitive(const bool bTemp)
Definition: xmlfilti.hxx:177
::std::stack< bool > aConnectionOrStack
Definition: xmlfilti.hxx:162
void SetSearchType(const utl::SearchParam::SearchType eTemp)
Definition: xmlfilti.hxx:178
utl::SearchParam::SearchType eSearchType
Definition: xmlfilti.hxx:156
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
Definition: xmlfilti.cxx:558
ScQueryParam aFilterFields
Definition: xmlfilti.hxx:155
ScXMLDPFilterContext(ScXMLImport &rImport, const rtl::Reference< sax_fastparser::FastAttributeList > &rAttrList, ScXMLDataPilotTableContext *pTempDataPilotTableContext)
Definition: xmlfilti.cxx:482
virtual ~ScXMLDPFilterContext() override
Definition: xmlfilti.cxx:525
void OpenConnection(const bool bVal)
Definition: xmlfilti.hxx:184
void AddFilterField(const ScQueryEntry &aFilterField)
Definition: xmlfilti.cxx:567
sal_uInt8 nFilterFieldCount
Definition: xmlfilti.hxx:157
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: xmlfilti.cxx:529
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: xmlfilti.cxx:629
virtual ~ScXMLDPOrContext() override
Definition: xmlfilti.cxx:625
ScXMLDPFilterContext * pFilterContext
Definition: xmlfilti.hxx:228
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
Definition: xmlfilti.cxx:653
ScXMLDPOrContext(ScXMLImport &rImport, ScXMLDPFilterContext *pTempFilterContext)
Definition: xmlfilti.cxx:617
ScXMLFilterContext(ScXMLImport &rImport, const rtl::Reference< sax_fastparser::FastAttributeList > &rAttrList, ScQueryParam &rParam, ScXMLDatabaseRangeContext *pTempDatabaseRangeContext)
Definition: xmlfilti.cxx:41
ScXMLDatabaseRangeContext * pDatabaseRangeContext
Definition: xmlfilti.hxx:43
void OpenConnection(bool b)
Definition: xmlfilti.cxx:146
bool bConditionSourceRange
Definition: xmlfilti.hxx:49
ScRange aConditionSourceRangeAddress
Definition: xmlfilti.hxx:46
ScAddress aOutputPosition
Definition: xmlfilti.hxx:45
void CloseConnection()
Definition: xmlfilti.cxx:151
std::vector< ConnStackItem > maConnStack
Definition: xmlfilti.hxx:50
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
Definition: xmlfilti.cxx:130
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: xmlfilti.cxx:98
virtual ~ScXMLFilterContext() override
Definition: xmlfilti.cxx:94
ScQueryParam & mrQueryParam
Definition: xmlfilti.hxx:42
This class exists only to provide GetScImport() to its derived classes.
virtual void SAL_CALL endFastElement(sal_Int32 nElement) override
Definition: xmlfilti.cxx:272
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: xmlfilti.cxx:246
ScQueryParam & mrQueryParam
Definition: xmlfilti.hxx:92
ScXMLFilterContext * pFilterContext
Definition: xmlfilti.hxx:93
ScXMLOrContext(ScXMLImport &rImport, ScQueryParam &rParam, ScXMLFilterContext *pTempFilterContext)
Definition: xmlfilti.cxx:232
virtual ~ScXMLOrContext() override
Definition: xmlfilti.cxx:242
ScXMLSetItemContext(ScXMLImport &rImport, sal_Int32 nElement, const rtl::Reference< sax_fastparser::FastAttributeList > &rAttrList, ScXMLConditionContext &rParent)
Definition: xmlfilti.cxx:452
virtual ~ScXMLSetItemContext() override
Definition: xmlfilti.cxx:478
ScQueryOp
Definition: global.hxx:833
Each instance of this struct represents a single filtering criteria.
Definition: queryentry.hxx:34
std::vector< Item > QueryItemsType
Definition: queryentry.hxx:58
unsigned char sal_uInt8