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_XMLTABLE_HXX
24 #define DBA_XMLTABLE_HXX
25 
26 #ifndef _XMLOFF_XMLICTXT_HXX
27 #include <xmloff/xmlictxt.hxx>
28 #endif
29 #ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_
30 #include <com/sun/star/beans/XPropertySet.hpp>
31 #endif
32 #ifndef _COM_SUN_STAR_CONTAINER_XNAMEACCESS_HPP_
33 #include <com/sun/star/container/XNameAccess.hpp>
34 #endif
35 
36 namespace dbaxml
37 {
38 	class ODBFilter;
39 	class OXMLTable : public SvXMLImportContext
40 	{
41 	protected:
42 		::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >	m_xParentContainer;
43 		::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >		m_xTable;
44 		::rtl::OUString m_sFilterStatement;
45 		::rtl::OUString m_sOrderStatement;
46 		::rtl::OUString m_sName;
47 		::rtl::OUString m_sSchema;
48 		::rtl::OUString m_sCatalog;
49 		::rtl::OUString m_sStyleName;
50 		::rtl::OUString m_sServiceName;
51 		sal_Bool		m_bApplyFilter;
52 		sal_Bool		m_bApplyOrder;
53 
54 
55 		ODBFilter& GetOwnImport();
56 
57 		void fillAttributes(	sal_uInt16 nPrfx
58 								,const ::rtl::OUString& _sLocalName
59 								,const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & xAttrList
60 								, ::rtl::OUString& _rsCommand
61 								,::rtl::OUString& _rsTableName
62 								,::rtl::OUString& _rsTableSchema
63 								,::rtl::OUString& _rsTableCatalog
64 							);
65 
66 		virtual void setProperties(::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > & _xProp);
67 	public:
68 
69 		OXMLTable( ODBFilter& rImport
70 					, sal_uInt16 nPrfx
71 					,const ::rtl::OUString& rLName
72 					,const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & xAttrList
73 					,const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& _xParentContainer
74 					,const ::rtl::OUString& _sServiceName
75 					);
76 		virtual ~OXMLTable();
77 
78 		virtual SvXMLImportContext *CreateChildContext( sal_uInt16 nPrefix,
79 					const ::rtl::OUString& rLocalName,
80 					const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & xAttrList );
81 		virtual void EndElement();
82 	};
83 // -----------------------------------------------------------------------------
84 } // namespace dbaxml
85 // -----------------------------------------------------------------------------
86 
87 #endif // DBA_XMLTABLE_HXX
88