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 
24 #ifndef SC_XMLEXPORTDATAPILOT_HXX
25 #define SC_XMLEXPORTDATAPILOT_HXX
26 
27 #include <com/sun/star/sheet/XSpreadsheetDocument.hpp>
28 #include <rtl/ustring.hxx>
29 #include "global.hxx"
30 #include "xmloff/xmltoken.hxx"
31 
32 class ScXMLExport;
33 class ScDocument;
34 class ScDPSaveDimension;
35 class ScDPSaveData;
36 class ScDPDimensionSaveData;
37 class ScDPSaveGroupDimension;
38 class ScDPSaveNumGroupDimension;
39 struct ScDPNumGroupInfo;
40 struct ScQueryParam;
41 
42 class ScXMLExportDataPilot
43 {
44 	ScXMLExport&		rExport;
45 	ScDocument*			pDoc;
46 
47 	rtl::OUString getDPOperatorXML(const ScQueryOp aFilterOperator, const sal_Bool bUseRegularExpressions,
48 									const sal_Bool bIsString, const double dVal, const String& sVal) const;
49 	void WriteDPCondition(const ScQueryEntry& aQueryEntry, sal_Bool bIsCaseSensitive, sal_Bool bUseRegularExpressions);
50 	void WriteDPFilter(const ScQueryParam& aQueryParam);
51 
52     void WriteFieldReference(ScDPSaveDimension* pDim);
53     void WriteSortInfo(ScDPSaveDimension* pDim);
54     void WriteAutoShowInfo(ScDPSaveDimension* pDim);
55     void WriteLayoutInfo(ScDPSaveDimension* pDim);
56     void WriteSubTotals(ScDPSaveDimension* pDim);
57     void WriteMembers(ScDPSaveDimension* pDim);
58     void WriteLevels(ScDPSaveDimension* pDim);
59     void WriteDatePart(sal_Int32 nPart);
60     void WriteNumGroupInfo(const ScDPNumGroupInfo& pGroupInfo);
61     void WriteGroupDimAttributes(const ScDPSaveGroupDimension* pGroupDim);
62     void WriteGroupDimElements(ScDPSaveDimension* pDim, const ScDPDimensionSaveData* pDimData);
63     void WriteNumGroupDim(const ScDPSaveNumGroupDimension* pNumGroupDim);
64     void WriteDimension(ScDPSaveDimension* pDim, const ScDPDimensionSaveData* pDimData);
65     void WriteDimensions(ScDPSaveData* pDPSave);
66 
67     void WriteGrandTotal(::xmloff::token::XMLTokenEnum eOrient, bool bVisible, const ::rtl::OUString* pGrandTotal);
68 
69 public:
70 	ScXMLExportDataPilot(ScXMLExport& rExport);
71 	~ScXMLExportDataPilot();
72 	void WriteDataPilots(const com::sun::star::uno::Reference <com::sun::star::sheet::XSpreadsheetDocument>& xSpreaDoc);
73 };
74 
75 #endif
76 
77