Version 6.4.0.3, tag libreoffice-6.4.0.3
[LibreOffice.git] / connectivity / source / inc / odbc / ODriver.hxx
blob6172cd01aa890e180a4df047a9df2666f6451866
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 .
20 #ifndef INCLUDED_CONNECTIVITY_SOURCE_INC_ODBC_ODRIVER_HXX
21 #define INCLUDED_CONNECTIVITY_SOURCE_INC_ODBC_ODRIVER_HXX
23 #include <com/sun/star/sdbc/XDriver.hpp>
24 #include <com/sun/star/lang/XServiceInfo.hpp>
25 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
26 #include <cppuhelper/compbase.hxx>
27 #include <connectivity/odbc.hxx>
28 #include <odbc/odbcbasedllapi.hxx>
29 #include <connectivity/CommonTools.hxx>
30 #include <osl/module.h>
31 #include <odbc/OTools.hxx>
33 namespace connectivity
35 namespace odbc
37 typedef ::cppu::WeakComponentImplHelper< css::sdbc::XDriver, css::lang::XServiceInfo > ODriver_BASE;
39 class OOO_DLLPUBLIC_ODBCBASE SAL_NO_VTABLE ODBCDriver : public ODriver_BASE
41 protected:
42 ::osl::Mutex m_aMutex;
44 connectivity::OWeakRefArray m_xConnections; // vector containing a list
45 // of all the Connection objects
46 // for this Driver
48 css::uno::Reference< css::lang::XMultiServiceFactory > m_xORB;
49 SQLHANDLE m_pDriverHandle;
51 virtual SQLHANDLE EnvironmentHandle(OUString &_rPath) = 0;
53 public:
55 ODBCDriver(const css::uno::Reference< css::lang::XMultiServiceFactory >& _rxFactory);
57 // only possibility to get the odbc functions
58 virtual oslGenericFunction getOdbcFunction(ODBC3SQLFunctionId _nIndex) const = 0;
59 // OComponentHelper
60 virtual void SAL_CALL disposing() override;
61 // XInterface
62 /// @throws css::uno::RuntimeException
63 static OUString getImplementationName_Static( );
64 /// @throws css::uno::RuntimeException
65 static css::uno::Sequence< OUString > getSupportedServiceNames_Static( );
67 // XServiceInfo
68 virtual OUString SAL_CALL getImplementationName( ) override;
69 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
70 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override;
72 // XDriver
73 virtual css::uno::Reference< css::sdbc::XConnection > SAL_CALL connect( const OUString& url, const css::uno::Sequence< css::beans::PropertyValue >& info ) override;
74 virtual sal_Bool SAL_CALL acceptsURL( const OUString& url ) override;
75 virtual css::uno::Sequence< css::sdbc::DriverPropertyInfo > SAL_CALL getPropertyInfo( const OUString& url, const css::uno::Sequence< css::beans::PropertyValue >& info ) override;
76 virtual sal_Int32 SAL_CALL getMajorVersion( ) override;
77 virtual sal_Int32 SAL_CALL getMinorVersion( ) override;
79 const css::uno::Reference< css::lang::XMultiServiceFactory >& getORB() const { return m_xORB; }
84 #endif // INCLUDED_CONNECTIVITY_SOURCE_INC_ODBC_ODRIVER_HXX
87 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */