bump product version to 7.2.5.1
[LibreOffice.git] / connectivity / source / drivers / macab / MacabConnection.hxx
blobb18d4778e2dadc6c1de2651cf3dd30cfb93e6a39
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 <map>
23 #include <connectivity/CommonTools.hxx>
24 #include <com/sun/star/lang/XServiceInfo.hpp>
25 #include <com/sun/star/sdbc/SQLWarning.hpp>
26 #include <com/sun/star/sdbc/XWarningsSupplier.hpp>
27 #include <com/sun/star/sdbc/XConnection.hpp>
28 #include <com/sun/star/sdbcx/XTablesSupplier.hpp>
29 #include <cppuhelper/compbase.hxx>
30 #include <TConnection.hxx>
32 namespace connectivity::macab
35 typedef ::cppu::WeakComponentImplHelper<css::sdbc::XConnection,
36 css::sdbc::XWarningsSupplier,
37 css::lang::XServiceInfo
38 > OMetaConnection_BASE;
40 class MacabDriver;
41 class MacabAddressBook;
43 typedef std::vector< css::uno::WeakReferenceHelper > OWeakRefArray;
45 typedef connectivity::OMetaConnection MacabConnection_BASE;
47 class MacabConnection : public MacabConnection_BASE
49 protected:
51 // Data attributes
53 MacabAddressBook* m_pAddressBook; // the address book
54 MacabDriver* m_pDriver; // pointer to the owning driver object
55 css::uno::Reference< css::sdbcx::XTablesSupplier>
56 m_xCatalog; // needed for the SQL interpreter
58 private:
59 bool doIsClosed();
61 void doClose();
63 public:
64 /// @throws css::sdbc::SQLException
65 virtual void construct( const OUString& url,const css::uno::Sequence< css::beans::PropertyValue >& info);
67 explicit MacabConnection(MacabDriver* _pDriver);
68 virtual ~MacabConnection() override;
70 // OComponentHelper
71 virtual void SAL_CALL disposing() override;
73 // XServiceInfo
74 DECLARE_SERVICE_INFO();
76 // XConnection
77 virtual css::uno::Reference< css::sdbc::XStatement > SAL_CALL createStatement( ) override;
78 virtual css::uno::Reference< css::sdbc::XPreparedStatement > SAL_CALL prepareStatement( const OUString& sql ) override;
79 virtual css::uno::Reference< css::sdbc::XPreparedStatement > SAL_CALL prepareCall( const OUString& sql ) override;
80 virtual OUString SAL_CALL nativeSQL( const OUString& sql ) override;
81 virtual void SAL_CALL setAutoCommit( sal_Bool autoCommit ) override;
82 virtual sal_Bool SAL_CALL getAutoCommit( ) override;
83 virtual void SAL_CALL commit( ) override;
84 virtual void SAL_CALL rollback( ) override;
85 virtual sal_Bool SAL_CALL isClosed( ) override;
86 virtual css::uno::Reference< css::sdbc::XDatabaseMetaData > SAL_CALL getMetaData( ) override;
87 virtual void SAL_CALL setReadOnly( sal_Bool readOnly ) override;
88 virtual sal_Bool SAL_CALL isReadOnly( ) override;
89 virtual void SAL_CALL setCatalog( const OUString& catalog ) override;
90 virtual OUString SAL_CALL getCatalog( ) override;
91 virtual void SAL_CALL setTransactionIsolation( sal_Int32 level ) override;
92 virtual sal_Int32 SAL_CALL getTransactionIsolation( ) override;
93 virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getTypeMap( ) override;
94 virtual void SAL_CALL setTypeMap( const css::uno::Reference< css::container::XNameAccess >& typeMap ) override;
96 // XCloseable
97 virtual void SAL_CALL close( ) override;
99 // XWarningsSupplier
100 virtual css::uno::Any SAL_CALL getWarnings( ) override;
101 virtual void SAL_CALL clearWarnings( ) override;
103 // needed for the SQL interpreter
104 css::uno::Reference< css::sdbcx::XTablesSupplier > createCatalog();
106 // accessors
107 MacabDriver* getDriver() const { return m_pDriver;}
108 MacabAddressBook* getAddressBook() const;
112 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */