Repository.mk | 1 connectivity/Library_mork.mk | 28 ++ connectivity/Module_connectivity.mk | 1 connectivity/source/drivers/mork/driver.cxx | 243 ++++++++++++++++++++++++ connectivity/source/drivers/mork/driver.hxx | 58 +++++ connectivity/source/drivers/mork/mork.component | 16 + connectivity/source/drivers/mork/services.cxx | 40 +++ 7 files changed, 387 insertions(+)
New commits: commit 65a4881c2aac4810f223a685a807587633a9566f Author: Fridrich Å trba <fridrich.st...@bluewin.ch> Date: Fri Jul 20 15:00:26 2012 +0200 Prototypes of functions to implement Change-Id: I32123b09835920267f72cd98b3fd98ddf8b83d5a diff --git a/connectivity/source/drivers/mork/driver.cxx b/connectivity/source/drivers/mork/driver.cxx index ec876e1..2286556 100644 --- a/connectivity/source/drivers/mork/driver.cxx +++ b/connectivity/source/drivers/mork/driver.cxx @@ -30,12 +30,13 @@ #include "driver.hxx" -namespace connectivity { namespace mork { - -namespace { - namespace css = com::sun::star; +namespace connectivity +{ +namespace mork +{ + class Service: public cppu::WeakImplHelper2< css::lang::XServiceInfo, css::sdbc::XDriver >, private boost::noncopyable @@ -43,43 +44,51 @@ class Service: public: Service(css::uno::Reference< css::uno::XComponentContext > const context): context_(context) - { assert(context.is()); } + { + assert(context.is()); + } private: virtual ~Service() {} - virtual rtl::OUString SAL_CALL getImplementationName() - throw (css::uno::RuntimeException) - { return connectivity::mork::getImplementationName(); } + rtl::OUString SAL_CALL getImplementationName() + throw (css::uno::RuntimeException) + { + return connectivity::mork::getImplementationName(); + } - virtual sal_Bool SAL_CALL supportsService(rtl::OUString const & ServiceName) - throw (css::uno::RuntimeException) - { return ServiceName == getSupportedServiceNames()[0]; } //TODO + sal_Bool SAL_CALL supportsService(rtl::OUString const &ServiceName) + throw (css::uno::RuntimeException) + { + return ServiceName == getSupportedServiceNames()[0]; //TODO + } - virtual css::uno::Sequence< rtl::OUString > SAL_CALL + css::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames() throw (css::uno::RuntimeException) - { return connectivity::mork::getSupportedServiceNames(); } + { + return connectivity::mork::getSupportedServiceNames(); + } - virtual css::uno::Reference< css::sdbc::XConnection > SAL_CALL connect( - rtl::OUString const & url, - css::uno::Sequence< css::beans::PropertyValue > const & info) - throw (css::sdbc::SQLException, css::uno::RuntimeException); + css::uno::Reference< css::sdbc::XConnection > SAL_CALL connect( + rtl::OUString const &url, + css::uno::Sequence< css::beans::PropertyValue > const &info) + throw (css::sdbc::SQLException, css::uno::RuntimeException); - virtual sal_Bool SAL_CALL acceptsURL( - rtl::OUString const & url) - throw (css::sdbc::SQLException, css::uno::RuntimeException); + sal_Bool SAL_CALL acceptsURL( + rtl::OUString const &url) + throw (css::sdbc::SQLException, css::uno::RuntimeException); - virtual css::uno::Sequence< css::sdbc::DriverPropertyInfo > SAL_CALL + css::uno::Sequence< css::sdbc::DriverPropertyInfo > SAL_CALL getPropertyInfo( - rtl::OUString const & url, - css::uno::Sequence< css::beans::PropertyValue > const & info) - throw (css::sdbc::SQLException, css::uno::RuntimeException); + rtl::OUString const &url, + css::uno::Sequence< css::beans::PropertyValue > const &info) + throw (css::sdbc::SQLException, css::uno::RuntimeException); - virtual sal_Int32 SAL_CALL getMajorVersion() - throw (css::uno::RuntimeException); + sal_Int32 SAL_CALL getMajorVersion() + throw (css::uno::RuntimeException); - virtual sal_Int32 SAL_CALL getMinorVersion() - throw (css::uno::RuntimeException); + sal_Int32 SAL_CALL getMinorVersion() + throw (css::uno::RuntimeException); css::uno::Reference< css::uno::XComponentContext > context_; }; @@ -90,73 +99,145 @@ class Connection: { public: Connection( - css::uno::Reference< css::uno::XComponentContext > const context): - context_(context) - { assert(context.is()); } + css::uno::Reference< css::uno::XComponentContext > const context); private: - virtual ~Connection() {} + ~Connection(); + + // XConnection + ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XStatement > SAL_CALL createStatement( ) + throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + + ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XPreparedStatement > SAL_CALL prepareStatement( const ::rtl::OUString &sql ) + throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + + ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XPreparedStatement > SAL_CALL prepareCall( const ::rtl::OUString &sql ) + throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + + ::rtl::OUString SAL_CALL nativeSQL( const ::rtl::OUString &sql ) + throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + + void SAL_CALL setAutoCommit( sal_Bool autoCommit ) + throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + + sal_Bool SAL_CALL getAutoCommit( ) + throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + + void SAL_CALL commit( ) + throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + + void SAL_CALL rollback( ) + throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + + sal_Bool SAL_CALL isClosed( ) + throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + + ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData > SAL_CALL getMetaData( ) + throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + + void SAL_CALL setReadOnly( sal_Bool readOnly ) + throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + + sal_Bool SAL_CALL isReadOnly( ) + throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + + void SAL_CALL setCatalog( const ::rtl::OUString &catalog ) + throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + + ::rtl::OUString SAL_CALL getCatalog( ) + throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + + void SAL_CALL setTransactionIsolation( sal_Int32 level ) + throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + + sal_Int32 SAL_CALL getTransactionIsolation( ) + throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + + ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL getTypeMap( ) + throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + + void SAL_CALL setTypeMap( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& typeMap ) + throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); + + // XCloseable + void SAL_CALL close( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException); - //... TODO css::uno::Reference< css::uno::XComponentContext > context_; }; -css::uno::Reference< css::sdbc::XConnection > Service::connect( - rtl::OUString const & url, - css::uno::Sequence< css::beans::PropertyValue > const & info) - throw (css::sdbc::SQLException, css::uno::RuntimeException) +} +} + +connectivity::mork::Connection::Connection( + css::uno::Reference< css::uno::XComponentContext > const context): + context_(context) +{ + assert(context.is()); +} + +connectivity::mork::Connection::~Connection() +{ +} + +css::uno::Reference< css::sdbc::XConnection > connectivity::mork::Service::connect( + rtl::OUString const &url, + css::uno::Sequence< css::beans::PropertyValue > const &info) +throw (css::sdbc::SQLException, css::uno::RuntimeException) { //... TODO - (void) url; (void) info; // avoid warnings - return static_cast< cppu::OWeakObject * >(new Connection(context_)); + (void) url; + (void) info; // avoid warnings + + return new connectivity::mork::Connection(context_); } -sal_Bool Service::acceptsURL(rtl::OUString const & url) - throw (css::sdbc::SQLException, css::uno::RuntimeException) +sal_Bool connectivity::mork::Service::acceptsURL(rtl::OUString const &url) +throw (css::sdbc::SQLException, css::uno::RuntimeException) { //... TODO (void) url; // avoid warnings return false; } -css::uno::Sequence< css::sdbc::DriverPropertyInfo > Service::getPropertyInfo( - rtl::OUString const & url, - css::uno::Sequence< css::beans::PropertyValue > const & info) - throw (css::sdbc::SQLException, css::uno::RuntimeException) +css::uno::Sequence< css::sdbc::DriverPropertyInfo > connectivity::mork::Service::getPropertyInfo( + rtl::OUString const &url, + css::uno::Sequence< css::beans::PropertyValue > const &info) +throw (css::sdbc::SQLException, css::uno::RuntimeException) { //... TODO - (void) url; (void) info; // avoid warnings + (void) url; + (void) info; // avoid warnings return css::uno::Sequence< css::sdbc::DriverPropertyInfo >(); } -sal_Int32 Service::getMajorVersion() throw (css::uno::RuntimeException) { +sal_Int32 connectivity::mork::Service::getMajorVersion() throw (css::uno::RuntimeException) +{ //... TODO return 0; } -sal_Int32 Service::getMinorVersion() throw (css::uno::RuntimeException) { +sal_Int32 connectivity::mork::Service::getMinorVersion() throw (css::uno::RuntimeException) +{ //... TODO return 0; } -} - css::uno::Reference< css::uno::XInterface > create( - css::uno::Reference< css::uno::XComponentContext > const & context) + css::uno::Reference< css::uno::XComponentContext > const &context) { - return static_cast< cppu::OWeakObject * >(new Service(context)); + return static_cast< cppu::OWeakObject * >(new connectivity::mork::Service(context)); } -rtl::OUString getImplementationName() { +rtl::OUString connectivity::mork::getImplementationName() +{ return rtl::OUString("com.sun.star.comp.sdbc.MorkDriver"); } -css::uno::Sequence< rtl::OUString > getSupportedServiceNames() { +css::uno::Sequence< rtl::OUString > connectivity::mork::getSupportedServiceNames() +{ rtl::OUString name("com.sun.star.sdbc.Driver"); return css::uno::Sequence< rtl::OUString >(&name, 1); } -} } - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/connectivity/source/drivers/mork/driver.hxx b/connectivity/source/drivers/mork/driver.hxx index 806ca69..f3b286e 100644 --- a/connectivity/source/drivers/mork/driver.hxx +++ b/connectivity/source/drivers/mork/driver.hxx @@ -16,27 +16,42 @@ #include "com/sun/star/uno/Sequence.hxx" #include "sal/types.h" -namespace com { namespace sun { namespace star { - namespace uno { - class XComponentContext; - class XInterface; - } -} } } -namespace rtl { class OUString; } - -namespace connectivity { namespace mork { +namespace com +{ +namespace sun +{ +namespace star +{ +namespace uno +{ +class XComponentContext; +class XInterface; +} +} +} +} +namespace rtl +{ +class OUString; +} + +namespace connectivity +{ +namespace mork +{ com::sun::star::uno::Reference< com::sun::star::uno::XInterface > SAL_CALL create( com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > - const &); + const &); rtl::OUString SAL_CALL getImplementationName(); com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames(); -} } +} +} #endif diff --git a/connectivity/source/drivers/mork/services.cxx b/connectivity/source/drivers/mork/services.cxx index be5e2b1..f808392 100644 --- a/connectivity/source/drivers/mork/services.cxx +++ b/connectivity/source/drivers/mork/services.cxx @@ -15,22 +15,26 @@ #include "driver.hxx" -namespace { +namespace +{ -static cppu::ImplementationEntry const services[] = { - { &connectivity::mork::create, &connectivity::mork::getImplementationName, - &connectivity::mork::getSupportedServiceNames, - &cppu::createSingleComponentFactory, 0, 0 }, +static cppu::ImplementationEntry const services[] = +{ + { + &connectivity::mork::create, &connectivity::mork::getImplementationName, + &connectivity::mork::getSupportedServiceNames, + &cppu::createSingleComponentFactory, 0, 0 + }, { 0, 0, 0, 0, 0, 0 } }; } -extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory( - char const * pImplName, void * pServiceManager, void * pRegistryKey) +extern "C" SAL_DLLPUBLIC_EXPORT void *SAL_CALL component_getFactory( + char const *pImplName, void *pServiceManager, void *pRegistryKey) { return cppu::component_getFactoryHelper( - pImplName, pServiceManager, pRegistryKey, services); + pImplName, pServiceManager, pRegistryKey, services); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ commit 6f1c3c67d87b9ed5145467b1d51737166d398fea Author: Fridrich Å trba <fridrich.st...@bluewin.ch> Date: Fri Jul 20 14:30:27 2012 +0200 Missing include Change-Id: Ie2cf98c6f7ea7b5aa795822eac26c90d227a28cc diff --git a/connectivity/source/drivers/mork/driver.cxx b/connectivity/source/drivers/mork/driver.cxx index 9ef5f63..ec876e1 100644 --- a/connectivity/source/drivers/mork/driver.cxx +++ b/connectivity/source/drivers/mork/driver.cxx @@ -22,6 +22,7 @@ #include "com/sun/star/uno/RuntimeException.hpp" #include "com/sun/star/uno/Sequence.hxx" #include "com/sun/star/uno/XComponentContext.hpp" +#include "cppuhelper/implbase1.hxx" #include "cppuhelper/implbase2.hxx" #include "cppuhelper/weak.hxx" #include "rtl/ustring.hxx" commit b8eab4916d3665d55c80b4e925f86ee8a17172f0 Author: Stephan Bergmann <sberg...@redhat.com> Date: Wed Jul 11 17:36:11 2012 +0200 Some more skeleton stuff Change-Id: Iff2e328aaddc9d48112c39bc1640c63520d4b206 diff --git a/connectivity/source/drivers/mork/driver.cxx b/connectivity/source/drivers/mork/driver.cxx index d50b495..9ef5f63 100644 --- a/connectivity/source/drivers/mork/driver.cxx +++ b/connectivity/source/drivers/mork/driver.cxx @@ -83,6 +83,24 @@ private: css::uno::Reference< css::uno::XComponentContext > context_; }; +class Connection: + public cppu::WeakImplHelper1< css::sdbc::XConnection >, + private boost::noncopyable +{ +public: + Connection( + css::uno::Reference< css::uno::XComponentContext > const context): + context_(context) + { assert(context.is()); } + +private: + virtual ~Connection() {} + + //... TODO + + css::uno::Reference< css::uno::XComponentContext > context_; +}; + css::uno::Reference< css::sdbc::XConnection > Service::connect( rtl::OUString const & url, css::uno::Sequence< css::beans::PropertyValue > const & info) @@ -90,7 +108,7 @@ css::uno::Reference< css::sdbc::XConnection > Service::connect( { //... TODO (void) url; (void) info; // avoid warnings - return css::uno::Reference< css::sdbc::XConnection >(); + return static_cast< cppu::OWeakObject * >(new Connection(context_)); } sal_Bool Service::acceptsURL(rtl::OUString const & url) commit 5d1184239724b9ee0416632bd1475bf5938156e5 Author: Stephan Bergmann <sberg...@redhat.com> Date: Wed Jul 11 17:09:36 2012 +0200 mork driver skeleton Change-Id: Ib2413ab6856f163337aa311c4bf7b1182d6c6f63 diff --git a/Repository.mk b/Repository.mk index ad27532..f689f5a 100644 --- a/Repository.mk +++ b/Repository.mk @@ -310,6 +310,7 @@ $(eval $(call gb_Helper_register_libraries,OOOLIBS, \ lwpft \ MacOSXSpell \ merged \ + mork \ mozab2 \ mozabdrv \ msfilter \ diff --git a/connectivity/Library_mork.mk b/connectivity/Library_mork.mk new file mode 100644 index 0000000..e0ea9c8 --- /dev/null +++ b/connectivity/Library_mork.mk @@ -0,0 +1,28 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# 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/. +# + +$(eval $(call gb_Library_Library,mork)) + +$(eval $(call gb_Library_add_exception_objects,mork, \ + connectivity/source/drivers/mork/driver \ + connectivity/source/drivers/mork/services \ +)) + +$(eval $(call gb_Library_set_componentfile,mork,connectivity/source/drivers/mork/mork)) + +$(eval $(call gb_Library_use_libraries,mork, \ + cppu \ + cppuhelper \ + sal \ + $(gb_STDLIBS) \ +)) + +$(eval $(call gb_Library_use_sdk_api,mork)) + +# vim: set noet sw=4 ts=4: diff --git a/connectivity/Module_connectivity.mk b/connectivity/Module_connectivity.mk index a57b42d..a438066 100644 --- a/connectivity/Module_connectivity.mk +++ b/connectivity/Module_connectivity.mk @@ -44,6 +44,7 @@ $(eval $(call gb_Module_add_targets,connectivity,\ Library_dbtools \ Library_file \ Library_flat \ + Library_mork \ Library_mysql \ Library_odbc \ Library_odbcbase \ diff --git a/connectivity/source/drivers/mork/driver.cxx b/connectivity/source/drivers/mork/driver.cxx new file mode 100644 index 0000000..d50b495 --- /dev/null +++ b/connectivity/source/drivers/mork/driver.cxx @@ -0,0 +1,143 @@ +/* -*- 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 "sal/config.h" + +#include <cassert> + +#include "boost/noncopyable.hpp" +#include "com/sun/star/beans/PropertyValue.hpp" +#include "com/sun/star/lang/XServiceInfo.hpp" +#include "com/sun/star/sdbc/DriverPropertyInfo.hpp" +#include "com/sun/star/sdbc/SQLException.hpp" +#include "com/sun/star/sdbc/XConnection.hpp" +#include "com/sun/star/sdbc/XDriver.hpp" +#include "com/sun/star/uno/Reference.hxx" +#include "com/sun/star/uno/RuntimeException.hpp" +#include "com/sun/star/uno/Sequence.hxx" +#include "com/sun/star/uno/XComponentContext.hpp" +#include "cppuhelper/implbase2.hxx" +#include "cppuhelper/weak.hxx" +#include "rtl/ustring.hxx" +#include "sal/types.h" + +#include "driver.hxx" + +namespace connectivity { namespace mork { + +namespace { + +namespace css = com::sun::star; + +class Service: + public cppu::WeakImplHelper2< css::lang::XServiceInfo, css::sdbc::XDriver >, + private boost::noncopyable +{ +public: + Service(css::uno::Reference< css::uno::XComponentContext > const context): + context_(context) + { assert(context.is()); } + +private: + virtual ~Service() {} + + virtual rtl::OUString SAL_CALL getImplementationName() + throw (css::uno::RuntimeException) + { return connectivity::mork::getImplementationName(); } + + virtual sal_Bool SAL_CALL supportsService(rtl::OUString const & ServiceName) + throw (css::uno::RuntimeException) + { return ServiceName == getSupportedServiceNames()[0]; } //TODO + + virtual css::uno::Sequence< rtl::OUString > SAL_CALL + getSupportedServiceNames() throw (css::uno::RuntimeException) + { return connectivity::mork::getSupportedServiceNames(); } + + virtual css::uno::Reference< css::sdbc::XConnection > SAL_CALL connect( + rtl::OUString const & url, + css::uno::Sequence< css::beans::PropertyValue > const & info) + throw (css::sdbc::SQLException, css::uno::RuntimeException); + + virtual sal_Bool SAL_CALL acceptsURL( + rtl::OUString const & url) + throw (css::sdbc::SQLException, css::uno::RuntimeException); + + virtual css::uno::Sequence< css::sdbc::DriverPropertyInfo > SAL_CALL + getPropertyInfo( + rtl::OUString const & url, + css::uno::Sequence< css::beans::PropertyValue > const & info) + throw (css::sdbc::SQLException, css::uno::RuntimeException); + + virtual sal_Int32 SAL_CALL getMajorVersion() + throw (css::uno::RuntimeException); + + virtual sal_Int32 SAL_CALL getMinorVersion() + throw (css::uno::RuntimeException); + + css::uno::Reference< css::uno::XComponentContext > context_; +}; + +css::uno::Reference< css::sdbc::XConnection > Service::connect( + rtl::OUString const & url, + css::uno::Sequence< css::beans::PropertyValue > const & info) + throw (css::sdbc::SQLException, css::uno::RuntimeException) +{ + //... TODO + (void) url; (void) info; // avoid warnings + return css::uno::Reference< css::sdbc::XConnection >(); +} + +sal_Bool Service::acceptsURL(rtl::OUString const & url) + throw (css::sdbc::SQLException, css::uno::RuntimeException) +{ + //... TODO + (void) url; // avoid warnings + return false; +} + +css::uno::Sequence< css::sdbc::DriverPropertyInfo > Service::getPropertyInfo( + rtl::OUString const & url, + css::uno::Sequence< css::beans::PropertyValue > const & info) + throw (css::sdbc::SQLException, css::uno::RuntimeException) +{ + //... TODO + (void) url; (void) info; // avoid warnings + return css::uno::Sequence< css::sdbc::DriverPropertyInfo >(); +} + +sal_Int32 Service::getMajorVersion() throw (css::uno::RuntimeException) { + //... TODO + return 0; +} + +sal_Int32 Service::getMinorVersion() throw (css::uno::RuntimeException) { + //... TODO + return 0; +} + +} + +css::uno::Reference< css::uno::XInterface > create( + css::uno::Reference< css::uno::XComponentContext > const & context) +{ + return static_cast< cppu::OWeakObject * >(new Service(context)); +} + +rtl::OUString getImplementationName() { + return rtl::OUString("com.sun.star.comp.sdbc.MorkDriver"); +} + +css::uno::Sequence< rtl::OUString > getSupportedServiceNames() { + rtl::OUString name("com.sun.star.sdbc.Driver"); + return css::uno::Sequence< rtl::OUString >(&name, 1); +} + +} } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/connectivity/source/drivers/mork/driver.hxx b/connectivity/source/drivers/mork/driver.hxx new file mode 100644 index 0000000..806ca69 --- /dev/null +++ b/connectivity/source/drivers/mork/driver.hxx @@ -0,0 +1,43 @@ +/* -*- 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 INCLUDED_CONNECTIVITY_SOURCE_DRIVERS_MORK_DRIVER_HXX +#define INCLUDED_CONNECTIVITY_SOURCE_DRIVERS_MORK_DRIVER_HXX + +#include "sal/config.h" + +#include "com/sun/star/uno/Reference.hxx" +#include "com/sun/star/uno/Sequence.hxx" +#include "sal/types.h" + +namespace com { namespace sun { namespace star { + namespace uno { + class XComponentContext; + class XInterface; + } +} } } +namespace rtl { class OUString; } + +namespace connectivity { namespace mork { + +com::sun::star::uno::Reference< com::sun::star::uno::XInterface > SAL_CALL +create( + com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > + const &); + +rtl::OUString SAL_CALL getImplementationName(); + +com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL +getSupportedServiceNames(); + +} } + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/connectivity/source/drivers/mork/mork.component b/connectivity/source/drivers/mork/mork.component new file mode 100644 index 0000000..b8124fa --- /dev/null +++ b/connectivity/source/drivers/mork/mork.component @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + * 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/. + * +--> + +<component loader="com.sun.star.loader.SharedLibrary" + xmlns="http://openoffice.org/2010/uno-components"> + <implementation name="com.sun.star.comp.sdbc.MorkDriver"> + <service name="com.sun.star.sdbc.Driver"/> + </implementation> +</component> diff --git a/connectivity/source/drivers/mork/services.cxx b/connectivity/source/drivers/mork/services.cxx new file mode 100644 index 0000000..be5e2b1 --- /dev/null +++ b/connectivity/source/drivers/mork/services.cxx @@ -0,0 +1,36 @@ +/* -*- 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 "sal/config.h" + +#include "cppuhelper/factory.hxx" +#include "cppuhelper/implementationentry.hxx" +#include "sal/types.h" + +#include "driver.hxx" + +namespace { + +static cppu::ImplementationEntry const services[] = { + { &connectivity::mork::create, &connectivity::mork::getImplementationName, + &connectivity::mork::getSupportedServiceNames, + &cppu::createSingleComponentFactory, 0, 0 }, + { 0, 0, 0, 0, 0, 0 } +}; + +} + +extern "C" SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory( + char const * pImplName, void * pServiceManager, void * pRegistryKey) +{ + return cppu::component_getFactoryHelper( + pImplName, pServiceManager, pRegistryKey, services); +} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits