bump product version to 6.3.0.0.beta1
[LibreOffice.git] / include / connectivity / DriversConfig.hxx
bloba415f42cb6659fe33af9e21e653768bca69bb027
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 INCLUDED_CONNECTIVITY_DRIVERSCONFIG_HXX
20 #define INCLUDED_CONNECTIVITY_DRIVERSCONFIG_HXX
22 #include <sal/config.h>
24 #include <map>
26 #include <com/sun/star/uno/Sequence.h>
27 #include <connectivity/dbtoolsdllapi.hxx>
28 #include <salhelper/singletonref.hxx>
29 #include <comphelper/namedvaluecollection.hxx>
30 #include <unotools/confignode.hxx>
32 namespace connectivity
34 typedef struct
36 ::comphelper::NamedValueCollection aProperties;
37 ::comphelper::NamedValueCollection aFeatures;
38 ::comphelper::NamedValueCollection aMetaData;
39 OUString sDriverFactory;
40 OUString sDriverTypeDisplayName;
41 } TInstalledDriver;
42 typedef std::map<OUString, TInstalledDriver> TInstalledDrivers;
44 class DriversConfigImpl
46 mutable ::utl::OConfigurationTreeRoot m_aInstalled;
47 mutable TInstalledDrivers m_aDrivers;
48 public:
49 DriversConfigImpl();
51 const TInstalledDrivers& getInstalledDrivers(const css::uno::Reference< css::uno::XComponentContext >& _rxORB) const;
54 // Allows to access all driver which are located in the configuration
56 class OOO_DLLPUBLIC_DBTOOLS DriversConfig
58 typedef salhelper::SingletonRef<DriversConfigImpl> OSharedConfigNode;
60 const ::comphelper::NamedValueCollection& impl_get(const OUString& _sURL,sal_Int32 _nProps) const;
61 public:
62 DriversConfig(const css::uno::Reference< css::uno::XComponentContext >& _rxORB);
63 ~DriversConfig();
65 DriversConfig( const DriversConfig& );
66 DriversConfig& operator=( const DriversConfig& );
68 OUString getDriverFactoryName(const OUString& _sUrl) const;
69 OUString getDriverTypeDisplayName(const OUString& _sUrl) const;
70 const ::comphelper::NamedValueCollection& getProperties(const OUString& _sURL) const;
71 const ::comphelper::NamedValueCollection& getFeatures(const OUString& _sURL) const;
72 const ::comphelper::NamedValueCollection& getMetaData(const OUString& _sURL) const;
73 css::uno::Sequence< OUString > getURLs() const;
74 private:
75 OSharedConfigNode m_aNode;
76 css::uno::Reference< css::uno::XComponentContext > m_xORB;
79 #endif // INCLUDED_CONNECTIVITY_DRIVERSCONFIG_HXX
81 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */