LibreOffice Module connectivity (master) 1
mysqlc_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#pragma once
20
21#include "mysqlc_connection.hxx"
22
23#include <com/sun/star/sdbc/XDriver.hpp>
24#include <com/sun/star/lang/XMultiServiceFactory.hpp>
25#include <com/sun/star/sdbcx/XDataDefinitionSupplier.hpp>
27
29{
30using css::uno::Reference;
31using css::uno::Sequence;
32
33Reference<css::uno::XInterface>
34MysqlCDriver_CreateInstance(const Reference<css::lang::XMultiServiceFactory>& _rxFactory);
35
36typedef ::cppu::WeakComponentImplHelper<css::sdbc::XDriver, css::sdbcx::XDataDefinitionSupplier,
37 css::lang::XServiceInfo>
39
40typedef void* (*OMysqlCConnection_CreateInstanceFunction)(void* _pDriver);
41
43{
44protected:
45 Reference<css::lang::XMultiServiceFactory> m_xFactory;
46 ::osl::Mutex m_aMutex; // mutex is need to control member access
47 OWeakRefArray m_xConnections; // vector containing a list
48 // of all the Connection objects
49 // for this Driver
50public:
51 explicit MysqlCDriver(const Reference<css::lang::XMultiServiceFactory>& _rxFactory);
52
53 // OComponentHelper
54 void SAL_CALL disposing() override;
55 // XInterface
56 static OUString getImplementationName_Static();
57 static Sequence<OUString> getSupportedServiceNames_Static();
58
59 // XServiceInfo
60 OUString SAL_CALL getImplementationName() override;
61 sal_Bool SAL_CALL supportsService(const OUString& ServiceName) override;
62 Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
63
64 // XDriver
65 Reference<css::sdbc::XConnection> SAL_CALL
66 connect(const OUString& url, const Sequence<css::beans::PropertyValue>& info) override;
67
68 sal_Bool SAL_CALL acceptsURL(const OUString& url) override;
69 Sequence<css::sdbc::DriverPropertyInfo> SAL_CALL
70 getPropertyInfo(const OUString& url, const Sequence<css::beans::PropertyValue>& info) override;
71
72 sal_Int32 SAL_CALL getMajorVersion() override;
73 sal_Int32 SAL_CALL getMinorVersion() override;
74
75 const Reference<css::lang::XMultiServiceFactory>& getFactory() const { return m_xFactory; }
76
77 static rtl_TextEncoding getDefaultEncoding() { return RTL_TEXTENCODING_UTF8; }
78
79 // XDataDefinitionSupplier
80 virtual css::uno::Reference<css::sdbcx::XTablesSupplier> SAL_CALL getDataDefinitionByConnection(
81 const css::uno::Reference<css::sdbc::XConnection>& rxConnection) override;
82 virtual css::uno::Reference<css::sdbcx::XTablesSupplier> SAL_CALL getDataDefinitionByURL(
83 const OUString& rsURL, const css::uno::Sequence<css::beans::PropertyValue>& rInfo) override;
84};
85
86} /* connectivity::mysqlc */
87
88/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
OUString SAL_CALL getImplementationName() override
static OUString getImplementationName_Static()
static Sequence< OUString > getSupportedServiceNames_Static()
static rtl_TextEncoding getDefaultEncoding()
virtual css::uno::Reference< css::sdbcx::XTablesSupplier > SAL_CALL getDataDefinitionByConnection(const css::uno::Reference< css::sdbc::XConnection > &rxConnection) override
virtual css::uno::Reference< css::sdbcx::XTablesSupplier > SAL_CALL getDataDefinitionByURL(const OUString &rsURL, const css::uno::Sequence< css::beans::PropertyValue > &rInfo) override
Reference< css::sdbc::XConnection > SAL_CALL connect(const OUString &url, const Sequence< css::beans::PropertyValue > &info) override
Sequence< OUString > SAL_CALL getSupportedServiceNames() override
sal_Bool SAL_CALL acceptsURL(const OUString &url) override
MysqlCDriver(const Reference< css::lang::XMultiServiceFactory > &_rxFactory)
const Reference< css::lang::XMultiServiceFactory > & getFactory() const
sal_Int32 SAL_CALL getMajorVersion() override
Sequence< css::sdbc::DriverPropertyInfo > SAL_CALL getPropertyInfo(const OUString &url, const Sequence< css::beans::PropertyValue > &info) override
void SAL_CALL disposing() override
sal_Int32 SAL_CALL getMinorVersion() override
Reference< css::lang::XMultiServiceFactory > m_xFactory
sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
::cppu::WeakComponentImplHelper< css::sdbc::XDriver, css::sdbcx::XDataDefinitionSupplier, css::lang::XServiceInfo > ODriver_BASE
std::vector< css::uno::WeakReferenceHelper > OWeakRefArray
Reference< XInterface > MysqlCDriver_CreateInstance(const Reference< XMultiServiceFactory > &_rxFactory)
unsigned char sal_Bool