LibreOffice Module connectivity (master) 1
MacabConnection.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
23#include <com/sun/star/lang/XServiceInfo.hpp>
24#include <com/sun/star/sdbc/XWarningsSupplier.hpp>
25#include <com/sun/star/sdbc/XConnection.hpp>
26#include <com/sun/star/sdbcx/XTablesSupplier.hpp>
28#include <TConnection.hxx>
29
30namespace connectivity::macab
31{
32
33 typedef ::cppu::WeakComponentImplHelper<css::sdbc::XConnection,
34 css::sdbc::XWarningsSupplier,
35 css::lang::XServiceInfo
37
38 class MacabDriver;
39 class MacabAddressBook;
40
41 typedef std::vector< css::uno::WeakReferenceHelper > OWeakRefArray;
42
44
46 {
47 protected:
48
49 // Data attributes
50
51 MacabAddressBook* m_pAddressBook; // the address book
52 MacabDriver* m_pDriver; // pointer to the owning driver object
53 css::uno::Reference< css::sdbcx::XTablesSupplier>
54 m_xCatalog; // needed for the SQL interpreter
55
56 private:
57 bool doIsClosed();
58
59 void doClose();
60
61 public:
63 virtual void construct( const OUString& url,const css::uno::Sequence< css::beans::PropertyValue >& info);
64
65 explicit MacabConnection(MacabDriver* _pDriver);
66 virtual ~MacabConnection() override;
67
68 // OComponentHelper
69 virtual void SAL_CALL disposing() override;
70
71 // XServiceInfo
73
74 // XConnection
75 virtual css::uno::Reference< css::sdbc::XStatement > SAL_CALL createStatement( ) override;
76 virtual css::uno::Reference< css::sdbc::XPreparedStatement > SAL_CALL prepareStatement( const OUString& sql ) override;
77 virtual css::uno::Reference< css::sdbc::XPreparedStatement > SAL_CALL prepareCall( const OUString& sql ) override;
78 virtual OUString SAL_CALL nativeSQL( const OUString& sql ) override;
79 virtual void SAL_CALL setAutoCommit( sal_Bool autoCommit ) override;
80 virtual sal_Bool SAL_CALL getAutoCommit( ) override;
81 virtual void SAL_CALL commit( ) override;
82 virtual void SAL_CALL rollback( ) override;
83 virtual sal_Bool SAL_CALL isClosed( ) override;
84 virtual css::uno::Reference< css::sdbc::XDatabaseMetaData > SAL_CALL getMetaData( ) override;
85 virtual void SAL_CALL setReadOnly( sal_Bool readOnly ) override;
86 virtual sal_Bool SAL_CALL isReadOnly( ) override;
87 virtual void SAL_CALL setCatalog( const OUString& catalog ) override;
88 virtual OUString SAL_CALL getCatalog( ) override;
89 virtual void SAL_CALL setTransactionIsolation( sal_Int32 level ) override;
90 virtual sal_Int32 SAL_CALL getTransactionIsolation( ) override;
91 virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getTypeMap( ) override;
92 virtual void SAL_CALL setTypeMap( const css::uno::Reference< css::container::XNameAccess >& typeMap ) override;
93
94 // XCloseable
95 virtual void SAL_CALL close( ) override;
96
97 // XWarningsSupplier
98 virtual css::uno::Any SAL_CALL getWarnings( ) override;
99 virtual void SAL_CALL clearWarnings( ) override;
100
101 // needed for the SQL interpreter
102 css::uno::Reference< css::sdbcx::XTablesSupplier > createCatalog();
103
104 // accessors
105 MacabDriver* getDriver() const { return m_pDriver;}
107 };
108}
109
110/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void SAL_CALL close() override
virtual void SAL_CALL setAutoCommit(sal_Bool autoCommit) override
virtual OUString SAL_CALL nativeSQL(const OUString &sql) override
MacabConnection(MacabDriver *_pDriver)
virtual void construct(const OUString &url, const css::uno::Sequence< css::beans::PropertyValue > &info)
virtual void SAL_CALL disposing() override
virtual sal_Bool SAL_CALL isReadOnly() override
virtual css::uno::Reference< css::sdbc::XPreparedStatement > SAL_CALL prepareCall(const OUString &sql) override
virtual css::uno::Any SAL_CALL getWarnings() override
virtual sal_Int32 SAL_CALL getTransactionIsolation() override
virtual void SAL_CALL clearWarnings() override
virtual void SAL_CALL setReadOnly(sal_Bool readOnly) override
virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getTypeMap() override
virtual void SAL_CALL setTransactionIsolation(sal_Int32 level) override
virtual sal_Bool SAL_CALL isClosed() override
css::uno::Reference< css::sdbcx::XTablesSupplier > m_xCatalog
virtual css::uno::Reference< css::sdbc::XPreparedStatement > SAL_CALL prepareStatement(const OUString &sql) override
virtual void SAL_CALL setCatalog(const OUString &catalog) override
virtual css::uno::Reference< css::sdbc::XStatement > SAL_CALL createStatement() override
virtual sal_Bool SAL_CALL getAutoCommit() override
MacabAddressBook * getAddressBook() const
virtual css::uno::Reference< css::sdbc::XDatabaseMetaData > SAL_CALL getMetaData() override
virtual void SAL_CALL commit() override
virtual OUString SAL_CALL getCatalog() override
virtual void SAL_CALL setTypeMap(const css::uno::Reference< css::container::XNameAccess > &typeMap) override
css::uno::Reference< css::sdbcx::XTablesSupplier > createCatalog()
virtual void SAL_CALL rollback() override
std::vector< css::uno::WeakReferenceHelper > OWeakRefArray
::cppu::WeakComponentImplHelper< css::sdbc::XConnection, css::sdbc::XWarningsSupplier, css::lang::XServiceInfo > OMetaConnection_BASE
connectivity::OMetaConnection MacabConnection_BASE
unsigned char sal_Bool