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 DBA_XMLDATASOURCESETTING_HXX
24 #define DBA_XMLDATASOURCESETTING_HXX
25 
26 #ifndef _XMLOFF_XMLICTXT_HXX
27 #include <xmloff/xmlictxt.hxx>
28 #endif
29 #ifndef _COM_SUN_STAR_BEANS_PROPERTYVALUE_HPP_
30 #include <com/sun/star/beans/PropertyValue.hpp>
31 #endif
32 #ifndef _COM_SUN_STAR_UNO_SEQUENCE_HXX_
33 #include <com/sun/star/uno/Sequence.hxx>
34 #endif
35 
36 namespace dbaxml
37 {
38 	class ODBFilter;
39 	class OXMLDataSource;
40 	class OXMLDataSourceSetting : public SvXMLImportContext
41 	{
42 		::com::sun::star::beans::PropertyValue m_aSetting;
43 		::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any> m_aInfoSequence;
44 		OXMLDataSourceSetting* m_pContainer;
45 		::com::sun::star::uno::Type	m_aPropType;			// the type of the property the instance imports currently
46 		sal_Bool m_bIsList;
47 
48 		ODBFilter& GetOwnImport();
49 		::com::sun::star::uno::Any convertString(const ::com::sun::star::uno::Type& _rExpectedType, const ::rtl::OUString& _rReadCharacters);
50 	public:
51 
52 		OXMLDataSourceSetting( ODBFilter& rImport, sal_uInt16 nPrfx,
53 					const ::rtl::OUString& rLName,
54 					const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & xAttrList
55 					,OXMLDataSourceSetting* _pContainer = NULL);
56 		virtual ~OXMLDataSourceSetting();
57 
58 		virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix,
59 					const ::rtl::OUString& rLocalName,
60 					const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & xAttrList );
61 
62 		virtual void EndElement();
63 
64 		virtual void Characters( const ::rtl::OUString& rChars );
65 
66 
67 		/** adds value to property
68 			@param	_sValue
69 				The value to add.
70 		*/
71 		void addValue(const ::rtl::OUString& _sValue);
72 	};
73 // -----------------------------------------------------------------------------
74 } // namespace dbaxml
75 // -----------------------------------------------------------------------------
76 
77 #endif // DBA_XMLDATASOURCESETTING_HXX
78