LibreOffice Module connectivity (master) 1
ODriver.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#pragma once
21
22#include <com/sun/star/sdbc/XDriver.hpp>
23#include <com/sun/star/lang/XServiceInfo.hpp>
24#include <com/sun/star/uno/XComponentContext.hpp>
26#include <connectivity/odbc.hxx>
29#include <osl/module.h>
30#include <odbc/OTools.hxx>
31
32namespace connectivity::odbc
33 {
34 typedef ::cppu::WeakComponentImplHelper< css::sdbc::XDriver, css::lang::XServiceInfo > ODriver_BASE;
35
37 {
38 protected:
39 ::osl::Mutex m_aMutex;
40
41 connectivity::OWeakRefArray m_xConnections; // vector containing a list
42 // of all the Connection objects
43 // for this Driver
44
45 css::uno::Reference< css::uno::XComponentContext > m_xContext;
46 SQLHANDLE m_pDriverHandle;
47
48 virtual SQLHANDLE EnvironmentHandle(OUString &_rPath) = 0;
49
50 public:
51
52 ODBCDriver(css::uno::Reference< css::uno::XComponentContext > xContext);
53
54 // only possibility to get the odbc functions
55 virtual oslGenericFunction getOdbcFunction(ODBC3SQLFunctionId _nIndex) const = 0;
56 // OComponentHelper
57 virtual void SAL_CALL disposing() override;
58
59 // XServiceInfo
60 virtual OUString SAL_CALL getImplementationName( ) override;
61 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
62 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override;
63
64 // XDriver
65 virtual css::uno::Reference< css::sdbc::XConnection > SAL_CALL connect( const OUString& url, const css::uno::Sequence< css::beans::PropertyValue >& info ) override;
66 virtual sal_Bool SAL_CALL acceptsURL( const OUString& url ) override;
67 virtual css::uno::Sequence< css::sdbc::DriverPropertyInfo > SAL_CALL getPropertyInfo( const OUString& url, const css::uno::Sequence< css::beans::PropertyValue >& info ) override;
68 virtual sal_Int32 SAL_CALL getMajorVersion( ) override;
69 virtual sal_Int32 SAL_CALL getMinorVersion( ) override;
70
71 const css::uno::Reference< css::uno::XComponentContext >& getContext() const { return m_xContext; }
72 };
73
74}
75
76
77/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
ODBC3SQLFunctionId
Definition: OTools.hxx:33
Reference< XComponentContext > m_xContext
virtual oslGenericFunction getOdbcFunction(ODBC3SQLFunctionId _nIndex) const =0
virtual SQLHANDLE EnvironmentHandle(OUString &_rPath)=0
css::uno::Reference< css::uno::XComponentContext > m_xContext
Definition: ODriver.hxx:45
connectivity::OWeakRefArray m_xConnections
Definition: ODriver.hxx:41
const css::uno::Reference< css::uno::XComponentContext > & getContext() const
Definition: ODriver.hxx:71
css::uno::Sequence< OUString > getSupportedServiceNames()
OUString getImplementationName()
::cppu::WeakComponentImplHelper< css::sdbc::XDriver, css::lang::XServiceInfo > ODriver_BASE
Definition: ODriver.hxx:34
std::vector< css::uno::WeakReferenceHelper > OWeakRefArray
Definition: CommonTools.hxx:53
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
#define OOO_DLLPUBLIC_ODBCBASE
#define SAL_NO_VTABLE
unsigned char sal_Bool