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_XMLCALCULATIONSETTINGSCONTEXT_HXX
25 #define SC_XMLCALCULATIONSETTINGSCONTEXT_HXX
26 
27 #include <xmloff/xmlictxt.hxx>
28 #include <com/sun/star/util/Date.hpp>
29 
30 class ScXMLImport;
31 
32 class ScXMLCalculationSettingsContext : public SvXMLImportContext
33 {
34 	com::sun::star::util::Date aNullDate;
35 	double fIterationEpsilon;
36 	sal_Int32 nIterationCount;
37 	sal_uInt16 nYear2000;
38 	sal_Bool bIsIterationEnabled;
39 	sal_Bool bCalcAsShown;
40 	sal_Bool bIgnoreCase;
41 	sal_Bool bLookUpLabels;
42 	sal_Bool bMatchWholeCell;
43 	sal_Bool bUseRegularExpressions;
44 
GetScImport() const45 	const ScXMLImport& GetScImport() const { return (const ScXMLImport&)GetImport(); }
GetScImport()46 	ScXMLImport& GetScImport() { return (ScXMLImport&)GetImport(); }
47 public:
48 	ScXMLCalculationSettingsContext( ScXMLImport& rImport, sal_uInt16 nPrfx,
49 						const ::rtl::OUString& rLName,
50 						const ::com::sun::star::uno::Reference<
51 										::com::sun::star::xml::sax::XAttributeList>& xAttrList);
52 
53 	virtual ~ScXMLCalculationSettingsContext();
54 
55 	virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix,
56 									 const ::rtl::OUString& rLocalName,
57 									 const ::com::sun::star::uno::Reference<
58 									  	::com::sun::star::xml::sax::XAttributeList>& xAttrList );
59 
SetNullDate(const com::sun::star::util::Date & aDate)60 	void SetNullDate(const com::sun::star::util::Date& aDate) { aNullDate = aDate; }
SetIterationStatus(const sal_Bool bValue)61 	void SetIterationStatus(const sal_Bool bValue) { bIsIterationEnabled = bValue; }
SetIterationCount(const sal_Int32 nValue)62 	void SetIterationCount(const sal_Int32 nValue) { nIterationCount = nValue; }
SetIterationEpsilon(const double fValue)63 	void SetIterationEpsilon(const double fValue) { fIterationEpsilon = fValue; }
64 	virtual void EndElement();
65 };
66 
67 class ScXMLNullDateContext : public SvXMLImportContext
68 {
GetScImport() const69 	const ScXMLImport& GetScImport() const { return (const ScXMLImport&)GetImport(); }
GetScImport()70 	ScXMLImport& GetScImport() { return (ScXMLImport&)GetImport(); }
71 public:
72 	ScXMLNullDateContext( ScXMLImport& rImport, sal_uInt16 nPrfx,
73 						const ::rtl::OUString& rLName,
74 						const ::com::sun::star::uno::Reference<
75 										::com::sun::star::xml::sax::XAttributeList>& xAttrList, ScXMLCalculationSettingsContext* pCalcSet);
76 
77 	virtual ~ScXMLNullDateContext();
78 
79 	virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix,
80 									 const ::rtl::OUString& rLocalName,
81 									 const ::com::sun::star::uno::Reference<
82 									  	::com::sun::star::xml::sax::XAttributeList>& xAttrList );
83 
84 	virtual void EndElement();
85 };
86 
87 class ScXMLIterationContext : public SvXMLImportContext
88 {
GetScImport() const89 	const ScXMLImport& GetScImport() const { return (const ScXMLImport&)GetImport(); }
GetScImport()90 	ScXMLImport& GetScImport() { return (ScXMLImport&)GetImport(); }
91 public:
92 	ScXMLIterationContext( ScXMLImport& rImport, sal_uInt16 nPrfx,
93 						const ::rtl::OUString& rLName,
94 						const ::com::sun::star::uno::Reference<
95 										::com::sun::star::xml::sax::XAttributeList>& xAttrList, ScXMLCalculationSettingsContext* pCalcSet);
96 
97 	virtual ~ScXMLIterationContext();
98 
99 	virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix,
100 									 const ::rtl::OUString& rLocalName,
101 									 const ::com::sun::star::uno::Reference<
102 									  	::com::sun::star::xml::sax::XAttributeList>& xAttrList );
103 
104 	virtual void EndElement();
105 };
106 
107 #endif
108