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 // MARKER(update_precomp.py): autogen include statement, do not remove
25 #include "precompiled_dbaxml.hxx"
26 #ifndef DBA_XMLDATASOURCESETTINGS_HXX
27 #include "xmlDataSourceSettings.hxx"
28 #endif
29 #ifndef DBA_XMLDATASOURCESETTING_HXX
30 #include "xmlDataSourceSetting.hxx"
31 #endif
32 #ifndef DBA_XMLFILTER_HXX
33 #include "xmlfilter.hxx"
34 #endif
35 #ifndef _XMLOFF_XMLTOKEN_HXX
36 #include <xmloff/xmltoken.hxx>
37 #endif
38 #ifndef _XMLOFF_XMLNMSPE_HXX
39 #include <xmloff/xmlnmspe.hxx>
40 #endif
41 #ifndef _XMLOFF_NMSPMAP_HXX
42 #include <xmloff/nmspmap.hxx>
43 #endif
44 #ifndef DBA_XMLENUMS_HXX
45 #include "xmlEnums.hxx"
46 #endif
47 #ifndef DBACCESS_SHARED_XMLSTRINGS_HRC
48 #include "xmlstrings.hrc"
49 #endif
50 #ifndef _COM_SUN_STAR_BEANS_PROPERTYVALUE_HPP_
51 #include <com/sun/star/beans/PropertyValue.hpp>
52 #endif
53 #ifndef _TOOLS_DEBUG_HXX
54 #include <tools/debug.hxx>
55 #endif
56 
57 #include <vector>
58 
59 namespace dbaxml
60 {
61 	using namespace ::com::sun::star::uno;
62 	using namespace ::com::sun::star::xml::sax;
DBG_NAME(OXMLDataSourceSettings)63 DBG_NAME(OXMLDataSourceSettings)
64 
65 OXMLDataSourceSettings::OXMLDataSourceSettings( ODBFilter& rImport
66 				,sal_uInt16 nPrfx
67 				,const ::rtl::OUString& _sLocalName) :
68 	SvXMLImportContext( rImport, nPrfx, _sLocalName )
69 {
70     DBG_CTOR(OXMLDataSourceSettings,NULL);
71 
72 }
73 // -----------------------------------------------------------------------------
74 
~OXMLDataSourceSettings()75 OXMLDataSourceSettings::~OXMLDataSourceSettings()
76 {
77 
78     DBG_DTOR(OXMLDataSourceSettings,NULL);
79 }
80 // -----------------------------------------------------------------------------
CreateChildContext(sal_uInt16 nPrefix,const::rtl::OUString & rLocalName,const Reference<XAttributeList> & xAttrList)81 SvXMLImportContext* OXMLDataSourceSettings::CreateChildContext(
82 		sal_uInt16 nPrefix,
83 		const ::rtl::OUString& rLocalName,
84 		const Reference< XAttributeList > & xAttrList )
85 {
86 	SvXMLImportContext *pContext = 0;
87 	const SvXMLTokenMap&	rTokenMap	= GetOwnImport().GetDataSourceInfoElemTokenMap();
88 
89 	switch( rTokenMap.Get( nPrefix, rLocalName ) )
90 	{
91 		case XML_TOK_DATA_SOURCE_SETTING:
92 			GetOwnImport().GetProgressBarHelper()->Increment( PROGRESS_BAR_STEP );
93 			pContext = new OXMLDataSourceSetting( GetOwnImport(), nPrefix, rLocalName,xAttrList);
94 			break;
95 	}
96 
97 	if( !pContext )
98 		pContext = new SvXMLImportContext( GetImport(), nPrefix, rLocalName );
99 
100 	return pContext;
101 }
102 // -----------------------------------------------------------------------------
GetOwnImport()103 ODBFilter& OXMLDataSourceSettings::GetOwnImport()
104 {
105 	return static_cast<ODBFilter&>(GetImport());
106 }
107 // -----------------------------------------------------------------------------
108 //----------------------------------------------------------------------------
109 } // namespace dbaxml
110 // -----------------------------------------------------------------------------
111