1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: xmlDataSourceSettings.cxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_dbaccess.hxx"
33 #ifndef DBA_XMLDATASOURCESETTINGS_HXX
34 #include "xmlDataSourceSettings.hxx"
36 #ifndef DBA_XMLDATASOURCESETTING_HXX
37 #include "xmlDataSourceSetting.hxx"
39 #ifndef DBA_XMLFILTER_HXX
40 #include "xmlfilter.hxx"
42 #ifndef _XMLOFF_XMLTOKEN_HXX
43 #include <xmloff/xmltoken.hxx>
45 #ifndef _XMLOFF_XMLNMSPE_HXX
46 #include <xmloff/xmlnmspe.hxx>
48 #ifndef _XMLOFF_NMSPMAP_HXX
49 #include <xmloff/nmspmap.hxx>
51 #ifndef DBA_XMLENUMS_HXX
52 #include "xmlEnums.hxx"
54 #ifndef DBACCESS_SHARED_XMLSTRINGS_HRC
55 #include "xmlstrings.hrc"
57 #ifndef _COM_SUN_STAR_BEANS_PROPERTYVALUE_HPP_
58 #include <com/sun/star/beans/PropertyValue.hpp>
60 #ifndef _TOOLS_DEBUG_HXX
61 #include <tools/debug.hxx>
68 using namespace ::com::sun::star::uno
;
69 using namespace ::com::sun::star::xml::sax
;
70 DBG_NAME(OXMLDataSourceSettings
)
72 OXMLDataSourceSettings::OXMLDataSourceSettings( ODBFilter
& rImport
74 ,const ::rtl::OUString
& _sLocalName
) :
75 SvXMLImportContext( rImport
, nPrfx
, _sLocalName
)
77 DBG_CTOR(OXMLDataSourceSettings
,NULL
);
80 // -----------------------------------------------------------------------------
82 OXMLDataSourceSettings::~OXMLDataSourceSettings()
85 DBG_DTOR(OXMLDataSourceSettings
,NULL
);
87 // -----------------------------------------------------------------------------
88 SvXMLImportContext
* OXMLDataSourceSettings::CreateChildContext(
90 const ::rtl::OUString
& rLocalName
,
91 const Reference
< XAttributeList
> & xAttrList
)
93 SvXMLImportContext
*pContext
= 0;
94 const SvXMLTokenMap
& rTokenMap
= GetOwnImport().GetDataSourceInfoElemTokenMap();
96 switch( rTokenMap
.Get( nPrefix
, rLocalName
) )
98 case XML_TOK_DATA_SOURCE_SETTING
:
99 GetOwnImport().GetProgressBarHelper()->Increment( PROGRESS_BAR_STEP
);
100 pContext
= new OXMLDataSourceSetting( GetOwnImport(), nPrefix
, rLocalName
,xAttrList
);
105 pContext
= new SvXMLImportContext( GetImport(), nPrefix
, rLocalName
);
109 // -----------------------------------------------------------------------------
110 ODBFilter
& OXMLDataSourceSettings::GetOwnImport()
112 return static_cast<ODBFilter
&>(GetImport());
114 // -----------------------------------------------------------------------------
115 //----------------------------------------------------------------------------
116 } // namespace dbaxml
117 // -----------------------------------------------------------------------------