xref: /trunk/main/sc/source/filter/xml/xmldpimp.hxx (revision 38d50f7b)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 #ifndef SC_XMLDPIMP_HXX
24 #define SC_XMLDPIMP_HXX
25 
26 #include <xmloff/xmlictxt.hxx>
27 #include <xmloff/xmlimp.hxx>
28 #include <com/sun/star/sheet/DataPilotFieldReference.hpp>
29 #include <com/sun/star/sheet/DataPilotFieldSortInfo.hpp>
30 #include <com/sun/star/sheet/DataPilotFieldAutoShowInfo.hpp>
31 #include <com/sun/star/sheet/DataPilotFieldLayoutInfo.hpp>
32 
33 #include "global.hxx"
34 #include "dpobject.hxx"
35 #include "dpsave.hxx"
36 #include "queryparam.hxx"
37 
38 #include <hash_set>
39 
40 class ScXMLImport;
41 class ScDPSaveNumGroupDimension;
42 class ScDPSaveGroupDimension;
43 
44 enum ScMySourceType
45 {
46 	SQL,
47 	TABLE,
48 	QUERY,
49 	SERVICE,
50 	CELLRANGE
51 };
52 
53 class ScXMLDataPilotTablesContext : public SvXMLImportContext
54 {
55 
GetScImport() const56 	const ScXMLImport& GetScImport() const { return (const ScXMLImport&)GetImport(); }
GetScImport()57 	ScXMLImport& GetScImport() { return (ScXMLImport&)GetImport(); }
58 
59 public:
60 
61 	ScXMLDataPilotTablesContext( ScXMLImport& rImport, sal_uInt16 nPrfx,
62 						const ::rtl::OUString& rLName,
63 						const ::com::sun::star::uno::Reference<
64 										::com::sun::star::xml::sax::XAttributeList>& xAttrList);
65 
66 	virtual ~ScXMLDataPilotTablesContext();
67 
68 	virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix,
69 									 const ::rtl::OUString& rLocalName,
70 									 const ::com::sun::star::uno::Reference<
71 									  	::com::sun::star::xml::sax::XAttributeList>& xAttrList );
72 
73 	virtual void EndElement();
74 };
75 
76 class ScXMLDataPilotTableContext : public SvXMLImportContext
77 {
78     typedef ::std::hash_set< ::rtl::OUString, ::rtl::OUStringHash > StringSet;
79     StringSet       maHiddenMemberFields;
80 
81     struct GrandTotalItem
82     {
83         ::rtl::OUString maDisplayName;
84         bool            mbVisible;
85         GrandTotalItem();
86     };
87 	ScDocument*		pDoc;
88 	ScDPObject*		pDPObject;
89 	ScDPSaveData*	pDPSave;
90     ScDPDimensionSaveData* pDPDimSaveData;
91     GrandTotalItem  maRowGrandTotal;
92     GrandTotalItem  maColGrandTotal;
93 	rtl::OUString	sDataPilotTableName;
94 	rtl::OUString	sApplicationData;
95 	rtl::OUString	sDatabaseName;
96 	rtl::OUString	sSourceObject;
97 	rtl::OUString	sServiceName;
98 	rtl::OUString	sServiceSourceName;
99 	rtl::OUString	sServiceSourceObject;
100 	rtl::OUString	sServiceUsername;
101 	rtl::OUString	sServicePassword;
102 	rtl::OUString	sButtons;
103 	ScRange			aSourceCellRangeAddress;
104 	ScRange			aTargetRangeAddress;
105 	ScRange			aFilterSourceRange;
106 	ScAddress		aFilterOutputPosition;
107 	ScQueryParam	aSourceQueryParam;
108 	ScMySourceType	nSourceType;
109     sal_uInt32      mnRowFieldCount;
110     sal_uInt32      mnColFieldCount;
111     sal_uInt32      mnPageFieldCount;
112     sal_uInt32      mnDataFieldCount;
113 	sal_Bool		bIsNative;
114 	sal_Bool		bIgnoreEmptyRows;
115 	sal_Bool		bIdentifyCategories;
116 	sal_Bool		bUseRegularExpression;
117 	sal_Bool		bIsCaseSensitive;
118 	sal_Bool		bSkipDuplicates;
119 	sal_Bool		bFilterCopyOutputData;
120 	sal_Bool		bTargetRangeAddress;
121 	sal_Bool		bSourceCellRange;
122     sal_Bool        bShowFilter;
123     sal_Bool        bDrillDown;
124 
GetScImport() const125 	const ScXMLImport& GetScImport() const { return (const ScXMLImport&)GetImport(); }
GetScImport()126 	ScXMLImport& GetScImport() { return (ScXMLImport&)GetImport(); }
127 
128 public:
129 
130 	ScXMLDataPilotTableContext( ScXMLImport& rImport, sal_uInt16 nPrfx,
131 						const ::rtl::OUString& rLName,
132 						const ::com::sun::star::uno::Reference<
133 										::com::sun::star::xml::sax::XAttributeList>& xAttrList);
134 
135 	virtual ~ScXMLDataPilotTableContext();
136 
137 	virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix,
138 									 const ::rtl::OUString& rLocalName,
139 									 const ::com::sun::star::uno::Reference<
140 									  	::com::sun::star::xml::sax::XAttributeList>& xAttrList );
141 
142 	virtual void EndElement();
143 
144     void SetGrandTotal(::xmloff::token::XMLTokenEnum eOrientation, bool bVisible, const ::rtl::OUString& rDisplayName);
SetDatabaseName(const rtl::OUString & sValue)145 	void SetDatabaseName(const rtl::OUString& sValue) { sDatabaseName = sValue; }
SetSourceObject(const rtl::OUString & sValue)146 	void SetSourceObject(const rtl::OUString& sValue) { sSourceObject = sValue; }
SetNative(const sal_Bool bValue)147 	void SetNative(const sal_Bool bValue) { bIsNative = bValue; }
SetServiceName(const rtl::OUString & sValue)148 	void SetServiceName(const rtl::OUString& sValue) { sServiceName = sValue; }
SetServiceSourceName(const rtl::OUString & sValue)149 	void SetServiceSourceName(const rtl::OUString& sValue) { sServiceSourceName = sValue; }
SetServiceSourceObject(const rtl::OUString & sValue)150 	void SetServiceSourceObject(const rtl::OUString& sValue) { sServiceSourceObject = sValue; }
SetServiceUsername(const rtl::OUString & sValue)151 	void SetServiceUsername(const rtl::OUString& sValue) { sServiceUsername = sValue; }
SetServicePassword(const rtl::OUString & sValue)152 	void SetServicePassword(const rtl::OUString& sValue) { sServicePassword = sValue; }
SetSourceCellRangeAddress(const ScRange & aValue)153 	void SetSourceCellRangeAddress(const ScRange& aValue) { aSourceCellRangeAddress = aValue; bSourceCellRange = sal_True; }
SetSourceQueryParam(const ScQueryParam & aValue)154 	void SetSourceQueryParam(const ScQueryParam& aValue) { aSourceQueryParam = aValue; }
155 //	void SetFilterUseRegularExpressions(const sal_Bool bValue) { aSourceQueryParam.bRegExp = bValue; }
SetFilterOutputPosition(const ScAddress & aValue)156 	void SetFilterOutputPosition(const ScAddress& aValue) { aFilterOutputPosition = aValue; }
SetFilterCopyOutputData(const sal_Bool bValue)157 	void SetFilterCopyOutputData(const sal_Bool bValue) { bFilterCopyOutputData = bValue; }
SetFilterSourceRange(const ScRange & aValue)158 	void SetFilterSourceRange(const ScRange& aValue) { aFilterSourceRange = aValue; }
159 //	void SetFilterIsCaseSensitive(const sal_Bool bValue) { aSourceQueryParam.bCaseSens = bValue; }
160 //	void SetFilterSkipDuplicates(const sal_Bool bValue) { aSourceQueryParam.bDuplicate = !bValue; }
161 	void AddDimension(ScDPSaveDimension* pDim, bool bHasHiddenMember);
162     void AddGroupDim(const ScDPSaveNumGroupDimension& aNumGroupDim);
163     void AddGroupDim(const ScDPSaveGroupDimension& aGroupDim);
164 	void SetButtons();
165 };
166 
167 class ScXMLDPSourceSQLContext : public SvXMLImportContext
168 {
169 	ScXMLDataPilotTableContext*	pDataPilotTable;
170 
GetScImport() const171 	const ScXMLImport& GetScImport() const { return (const ScXMLImport&)GetImport(); }
GetScImport()172 	ScXMLImport& GetScImport() { return (ScXMLImport&)GetImport(); }
173 
174 public:
175 
176 	ScXMLDPSourceSQLContext( ScXMLImport& rImport, sal_uInt16 nPrfx,
177 						const ::rtl::OUString& rLName,
178 						const ::com::sun::star::uno::Reference<
179 						::com::sun::star::xml::sax::XAttributeList>& xAttrList,
180 						ScXMLDataPilotTableContext* pDataPilotTable);
181 
182 	virtual ~ScXMLDPSourceSQLContext();
183 
184 	virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix,
185 									 const ::rtl::OUString& rLocalName,
186 									 const ::com::sun::star::uno::Reference<
187 									  	::com::sun::star::xml::sax::XAttributeList>& xAttrList );
188 
189 	virtual void EndElement();
190 };
191 
192 class ScXMLDPSourceTableContext : public SvXMLImportContext
193 {
194 	ScXMLDataPilotTableContext*	pDataPilotTable;
195 
GetScImport() const196 	const ScXMLImport& GetScImport() const { return (const ScXMLImport&)GetImport(); }
GetScImport()197 	ScXMLImport& GetScImport() { return (ScXMLImport&)GetImport(); }
198 
199 public:
200 
201 	ScXMLDPSourceTableContext( ScXMLImport& rImport, sal_uInt16 nPrfx,
202 						const ::rtl::OUString& rLName,
203 						const ::com::sun::star::uno::Reference<
204 						::com::sun::star::xml::sax::XAttributeList>& xAttrList,
205 						ScXMLDataPilotTableContext* pDataPilotTable);
206 
207 	virtual ~ScXMLDPSourceTableContext();
208 
209 	virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix,
210 									 const ::rtl::OUString& rLocalName,
211 									 const ::com::sun::star::uno::Reference<
212 									  	::com::sun::star::xml::sax::XAttributeList>& xAttrList );
213 
214 	virtual void EndElement();
215 };
216 
217 class ScXMLDPSourceQueryContext : public SvXMLImportContext
218 {
219 	ScXMLDataPilotTableContext*	pDataPilotTable;
220 
GetScImport() const221 	const ScXMLImport& GetScImport() const { return (const ScXMLImport&)GetImport(); }
GetScImport()222 	ScXMLImport& GetScImport() { return (ScXMLImport&)GetImport(); }
223 
224 public:
225 
226 	ScXMLDPSourceQueryContext( ScXMLImport& rImport, sal_uInt16 nPrfx,
227 						const ::rtl::OUString& rLName,
228 						const ::com::sun::star::uno::Reference<
229 						::com::sun::star::xml::sax::XAttributeList>& xAttrList,
230 						ScXMLDataPilotTableContext* pDataPilotTable);
231 
232 	virtual ~ScXMLDPSourceQueryContext();
233 
234 	virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix,
235 									 const ::rtl::OUString& rLocalName,
236 									 const ::com::sun::star::uno::Reference<
237 									  	::com::sun::star::xml::sax::XAttributeList>& xAttrList );
238 
239 	virtual void EndElement();
240 };
241 
242 class ScXMLSourceServiceContext : public SvXMLImportContext
243 {
244 	ScXMLDataPilotTableContext*	pDataPilotTable;
245 
GetScImport() const246 	const ScXMLImport& GetScImport() const { return (const ScXMLImport&)GetImport(); }
GetScImport()247 	ScXMLImport& GetScImport() { return (ScXMLImport&)GetImport(); }
248 
249 public:
250 
251 	ScXMLSourceServiceContext( ScXMLImport& rImport, sal_uInt16 nPrfx,
252 						const ::rtl::OUString& rLName,
253 						const ::com::sun::star::uno::Reference<
254 						::com::sun::star::xml::sax::XAttributeList>& xAttrList,
255 						ScXMLDataPilotTableContext* pDataPilotTable);
256 
257 	virtual ~ScXMLSourceServiceContext();
258 
259 	virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix,
260 									 const ::rtl::OUString& rLocalName,
261 									 const ::com::sun::star::uno::Reference<
262 									  	::com::sun::star::xml::sax::XAttributeList>& xAttrList );
263 
264 	virtual void EndElement();
265 };
266 
267 class ScXMLDataPilotGrandTotalContext : public SvXMLImportContext
268 {
269     enum Orientation { COLUMN, ROW, BOTH, NONE };
270 
271     ScXMLImport& GetScImport();
272 
273     ScXMLDataPilotTableContext* mpTableContext;
274     ::rtl::OUString             maDisplayName;
275     Orientation                 meOrientation;
276     bool                        mbVisible;
277 
278 public:
279     ScXMLDataPilotGrandTotalContext(
280         ScXMLImport& rImport, sal_uInt16 nPrefix, const ::rtl::OUString& rLName,
281         const ::com::sun::star::uno::Reference<
282             ::com::sun::star::xml::sax::XAttributeList>& xAttrList,
283         ScXMLDataPilotTableContext* pTableContext );
284 
285     virtual ~ScXMLDataPilotGrandTotalContext();
286 
287     virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix,
288                                      const ::rtl::OUString& rLocalName,
289                                      const ::com::sun::star::uno::Reference<
290                                         ::com::sun::star::xml::sax::XAttributeList>& xAttrList );
291 
292     virtual void EndElement();
293 };
294 
295 class ScXMLSourceCellRangeContext : public SvXMLImportContext
296 {
297 	ScXMLDataPilotTableContext*	pDataPilotTable;
298 
GetScImport() const299 	const ScXMLImport& GetScImport() const { return (const ScXMLImport&)GetImport(); }
GetScImport()300 	ScXMLImport& GetScImport() { return (ScXMLImport&)GetImport(); }
301 
302 public:
303 
304 	ScXMLSourceCellRangeContext( ScXMLImport& rImport, sal_uInt16 nPrfx,
305 						const ::rtl::OUString& rLName,
306 						const ::com::sun::star::uno::Reference<
307 						::com::sun::star::xml::sax::XAttributeList>& xAttrList,
308 						ScXMLDataPilotTableContext* pDataPilotTable);
309 
310 	virtual ~ScXMLSourceCellRangeContext();
311 
312 	virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix,
313 									 const ::rtl::OUString& rLocalName,
314 									 const ::com::sun::star::uno::Reference<
315 									  	::com::sun::star::xml::sax::XAttributeList>& xAttrList );
316 
317 	virtual void EndElement();
318 };
319 
320 struct ScXMLDataPilotGroup
321 {
322     ::std::vector<rtl::OUString> aMembers;
323     rtl::OUString aName;
324 };
325 
326 class ScXMLDataPilotFieldContext : public SvXMLImportContext
327 {
328 	ScXMLDataPilotTableContext*	pDataPilotTable;
329 	ScDPSaveDimension*			pDim;
330 
331     ::std::vector<ScXMLDataPilotGroup> aGroups;
332     rtl::OUString               sGroupSource;
333     rtl::OUString               sSelectedPage;
334     rtl::OUString               sName;
335     double                      fStart;
336     double                      fEnd;
337     double                      fStep;
338 	sal_Int32					nUsedHierarchy;
339     sal_Int32                   nGroupPart;
340 	sal_Int16					nFunction;
341 	sal_Int16					nOrientation;
342 	sal_Bool					bShowEmpty:1;
343     sal_Bool                    bSelectedPage:1;
344     sal_Bool                    bIsGroupField:1;
345     sal_Bool                    bDateValue:1;
346     sal_Bool                    bAutoStart:1;
347     sal_Bool                    bAutoEnd:1;
348     bool                        mbHasHiddenMember:1;
349 
GetScImport() const350 	const ScXMLImport& GetScImport() const { return (const ScXMLImport&)GetImport(); }
GetScImport()351 	ScXMLImport& GetScImport() { return (ScXMLImport&)GetImport(); }
352 
353 public:
354 
355 	ScXMLDataPilotFieldContext( ScXMLImport& rImport, sal_uInt16 nPrfx,
356 						const ::rtl::OUString& rLName,
357 						const ::com::sun::star::uno::Reference<
358 						::com::sun::star::xml::sax::XAttributeList>& xAttrList,
359 						ScXMLDataPilotTableContext* pDataPilotTable);
360 
361 	virtual ~ScXMLDataPilotFieldContext();
362 
363 	virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix,
364 									 const ::rtl::OUString& rLocalName,
365 									 const ::com::sun::star::uno::Reference<
366 									  	::com::sun::star::xml::sax::XAttributeList>& xAttrList );
367 
368 	virtual void EndElement();
369 
SetShowEmpty(const sal_Bool bValue)370 	void SetShowEmpty(const sal_Bool bValue) { if (pDim) pDim->SetShowEmpty(bValue); }
SetSubTotals(const sal_uInt16 * pFunctions,const sal_Int16 nCount)371 	void SetSubTotals(const sal_uInt16* pFunctions, const sal_Int16 nCount) { if(pDim) pDim->SetSubTotals(nCount, pFunctions); }
372     void AddMember(ScDPSaveMember* pMember);
373     void SetSubTotalName(const ::rtl::OUString& rName);
SetFieldReference(const com::sun::star::sheet::DataPilotFieldReference & aRef)374     void SetFieldReference(const com::sun::star::sheet::DataPilotFieldReference& aRef) { if (pDim) pDim->SetReferenceValue(&aRef); }
SetAutoShowInfo(const com::sun::star::sheet::DataPilotFieldAutoShowInfo & aInfo)375     void SetAutoShowInfo(const com::sun::star::sheet::DataPilotFieldAutoShowInfo& aInfo) { if (pDim) pDim->SetAutoShowInfo(&aInfo); }
SetSortInfo(const com::sun::star::sheet::DataPilotFieldSortInfo & aInfo)376     void SetSortInfo(const com::sun::star::sheet::DataPilotFieldSortInfo& aInfo) { if (pDim) pDim->SetSortInfo(&aInfo); }
SetLayoutInfo(const com::sun::star::sheet::DataPilotFieldLayoutInfo & aInfo)377     void SetLayoutInfo(const com::sun::star::sheet::DataPilotFieldLayoutInfo& aInfo) { if (pDim) pDim->SetLayoutInfo(&aInfo); }
SetGrouping(const rtl::OUString & rGroupSource,const double & rStart,const double & rEnd,const double & rStep,sal_Int32 nPart,sal_Bool bDate,sal_Bool bAutoSt,sal_Bool bAutoE)378     void SetGrouping(const rtl::OUString& rGroupSource, const double& rStart, const double& rEnd, const double& rStep,
379         sal_Int32 nPart, sal_Bool bDate, sal_Bool bAutoSt, sal_Bool bAutoE)
380     {
381         bIsGroupField = sal_True;
382         sGroupSource = rGroupSource;
383         fStart = rStart;
384         fEnd = rEnd;
385         fStep = rStep;
386         nGroupPart = nPart;
387         bDateValue = bDate;
388         bAutoStart = bAutoSt;
389         bAutoEnd = bAutoE;
390     }
391     void AddGroup(const ::std::vector<rtl::OUString>& rMembers, const rtl::OUString& rName);
392 };
393 
394 class ScXMLDataPilotFieldReferenceContext : public SvXMLImportContext
395 {
396 //    com::sun::star::sheet::DataPilotFieldReference aReference;
397 
GetScImport() const398 	const ScXMLImport& GetScImport() const { return (const ScXMLImport&)GetImport(); }
GetScImport()399 	ScXMLImport& GetScImport() { return (ScXMLImport&)GetImport(); }
400 
401 public:
402 
403 	ScXMLDataPilotFieldReferenceContext( ScXMLImport& rImport, sal_uInt16 nPrfx,
404 						const ::rtl::OUString& rLName,
405 						const ::com::sun::star::uno::Reference<
406 						::com::sun::star::xml::sax::XAttributeList>& xAttrList,
407 						ScXMLDataPilotFieldContext* pDataPilotField);
408 
409 	virtual ~ScXMLDataPilotFieldReferenceContext();
410 };
411 
412 class ScXMLDataPilotLevelContext : public SvXMLImportContext
413 {
414 	ScXMLDataPilotFieldContext*	pDataPilotField;
415 
GetScImport() const416 	const ScXMLImport& GetScImport() const { return (const ScXMLImport&)GetImport(); }
GetScImport()417 	ScXMLImport& GetScImport() { return (ScXMLImport&)GetImport(); }
418 
419 public:
420 
421 	ScXMLDataPilotLevelContext( ScXMLImport& rImport, sal_uInt16 nPrfx,
422 						const ::rtl::OUString& rLName,
423 						const ::com::sun::star::uno::Reference<
424 						::com::sun::star::xml::sax::XAttributeList>& xAttrList,
425 						ScXMLDataPilotFieldContext* pDataPilotField);
426 
427 	virtual ~ScXMLDataPilotLevelContext();
428 
429 	virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix,
430 									 const ::rtl::OUString& rLocalName,
431 									 const ::com::sun::star::uno::Reference<
432 									  	::com::sun::star::xml::sax::XAttributeList>& xAttrList );
433 
434 	virtual void EndElement();
435 };
436 
437 class ScXMLDataPilotDisplayInfoContext : public SvXMLImportContext
438 {
439 //    com::sun::star::sheet::DataPilotFieldAutoShowInfo aInfo;
440 
GetScImport() const441 	const ScXMLImport& GetScImport() const { return (const ScXMLImport&)GetImport(); }
GetScImport()442 	ScXMLImport& GetScImport() { return (ScXMLImport&)GetImport(); }
443 
444 public:
445 
446 	ScXMLDataPilotDisplayInfoContext( ScXMLImport& rImport, sal_uInt16 nPrfx,
447 						const ::rtl::OUString& rLName,
448 						const ::com::sun::star::uno::Reference<
449 						::com::sun::star::xml::sax::XAttributeList>& xAttrList,
450 						ScXMLDataPilotFieldContext* pDataPilotField);
451 
452 	virtual ~ScXMLDataPilotDisplayInfoContext();
453 };
454 
455 class ScXMLDataPilotSortInfoContext : public SvXMLImportContext
456 {
457 //    com::sun::star::sheet::DataPilotFieldSortInfo aInfo;
458 
GetScImport() const459 	const ScXMLImport& GetScImport() const { return (const ScXMLImport&)GetImport(); }
GetScImport()460 	ScXMLImport& GetScImport() { return (ScXMLImport&)GetImport(); }
461 
462 public:
463 
464 	ScXMLDataPilotSortInfoContext( ScXMLImport& rImport, sal_uInt16 nPrfx,
465 						const ::rtl::OUString& rLName,
466 						const ::com::sun::star::uno::Reference<
467 						::com::sun::star::xml::sax::XAttributeList>& xAttrList,
468 						ScXMLDataPilotFieldContext* pDataPilotField);
469 
470 	virtual ~ScXMLDataPilotSortInfoContext();
471 };
472 
473 class ScXMLDataPilotLayoutInfoContext : public SvXMLImportContext
474 {
475 //    com::sun::star::sheet::DataPilotFieldLayoutInfo aInfo;
476 
GetScImport() const477 	const ScXMLImport& GetScImport() const { return (const ScXMLImport&)GetImport(); }
GetScImport()478 	ScXMLImport& GetScImport() { return (ScXMLImport&)GetImport(); }
479 
480 public:
481 
482 	ScXMLDataPilotLayoutInfoContext( ScXMLImport& rImport, sal_uInt16 nPrfx,
483 						const ::rtl::OUString& rLName,
484 						const ::com::sun::star::uno::Reference<
485 						::com::sun::star::xml::sax::XAttributeList>& xAttrList,
486 						ScXMLDataPilotFieldContext* pDataPilotField);
487 
488 	virtual ~ScXMLDataPilotLayoutInfoContext();
489 };
490 
491 class ScXMLDataPilotSubTotalsContext : public SvXMLImportContext
492 {
493 	ScXMLDataPilotFieldContext* pDataPilotField;
494 
495 	sal_Int16	nFunctionCount;
496 	sal_uInt16*	pFunctions;
497     ::rtl::OUString maDisplayName;
498 
GetScImport() const499 	const ScXMLImport& GetScImport() const { return (const ScXMLImport&)GetImport(); }
GetScImport()500 	ScXMLImport& GetScImport() { return (ScXMLImport&)GetImport(); }
501 
502 public:
503 
GetDataPilotField()504 	ScXMLDataPilotFieldContext* GetDataPilotField() { return pDataPilotField; }
505 
506 	ScXMLDataPilotSubTotalsContext( ScXMLImport& rImport, sal_uInt16 nPrfx,
507 						const ::rtl::OUString& rLName,
508 						const ::com::sun::star::uno::Reference<
509 						::com::sun::star::xml::sax::XAttributeList>& xAttrList,
510 						ScXMLDataPilotFieldContext* pDataPilotField);
511 
512 	virtual ~ScXMLDataPilotSubTotalsContext();
513 
514 	virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix,
515 									 const ::rtl::OUString& rLocalName,
516 									 const ::com::sun::star::uno::Reference<
517 									  	::com::sun::star::xml::sax::XAttributeList>& xAttrList );
518 
519 	virtual void EndElement();
520 	void AddFunction(sal_Int16 nFunction);
521     void SetDisplayName(const ::rtl::OUString& rName);
522 };
523 
524 class ScXMLDataPilotSubTotalContext : public SvXMLImportContext
525 {
526 	ScXMLDataPilotSubTotalsContext*	pDataPilotSubTotals;
527 
GetScImport() const528 	const ScXMLImport& GetScImport() const { return (const ScXMLImport&)GetImport(); }
GetScImport()529 	ScXMLImport& GetScImport() { return (ScXMLImport&)GetImport(); }
530 
531 public:
532 
533 	ScXMLDataPilotSubTotalContext( ScXMLImport& rImport, sal_uInt16 nPrfx,
534 						const ::rtl::OUString& rLName,
535 						const ::com::sun::star::uno::Reference<
536 						::com::sun::star::xml::sax::XAttributeList>& xAttrList,
537 						ScXMLDataPilotSubTotalsContext* pDataPilotSubTotals);
538 
539 	virtual ~ScXMLDataPilotSubTotalContext();
540 
541 	virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix,
542 									 const ::rtl::OUString& rLocalName,
543 									 const ::com::sun::star::uno::Reference<
544 									  	::com::sun::star::xml::sax::XAttributeList>& xAttrList );
545 
546 	virtual void EndElement();
547 };
548 
549 class ScXMLDataPilotMembersContext : public SvXMLImportContext
550 {
551 	ScXMLDataPilotFieldContext* pDataPilotField;
552 
GetScImport() const553 	const ScXMLImport& GetScImport() const { return (const ScXMLImport&)GetImport(); }
GetScImport()554 	ScXMLImport& GetScImport() { return (ScXMLImport&)GetImport(); }
555 
556 public:
557 
558 	ScXMLDataPilotMembersContext( ScXMLImport& rImport, sal_uInt16 nPrfx,
559 						const ::rtl::OUString& rLName,
560 						const ::com::sun::star::uno::Reference<
561 						::com::sun::star::xml::sax::XAttributeList>& xAttrList,
562 						ScXMLDataPilotFieldContext* pDataPilotField);
563 
564 	virtual ~ScXMLDataPilotMembersContext();
565 
566 	virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix,
567 									 const ::rtl::OUString& rLocalName,
568 									 const ::com::sun::star::uno::Reference<
569 									  	::com::sun::star::xml::sax::XAttributeList>& xAttrList );
570 
571 	virtual void EndElement();
572 };
573 
574 class ScXMLDataPilotMemberContext : public SvXMLImportContext
575 {
576 	ScXMLDataPilotFieldContext*	pDataPilotField;
577 
578 	rtl::OUString sName;
579     rtl::OUString maDisplayName;
580 	sal_Bool	bDisplay;
581 	sal_Bool	bDisplayDetails;
582     sal_Bool    bHasName;
583 
GetScImport() const584 	const ScXMLImport& GetScImport() const { return (const ScXMLImport&)GetImport(); }
GetScImport()585 	ScXMLImport& GetScImport() { return (ScXMLImport&)GetImport(); }
586 
587 public:
588 
589 	ScXMLDataPilotMemberContext( ScXMLImport& rImport, sal_uInt16 nPrfx,
590 						const ::rtl::OUString& rLName,
591 						const ::com::sun::star::uno::Reference<
592 						::com::sun::star::xml::sax::XAttributeList>& xAttrList,
593 						ScXMLDataPilotFieldContext* pDataPilotField);
594 
595 	virtual ~ScXMLDataPilotMemberContext();
596 
597 	virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix,
598 									 const ::rtl::OUString& rLocalName,
599 									 const ::com::sun::star::uno::Reference<
600 									  	::com::sun::star::xml::sax::XAttributeList>& xAttrList );
601 
602 	virtual void EndElement();
603 };
604 
605 class ScXMLDataPilotGroupsContext : public SvXMLImportContext
606 {
607 	ScXMLDataPilotFieldContext*	pDataPilotField;
608 
GetScImport() const609 	const ScXMLImport& GetScImport() const { return (const ScXMLImport&)GetImport(); }
GetScImport()610 	ScXMLImport& GetScImport() { return (ScXMLImport&)GetImport(); }
611 
612 public:
613 
614 	ScXMLDataPilotGroupsContext( ScXMLImport& rImport, sal_uInt16 nPrfx,
615 						const ::rtl::OUString& rLName,
616 						const ::com::sun::star::uno::Reference<
617 						::com::sun::star::xml::sax::XAttributeList>& xAttrList,
618 						ScXMLDataPilotFieldContext* pDataPilotField);
619 
620 	virtual ~ScXMLDataPilotGroupsContext();
621 
622 	virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix,
623 									 const ::rtl::OUString& rLocalName,
624 									 const ::com::sun::star::uno::Reference<
625 									  	::com::sun::star::xml::sax::XAttributeList>& xAttrList );
626 
627 	virtual void EndElement();
628 };
629 
630 class ScXMLDataPilotGroupContext : public SvXMLImportContext
631 {
632 	ScXMLDataPilotFieldContext*	pDataPilotField;
633 
634 	rtl::OUString sName;
635     ::std::vector<rtl::OUString> aMembers;
636 
GetScImport() const637 	const ScXMLImport& GetScImport() const { return (const ScXMLImport&)GetImport(); }
GetScImport()638 	ScXMLImport& GetScImport() { return (ScXMLImport&)GetImport(); }
639 
640 public:
641 
642 	ScXMLDataPilotGroupContext( ScXMLImport& rImport, sal_uInt16 nPrfx,
643 						const ::rtl::OUString& rLName,
644 						const ::com::sun::star::uno::Reference<
645 						::com::sun::star::xml::sax::XAttributeList>& xAttrList,
646 						ScXMLDataPilotFieldContext* pDataPilotField);
647 
648 	virtual ~ScXMLDataPilotGroupContext();
649 
650 	virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix,
651 									 const ::rtl::OUString& rLocalName,
652 									 const ::com::sun::star::uno::Reference<
653 									  	::com::sun::star::xml::sax::XAttributeList>& xAttrList );
654 
655 	virtual void EndElement();
656 
AddMember(const rtl::OUString & sMember)657     void AddMember(const rtl::OUString& sMember) { aMembers.push_back(sMember); }
658 };
659 
660 class ScXMLDataPilotGroupMemberContext : public SvXMLImportContext
661 {
662 	ScXMLDataPilotGroupContext*	pDataPilotGroup;
663 
664 	rtl::OUString sName;
665 
GetScImport() const666 	const ScXMLImport& GetScImport() const { return (const ScXMLImport&)GetImport(); }
GetScImport()667 	ScXMLImport& GetScImport() { return (ScXMLImport&)GetImport(); }
668 
669 public:
670 
671 	ScXMLDataPilotGroupMemberContext( ScXMLImport& rImport, sal_uInt16 nPrfx,
672 						const ::rtl::OUString& rLName,
673 						const ::com::sun::star::uno::Reference<
674 						::com::sun::star::xml::sax::XAttributeList>& xAttrList,
675 						ScXMLDataPilotGroupContext* pDataPilotGroup);
676 
677 	virtual ~ScXMLDataPilotGroupMemberContext();
678 
679 	virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix,
680 									 const ::rtl::OUString& rLocalName,
681 									 const ::com::sun::star::uno::Reference<
682 									  	::com::sun::star::xml::sax::XAttributeList>& xAttrList );
683 
684 	virtual void EndElement();
685 };
686 
687 #endif
688 
689