bump product version to 6.3.0.0.beta1
[LibreOffice.git] / connectivity / source / drivers / postgresql / pq_driver.hxx
blobde41bc9ed38e2bbb06a050543c2282688c87d39c
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * Effective License of whole file:
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License version 2.1, as published by the Free Software Foundation.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
18 * MA 02111-1307 USA
20 * Parts "Copyright by Sun Microsystems, Inc" prior to August 2011:
22 * The Contents of this file are made available subject to the terms of
23 * the GNU Lesser General Public License Version 2.1
25 * Copyright: 2000 by Sun Microsystems, Inc.
27 * Contributor(s): Joerg Budischewski
29 * All parts contributed on or after August 2011:
31 * This Source Code Form is subject to the terms of the Mozilla Public
32 * License, v. 2.0. If a copy of the MPL was not distributed with this
33 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
35 ************************************************************************/
37 #ifndef INCLUDED_CONNECTIVITY_SOURCE_DRIVERS_POSTGRESQL_PQ_DRIVER_HXX
38 #define INCLUDED_CONNECTIVITY_SOURCE_DRIVERS_POSTGRESQL_PQ_DRIVER_HXX
40 #include <osl/mutex.hxx>
42 #include <cppuhelper/compbase.hxx>
44 #include <com/sun/star/lang/XServiceInfo.hpp>
46 #include <com/sun/star/sdbc/XDriver.hpp>
47 #include <com/sun/star/sdbcx/XDataDefinitionSupplier.hpp>
49 #include <com/sun/star/uno/XComponentContext.hpp>
51 namespace pq_sdbc_driver
54 #define MY_STRINGIFY( x ) #x
56 #define PQ_SDBC_DRIVER_VERSION MY_STRINGIFY(PQ_SDBC_MAJOR) "." \
57 MY_STRINGIFY(PQ_SDBC_MINOR) "." \
58 MY_STRINGIFY(PQ_SDBC_MICRO)
60 struct MutexHolder { osl::Mutex m_mutex; };
61 // use this to switch off sdbc support !
62 // typedef cppu::WeakComponentImplHelper<
63 // css::sdbc::XDriver,
64 // css::lang::XServiceInfo
65 // > DriverBase ;
66 typedef cppu::WeakComponentImplHelper<
67 css::sdbc::XDriver,
68 css::lang::XServiceInfo,
69 css::sdbcx::XDataDefinitionSupplier > DriverBase ;
70 class Driver : public MutexHolder, public DriverBase
72 css::uno::Reference< css::uno::XComponentContext > m_ctx;
73 css::uno::Reference< css::lang::XMultiComponentFactory > m_smgr;
75 public:
76 explicit Driver ( const css::uno::Reference < css::uno::XComponentContext > & ctx )
77 : DriverBase( m_mutex ),
78 m_ctx( ctx ),
79 m_smgr( ctx->getServiceManager() )
82 public: // XDriver
83 virtual css::uno::Reference< css::sdbc::XConnection > SAL_CALL connect(
84 const OUString& url,
85 const css::uno::Sequence< css::beans::PropertyValue >& info ) override;
87 virtual sal_Bool SAL_CALL acceptsURL( const OUString& url ) override;
89 virtual css::uno::Sequence< css::sdbc::DriverPropertyInfo > SAL_CALL getPropertyInfo(
90 const OUString& url,
91 const css::uno::Sequence< css::beans::PropertyValue >& info ) override;
93 virtual sal_Int32 SAL_CALL getMajorVersion( ) override;
94 virtual sal_Int32 SAL_CALL getMinorVersion( ) override;
96 public: // XServiceInfo
97 // XServiceInfo
98 virtual OUString SAL_CALL getImplementationName() override;
99 virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) override;
101 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
103 public: // XDataDefinitionSupplier
104 virtual css::uno::Reference< css::sdbcx::XTablesSupplier > SAL_CALL
105 getDataDefinitionByConnection(
106 const css::uno::Reference< css::sdbc::XConnection >& connection ) override;
107 virtual css::uno::Reference< css::sdbcx::XTablesSupplier > SAL_CALL
108 getDataDefinitionByURL(
109 const OUString& url,
110 const css::uno::Sequence< css::beans::PropertyValue >& info ) override;
112 // XComponent
113 virtual void SAL_CALL disposing() override;
120 #endif
122 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */