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