1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include "xmlConnectionData.hxx"
21 #include "xmlLogin.hxx"
22 #include "xmlTableFilterList.hxx"
23 #include "xmlfilter.hxx"
24 #include <xmloff/xmltoken.hxx>
25 #include <xmloff/xmlnmspe.hxx>
26 #include <xmloff/nmspmap.hxx>
27 #include "xmlEnums.hxx"
28 #include "xmlDatabaseDescription.hxx"
29 #include "xmlConnectionResource.hxx"
30 #include "xmlstrings.hrc"
31 #include <tools/debug.hxx>
32 #include <tools/diagnose_ex.h>
36 using namespace ::com::sun::star::uno
;
37 using namespace ::com::sun::star::xml::sax
;
39 OXMLConnectionData::OXMLConnectionData( ODBFilter
& rImport
,
40 sal_uInt16 nPrfx
, const OUString
& _sLocalName
) :
41 SvXMLImportContext( rImport
, nPrfx
, _sLocalName
)
44 rImport
.setNewFormat(true);
47 OXMLConnectionData::~OXMLConnectionData()
52 SvXMLImportContext
* OXMLConnectionData::CreateChildContext(
54 const OUString
& rLocalName
,
55 const Reference
< XAttributeList
> & xAttrList
)
57 SvXMLImportContext
*pContext
= 0;
58 const SvXMLTokenMap
& rTokenMap
= GetOwnImport().GetDataSourceElemTokenMap();
60 switch( rTokenMap
.Get( nPrefix
, rLocalName
) )
63 GetOwnImport().GetProgressBarHelper()->Increment( PROGRESS_BAR_STEP
);
64 pContext
= new OXMLLogin( GetOwnImport(), nPrefix
, rLocalName
,xAttrList
);
66 case XML_TOK_DATABASE_DESCRIPTION
:
70 GetOwnImport().GetProgressBarHelper()->Increment( PROGRESS_BAR_STEP
);
71 pContext
= new OXMLDatabaseDescription( GetOwnImport(), nPrefix
, rLocalName
);
74 case XML_TOK_CONNECTION_RESOURCE
:
78 GetOwnImport().GetProgressBarHelper()->Increment( PROGRESS_BAR_STEP
);
79 pContext
= new OXMLConnectionResource( GetOwnImport(), nPrefix
, rLocalName
,xAttrList
);
82 case XML_TOK_COMPOUND_DATABASE
:
86 OSL_FAIL("Not supported yet!");
92 pContext
= new SvXMLImportContext( GetImport(), nPrefix
, rLocalName
);
97 ODBFilter
& OXMLConnectionData::GetOwnImport()
99 return static_cast<ODBFilter
&>(GetImport());
102 } // namespace dbaxml
104 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */