build fix
[LibreOffice.git] / connectivity / source / drivers / mork / MConnection.hxx
blob0e517daafc558bfe0ee0d44b3280aeb839936380
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/.
8 */
10 #ifndef INCLUDED_CONNECTIVITY_SOURCE_DRIVERS_MORK_MCONNECTION_HXX
11 #define INCLUDED_CONNECTIVITY_SOURCE_DRIVERS_MORK_MCONNECTION_HXX
13 #include <connectivity/OSubComponent.hxx>
14 #include "TConnection.hxx"
15 #include "MColumnAlias.hxx"
17 #include <com/sun/star/sdbcx/XTablesSupplier.hpp>
19 // do we want here namespace too?
20 class MorkParser;
22 namespace connectivity
24 namespace mork
26 class MorkDriver;
27 class ErrorDescriptor;
29 typedef connectivity::OMetaConnection OConnection_BASE; // implements basics and text encoding
31 class OConnection : public OConnection_BASE,
32 public connectivity::OSubComponent<OConnection, OConnection_BASE>
34 friend class connectivity::OSubComponent<OConnection, OConnection_BASE>;
36 protected:
38 // Data attributes
40 rtl::Reference<MorkDriver> m_xDriver; // Pointer to the owning
41 // driver object
42 OColumnAlias m_aColumnAlias;
43 // Mork Parser (abook)
44 MorkParser* m_pBook;
45 // Mork Parser (history)
46 MorkParser* m_pHistory;
47 // Store Catalog
48 css::uno::Reference< css::sdbcx::XTablesSupplier> m_xCatalog;
50 public:
51 void construct( const OUString& url,const css::uno::Sequence< css::beans::PropertyValue >& info) throw(css::sdbc::SQLException);
52 explicit OConnection(MorkDriver* const driver);
53 virtual ~OConnection() override;
55 const rtl::Reference<MorkDriver>& getDriver() {return m_xDriver;};
56 MorkParser* getMorkParser(const OString& t) {return t == "CollectedAddressBook" ? m_pHistory : m_pBook;};
58 // OComponentHelper
59 virtual void SAL_CALL disposing() override;
60 // XInterface
61 virtual void SAL_CALL release() throw() override;
63 // XServiceInfo
64 DECLARE_SERVICE_INFO();
65 // XConnection
66 virtual css::uno::Reference< css::sdbc::XStatement > SAL_CALL createStatement( ) throw(css::sdbc::SQLException, css::uno::RuntimeException, std::exception) override;
67 virtual css::uno::Reference< css::sdbc::XPreparedStatement > SAL_CALL prepareStatement( const OUString& sql ) throw(css::sdbc::SQLException, css::uno::RuntimeException, std::exception) override;
68 virtual css::uno::Reference< css::sdbc::XPreparedStatement > SAL_CALL prepareCall( const OUString& sql ) throw(css::sdbc::SQLException, css::uno::RuntimeException, std::exception) override;
69 virtual OUString SAL_CALL nativeSQL( const OUString& sql ) throw(css::sdbc::SQLException, css::uno::RuntimeException, std::exception) override;
70 virtual void SAL_CALL setAutoCommit( sal_Bool autoCommit ) throw(css::sdbc::SQLException, css::uno::RuntimeException, std::exception) override;
71 virtual sal_Bool SAL_CALL getAutoCommit( ) throw(css::sdbc::SQLException, css::uno::RuntimeException, std::exception) override;
72 virtual void SAL_CALL commit( ) throw(css::sdbc::SQLException, css::uno::RuntimeException, std::exception) override;
73 virtual void SAL_CALL rollback( ) throw(css::sdbc::SQLException, css::uno::RuntimeException, std::exception) override;
74 virtual sal_Bool SAL_CALL isClosed( ) throw(css::sdbc::SQLException, css::uno::RuntimeException, std::exception) override;
75 virtual css::uno::Reference< css::sdbc::XDatabaseMetaData > SAL_CALL getMetaData( ) throw(css::sdbc::SQLException, css::uno::RuntimeException, std::exception) override;
76 virtual void SAL_CALL setReadOnly( sal_Bool readOnly ) throw(css::sdbc::SQLException, css::uno::RuntimeException, std::exception) override;
77 virtual sal_Bool SAL_CALL isReadOnly( ) throw(css::sdbc::SQLException, css::uno::RuntimeException, std::exception) override;
78 virtual void SAL_CALL setCatalog( const OUString& catalog ) throw(css::sdbc::SQLException, css::uno::RuntimeException, std::exception) override;
79 virtual OUString SAL_CALL getCatalog( ) throw(css::sdbc::SQLException, css::uno::RuntimeException, std::exception) override;
80 virtual void SAL_CALL setTransactionIsolation( sal_Int32 level ) throw(css::sdbc::SQLException, css::uno::RuntimeException, std::exception) override;
81 virtual sal_Int32 SAL_CALL getTransactionIsolation( ) throw(css::sdbc::SQLException, css::uno::RuntimeException, std::exception) override;
82 virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getTypeMap( ) throw(css::sdbc::SQLException, css::uno::RuntimeException, std::exception) override;
83 virtual void SAL_CALL setTypeMap( const css::uno::Reference< css::container::XNameAccess >& typeMap ) throw(css::sdbc::SQLException, css::uno::RuntimeException, std::exception) override;
84 // XCloseable
85 virtual void SAL_CALL close( ) throw(css::sdbc::SQLException, css::uno::RuntimeException, std::exception) override;
86 // XWarningsSupplier
87 virtual css::uno::Any SAL_CALL getWarnings( ) throw(css::sdbc::SQLException, css::uno::RuntimeException, std::exception) override;
88 virtual void SAL_CALL clearWarnings() throw(css::sdbc::SQLException, css::uno::RuntimeException, std::exception) override;
90 const OColumnAlias & getColumnAlias() const { return m_aColumnAlias; }
92 static bool getForceLoadTables() {return true;}
94 // Added to enable me to use SQLInterpreter which requires an
95 // XNameAccess i/f to access tables.
96 css::uno::Reference< css::sdbcx::XTablesSupplier > SAL_CALL createCatalog();
98 void throwSQLException( const ErrorDescriptor& _rError, const css::uno::Reference< css::uno::XInterface >& _rxContext );
99 void throwSQLException( const sal_uInt16 _nErrorResourceId, const css::uno::Reference< css::uno::XInterface >& _rxContext );
103 #endif // INCLUDED_CONNECTIVITY_SOURCE_DRIVERS_MORK_MCONNECTION_HXX
105 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */