LibreOffice Module connectivity (master) 1
drivers/firebird/Driver.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
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 "Connection.hxx"
23
24#include <com/sun/star/lang/XServiceInfo.hpp>
25#include <com/sun/star/lang/XMultiServiceFactory.hpp>
26#include <com/sun/star/sdbc/XDriver.hpp>
27#include <com/sun/star/sdbcx/XDataDefinitionSupplier.hpp>
29#include <unotools/tempfile.hxx>
30
32 {
33 // The SQL dialect in use
34 // Has to be used in various isc_* calls.
35 // 3: Is IB6 -- minimum required for delimited identifiers.
36 // SQL_DIALECT_V6 = 3, it's the last current version
37 // SQL_DIALECT_CURRENT is an alias for SQL_DIALECT_V6
38 // See src/dsql/sqlda_pub.h for full details
39
40 typedef ::cppu::WeakComponentImplHelper< css::sdbc::XDriver,
41 css::sdbcx::XDataDefinitionSupplier,
42 css::lang::XServiceInfo > ODriver_BASE;
43
45 {
46 private:
47 css::uno::Reference<css::uno::XComponentContext> m_aContext;
50
51 protected:
52 ::osl::Mutex m_aMutex; // mutex is need to control member access
53 OWeakRefArray m_xConnections; // vector containing a list
54 // of all the Connection objects
55 // for this Driver
56
57 public:
58
59 explicit FirebirdDriver(const css::uno::Reference< css::uno::XComponentContext >& _rxContext);
60 virtual ~FirebirdDriver() override;
61 const css::uno::Reference<css::uno::XComponentContext>& getContext() const { return m_aContext; }
62
63 // OComponentHelper
64 virtual void SAL_CALL disposing() override;
65
66 // XServiceInfo
67 virtual OUString SAL_CALL getImplementationName( ) override;
68 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
69 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override;
70
71 // XDriver
72 virtual css::uno::Reference< css::sdbc::XConnection > SAL_CALL connect( const OUString& url, const css::uno::Sequence< css::beans::PropertyValue >& info ) override;
73 virtual sal_Bool SAL_CALL acceptsURL( const OUString& url ) override;
74 virtual css::uno::Sequence< css::sdbc::DriverPropertyInfo > SAL_CALL getPropertyInfo( const OUString& url, const css::uno::Sequence< css::beans::PropertyValue >& info ) override;
75 virtual sal_Int32 SAL_CALL getMajorVersion( ) override;
76 virtual sal_Int32 SAL_CALL getMinorVersion( ) override;
77
78 // XDataDefinitionSupplier
79 virtual css::uno::Reference< css::sdbcx::XTablesSupplier >
81 const css::uno::Reference< css::sdbc::XConnection >& rxConnection) override;
82 virtual css::uno::Reference< css::sdbcx::XTablesSupplier >
84 const OUString& rsURL,
85 const css::uno::Sequence< css::beans::PropertyValue >& rInfo) override;
86 };
87
88}
89
90/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
virtual css::uno::Sequence< css::sdbc::DriverPropertyInfo > SAL_CALL getPropertyInfo(const OUString &url, const css::uno::Sequence< css::beans::PropertyValue > &info) override
Definition: Driver.cxx:164
const css::uno::Reference< css::uno::XComponentContext > & getContext() const
virtual OUString SAL_CALL getImplementationName() override
Definition: Driver.cxx:123
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: Driver.cxx:133
virtual void SAL_CALL disposing() override
Definition: Driver.cxx:96
virtual css::uno::Reference< css::sdbc::XConnection > SAL_CALL connect(const OUString &url, const css::uno::Sequence< css::beans::PropertyValue > &info) override
Definition: Driver.cxx:139
virtual css::uno::Reference< css::sdbcx::XTablesSupplier > SAL_CALL getDataDefinitionByURL(const OUString &rsURL, const css::uno::Sequence< css::beans::PropertyValue > &rInfo) override
Definition: Driver.cxx:198
virtual sal_Bool SAL_CALL acceptsURL(const OUString &url) override
Definition: Driver.cxx:159
FirebirdDriver(const css::uno::Reference< css::uno::XComponentContext > &_rxContext)
Definition: Driver.cxx:56
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: Driver.cxx:128
virtual sal_Int32 SAL_CALL getMajorVersion() override
Definition: Driver.cxx:177
virtual css::uno::Reference< css::sdbcx::XTablesSupplier > SAL_CALL getDataDefinitionByConnection(const css::uno::Reference< css::sdbc::XConnection > &rxConnection) override
Definition: Driver.cxx:190
virtual sal_Int32 SAL_CALL getMinorVersion() override
Definition: Driver.cxx:184
css::uno::Reference< css::uno::XComponentContext > m_aContext
::cppu::WeakComponentImplHelper< css::sdbc::XDriver, css::sdbcx::XDataDefinitionSupplier, css::lang::XServiceInfo > ODriver_BASE
std::vector< css::uno::WeakReferenceHelper > OWeakRefArray
unsigned char sal_Bool