Use COMReference to handle COM pointers in CreateShortcut
[LibreOffice.git] / connectivity / source / drivers / firebird / Driver.hxx
blobd884b5008d6a95adc8ceb6970c33a3ea761817c2
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.
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 #pragma once
22 #include "Connection.hxx"
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>
28 #include <cppuhelper/compbase.hxx>
29 #include <unotools/tempfile.hxx>
31 namespace connectivity::firebird
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
40 typedef ::cppu::WeakComponentImplHelper< css::sdbc::XDriver,
41 css::sdbcx::XDataDefinitionSupplier,
42 css::lang::XServiceInfo > ODriver_BASE;
44 class FirebirdDriver : public ODriver_BASE
46 private:
47 css::uno::Reference<css::uno::XComponentContext> m_aContext;
48 ::utl::TempFileNamed m_firebirdTMPDirectory;
49 ::utl::TempFileNamed m_firebirdLockDirectory;
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
57 public:
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; }
63 // OComponentHelper
64 virtual void SAL_CALL disposing() override;
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;
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;
78 // XDataDefinitionSupplier
79 virtual css::uno::Reference< css::sdbcx::XTablesSupplier >
80 SAL_CALL getDataDefinitionByConnection(
81 const css::uno::Reference< css::sdbc::XConnection >& rxConnection) override;
82 virtual css::uno::Reference< css::sdbcx::XTablesSupplier >
83 SAL_CALL getDataDefinitionByURL(
84 const OUString& rsURL,
85 const css::uno::Sequence< css::beans::PropertyValue >& rInfo) override;
90 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */