bump product version to 4.1.6.2
[LibreOffice.git] / include / connectivity / DriversConfig.hxx
blob69c28cacbb02351b339d0bad0dfbea8f11bc1a58
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 .
19 #ifndef CONNECTIVITY_DRIVERSCONFIG_HXX_INCLUDED
20 #define CONNECTIVITY_DRIVERSCONFIG_HXX_INCLUDED
22 #include <comphelper/stl_types.hxx>
23 #include <com/sun/star/beans/NamedValue.hpp>
24 #include <com/sun/star/uno/Sequence.h>
25 #include "connectivity/dbtoolsdllapi.hxx"
26 #include <salhelper/singletonref.hxx>
27 #include <comphelper/namedvaluecollection.hxx>
28 #include <unotools/confignode.hxx>
30 namespace connectivity
32 typedef struct
34 ::comphelper::NamedValueCollection aProperties;
35 ::comphelper::NamedValueCollection aFeatures;
36 ::comphelper::NamedValueCollection aMetaData;
37 OUString sDriverFactory;
38 OUString sDriverTypeDisplayName;
39 } TInstalledDriver;
40 DECLARE_STL_USTRINGACCESS_MAP( TInstalledDriver, TInstalledDrivers);
42 class DriversConfigImpl
44 mutable ::utl::OConfigurationTreeRoot m_aInstalled;
45 mutable TInstalledDrivers m_aDrivers;
46 void Load(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxORB) const;
47 public:
48 DriversConfigImpl();
50 const TInstalledDrivers& getInstalledDrivers(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxORB) const { Load(_rxORB); return m_aDrivers; }
53 // Allows to access all driver which are located in the configuration
55 class OOO_DLLPUBLIC_DBTOOLS DriversConfig
57 typedef salhelper::SingletonRef<DriversConfigImpl> OSharedConfigNode;
59 const ::comphelper::NamedValueCollection& impl_get(const OUString& _sURL,sal_Int32 _nProps) const;
60 public:
61 DriversConfig(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxORB);
62 ~DriversConfig();
64 DriversConfig( const DriversConfig& );
65 DriversConfig& operator=( const DriversConfig& );
67 OUString getDriverFactoryName(const OUString& _sUrl) const;
68 OUString getDriverTypeDisplayName(const OUString& _sUrl) const;
69 const ::comphelper::NamedValueCollection& getProperties(const OUString& _sURL) const;
70 const ::comphelper::NamedValueCollection& getFeatures(const OUString& _sURL) const;
71 const ::comphelper::NamedValueCollection& getMetaData(const OUString& _sURL) const;
72 ::com::sun::star::uno::Sequence< OUString > getURLs() const;
73 private:
74 OSharedConfigNode m_aNode;
75 ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xORB;
78 #endif // CONNECTIVITY_DRIVERSCONFIG_HXX_INCLUDED
80 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */