LibreOffice Module connectivity (master) 1
NDriver.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 <sal/config.h>
23
24#include <string_view>
25
26#include <com/sun/star/sdbc/XDriver.hpp>
27#include <com/sun/star/lang/XServiceInfo.hpp>
30
31inline constexpr OUStringLiteral EVOAB_DRIVER_IMPL_NAME = u"com.sun.star.comp.sdbc.evoab.OEvoabDriver";
32
33namespace connectivity::evoab
34 {
35 typedef ::cppu::WeakComponentImplHelper< css::sdbc::XDriver,
36 css::lang::XServiceInfo > ODriver_BASE;
37
38
39 class OEvoabDriver final : public ODriver_BASE
40 {
41 ::osl::Mutex m_aMutex;
43 css::uno::Reference< css::uno::XComponentContext > m_xContext;
44
45 public:
46 explicit OEvoabDriver(const css::uno::Reference< css::uno::XComponentContext >& );
47 virtual ~OEvoabDriver() override;
48
49 // OComponentHelper
50 virtual void SAL_CALL disposing() override;
51
52 // XServiceInfo
53 virtual OUString SAL_CALL getImplementationName( ) override;
54 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
55 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override;
56
57
58 // XDriver
59 virtual css::uno::Reference< css::sdbc::XConnection > SAL_CALL connect( const OUString& url, const css::uno::Sequence< css::beans::PropertyValue >& info ) override;
60 virtual sal_Bool SAL_CALL acceptsURL( const OUString& url ) override;
61 virtual css::uno::Sequence< css::sdbc::DriverPropertyInfo > SAL_CALL getPropertyInfo( const OUString& url, const css::uno::Sequence< css::beans::PropertyValue >& info ) override;
62 virtual sal_Int32 SAL_CALL getMajorVersion( ) override;
63 virtual sal_Int32 SAL_CALL getMinorVersion( ) override;
64
65 public:
66 const css::uno::Reference< css::uno::XComponentContext >& getComponentContext( ) const { return m_xContext; }
67
68 // static methods
69 static bool acceptsURL_Stat( std::u16string_view url );
70 };
71}
72
73
74/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
constexpr OUStringLiteral EVOAB_DRIVER_IMPL_NAME
Definition: NDriver.hxx:31
css::uno::Reference< css::uno::XComponentContext > m_xContext
Definition: NDriver.hxx:43
virtual css::uno::Reference< css::sdbc::XConnection > SAL_CALL connect(const OUString &url, const css::uno::Sequence< css::beans::PropertyValue > &info) override
Definition: NDriver.cxx:98
OEvoabDriver(const css::uno::Reference< css::uno::XComponentContext > &)
Definition: NDriver.cxx:40
virtual sal_Int32 SAL_CALL getMajorVersion() override
Definition: NDriver.cxx:134
virtual css::uno::Sequence< css::sdbc::DriverPropertyInfo > SAL_CALL getPropertyInfo(const OUString &url, const css::uno::Sequence< css::beans::PropertyValue > &info) override
Definition: NDriver.cxx:120
static bool acceptsURL_Stat(std::u16string_view url)
Definition: NDriver.cxx:144
connectivity::OWeakRefArray m_xConnections
Definition: NDriver.hxx:42
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: NDriver.cxx:85
const css::uno::Reference< css::uno::XComponentContext > & getComponentContext() const
Definition: NDriver.hxx:66
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: NDriver.cxx:90
virtual ~OEvoabDriver() override
Definition: NDriver.cxx:45
virtual void SAL_CALL disposing() override
Definition: NDriver.cxx:49
virtual sal_Bool SAL_CALL acceptsURL(const OUString &url) override
Definition: NDriver.cxx:114
virtual sal_Int32 SAL_CALL getMinorVersion() override
Definition: NDriver.cxx:139
virtual OUString SAL_CALL getImplementationName() override
Definition: NDriver.cxx:78
float u
::cppu::WeakComponentImplHelper< css::sdbc::XDriver, css::lang::XServiceInfo > ODriver_BASE
Definition: NDriver.hxx:36
std::vector< css::uno::WeakReferenceHelper > OWeakRefArray
Definition: CommonTools.hxx:53
unsigned char sal_Bool