diff options
author | Oliver Bolte <obo@openoffice.org> | 2005-12-19 15:52:13 +0000 |
---|---|---|
committer | Oliver Bolte <obo@openoffice.org> | 2005-12-19 15:52:13 +0000 |
commit | 037eb9903fa5018d1d5384a6a4ad95d8a50e54ab (patch) | |
tree | 85c5416ee050e668920e34c3af08206e856f30b9 /connectivity | |
parent | 2cd7942985dceeff788821af973a6274a28c2f73 (diff) |
INTEGRATION: CWS kaddrbook (1.1.2); FILE ADDED
2005/12/02 20:19:17 ebischoff 1.1.2.3: Issue number:
Submitted by:
Reviewed by:
Making "Revision date" a "version" field. Such fields are not displayed, by default.
2005/11/30 13:56:42 kendy 1.1.2.2: #i54170#
SISSL/LGPL -> LGPL for the KDE AddressBook files.
2005/08/29 08:43:55 ebischoff 1.1.2.1: Initial checkin of KDE address book driver
Diffstat (limited to 'connectivity')
-rw-r--r-- | connectivity/source/drivers/kab/KTables.cxx | 104 | ||||
-rw-r--r-- | connectivity/source/drivers/kab/KTables.hxx | 73 |
2 files changed, 177 insertions, 0 deletions
diff --git a/connectivity/source/drivers/kab/KTables.cxx b/connectivity/source/drivers/kab/KTables.cxx new file mode 100644 index 000000000000..52ca873b4e1d --- /dev/null +++ b/connectivity/source/drivers/kab/KTables.cxx @@ -0,0 +1,104 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: KTables.cxx,v $ + * + * $Revision: 1.2 $ + * + * last change: $Author: obo $ $Date: 2005-12-19 16:52:04 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2005 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ + +#include "KTables.hxx" +#ifndef _CONNECTIVITY_KAB_TABLE_HXX_ +#include "KTable.hxx" +#endif +#ifndef _CONNECTIVITY_KAB_CATALOG_HXX_ +#include "KCatalog.hxx" +#endif +#ifndef _CONNECTIVITY_KAB_CONNECTION_HXX_ +#include "KConnection.hxx" +#endif + +#ifndef _COMPHELPER_TYPES_HXX_ +#include <comphelper/types.hxx> +#endif + +using namespace connectivity::kab; +using namespace connectivity; +using namespace ::comphelper; +using namespace ::cppu; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::beans; +using namespace ::com::sun::star::sdbcx; +using namespace ::com::sun::star::sdbc; +using namespace ::com::sun::star::container; +using namespace ::com::sun::star::lang; + +sdbcx::ObjectType KabTables::createObject(const ::rtl::OUString& _rName) +{ + ::rtl::OUString aName,aSchema; + aSchema = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("%")); + aName = _rName; + + Sequence< ::rtl::OUString > aTypes(1); + aTypes[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("%")); + ::rtl::OUString sEmpty; + + Reference< XResultSet > xResult = m_xMetaData->getTables(Any(), aSchema, aName, aTypes); + + sdbcx::ObjectType xRet = NULL; + if (xResult.is()) + { + Reference< XRow > xRow(xResult, UNO_QUERY); + if (xResult->next()) // there can be only one table with this name + { + KabTable* pRet = new KabTable( + this, + static_cast<KabCatalog&>(m_rParent).getConnection(), + aName, + xRow->getString(4), + xRow->getString(5), + sEmpty); + xRet = pRet; + } + } + ::comphelper::disposeComponent(xResult); + + return xRet; +} +// ------------------------------------------------------------------------- +void KabTables::impl_refresh( ) throw(RuntimeException) +{ + static_cast<KabCatalog&>(m_rParent).refreshTables(); +} +// ------------------------------------------------------------------------- +void KabTables::disposing(void) +{ + m_xMetaData = NULL; + OCollection::disposing(); +} diff --git a/connectivity/source/drivers/kab/KTables.hxx b/connectivity/source/drivers/kab/KTables.hxx new file mode 100644 index 000000000000..e8dfe1d22c19 --- /dev/null +++ b/connectivity/source/drivers/kab/KTables.hxx @@ -0,0 +1,73 @@ +/************************************************************************* + * + * OpenOffice.org - a multi-platform office productivity suite + * + * $RCSfile: KTables.hxx,v $ + * + * $Revision: 1.2 $ + * + * last change: $Author: obo $ $Date: 2005-12-19 16:52:13 $ + * + * The Contents of this file are made available subject to + * the terms of GNU Lesser General Public License Version 2.1. + * + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2005 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ************************************************************************/ + +#ifndef _CONNECTIVITY_KAB_TABLES_HXX_ +#define _CONNECTIVITY_KAB_TABLES_HXX_ + +#ifndef _CONNECTIVITY_SDBCX_COLLECTION_HXX_ +#include "connectivity/sdbcx/VCollection.hxx" +#endif +#ifndef _COM_SUN_STAR_SDBC_XDATABASEMETADATA_HPP_ +#include <com/sun/star/sdbc/XDatabaseMetaData.hpp> +#endif + +namespace connectivity +{ + namespace kab + { + class KabTables : public sdbcx::OCollection + { + ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData > m_xMetaData; + + protected: + virtual sdbcx::ObjectType createObject(const ::rtl::OUString& _rName); + virtual void impl_refresh() throw(::com::sun::star::uno::RuntimeException); + + public: + KabTables( + const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData >& _rMetaData, + ::cppu::OWeakObject& _rParent, + ::osl::Mutex& _rMutex, + const TStringVector &_rVector) + : sdbcx::OCollection(_rParent,sal_True,_rMutex,_rVector), + m_xMetaData(_rMetaData) + { } + + virtual void SAL_CALL disposing(void); + }; + } +} + +#endif // _CONNECTIVITY_KAB_TABLES_HXX_ |