LibreOffice Module connectivity (master) 1
ADriver.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/sdbcx/XDataDefinitionSupplier.hpp>
24#include <com/sun/star/lang/XServiceInfo.hpp>
27
28namespace com::sun::star::uno { class XComponentContext; }
29
30namespace connectivity::ado
31{
32 typedef ::cppu::WeakComponentImplHelper< css::sdbc::XDriver,
33 css::sdbcx::XDataDefinitionSupplier,
34 css::lang::XServiceInfo
36 class ODriver : public ODriver_BASE
37 {
38 ::osl::Mutex m_aMutex;
39
40 connectivity::OWeakRefArray m_xConnections; // vector containing a list
41 // of all the Connection objects
42 // for this Driver
43 css::uno::Reference< css::uno::XComponentContext > m_xContext;
44
45 // to put back all the inits with COINIT_MULTITHREADED if needed
47
48 public:
49 ODriver(const css::uno::Reference< css::uno::XComponentContext >& xContext);
50 ~ODriver() override;
51
52 // OComponentHelper
53 virtual void SAL_CALL disposing() override;
54
55 css::uno::Reference< css::uno::XComponentContext > getContext() const { return m_xContext; }
56
57 private:
58 void impl_checkURL_throw(const OUString& _sUrl);
59
60 // XServiceInfo
61 virtual OUString SAL_CALL getImplementationName( ) override;
62 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
63 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override;
64
65 // XDriver
66 virtual css::uno::Reference< css::sdbc::XConnection > SAL_CALL connect( const OUString& url, const css::uno::Sequence< css::beans::PropertyValue >& info ) override;
67 virtual sal_Bool SAL_CALL acceptsURL( const OUString& url ) override;
68 virtual css::uno::Sequence< css::sdbc::DriverPropertyInfo > SAL_CALL getPropertyInfo( const OUString& url, const css::uno::Sequence< css::beans::PropertyValue >& info ) override;
69 virtual sal_Int32 SAL_CALL getMajorVersion( ) override;
70 virtual sal_Int32 SAL_CALL getMinorVersion( ) override;
71
72 // XDataDefinitionSupplier
73 virtual css::uno::Reference< css::sdbcx::XTablesSupplier > SAL_CALL getDataDefinitionByConnection( const css::uno::Reference< css::sdbc::XConnection >& connection ) override;
74 virtual css::uno::Reference< css::sdbcx::XTablesSupplier > SAL_CALL getDataDefinitionByURL( const OUString& url, const css::uno::Sequence< css::beans::PropertyValue >& info ) override;
75 };
76
77}
78
79
80/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual sal_Int32 SAL_CALL getMajorVersion() override
Definition: ADriver.cxx:155
virtual css::uno::Reference< css::sdbcx::XTablesSupplier > SAL_CALL getDataDefinitionByConnection(const css::uno::Reference< css::sdbc::XConnection > &connection) override
Definition: ADriver.cxx:166
virtual css::uno::Reference< css::sdbc::XConnection > SAL_CALL connect(const OUString &url, const css::uno::Sequence< css::beans::PropertyValue > &info) override
virtual sal_Int32 SAL_CALL getMinorVersion() override
Definition: ADriver.cxx:160
css::uno::Reference< css::uno::XComponentContext > getContext() const
Definition: ADriver.hxx:55
virtual css::uno::Sequence< css::sdbc::DriverPropertyInfo > SAL_CALL getPropertyInfo(const OUString &url, const css::uno::Sequence< css::beans::PropertyValue > &info) override
virtual OUString SAL_CALL getImplementationName() override
Definition: ADriver.cxx:76
css::uno::Reference< css::uno::XComponentContext > m_xContext
Definition: ADriver.hxx:43
connectivity::OWeakRefArray m_xConnections
Definition: ADriver.hxx:40
ODriver(const css::uno::Reference< css::uno::XComponentContext > &xContext)
Definition: ADriver.cxx:46
virtual css::uno::Reference< css::sdbcx::XTablesSupplier > SAL_CALL getDataDefinitionByURL(const OUString &url, const css::uno::Sequence< css::beans::PropertyValue > &info) override
Definition: ADriver.cxx:200
virtual void SAL_CALL disposing() override
Definition: ADriver.cxx:59
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: ADriver.cxx:81
void impl_checkURL_throw(const OUString &_sUrl)
Definition: ADriver.cxx:110
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: ADriver.cxx:86
virtual sal_Bool SAL_CALL acceptsURL(const OUString &url) override
Definition: ADriver.cxx:105
::cppu::WeakComponentImplHelper< css::sdbc::XDriver, css::sdbcx::XDataDefinitionSupplier, css::lang::XServiceInfo > ODriver_BASE
Definition: ADriver.hxx:35
std::vector< css::uno::WeakReferenceHelper > OWeakRefArray
Definition: CommonTools.hxx:53
unsigned char sal_Bool