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 _XMLOFF_SETTINGSEXPORTHELPER_HXX
25 #define _XMLOFF_SETTINGSEXPORTHELPER_HXX
26 
27 #include "xmloff/dllapi.h"
28 
29 #include <com/sun/star/awt/Rectangle.hpp>
30 #include <com/sun/star/formula/SymbolDescriptor.hpp>
31 #include <com/sun/star/util/XStringSubstitution.hpp>
32 #include <xmloff/xmlexp.hxx>
33 
34 namespace com
35 {
36 	namespace sun { namespace star {
37 		namespace container { class XNameAccess; class XIndexAccess; }
38 		namespace util { struct DateTime; }
39 	} }
40 }
41 
42 namespace xmloff
43 {
44     class XMLSettingsExportContext;
45 }
46 
47 class XMLOFF_DLLPUBLIC XMLSettingsExportHelper
48 {
49     ::xmloff::XMLSettingsExportContext& m_rContext;
50 
51 	::com::sun::star::uno::Reference< ::com::sun::star::util::XStringSubstitution > mxStringSubsitution;
52 
53 	const rtl::OUString msPrinterIndependentLayout;
54 	const rtl::OUString msColorTableURL;
55 	const rtl::OUString msLineEndTableURL;
56 	const rtl::OUString msHatchTableURL;
57 	const rtl::OUString msDashTableURL;
58 	const rtl::OUString msGradientTableURL;
59 	const rtl::OUString msBitmapTableURL;
60 
61 	void ManipulateSetting( com::sun::star::uno::Any& rAny, const rtl::OUString& rName ) const;
62 
63 	void CallTypeFunction(const com::sun::star::uno::Any& rAny,
64 						const rtl::OUString& rName) const;
65 
66 	void exportBool(const sal_Bool bValue, const rtl::OUString& rName) const;
67 	void exportByte(const sal_Int8 nValue, const rtl::OUString& rName) const;
68 	void exportShort(const sal_Int16 nValue, const rtl::OUString& rName) const;
69 	void exportInt(const sal_Int32 nValue, const rtl::OUString& rName) const;
70 	void exportLong(const sal_Int64 nValue, const rtl::OUString& rName) const;
71 	void exportDouble(const double fValue, const rtl::OUString& rName) const;
72 	void exportString(const rtl::OUString& sValue, const rtl::OUString& rName) const;
73 	void exportDateTime(const com::sun::star::util::DateTime& aValue, const rtl::OUString& rName) const;
74 	void exportSequencePropertyValue(
75 		const com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>& aProps,
76 		const rtl::OUString& rName) const;
77 	void exportbase64Binary(
78 		const com::sun::star::uno::Sequence<sal_Int8>& aProps,
79 		const rtl::OUString& rName) const;
80 	void exportMapEntry(const com::sun::star::uno::Any& rAny,
81 						const rtl::OUString& rName,
82 						const sal_Bool bNameAccess) const;
83 	void exportNameAccess(
84 		const com::sun::star::uno::Reference<com::sun::star::container::XNameAccess>& aNamed,
85 		const rtl::OUString& rName) const;
86 	void exportIndexAccess(
87 		const com::sun::star::uno::Reference<com::sun::star::container::XIndexAccess> aIndexed,
88 		const rtl::OUString rName) const;
89 
90 	void exportSymbolDescriptors(
91 					const com::sun::star::uno::Sequence < com::sun::star::formula::SymbolDescriptor > &rProps,
92 					const rtl::OUString rName) const;
93 	void exportForbiddenCharacters(
94 					const com::sun::star::uno::Any &rAny,
95 					const rtl::OUString rName) const;
96 
97 public:
98     XMLSettingsExportHelper( ::xmloff::XMLSettingsExportContext& i_rContext );
99 	~XMLSettingsExportHelper();
100 
101 	void exportAllSettings(
102 		const com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue>& aProps,
103 		const rtl::OUString& rName) const;
104 };
105 
106 #endif
107 
108