diff options
author | Andrzej J.R. Hunt <andrzej@ahunt.org> | 2013-08-08 18:04:18 +0100 |
---|---|---|
committer | Andrzej J.R. Hunt <andrzej@ahunt.org> | 2013-08-11 16:05:10 +0100 |
commit | 464a0b50008e7b6824edc28d56685b8e4fd3d632 (patch) | |
tree | ee04ff06044bb71e77ad7753be1ac0ad175a1dbd /connectivity | |
parent | 0c2b01f038b55d6410242e98067845ec6cda4b5a (diff) |
First chunk of skeleton sdbcx.Container. (firebird-sdbc)
Change-Id: Ic92c4d13b0ed9aba622d3a2459f9677d8cce3245
Diffstat (limited to 'connectivity')
-rw-r--r-- | connectivity/Library_firebird_sdbc.mk | 1 | ||||
-rw-r--r-- | connectivity/source/drivers/firebird/Connection.cxx | 11 | ||||
-rw-r--r-- | connectivity/source/drivers/firebird/Connection.hxx | 21 | ||||
-rw-r--r-- | connectivity/source/drivers/firebird/Tables.cxx | 58 | ||||
-rw-r--r-- | connectivity/source/drivers/firebird/Tables.hxx | 58 |
5 files changed, 142 insertions, 7 deletions
diff --git a/connectivity/Library_firebird_sdbc.mk b/connectivity/Library_firebird_sdbc.mk index 18937186fa4f..b00ba7bba539 100644 --- a/connectivity/Library_firebird_sdbc.mk +++ b/connectivity/Library_firebird_sdbc.mk @@ -47,6 +47,7 @@ $(eval $(call gb_Library_add_exception_objects,firebird_sdbc,\ connectivity/source/drivers/firebird/Services \ connectivity/source/drivers/firebird/Statement \ connectivity/source/drivers/firebird/StatementCommonBase \ + connectivity/source/drivers/firebird/Tables \ connectivity/source/drivers/firebird/Util \ )) diff --git a/connectivity/source/drivers/firebird/Connection.cxx b/connectivity/source/drivers/firebird/Connection.cxx index 0402581597bd..870e7b666629 100644 --- a/connectivity/source/drivers/firebird/Connection.cxx +++ b/connectivity/source/drivers/firebird/Connection.cxx @@ -22,9 +22,9 @@ #include "Driver.hxx" #include "PreparedStatement.hxx" #include "Statement.hxx" +#include "Tables.hxx" #include "Util.hxx" - #include <com/sun/star/document/XDocumentEventBroadcaster.hpp> #include <com/sun/star/embed/ElementModes.hpp> #include <com/sun/star/frame/Desktop.hpp> @@ -761,4 +761,13 @@ void OConnection::clearStatements() } m_aStatements.clear(); } + +//----- XTablesSupplier ------------------------------------------------------ +uno::Reference< XNameAccess > OConnection::getTables() + throw (RuntimeException) +{ + // TODO: IMPLEMENT ME PROPERLY + //return new Tables(); + return 0; +} /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/connectivity/source/drivers/firebird/Connection.hxx b/connectivity/source/drivers/firebird/Connection.hxx index 5e35b36e501d..361ce2324ff6 100644 --- a/connectivity/source/drivers/firebird/Connection.hxx +++ b/connectivity/source/drivers/firebird/Connection.hxx @@ -27,7 +27,7 @@ #include <connectivity/CommonTools.hxx> #include <connectivity/OSubComponent.hxx> -#include <cppuhelper/compbase4.hxx> +#include <cppuhelper/compbase5.hxx> #include <cppuhelper/weakref.hxx> #include <map> #include <OTypeInfo.hxx> @@ -42,17 +42,19 @@ #include <com/sun/star/sdbc/SQLWarning.hpp> #include <com/sun/star/sdbc/XConnection.hpp> #include <com/sun/star/sdbc/XWarningsSupplier.hpp> +#include <com/sun/star/sdbcx/XTablesSupplier.hpp> namespace connectivity { namespace firebird { - typedef ::cppu::WeakComponentImplHelper4< ::com::sun::star::sdbc::XConnection, - ::com::sun::star::sdbc::XWarningsSupplier, - ::com::sun::star::lang::XServiceInfo, - ::com::sun::star::document::XDocumentEventListener - > OConnection_BASE; + typedef ::cppu::WeakComponentImplHelper5< ::com::sun::star::document::XDocumentEventListener, + ::com::sun::star::lang::XServiceInfo, + ::com::sun::star::sdbc::XConnection, + ::com::sun::star::sdbc::XWarningsSupplier, + ::com::sun::star::sdbcx::XTablesSupplier + > OConnection_BASE; class OStatementCommonBase; class FirebirdDriver; @@ -159,6 +161,13 @@ namespace connectivity // css.lang.XEventListener virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException); + // XTablesSupplier + ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > + getTables() + throw(::com::sun::star::uno::RuntimeException); + + + inline ::rtl::OUString getUserName() const { return m_sUser; } inline isc_db_handle& getDBHandle() { return m_DBHandler; } inline FirebirdDriver* getDriver() const { return m_pDriver;} diff --git a/connectivity/source/drivers/firebird/Tables.cxx b/connectivity/source/drivers/firebird/Tables.cxx new file mode 100644 index 000000000000..52b15127a2ee --- /dev/null +++ b/connectivity/source/drivers/firebird/Tables.cxx @@ -0,0 +1,58 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#include "Tables.hxx" + +using namespace ::connectivity::firebird; +using namespace ::connectivity::sdbcx; +using namespace ::cppu; +using namespace ::rtl; + +using namespace ::com::sun::star; +using namespace ::com::sun::star::container; +using namespace ::com::sun::star::lang; +using namespace ::com::sun::star::sdbc; +using namespace ::com::sun::star::uno; + +Tables::Tables(::cppu::OWeakObject& rParent, + ::osl::Mutex& rMutex, + const TStringVector& rVector) : + OCollection(rParent, sal_True, rMutex, rVector) +{ +} + +//----- OCollection ----------------------------------------------------------- +void Tables::impl_refresh() + throw(RuntimeException) +{ + // TODO: IMPLEMENT ME +} + +ObjectType Tables::createObject(const OUString& rName) +{ + (void) rName; + // TODO: IMPLEMENT ME + return ObjectType(); +} + +//----- XDrop ---------------------------------------------------------------- +void SAL_CALL Tables::dropByName(const OUString& rName) + throw (SQLException, NoSuchElementException, RuntimeException) +{ + (void) rName; + // TODO: IMPLEMENT ME +} + +void SAL_CALL Tables::dropByIndex(const sal_Int32 nIndex) + throw (SQLException, IndexOutOfBoundsException, RuntimeException) +{ + (void) nIndex; + // TODO: IMPLEMENT ME +} +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file diff --git a/connectivity/source/drivers/firebird/Tables.hxx b/connectivity/source/drivers/firebird/Tables.hxx new file mode 100644 index 000000000000..89f188d269b0 --- /dev/null +++ b/connectivity/source/drivers/firebird/Tables.hxx @@ -0,0 +1,58 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef CONNECTIVITY_FIREBIRD_TABLES_HXX +#define CONNECTIVITY_FIREBIRD_TABLES_HXX + +#include <connectivity/sdbcx/VCollection.hxx> + +namespace connectivity +{ + namespace firebird + { + + /** + * This implements com.sun.star.sdbcx.Container, which seems to be + * also known by the name of Tables and Collection. + */ + class Tables: public ::connectivity::sdbcx::OCollection + { + protected: + // OCollection: pure virtual functions requiring implementation + virtual void impl_refresh() + throw(::com::sun::star::uno::RuntimeException); + virtual ::connectivity::sdbcx::ObjectType createObject( + const ::rtl::OUString& rName); + + public: + Tables(::cppu::OWeakObject& rParent, + ::osl::Mutex& rMutex, + const TStringVector& rVector); + + // TODO: we should also implement XDataDescriptorFactory, XRefreshable, + // XAppend, etc., but all are optional. + + // XDrop + virtual void SAL_CALL dropByName(const ::rtl::OUString& rName) + throw (::com::sun::star::sdbc::SQLException, + ::com::sun::star::container::NoSuchElementException, + ::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL dropByIndex(const sal_Int32 nIndex) + throw (::com::sun::star::sdbc::SQLException, + com::sun::star::lang::IndexOutOfBoundsException, + ::com::sun::star::uno::RuntimeException); + }; + + } // namespace firebird +} // namespace connectivity + + +#endif // CONNECTIVITY_FIREBIRD_TABLES_HXX + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file |