xref: /aoo4110/main/sc/source/filter/xml/xmlsorti.hxx (revision b1cdbd2c)
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_XMLSORTI_HXX
24 #define SC_XMLSORTI_HXX
25 
26 #include <xmloff/xmlictxt.hxx>
27 #include <xmloff/xmlimp.hxx>
28 #include <com/sun/star/util/SortField.hpp>
29 #include <com/sun/star/table/CellAddress.hpp>
30 
31 #include "xmldrani.hxx"
32 
33 class ScXMLImport;
34 
35 class ScXMLSortContext : public SvXMLImportContext
36 {
37 	ScXMLDatabaseRangeContext* pDatabaseRangeContext;
38 
39 	com::sun::star::uno::Sequence <com::sun::star::util::SortField> aSortFields;
40 	com::sun::star::table::CellAddress aOutputPosition;
41 	rtl::OUString	sCountry;
42 	rtl::OUString	sLanguage;
43 	rtl::OUString	sAlgorithm;
44 	sal_Int16	nUserListIndex;
45 	sal_Bool	bCopyOutputData;
46 	sal_Bool	bBindFormatsToContent;
47 	sal_Bool	bIsCaseSensitive;
48 	sal_Bool	bEnabledUserList;
49 
GetScImport() const50 	const ScXMLImport& GetScImport() const { return (const ScXMLImport&)GetImport(); }
GetScImport()51 	ScXMLImport& GetScImport() { return (ScXMLImport&)GetImport(); }
52 
53 public:
54 
55 	ScXMLSortContext( ScXMLImport& rImport, sal_uInt16 nPrfx,
56 						const ::rtl::OUString& rLName,
57 						const ::com::sun::star::uno::Reference<
58 										::com::sun::star::xml::sax::XAttributeList>& xAttrList,
59 										ScXMLDatabaseRangeContext* pTempDatabaseRangeContext);
60 
61 	virtual ~ScXMLSortContext();
62 
63 	virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix,
64 									 const ::rtl::OUString& rLocalName,
65 									 const ::com::sun::star::uno::Reference<
66 									  	::com::sun::star::xml::sax::XAttributeList>& xAttrList );
67 
68 	virtual void EndElement();
69 
70 	void AddSortField(const rtl::OUString& sFieldNumber, const rtl::OUString& sDataType, const rtl::OUString& sOrder);
71 };
72 
73 class ScXMLSortByContext : public SvXMLImportContext
74 {
75 	ScXMLSortContext* pSortContext;
76 
77 	rtl::OUString	sFieldNumber;
78 	rtl::OUString	sDataType;
79 	rtl::OUString	sOrder;
80 
GetScImport() const81 	const ScXMLImport& GetScImport() const { return (const ScXMLImport&)GetImport(); }
GetScImport()82 	ScXMLImport& GetScImport() { return (ScXMLImport&)GetImport(); }
83 
84 public:
85 
86 	ScXMLSortByContext( ScXMLImport& rImport, sal_uInt16 nPrfx,
87 						const ::rtl::OUString& rLName,
88 						const ::com::sun::star::uno::Reference<
89 										::com::sun::star::xml::sax::XAttributeList>& xAttrList,
90 										ScXMLSortContext* pTempSortContext);
91 
92 	virtual ~ScXMLSortByContext();
93 
94 	virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix,
95 									 const ::rtl::OUString& rLocalName,
96 									 const ::com::sun::star::uno::Reference<
97 									  	::com::sun::star::xml::sax::XAttributeList>& xAttrList );
98 
99 	virtual void EndElement();
100 };
101 
102 #endif
103