diff options
author | Jens-Heiner Rechtien <hr@openoffice.org> | 2000-09-18 15:18:56 +0000 |
---|---|---|
committer | Jens-Heiner Rechtien <hr@openoffice.org> | 2000-09-18 15:18:56 +0000 |
commit | a253a5ecd3e1deb645b041c92b37f92bba0b8e15 (patch) | |
tree | 84082577e030e4e8ccb28b0409d98bea0ebbdd52 | |
download | core-a253a5ecd3e1deb645b041c92b37f92bba0b8e15.tar.gz core-a253a5ecd3e1deb645b041c92b37f92bba0b8e15.zip |
initial import
-rw-r--r-- | dbaccess/prj/d.lst | 6 | ||||
-rw-r--r-- | dbaccess/source/inc/apitools.hxx | 451 | ||||
-rw-r--r-- | dbaccess/source/inc/registrationhelper.hxx | 217 | ||||
-rw-r--r-- | dbaccess/source/inc/stringconstants.hrc | 442 | ||||
-rw-r--r-- | dbaccess/source/shared/apitools.cxx | 235 | ||||
-rw-r--r-- | dbaccess/source/shared/makefile.mk | 92 | ||||
-rw-r--r-- | dbaccess/source/shared/registrationhelper.cxx | 256 | ||||
-rw-r--r-- | dbaccess/source/shared/stringconstants.cxx | 266 | ||||
-rw-r--r-- | dbaccess/util/dba.map | 8 | ||||
-rw-r--r-- | dbaccess/util/makefile.mk | 131 |
10 files changed, 2104 insertions, 0 deletions
diff --git a/dbaccess/prj/d.lst b/dbaccess/prj/d.lst new file mode 100644 index 000000000000..c763cd48d9d7 --- /dev/null +++ b/dbaccess/prj/d.lst @@ -0,0 +1,6 @@ +..\%__SRC%\bin\*.dll %_DEST%\bin%_EXT%\*.dll +..\%__SRC%\lib\*.so %_DEST%\lib%_EXT%\*.so +..\%__SRC%\lib\*.sl %_DEST%\lib%_EXT%\*.sl +..\%__SRC%\bin\*.bin %_DEST%\bin%_EXT%\*.bin +..\%__SRC%\bin\*.res %_DEST%\bin%_EXT%\*.res +..\%__SRC%\bin\*.exe %_DEST%\bin%_EXT%\*.exe diff --git a/dbaccess/source/inc/apitools.hxx b/dbaccess/source/inc/apitools.hxx new file mode 100644 index 000000000000..e0682adc2dae --- /dev/null +++ b/dbaccess/source/inc/apitools.hxx @@ -0,0 +1,451 @@ +/************************************************************************* + * + * $RCSfile: apitools.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:14:56 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 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 + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef _DBASHARED_APITOOLS_HXX_ +#define _DBASHARED_APITOOLS_HXX_ + +#ifndef _COM_SUN_STAR_BEANS_PROPERTYVALUE_HPP_ +#include <com/sun/star/beans/PropertyValue.hpp> +#endif +#ifndef _COM_SUN_STAR_BEANS_PROPERTYATTRIBUTE_HPP_ +#include <com/sun/star/beans/PropertyAttribute.hpp> +#endif +#ifndef _COM_SUN_STAR_SDBC_SQLEXCEPTION_HPP_ +#include <com/sun/star/sdbc/SQLException.hpp> +#endif +#ifndef _COM_SUN_STAR_LANG_XUNOTUNNEL_HPP_ +#include <com/sun/star/lang/XUnoTunnel.hpp> +#endif +#ifndef _COM_SUN_STAR_SDBC_XDATABASEMETADATA_HPP_ +#include <com/sun/star/sdbc/XDatabaseMetaData.hpp> +#endif +#ifndef _CPPUHELPER_COMPONENT_HXX_ +#include <cppuhelper/component.hxx> +#endif +#ifndef _OSL_MUTEX_HXX_ +#include <osl/mutex.hxx> +#endif +#ifndef _CPPUHELPER_INTERFACECONTAINER_HXX_ +#include <cppuhelper/interfacecontainer.hxx> +#endif +#ifndef _OSL_DIAGNOSE_H_ +#include <osl/diagnose.h> +#endif +#ifndef _UTL_STLTYPES_HXX_ +#include <unotools/stl_types.hxx> +#endif + +//================================================================================== +//= various typedefs +//================================================================================== +DECLARE_STL_VECTOR(::com::sun::star::uno::WeakReferenceHelper, OWeakRefArray); + +//================================================================================== +//= various helper functions +//================================================================================== +//---------------------------------------------------------------------------------- +template <class TYPE> +inline void disposeComponent(const ::com::sun::star::uno::Reference< TYPE >& _rxObject) +{ + ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > xComp(_rxObject, UNO_QUERY); + if (xComp.is()) + xComp->dispose(); +} + +//---------------------------------------------------------------------------------- +/** compose a complete table name from it's up to three parts, regarding to the database meta data composing rules +*/ +void composeTableName( const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData >& _rxMetaData, + const ::rtl::OUString& _rCatalog, + const ::rtl::OUString& _rSchema, + const ::rtl::OUString& _rName, + ::rtl::OUString& _rComposedName, + sal_Bool _bQuote); + +//---------------------------------------------------------------------------------- +/** throw a generic SQLException, i.e. one with an SQLState of S1000, an ErrorCode of 0 and no NextException +*/ +inline void throwGenericSQLException(const ::rtl::OUString& _rMsg, const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxSource) + throw (::com::sun::star::sdbc::SQLException) +{ + throw ::com::sun::star::sdbc::SQLException(_rMsg, _rxSource, ::rtl::OUString::createFromAscii("S1000"), 0, ::com::sun::star::uno::Any()); +} + +//---------------------------------------------------------------------------------- +template <class TYPE> +sal_Bool getImplementation(TYPE*& _pObject, const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxIFace) +{ + _pObject = NULL; + ::com::sun::star::uno::Reference< ::com::sun::star::lang::XUnoTunnel > xTunnel(_rxIFace, UNO_QUERY); + if (xTunnel.is()) + _pObject = reinterpret_cast< TYPE* >(xTunnel->getSomething(TYPE::getUnoTunnelImplementationId())); + + return (_pObject != NULL); +} + +//================================================================================== +//= OSubComponent - a class which olds a Mutex and a OBroadcastHelper; +//= needed because when deriving from OPropertySetHelper, +//= the OBroadcastHelper has to be initialized before +//= the OPropertySetHelper +//================================================================================== +class OMutexAndBroadcastHelper +{ +protected: + ::osl::Mutex m_aMutex; + ::cppu::OBroadcastHelper m_aBHelper; + +public: + OMutexAndBroadcastHelper() : m_aBHelper( m_aMutex ) { } + ~OMutexAndBroadcastHelper() + { + int nDummy = 0; + } + + ::osl::Mutex& GetMutex() { return m_aMutex; } + ::cppu::OBroadcastHelper& GetBroadcastHelper() { return m_aBHelper; } + +}; + +//================================================================================== +//= OSubComponent - a component which holds a hard ref to it's parent +//= and is been hold itself (by the parent) with a weak ref +//================================================================================== +class OSubComponent : public ::cppu::OComponentHelper +{ +protected: + // the parent must support the tunnel implementation + ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > m_xParent; + +public: + OSubComponent(::osl::Mutex& _rMutex, + const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _xParent); + +// ::com::sun::star::lang::XTypeProvider + virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException); + +// ::com::sun::star::uno::XInterface + virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) + throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL acquire() throw(::com::sun::star::uno::RuntimeException); + virtual void SAL_CALL release() throw(::com::sun::star::uno::RuntimeException); + + inline operator ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > () const + { return (::com::sun::star::uno::XWeak *)this; } + +protected: + virtual void SAL_CALL disposing(); +}; + +//================================================================================== +//= StandardExceptions +//================================================================================== +class FunctionSequenceException : public ::com::sun::star::sdbc::SQLException +{ +public: + FunctionSequenceException(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _Context, + const ::com::sun::star::uno::Any& _Next = ::com::sun::star::uno::Any()); +}; + + +//************************************************************ +// OIdPropertyArrayUsageHelper +//************************************************************ +namespace cppu { class IPropertyArrayHelper; } + +typedef std::map< sal_Int32, ::cppu::IPropertyArrayHelper*, std::less< sal_Int32 > > OIdPropertyArrayMap; +template <class TYPE> +class OIdPropertyArrayUsageHelper +{ +protected: + static sal_Int32 s_nRefCount; + static OIdPropertyArrayMap* s_pMap; + static ::osl::Mutex s_aMutex; + +public: + OIdPropertyArrayUsageHelper(); + virtual ~OIdPropertyArrayUsageHelper() + { + ::osl::MutexGuard aGuard(s_aMutex); + OSL_ENSHURE(s_nRefCount > 0, "OIdPropertyArrayUsageHelper::~OIdPropertyArrayUsageHelper : suspicious call : have a refcount of 0 !"); + if (!--s_nRefCount) + { + // delete the element + for (OIdPropertyArrayMap::iterator i = s_pMap->begin(); i != s_pMap->end(); ++i) + delete (*i).second; + delete s_pMap; + s_pMap = NULL; + } + } + + /** call this in the getInfoHelper method of your derived class. The method returns the array helper of the + class, which is created if neccessary. + */ + ::cppu::IPropertyArrayHelper* getArrayHelper(sal_Int32 nId); + +protected: + /** used to implement the creation of the array helper which is shared amongst all instances of the class. + This method needs to be implemented in derived classes. + <BR> + The method gets called with s_aMutex acquired. + <BR> + as long as IPropertyArrayHelper has no virtual destructor, the implementation of ~OPropertyArrayUsageHelper + assumes that you created an ::cppu::OPropertyArrayHelper when deleting s_pProps. + @return an pointer to the newly created array helper. Must not be NULL. + */ + virtual ::cppu::IPropertyArrayHelper* createArrayHelper(sal_Int32 nId) const = 0; +}; + +//------------------------------------------------------------------ +template<class TYPE> +sal_Int32 OIdPropertyArrayUsageHelper< TYPE >::s_nRefCount = 0; + +template<class TYPE> +OIdPropertyArrayMap* OIdPropertyArrayUsageHelper< TYPE >::s_pMap = NULL; + +template<class TYPE> +::osl::Mutex OIdPropertyArrayUsageHelper< TYPE >::s_aMutex; + +//------------------------------------------------------------------ +template <class TYPE> +OIdPropertyArrayUsageHelper<TYPE>::OIdPropertyArrayUsageHelper() +{ + ::osl::MutexGuard aGuard(s_aMutex); + // create the map if necessary + if (s_pMap == NULL) + s_pMap = new OIdPropertyArrayMap(); + ++s_nRefCount; +} + +//------------------------------------------------------------------ +template <class TYPE> +::cppu::IPropertyArrayHelper* OIdPropertyArrayUsageHelper<TYPE>::getArrayHelper(sal_Int32 nId) +{ + OSL_ENSHURE(s_nRefCount, "OIdPropertyArrayUsageHelper::getArrayHelper : suspicious call : have a refcount of 0 !"); + ::osl::MutexGuard aGuard(s_aMutex); + // do we have the array already? + if (! (*s_pMap)[nId] ) + { + (*s_pMap)[nId] = createArrayHelper(nId); + OSL_ENSHURE((*s_pMap)[nId], "OIdPropertyArrayUsageHelper::getArrayHelper : createArrayHelper returned nonsense !"); + } + return (*s_pMap)[nId]; +} + + +//================================================================================== +//= helper for implementing the XServiceInfo interface + +//---------------------------------------------------------------------------------- +// (internal - not to be used outside - usually) +#define IMPLEMENT_SERVICE_INFO_IMPLNAME(classname, implasciiname) \ + ::rtl::OUString SAL_CALL classname::getImplementationName( ) throw (::com::sun::star::uno::RuntimeException) \ + { \ + return ::rtl::OUString::createFromAscii(implasciiname); \ + } \ + +#define IMPLEMENT_SERVICE_INFO_SUPPORTS(classname) \ + sal_Bool SAL_CALL classname::supportsService( const ::rtl::OUString& _rServiceName ) throw(::com::sun::star::uno::RuntimeException) \ + { \ + ::com::sun::star::uno::Sequence< ::rtl::OUString > aSupported(getSupportedServiceNames()); \ + const ::rtl::OUString* pSupported = aSupported.getConstArray(); \ + for (sal_Int32 i=0; i<aSupported.getLength(); ++i, ++pSupported) \ + if (pSupported->equals(_rServiceName)) \ + return sal_True; \ + \ + return sal_False; \ + } \ + +#define IMPLEMENT_SERVICE_INFO_GETSUPPORTED1(classname, serviceasciiname) \ + ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL classname::getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException) \ + { \ + ::com::sun::star::uno::Sequence< ::rtl::OUString > aSupported(1); \ + aSupported[0] = ::rtl::OUString::createFromAscii(serviceasciiname); \ + return aSupported; \ + } \ + +#define IMPLEMENT_SERVICE_INFO_GETSUPPORTED2(classname, serviceasciiname1, serviceasciiname2) \ + ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL classname::getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException) \ + { \ + ::com::sun::star::uno::Sequence< ::rtl::OUString > aSupported(2); \ + aSupported[0] = ::rtl::OUString::createFromAscii(serviceasciiname1); \ + aSupported[1] = ::rtl::OUString::createFromAscii(serviceasciiname2); \ + return aSupported; \ + } \ + +#define IMPLEMENT_SERVICE_INFO_GETSUPPORTED3(classname, serviceasciiname1, serviceasciiname2, serviceasciiname3) \ + ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL classname::getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException) \ + { \ + ::com::sun::star::uno::Sequence< ::rtl::OUString > aSupported(3); \ + aSupported[0] = ::rtl::OUString::createFromAscii(serviceasciiname1); \ + aSupported[1] = ::rtl::OUString::createFromAscii(serviceasciiname2); \ + aSupported[2] = ::rtl::OUString::createFromAscii(serviceasciiname3); \ + return aSupported; \ + } \ + +//---------------------------------------------------------------------------------- +// declare service info methods - no getImplementationName, so the class is abstract +#define DECLARE_SERVICE_INFO_ABSTRACT() \ + virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException); \ + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException) \ + +//---------------------------------------------------------------------------------- +// declare service info methods +#define DECLARE_SERVICE_INFO() \ + virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw (::com::sun::star::uno::RuntimeException); \ + virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException); \ + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException) \ + +//---------------------------------------------------------------------------------- +#define IMPLEMENT_SERVICE_INFO1(classname, implasciiname, serviceasciiname) \ + IMPLEMENT_SERVICE_INFO_IMPLNAME(classname, implasciiname) \ + IMPLEMENT_SERVICE_INFO_SUPPORTS(classname) \ + IMPLEMENT_SERVICE_INFO_GETSUPPORTED1(classname, serviceasciiname) \ + +//---------------------------------------------------------------------------------- +#define IMPLEMENT_SERVICE_INFO2(classname, implasciiname, serviceasciiname1, serviceasciiname2) \ + IMPLEMENT_SERVICE_INFO_IMPLNAME(classname, implasciiname) \ + IMPLEMENT_SERVICE_INFO_SUPPORTS(classname) \ + IMPLEMENT_SERVICE_INFO_GETSUPPORTED2(classname, serviceasciiname1, serviceasciiname2) \ + +//---------------------------------------------------------------------------------- +#define IMPLEMENT_SERVICE_INFO3(classname, implasciiname, serviceasciiname1, serviceasciiname2, serviceasciiname3) \ + IMPLEMENT_SERVICE_INFO_IMPLNAME(classname, implasciiname) \ + IMPLEMENT_SERVICE_INFO_SUPPORTS(classname) \ + IMPLEMENT_SERVICE_INFO_GETSUPPORTED3(classname, serviceasciiname1, serviceasciiname2, serviceasciiname3) \ + +//---------------------------------------------------------------------------------- +#define IMPLEMENT_SERVICE_INFO1_ABSTRACT(classname, serviceasciiname) \ + IMPLEMENT_SERVICE_INFO_SUPPORTS(classname) \ + IMPLEMENT_SERVICE_INFO_GETSUPPORTED1(classname, serviceasciiname) \ + +//---------------------------------------------------------------------------------- +#define IMPLEMENT_SERVICE_INFO2_ABSTRACT(classname, serviceasciiname1, serviceasciiname2) \ + IMPLEMENT_SERVICE_INFO_SUPPORTS(classname) \ + IMPLEMENT_SERVICE_INFO_GETSUPPORTED2(classname, serviceasciiname1, serviceasciiname2) \ + +//================================================================================== +//= helper for implementing the createArrayHelper +//---------------------------------------------------------------------------------- +#define BEGIN_PROPERTY_SEQUENCE(count) \ + ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property> aDescriptor(count); \ + ::com::sun::star::beans::Property* pDesc = aDescriptor.getArray(); \ + sal_Int32 nPos = 0; \ + +//---------------------------------------------------------------------------------- +#define BEGIN_PROPERTY_HELPER(count) \ + BEGIN_PROPERTY_SEQUENCE(count) + +//---------------------------------------------------------------------------------- +#define DECL_PROP_IMPL(varname, cpputype) \ + pDesc[nPos++] = ::com::sun::star::beans::Property(PROPERTY_##varname, PROPERTY_ID_##varname, cpputype, + +//---------------------------------------------------------------------------------- +#define DECL_PROP0(varname, type) \ + DECL_PROP_IMPL(varname, ::getCppuType((const type *)0)) 0) +//---------------------------------------------------------------------------------- +#define DECL_PROP0_BOOL(varname) \ + DECL_PROP_IMPL(varname, ::getBooleanCppuType()) 0) +//---------------------------------------------------------------------------------- +#define DECL_PROP0_IFACE(varname, iface) \ + DECL_PROP_IMPL(varname, ::getCppuType(static_cast< ::com::sun::star::uno::Reference< iface >* >(NULL))) 0) + +//---------------------------------------------------------------------------------- +#define DECL_PROP1(varname, type, attrib1) \ + DECL_PROP_IMPL(varname, ::getCppuType((const type *)0)) ::com::sun::star::beans::PropertyAttribute::##attrib1) +//---------------------------------------------------------------------------------- +#define DECL_PROP1_BOOL(varname, attrib1) \ + DECL_PROP_IMPL(varname, ::getBooleanCppuType()) ::com::sun::star::beans::PropertyAttribute::##attrib1) +//---------------------------------------------------------------------------------- +#define DECL_PROP1_IFACE(varname, iface, attrib1) \ + DECL_PROP_IMPL(varname, ::getCppuType(static_cast< ::com::sun::star::uno::Reference< iface >* >(NULL))) ::com::sun::star::beans::PropertyAttribute::##attrib1) + +//---------------------------------------------------------------------------------- +#define DECL_PROP2(varname, type, attrib1, attrib2) \ + DECL_PROP_IMPL(varname, ::getCppuType((const type *)0)) ::com::sun::star::beans::PropertyAttribute::##attrib1 | ::com::sun::star::beans::PropertyAttribute::##attrib2) +//---------------------------------------------------------------------------------- +#define DECL_PROP2_BOOL(varname, attrib1, attrib2) \ + DECL_PROP_IMPL(varname, ::getBooleanCppuType()) ::com::sun::star::beans::PropertyAttribute::##attrib1 | ::com::sun::star::beans::PropertyAttribute::##attrib2) + +//---------------------------------------------------------------------------------- +#define DECL_PROP3(varname, type, attrib1, attrib2, attrib3) \ + DECL_PROP_IMPL(varname, ::getCppuType((const type *)0)) ::com::sun::star::beans::PropertyAttribute::##attrib1 | ::com::sun::star::beans::PropertyAttribute::##attrib2 | ::com::sun::star::beans::PropertyAttribute::##attrib3) +//---------------------------------------------------------------------------------- +#define DECL_PROP3_BOOL(varname, attrib1, attrib2, attrib3) \ + DECL_PROP_IMPL(varname, ::getBooleanCppuType()) ::com::sun::star::beans::PropertyAttribute::##attrib1 | ::com::sun::star::beans::PropertyAttribute::##attrib2 | ::com::sun::star::beans::PropertyAttribute::##attrib3) + + +//---------------------------------------------------------------------------------- +#define END_PROPERTY_SEQUENCE() \ + OSL_ENSHURE(nPos == aDescriptor.getLength(), "forgot to adjust the count ?"); \ + +//---------------------------------------------------------------------------------- +#define END_PROPERTY_HELPER() \ + END_PROPERTY_SEQUENCE() \ + return new ::cppu::OPropertyArrayHelper(aDescriptor); + + +//================================================================================== +// miscellaneous +#define UNUSED(x) x; + +#endif // _DBASHARED_APITOOLS_HXX_ + diff --git a/dbaccess/source/inc/registrationhelper.hxx b/dbaccess/source/inc/registrationhelper.hxx new file mode 100644 index 000000000000..c32737259efb --- /dev/null +++ b/dbaccess/source/inc/registrationhelper.hxx @@ -0,0 +1,217 @@ +/************************************************************************* + * + * $RCSfile: registrationhelper.hxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:14:56 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 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 + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef _DBA_REGISTRATION_HELPER_HXX_ +#define _DBA_REGISTRATION_HELPER_HXX_ + +#ifndef _COM_SUN_STAR_UNO_SEQUENCE_HXX_ +#include <com/sun/star/uno/Sequence.hxx> +#endif +#ifndef _COM_SUN_STAR_REGISTRY_XREGISTRYKEY_HPP_ +#include <com/sun/star/registry/XRegistryKey.hpp> +#endif +#ifndef _RTL_USTRING_HXX_ +#include <rtl/ustring.hxx> +#endif +#ifndef _CPPUHELPER_FACTORY_HXX_ +#include <cppuhelper/factory.hxx> +#endif + +typedef ::com::sun::star::uno::Reference< ::com::sun::star::lang::XSingleServiceFactory > (SAL_CALL *FactoryInstantiation) + ( + const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rServiceManager, + const ::rtl::OUString & _rComponentName, + ::cppu::ComponentInstantiation _pCreateFunction, + const ::com::sun::star::uno::Sequence< ::rtl::OUString > & _rServiceNames + ); + +//========================================================================== +class OModuleRegistration +{ + static ::com::sun::star::uno::Sequence< ::rtl::OUString >* + s_pImplementationNames; + static ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::rtl::OUString > >* + s_pSupportedServices; + static ::com::sun::star::uno::Sequence< sal_Int64 >* + s_pCreationFunctionPointers; + static ::com::sun::star::uno::Sequence< sal_Int64 >* + s_pFactoryFunctionPointers; + + // no direct instantiation, only static members/methods + OModuleRegistration() { } + +public: + /** register a component implementing a service with the given data. + @param _rImplementationName the implementation name of the component + @param _rServiceNames the services the component supports + @param _pCreateFunction a function for creating an instance of the component + @param _pFactoryFunction a function for creating a factory for that component + @see revokeComponent + */ + static void registerComponent( + const ::rtl::OUString& _rImplementationName, + const ::com::sun::star::uno::Sequence< ::rtl::OUString >& _rServiceNames, + ::cppu::ComponentInstantiation _pCreateFunction, + FactoryInstantiation _pFactoryFunction); + + /** revoke the registration for the specified component + @param _rImplementationName the implementation name of the component + */ + static void revokeComponent( + const ::rtl::OUString& _rImplementationName); + + /** writes the registration information of all components which are currently registered into the specified registry. + Usually used from within component_writeInfo. + @param _rxServiceManager the service manager + @param _rRootKey the registry key under which the information will be stored + @return sal_True if the registration of all implementations was successfull, sal_False otherwise + */ + static sal_Bool writeComponentInfos( + const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxServiceManager, + const ::com::sun::star::uno::Reference< ::com::sun::star::registry::XRegistryKey >& _rRootKey); + + /** creates a Factory for the component with the given implementation name. Usually used from within component_getFactory. + @param _rxServiceManager a pointer to an XMultiServiceFactory interface as got in component_getFactory + @param _pImplementationName the implementation name of the component + @return the XInterface access to a factory for the component + */ + static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > getComponentFactory( + const ::rtl::OUString& _rImplementationName, + const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxServiceManager + ); +}; + +//========================================================================== +template <class TYPE> +class OMultiInstanceAutoRegistration +{ +public: + /** assumed that the template argument has the three methods<BR> + <code>static ::rtl::OUString getImplementationName_Static()</code><BR> + <code>static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static()</code><BR> + and<BR> + <code>static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > + Create(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >&)</code><BR> + the instantiation of this object will automatically register the class via <code>OModuleRegistration::registerComponent</code>. + The factory creation function used is <code>::cppu::createSingleFactory</code>.<BR> + @see OOneInstanceAutoRegistration + */ + OMultiInstanceAutoRegistration(); + ~OMultiInstanceAutoRegistration(); +}; + +template <class TYPE> +OMultiInstanceAutoRegistration<TYPE>::OMultiInstanceAutoRegistration() +{ + OModuleRegistration::registerComponent( + TYPE::getImplementationName_Static(), + TYPE::getSupportedServiceNames_Static(), + TYPE::Create, + ::cppu::createSingleFactory + ); +} + +template <class TYPE> +OMultiInstanceAutoRegistration<TYPE>::~OMultiInstanceAutoRegistration() +{ + OModuleRegistration::revokeComponent(TYPE::getImplementationName_Static()); +} + +//========================================================================== +template <class TYPE> +class OOneInstanceAutoRegistration +{ +public: + /** provided that the template argument has three methods<BR> + <code>static ::rtl::OUString getImplementationName_Static()</code><BR> + <code>static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static()</code><BR> + and<BR> + <code>static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > + Create(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >&)</code><BR> + the instantiation of this object will automatically register the class via <code>OModuleRegistration::registerComponent</code>. + The factory creation function used is <code>::cppu::createSingleFactory</code>.<BR> + @see OMultiInstanceAutoRegistration + */ + OOneInstanceAutoRegistration(); + ~OOneInstanceAutoRegistration(); +}; + +template <class TYPE> +OOneInstanceAutoRegistration<TYPE>::OOneInstanceAutoRegistration() +{ + OModuleRegistration::registerComponent( + TYPE::getImplementationName_Static(), + TYPE::getSupportedServiceNames_Static(), + TYPE::Create, + ::cppu::createOneInstanceFactory + ); +} + +template <class TYPE> +OOneInstanceAutoRegistration<TYPE>::~OOneInstanceAutoRegistration() +{ + OModuleRegistration::revokeComponent(TYPE::getImplementationName_Static()); +} + +//========================================================================== +#endif // _DBA_REGISTRATION_HELPER_HXX_ + + diff --git a/dbaccess/source/inc/stringconstants.hrc b/dbaccess/source/inc/stringconstants.hrc new file mode 100644 index 000000000000..09c1829d7b61 --- /dev/null +++ b/dbaccess/source/inc/stringconstants.hrc @@ -0,0 +1,442 @@ +/************************************************************************* + * + * $RCSfile: stringconstants.hrc,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:14:56 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 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 + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ +//************************************************************************** +// +// $Header: /zpool/svn/migration/cvs_rep_09_09_08/code/dbaccess/source/inc/stringconstants.hrc,v 1.1.1.1 2000-09-18 16:14:56 hr Exp $ +// +// ========================================================================= +// +// $Date: 2000-09-18 16:14:56 $ +// $Author: hr $ +// $Revision: 1.1.1.1 $ +// +// ========================================================================= +// +// Created: 08.05.2000 +// Creator: FS +// +// Copyright (c) 2000 Sun Microsystems Inc. +// +//************************************************************************** + +#ifndef _DBASHARED_STRINGCONSTANTS_HRC_ +#define _DBASHARED_STRINGCONSTANTS_HRC_ + +#ifndef _RTL_USTRING_HXX_ +#include <rtl/ustring.hxx> +#endif + +namespace dbaccess +{ + //============================================================ + //= a helper for static ascii pseudo-unicode strings + //============================================================ + // string constants + struct _ConstAsciiString_ + { + sal_Int32 length; + sal_Char const* str; + + operator ::rtl::OUString () const { return ::rtl::OUString(str, length, RTL_TEXTENCODING_ASCII_US); } + operator const sal_Char* () const { return str; } + }; + +#define DECLARE_CONSTASCII_USTRING( name ) \ + extern _ConstAsciiString_ const name + +#define IMPLEMENT_CONSTASCII_USTRING( name, string ) \ + _ConstAsciiString_ const name = { sizeof(string)-1, string } + +//============================================================ +//= property ids +//============================================================ +#define PROPERTY_ID_TITLE 1 +#define PROPERTY_ID_URL 2 +#define PROPERTY_ID_INFO 4 +#define PROPERTY_ID_ISPASSWORDREQUIRED 5 +#define PROPERTY_ID_TABLEFILTER 6 +#define PROPERTY_ID_NAME 7 +#define PROPERTY_ID_SCHEMANAME 8 +#define PROPERTY_ID_CATALOGNAME 9 +#define PROPERTY_ID_PRIVILEGES 10 +#define PROPERTY_ID_USE_ESCAPE_PROCESSING 11 +#define PROPERTY_ID_COMMAND 12 +#define PROPERTY_ID_TYPE 13 +#define PROPERTY_ID_TYPENAME 14 +#define PROPERTY_ID_PRECISION 15 +#define PROPERTY_ID_SCALE 16 +#define PROPERTY_ID_ISNULLABLE 17 +#define PROPERTY_ID_ISAUTOINCREMENT 18 +#define PROPERTY_ID_ISROWVERSION 19 +#define PROPERTY_ID_DESCRIPTION 20 +#define PROPERTY_ID_DEFAULTVALUE 21 +#define PROPERTY_ID_NUMBERFORMAT 22 +#define PROPERTY_ID_QUERYTIMEOUT 23 +#define PROPERTY_ID_MAXFIELDSIZE 24 +#define PROPERTY_ID_MAXROWS 25 +#define PROPERTY_ID_CURSORNAME 26 +#define PROPERTY_ID_RESULTSETCONCURRENCY 27 +#define PROPERTY_ID_RESULTSETTYPE 28 +#define PROPERTY_ID_FETCHDIRECTION 29 +#define PROPERTY_ID_FETCHSIZE 30 +#define PROPERTY_ID_USEBOOKMARKS 31 +#define PROPERTY_ID_ISSEARCHABLE 32 +#define PROPERTY_ID_ISCURRENCY 33 +#define PROPERTY_ID_ISSIGNED 34 +#define PROPERTY_ID_DISPLAYSIZE 35 +#define PROPERTY_ID_LABEL 36 +#define PROPERTY_ID_ISREADONLY 37 +#define PROPERTY_ID_ISWRITABLE 38 +#define PROPERTY_ID_ISDEFINITELYWRITABLE 39 +#define PROPERTY_ID_VALUE 40 +#define PROPERTY_ID_TABLENAME 41 +#define PROPERTY_ID_ISCASESENSITIVE 42 +#define PROPERTY_ID_SERVICENAME 43 +#define PROPERTY_ID_ISBOOKMARKABLE 44 +#define PROPERTY_ID_CANUPDATEINSERTEDROWS 45 +#define PROPERTY_ID_ISSET 46 +#define PROPERTY_ID_ISOUTPARAMETER 47 +#define PROPERTY_ID_NUMBERFORMATSSUPPLIER 48 +#define PROPERTY_ID_ISCALCULATED 49 +#define PROPERTY_ID_DATASOURCENAME 50 +#define PROPERTY_ID_TRANSACTIONISOLATION 51 +#define PROPERTY_ID_TYPEMAP 52 +#define PROPERTY_ID_USER 53 +#define PROPERTY_ID_PASSWORD 54 +#define PROPERTY_ID_COMMANDTYPE 55 +#define PROPERTY_ID_ACTIVECOMMAND 56 +#define PROPERTY_ID_ACTIVECONNECTION 57 +#define PROPERTY_ID_FILTER 58 +#define PROPERTY_ID_APPLYFILTER 59 +#define PROPERTY_ID_ORDER 60 +#define PROPERTY_ID_ISMODIFIED 61 +#define PROPERTY_ID_ISNEW 62 +#define PROPERTY_ID_ROWCOUNT 63 +#define PROPERTY_ID_ISROWCOUNTFINAL 64 +#define PROPERTY_ID_ISINSERTONLY 65 +#define PROPERTY_ID_HELPFILENAME 66 +#define PROPERTY_ID_REALNAME 67 +#define PROPERTY_ID_HIDDEN 68 +#define PROPERTY_ID_ALIGN 69 +#define PROPERTY_ID_WIDTH 70 +#define PROPERTY_ID_TABLETYPEFILTER 71 +#define PROPERTY_ID_DOCUMENTLOCATION 72 +#define PROPERTY_ID_FONT 73 +#define PROPERTY_ID_ROW_HEIGHT 74 +#define PROPERTY_ID_TEXTCOLOR 75 +#define PROPERTY_ID_UPDATE_TABLENAME 76 +#define PROPERTY_ID_UPDATE_SCHEMANAME 77 +#define PROPERTY_ID_UPDATE_CATALOGNAME 78 +#define PROPERTY_ID_CONTROLMODEL 79 +#define PROPERTY_ID_RELATIVEPOSITION 80 +#define PROPERTY_ID_ISASCENDING 81 +#define PROPERTY_ID_RELATEDCOLUMN 82 +#define PROPERTY_ID_ISUNIQUE 83 +#define PROPERTY_ID_ISPRIMARYKEYINDEX 84 +#define PROPERTY_ID_IGNORERESULT 85 +#define PROPERTY_ID_DELETERULE 86 +#define PROPERTY_ID_UPDATERULE 87 +#define PROPERTY_ID_REFERENCEDTABLE 88 +#define PROPERTY_ID_REFERENCEDCOLUMN 89 +//============================================================ +//= property names +//============================================================ + +DECLARE_CONSTASCII_USTRING(PROPERTY_TITLE); +DECLARE_CONSTASCII_USTRING(PROPERTY_URL); +DECLARE_CONSTASCII_USTRING(PROPERTY_INFO); +DECLARE_CONSTASCII_USTRING(PROPERTY_ISPASSWORDREQUIRED); +DECLARE_CONSTASCII_USTRING(PROPERTY_TABLEFILTER); +DECLARE_CONSTASCII_USTRING(PROPERTY_NAME); +DECLARE_CONSTASCII_USTRING(PROPERTY_SCHEMANAME); +DECLARE_CONSTASCII_USTRING(PROPERTY_CATALOGNAME); +DECLARE_CONSTASCII_USTRING(PROPERTY_PRIVILEGES); +DECLARE_CONSTASCII_USTRING(PROPERTY_USE_ESCAPE_PROCESSING); +DECLARE_CONSTASCII_USTRING(PROPERTY_COMMAND); +DECLARE_CONSTASCII_USTRING(PROPERTY_TYPE); +DECLARE_CONSTASCII_USTRING(PROPERTY_TYPENAME); +DECLARE_CONSTASCII_USTRING(PROPERTY_PRECISION); +DECLARE_CONSTASCII_USTRING(PROPERTY_SCALE); +DECLARE_CONSTASCII_USTRING(PROPERTY_ISNULLABLE); +DECLARE_CONSTASCII_USTRING(PROPERTY_ISAUTOINCREMENT); +DECLARE_CONSTASCII_USTRING(PROPERTY_ISROWVERSION); +DECLARE_CONSTASCII_USTRING(PROPERTY_DESCRIPTION); +DECLARE_CONSTASCII_USTRING(PROPERTY_DEFAULTVALUE); +DECLARE_CONSTASCII_USTRING(PROPERTY_NUMBERFORMAT); +DECLARE_CONSTASCII_USTRING(PROPERTY_QUERYTIMEOUT); +DECLARE_CONSTASCII_USTRING(PROPERTY_MAXFIELDSIZE); +DECLARE_CONSTASCII_USTRING(PROPERTY_MAXROWS); +DECLARE_CONSTASCII_USTRING(PROPERTY_CURSORNAME); +DECLARE_CONSTASCII_USTRING(PROPERTY_RESULTSETCONCURRENCY); +DECLARE_CONSTASCII_USTRING(PROPERTY_RESULTSETTYPE); +DECLARE_CONSTASCII_USTRING(PROPERTY_FETCHDIRECTION); +DECLARE_CONSTASCII_USTRING(PROPERTY_FETCHSIZE); +DECLARE_CONSTASCII_USTRING(PROPERTY_USEBOOKMARKS); +DECLARE_CONSTASCII_USTRING(PROPERTY_ISSEARCHABLE); +DECLARE_CONSTASCII_USTRING(PROPERTY_ISCURRENCY); +DECLARE_CONSTASCII_USTRING(PROPERTY_ISSIGNED); +DECLARE_CONSTASCII_USTRING(PROPERTY_DISPLAYSIZE); +DECLARE_CONSTASCII_USTRING(PROPERTY_LABEL); +DECLARE_CONSTASCII_USTRING(PROPERTY_ISREADONLY); +DECLARE_CONSTASCII_USTRING(PROPERTY_ISWRITABLE); +DECLARE_CONSTASCII_USTRING(PROPERTY_ISDEFINITELYWRITABLE); +DECLARE_CONSTASCII_USTRING(PROPERTY_VALUE); +DECLARE_CONSTASCII_USTRING(PROPERTY_TABLENAME); +DECLARE_CONSTASCII_USTRING(PROPERTY_ISCASESENSITIVE); +DECLARE_CONSTASCII_USTRING(PROPERTY_SERVICENAME); +DECLARE_CONSTASCII_USTRING(PROPERTY_ISBOOKMARKABLE); +DECLARE_CONSTASCII_USTRING(PROPERTY_CANUPDATEINSERTEDROWS); +DECLARE_CONSTASCII_USTRING(PROPERTY_ISSET); +DECLARE_CONSTASCII_USTRING(PROPERTY_ISOUTPARAMETER); +DECLARE_CONSTASCII_USTRING(PROPERTY_NUMBERFORMATSSUPPLIER); +DECLARE_CONSTASCII_USTRING(PROPERTY_ISCALCULATED); +DECLARE_CONSTASCII_USTRING(PROPERTY_DATASOURCENAME); +DECLARE_CONSTASCII_USTRING(PROPERTY_TRANSACTIONISOLATION); +DECLARE_CONSTASCII_USTRING(PROPERTY_TYPEMAP); +DECLARE_CONSTASCII_USTRING(PROPERTY_USER); +DECLARE_CONSTASCII_USTRING(PROPERTY_PASSWORD); +DECLARE_CONSTASCII_USTRING(PROPERTY_COMMANDTYPE); +DECLARE_CONSTASCII_USTRING(PROPERTY_ACTIVECOMMAND); +DECLARE_CONSTASCII_USTRING(PROPERTY_ACTIVECONNECTION); +DECLARE_CONSTASCII_USTRING(PROPERTY_FILTER); +DECLARE_CONSTASCII_USTRING(PROPERTY_APPLYFILTER); +DECLARE_CONSTASCII_USTRING(PROPERTY_ORDER); +DECLARE_CONSTASCII_USTRING(PROPERTY_ISMODIFIED); +DECLARE_CONSTASCII_USTRING(PROPERTY_ISNEW); +DECLARE_CONSTASCII_USTRING(PROPERTY_ROWCOUNT); +DECLARE_CONSTASCII_USTRING(PROPERTY_ISROWCOUNTFINAL); +DECLARE_CONSTASCII_USTRING(PROPERTY_ISINSERTONLY); +DECLARE_CONSTASCII_USTRING(PROPERTY_HELPFILENAME); +DECLARE_CONSTASCII_USTRING(PROPERTY_WIDTH); +DECLARE_CONSTASCII_USTRING(PROPERTY_ROW_HEIGHT); +DECLARE_CONSTASCII_USTRING(PROPERTY_FORMATKEY); +DECLARE_CONSTASCII_USTRING(PROPERTY_ALIGN); +DECLARE_CONSTASCII_USTRING(PROPERTY_FONT); +DECLARE_CONSTASCII_USTRING(PROPERTY_TEXTCOLOR); +DECLARE_CONSTASCII_USTRING(PROPERTY_BOUNDFIELD); +DECLARE_CONSTASCII_USTRING(PROPERTY_CONTROLSOURCE); +DECLARE_CONSTASCII_USTRING(PROPERTY_REALNAME); +DECLARE_CONSTASCII_USTRING(PROPERTY_HIDDEN); +DECLARE_CONSTASCII_USTRING(PROPERTY_TABLETYPEFILTER); +DECLARE_CONSTASCII_USTRING(PROPERTY_DOCUMENTLOCATION); +DECLARE_CONSTASCII_USTRING(PROPERTY_UPDATE_TABLENAME); +DECLARE_CONSTASCII_USTRING(PROPERTY_UPDATE_SCHEMANAME); +DECLARE_CONSTASCII_USTRING(PROPERTY_UPDATE_CATALOGNAME); +DECLARE_CONSTASCII_USTRING(PROPERTY_RELATIVEPOSITION); +DECLARE_CONSTASCII_USTRING(PROPERTY_CONTROLMODEL); +DECLARE_CONSTASCII_USTRING(PROPERTY_ISASCENDING); +DECLARE_CONSTASCII_USTRING(PROPERTY_RELATEDCOLUMN); +DECLARE_CONSTASCII_USTRING(PROPERTY_ISUNIQUE); +DECLARE_CONSTASCII_USTRING(PROPERTY_ISPRIMARYKEYINDEX); +DECLARE_CONSTASCII_USTRING(PROPERTY_IGNORERESULT); +DECLARE_CONSTASCII_USTRING(PROPERTY_UPDATERULE); +DECLARE_CONSTASCII_USTRING(PROPERTY_DELETERULE); +DECLARE_CONSTASCII_USTRING(PROPERTY_REFERENCEDTABLE); +DECLARE_CONSTASCII_USTRING(PROPERTY_REFERENCEDCOLUMN); + +//============================================================ +//= service names +//============================================================ +DECLARE_CONSTASCII_USTRING(SERVICE_SDBC_RESULTSET); +DECLARE_CONSTASCII_USTRING(SERVICE_SDBC_ROWSET); +DECLARE_CONSTASCII_USTRING(SERVICE_SDBC_STATEMENT); +DECLARE_CONSTASCII_USTRING(SERVICE_SDBC_PREPAREDSTATEMENT); +DECLARE_CONSTASCII_USTRING(SERVICE_SDBC_CALLABLESTATEMENT); +DECLARE_CONSTASCII_USTRING(SERVICE_SDBC_CONNECTION); +DECLARE_CONSTASCII_USTRING(SERVICE_SDBCX_CONTAINER); +DECLARE_CONSTASCII_USTRING(SERVICE_SDBCX_TABLE); +DECLARE_CONSTASCII_USTRING(SERVICE_SDBCX_RESULTSET); +DECLARE_CONSTASCII_USTRING(SERVICE_SDB_CONNECTION); +DECLARE_CONSTASCII_USTRING(SERVICE_SDBCX_COLUMN); +DECLARE_CONSTASCII_USTRING(SERVICE_SDBCX_INDEXCOLUMN); +DECLARE_CONSTASCII_USTRING(SERVICE_SDBCX_KEYCOLUMN); +DECLARE_CONSTASCII_USTRING(SERVICE_SDBCX_COLUMNDESCRIPTOR); +DECLARE_CONSTASCII_USTRING(SERVICE_SDB_COLUMNSETTINGS); +DECLARE_CONSTASCII_USTRING(SERVICE_SDB_RESULTCOLUMN); +DECLARE_CONSTASCII_USTRING(SERVICE_SDB_DATACOLUMN); +DECLARE_CONSTASCII_USTRING(SERVICE_SDB_DATAACCESSCONNECTION); +DECLARE_CONSTASCII_USTRING(SERVICE_SDB_DATABASECONTEXT); // the new (portal) service +DECLARE_CONSTASCII_USTRING(SERVICE_SDB_DATASOURCE); // the new (portal) service +DECLARE_CONSTASCII_USTRING(SERVICE_SDB_ROWSET); +DECLARE_CONSTASCII_USTRING(SERVICE_SDB_RESULTSET); +DECLARE_CONSTASCII_USTRING(SERVICE_SDB_STATEMENT); +DECLARE_CONSTASCII_USTRING(SERVICE_SDB_PREPAREDSTATMENT); +DECLARE_CONSTASCII_USTRING(SERVICE_SDB_CALLABLESTATEMENT); +DECLARE_CONSTASCII_USTRING(SERVICE_SDB_SQLQUERYCOMPOSER); +DECLARE_CONSTASCII_USTRING(SERVICE_SDB_DATASETTINGS); +DECLARE_CONSTASCII_USTRING(SERVICE_SDB_QUERYDESCRIPTOR); +DECLARE_CONSTASCII_USTRING(SERVICE_SDB_QUERY); +DECLARE_CONSTASCII_USTRING(SERVICE_SDB_QUERYDEFINITION); +DECLARE_CONSTASCII_USTRING(SERVICE_SDB_COLUMNSETTINGS); +DECLARE_CONSTASCII_USTRING(SERVICE_SDBCX_COLUMNS); +DECLARE_CONSTASCII_USTRING(SERVICE_SDBCX_TABLES); +DECLARE_CONSTASCII_USTRING(SERVICE_SDB_QUERIES); +DECLARE_CONSTASCII_USTRING(SERVICE_SDBC_DRIVERMANAGER); + +//============================================================ +//= configuration key names +//============================================================ +// (we could use PROPERTY_* strings for this, but this would mean that +// our configuration scheme would change if a property name changes for +// any reason) +DECLARE_CONSTASCII_USTRING(CONFIGKEY_CONTAINERLEMENT_TITLE); +DECLARE_CONSTASCII_USTRING(CONFIGKEY_CONTAINERLEMENT_OBJECT); + +DECLARE_CONSTASCII_USTRING(CONFIGKEY_DBLINK_CONNECTURL); +DECLARE_CONSTASCII_USTRING(CONFIGKEY_DBLINK_USER); +DECLARE_CONSTASCII_USTRING(CONFIGKEY_DBLINK_TABLEFILTER); +DECLARE_CONSTASCII_USTRING(CONFIGKEY_DBLINK_TABLETYEFILTER); +DECLARE_CONSTASCII_USTRING(CONFIGKEY_DBLINK_LOGINTIMEOUT); +DECLARE_CONSTASCII_USTRING(CONFIGKEY_DBLINK_PASSWORDREQUIRED); +DECLARE_CONSTASCII_USTRING(CONFIGKEY_DBLINK_FORMDOCUMENTS); +DECLARE_CONSTASCII_USTRING(CONFIGKEY_DBLINK_REPORTDOCUMENTS); +DECLARE_CONSTASCII_USTRING(CONFIGKEY_DBLINK_QUERYDOCUMENTS); +DECLARE_CONSTASCII_USTRING(CONFIGKEY_DBLINK_DOCUMENTLOCAITON); + +DECLARE_CONSTASCII_USTRING(CONFIGKEY_QRYDESCR_COMMAND); +DECLARE_CONSTASCII_USTRING(CONFIGKEY_QRYDESCR_USE_ESCAPE_PROCESSING); +DECLARE_CONSTASCII_USTRING(CONFIGKEY_QRYDESCR_UPDATE_TABLENAME); +DECLARE_CONSTASCII_USTRING(CONFIGKEY_QRYDESCR_UPDATE_SCHEMANAME); +DECLARE_CONSTASCII_USTRING(CONFIGKEY_QRYDESCR_UPDATE_CATALOGNAME); +DECLARE_CONSTASCII_USTRING(CONFIGKEY_QRYDESCR_COLUMNS); + +DECLARE_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FILTER); +DECLARE_CONSTASCII_USTRING(CONFIGKEY_DEFSET_APPLYFILTER); +DECLARE_CONSTASCII_USTRING(CONFIGKEY_DEFSET_ORDER); +DECLARE_CONSTASCII_USTRING(CONFIGKEY_DEFSET_ROW_HEIGHT); +DECLARE_CONSTASCII_USTRING(CONFIGKEY_DEFSET_TEXTCOLOR); +DECLARE_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_NAME); +DECLARE_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_HEIGHT); +DECLARE_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_WIDTH); +DECLARE_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_STYLENAME); +DECLARE_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_FAMILY); +DECLARE_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_CHARSET); +DECLARE_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_PITCH); +DECLARE_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_CHARACTERWIDTH); +DECLARE_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_WEIGHT); +DECLARE_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_SLANT); +DECLARE_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_UNDERLINE); +DECLARE_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_STRIKEOUT); +DECLARE_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_ORIENTATION); +DECLARE_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_KERNING); +DECLARE_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_WORDLINEMODE); +DECLARE_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_TYPE); +DECLARE_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_ROOTNODE); + +DECLARE_CONSTASCII_USTRING(CONFIGKEY_COLUMN_ALIGNMENT); +DECLARE_CONSTASCII_USTRING(CONFIGKEY_COLUMN_WIDTH); +//DECLARE_CONSTASCII_USTRING(CONFIGKEY_COLUMN_DESCRIPTION); +//DECLARE_CONSTASCII_USTRING(CONFIGKEY_COLUMN_DEFAULTVALUE); +DECLARE_CONSTASCII_USTRING(CONFIGKEY_COLUMN_NUMBERFORMAT); +DECLARE_CONSTASCII_USTRING(CONFIGKEY_COLUMN_RELPOSITION); +DECLARE_CONSTASCII_USTRING(CONFIGKEY_COLUMN_HIDDEN); + + +//============================================================ +//= SQLSTATE +//============================================================ +DECLARE_CONSTASCII_USTRING(SQLSTATE_GENERAL); +DECLARE_CONSTASCII_USTRING(SQLSTATE_SEQUENCE); + + +//============================================================ +//= error messages +//============================================================ +DECLARE_CONSTASCII_USTRING(ERRORMSG_SEQUENCE); +} +#endif // _DBASHARED_STRINGCONSTANTS_HRC_ + +//************************************************************************** +// history: +// $Log: not supported by cvs2svn $ +// Revision 1.10 2000/09/18 14:52:51 willem.vandorp +// OpenOffice header added. +// +// Revision 1.9 2000/09/01 15:31:16 oj +// some changes +// +// Revision 1.8 2000/08/04 16:29:23 willem.vandorp +// Header and footer replaced +// +// Revision 1.7 2000/06/27 08:55:51 dg +// CommandPreparation new +// +// Revision 1.6 2000/06/20 16:34:17 hr +// removed addtionla const +// +// Revision 1.5 2000/06/18 16:45:13 dg +// update of properties +// +// Revision 1.4 2000/06/14 06:39:49 fs +// adjustments +// +// Revision 1.3 2000/06/09 15:00:57 dg +// adjustments +// +// Revision 1.2 2000/06/09 12:53:54 fs +// adjustments +// +// Revision 1.1.1.1 2000/06/06 05:54:09 fs +// new database access +// +// +//************************************************************************** + diff --git a/dbaccess/source/shared/apitools.cxx b/dbaccess/source/shared/apitools.cxx new file mode 100644 index 000000000000..a4c28f763649 --- /dev/null +++ b/dbaccess/source/shared/apitools.cxx @@ -0,0 +1,235 @@ +/************************************************************************* + * + * $RCSfile: apitools.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:14:56 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 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 + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef _DBASHARED_APITOOLS_HXX_ +#include "apitools.hxx" +#endif +#ifndef _DBASHARED_STRINGCONSTANTS_HRC_ +#include "stringconstants.hrc" +#endif +#ifndef _CPPUHELPER_TYPEPROVIDER_HXX_ +#include <cppuhelper/typeprovider.hxx> +#endif +#ifndef _OSL_DIAGNOSE_H_ +#include <osl/diagnose.h> +#endif + +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::lang; +using namespace ::com::sun::star::sdbc; +using namespace cppu; +using namespace osl; +using namespace dbaccess; + +//============================================================ +//= FunctionSequenceException +//============================================================ +FunctionSequenceException::FunctionSequenceException(const Reference< XInterface >& _Context, const Any& _Next) + :SQLException(ERRORMSG_SEQUENCE, + _Context, + SQLSTATE_SEQUENCE, 0, + _Next){}; + +//================================================================================== +//= various helper functions +//================================================================================== +//-------------------------------------------------------------------------- +void composeTableName( const Reference< XDatabaseMetaData >& _rxMetaData, + const ::rtl::OUString& _rCatalog, + const ::rtl::OUString& _rSchema, + const ::rtl::OUString& _rName, + ::rtl::OUString& _rComposedName, + sal_Bool _bQuote) +{ + OSL_ENSHURE(_rxMetaData.is(), "composeTableName : invalid meta data !"); + OSL_ENSHURE(_rName.getLength(), "composeTableName : at least the name should be non-empty !"); + + ::rtl::OUString sQuoteString = _rxMetaData->getIdentifierQuoteString(); +#define QUOTE(s) if (_bQuote) s += sQuoteString + + static ::rtl::OUString sEmpty; + static ::rtl::OUString sSeparator = ::rtl::OUString::createFromAscii("."); + _rComposedName = sEmpty; + + if (_rCatalog.getLength() && _rxMetaData->isCatalogAtStart() && !_rxMetaData->usesLocalFiles()) + { + QUOTE(_rComposedName); + _rComposedName += _rCatalog; + QUOTE(_rComposedName); + _rComposedName += _rxMetaData->getCatalogSeparator(); + } + + if (_rSchema.getLength()) + { + QUOTE(_rComposedName); + _rComposedName += _rSchema; + QUOTE(_rComposedName); + _rComposedName += sSeparator; + QUOTE(_rComposedName); + _rComposedName += _rName; + QUOTE(_rComposedName); + } + else + { + QUOTE(_rComposedName); + _rComposedName += _rName; + QUOTE(_rComposedName); + } + + if (_rCatalog.getLength() && !_rxMetaData->isCatalogAtStart() && !_rxMetaData->usesLocalFiles()) + { + _rComposedName += _rxMetaData->getCatalogSeparator(); + QUOTE(_rComposedName); + _rComposedName += _rCatalog; + QUOTE(_rComposedName); + } +} + +//============================================================ +//= OSubComponent +//============================================================ +//-------------------------------------------------------------------------- +OSubComponent::OSubComponent(Mutex& _rMutex, const Reference< XInterface > & xParent) + :OComponentHelper(_rMutex) + ,m_xParent(xParent) +{ +} + +// com::sun::star::lang::XTypeProvider +//-------------------------------------------------------------------------- +Sequence< Type > OSubComponent::getTypes() throw (RuntimeException) +{ + OTypeCollection aTypes(::getCppuType( (const Reference< XComponent > *)0 ), + ::getCppuType( (const Reference< XTypeProvider > *)0 ), + ::getCppuType( (const Reference< XWeak > *)0 )); + + return aTypes.getTypes(); +} + +// XInterface +//-------------------------------------------------------------------------- +void OSubComponent::acquire() throw (RuntimeException) +{ + OComponentHelper::acquire(); +} + +//-------------------------------------------------------------------------- +void OSubComponent::release() throw (RuntimeException) +{ + Reference< XInterface > x( xDelegator ); + if (! x.is()) + { + if (osl_decrementInterlockedCount( &m_refCount ) == 0) + { + if (! rBHelper.bDisposed) + { + Reference< XInterface > xHoldAlive( *this ); + + // remember the parent + Reference< XInterface > xParent; + { + MutexGuard aGuard( rBHelper.rMutex ); + xParent = m_xParent; + m_xParent = NULL; + } + + // First dispose + dispose(); + + // only the alive ref holds the object + OSL_ASSERT( m_refCount == 1 ); + + // release the parent in the ~ + if (xParent.is()) + { + MutexGuard aGuard( rBHelper.rMutex ); + m_xParent = xParent; + } + + // destroy the object if xHoldAlive decrement the refcount to 0 + return; + } + } + // restore the reference count + osl_incrementInterlockedCount( &m_refCount ); + } + + // as we cover the job of the componenthelper we use the ... + OWeakAggObject::release(); +} + +//-------------------------------------------------------------------------- +Any OSubComponent::queryInterface( const Type & rType ) throw(RuntimeException) +{ + Any aReturn; + if (!rType.equals(::getCppuType(static_cast< Reference< XAggregation >* >(NULL)))) + aReturn = OComponentHelper::queryInterface(rType); + + return aReturn; +} + +//-------------------------------------------------------------------------- +void OSubComponent::disposing() +{ + MutexGuard aGuard( rBHelper.rMutex ); + m_xParent = NULL; +} + diff --git a/dbaccess/source/shared/makefile.mk b/dbaccess/source/shared/makefile.mk new file mode 100644 index 000000000000..c873ac91bbdf --- /dev/null +++ b/dbaccess/source/shared/makefile.mk @@ -0,0 +1,92 @@ +#************************************************************************* +# +# $RCSfile: makefile.mk,v $ +# +# $Revision: 1.1.1.1 $ +# +# last change: $Author: hr $ $Date: 2000-09-18 16:14:56 $ +# +# The Contents of this file are made available subject to the terms of +# either of the following licenses +# +# - GNU Lesser General Public License Version 2.1 +# - Sun Industry Standards Source License Version 1.1 +# +# Sun Microsystems Inc., October, 2000 +# +# GNU Lesser General Public License Version 2.1 +# ============================================= +# Copyright 2000 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 +# +# +# Sun Industry Standards Source License Version 1.1 +# ================================================= +# The contents of this file are subject to the Sun Industry Standards +# Source License Version 1.1 (the "License"); You may not use this file +# except in compliance with the License. You may obtain a copy of the +# License at http://www.openoffice.org/license.html. +# +# Software provided under this License is provided on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, +# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, +# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. +# See the License for the specific provisions governing your rights and +# obligations concerning the Software. +# +# The Initial Developer of the Original Code is: Sun Microsystems, Inc. +# +# Copyright: 2000 by Sun Microsystems, Inc. +# +# All Rights Reserved. +# +# Contributor(s): _______________________________________ +# +# +# +#************************************************************************* + +PRJ=..$/.. +PRJINC=$(PRJ)$/source +PRJNAME=dbaccess +TARGET=shared + +#ENABLE_EXCEPTIONS=TRUE + +# --- Settings ---------------------------------- + +.INCLUDE : settings.mk + +# --- Types ------------------------------------- + +# --- Files ------------------------------------- + +SLOFILES= \ + $(SLO)$/stubs.obj \ + $(SLO)$/registrationhelper.obj \ + $(SLO)$/stringconstants.obj \ + $(SLO)$/apitools.obj + +EXCEPTIONSFILES= \ + $(SLO)$/apitools.obj \ + $(SLO)$/registrationhelper.obj \ + $(SLO)$/stubs.obj + +# --- Targets ---------------------------------- + +.INCLUDE : target.mk + diff --git a/dbaccess/source/shared/registrationhelper.cxx b/dbaccess/source/shared/registrationhelper.cxx new file mode 100644 index 000000000000..36c514eb6795 --- /dev/null +++ b/dbaccess/source/shared/registrationhelper.cxx @@ -0,0 +1,256 @@ +/************************************************************************* + * + * $RCSfile: registrationhelper.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:14:56 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 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 + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef _DBA_REGISTRATION_HELPER_HXX_ +#include "registrationhelper.hxx" +#endif + +#ifndef _OSL_DIAGNOSE_H_ +#include <osl/diagnose.h> +#endif +#ifndef _UTL_SEQUENCE_HXX_ +#include <unotools/sequence.hxx> +#endif + +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::lang; +using namespace ::com::sun::star::registry; +using namespace ::rtl; +using namespace ::utl; +using namespace ::cppu; + +Sequence< OUString >* OModuleRegistration::s_pImplementationNames = NULL; +Sequence< Sequence< OUString > >* OModuleRegistration::s_pSupportedServices = NULL; +Sequence< sal_Int64 >* OModuleRegistration::s_pCreationFunctionPointers = NULL; +Sequence< sal_Int64 >* OModuleRegistration::s_pFactoryFunctionPointers = NULL; + +//-------------------------------------------------------------------------- +void OModuleRegistration::registerComponent( + const OUString& _rImplementationName, + const Sequence< OUString >& _rServiceNames, + ComponentInstantiation _pCreateFunction, + FactoryInstantiation _pFactoryFunction) +{ + if (!s_pImplementationNames) + { + OSL_ENSHURE(!s_pSupportedServices && !s_pCreationFunctionPointers && !s_pFactoryFunctionPointers, + "OModuleRegistration::registerComponent : inconsistent state (the pointers (1)) !"); + s_pImplementationNames = new Sequence< OUString >; + s_pSupportedServices = new Sequence< Sequence< OUString > >; + s_pCreationFunctionPointers = new Sequence< sal_Int64 >; + s_pFactoryFunctionPointers = new Sequence< sal_Int64 >; + } + OSL_ENSHURE(s_pImplementationNames && s_pSupportedServices && s_pCreationFunctionPointers && s_pFactoryFunctionPointers, + "OModuleRegistration::registerComponent : inconsistent state (the pointers (2)) !"); + + OSL_ENSHURE( (s_pImplementationNames->getLength() == s_pSupportedServices->getLength()) + && (s_pImplementationNames->getLength() == s_pCreationFunctionPointers->getLength()) + && (s_pImplementationNames->getLength() == s_pFactoryFunctionPointers->getLength()), + "OModuleRegistration::registerComponent : inconsistent state !"); + + sal_Int32 nOldLen = s_pImplementationNames->getLength(); + s_pImplementationNames->realloc(nOldLen + 1); + s_pSupportedServices->realloc(nOldLen + 1); + s_pCreationFunctionPointers->realloc(nOldLen + 1); + s_pFactoryFunctionPointers->realloc(nOldLen + 1); + + s_pImplementationNames->getArray()[nOldLen] = _rImplementationName; + s_pSupportedServices->getArray()[nOldLen] = _rServiceNames; + s_pCreationFunctionPointers->getArray()[nOldLen] = reinterpret_cast<sal_Int64>(_pCreateFunction); + s_pFactoryFunctionPointers->getArray()[nOldLen] = reinterpret_cast<sal_Int64>(_pFactoryFunction); +} + +//-------------------------------------------------------------------------- +void OModuleRegistration::revokeComponent(const ::rtl::OUString& _rImplementationName) +{ + if (!s_pImplementationNames) + { + OSL_ASSERT("OModuleRegistration::revokeComponent : have no class infos ! Are you sure called this method at the right time ?"); + return; + } + OSL_ENSHURE(s_pImplementationNames && s_pSupportedServices && s_pCreationFunctionPointers && s_pFactoryFunctionPointers, + "OModuleRegistration::revokeComponent : inconsistent state (the pointers) !"); + OSL_ENSHURE( (s_pImplementationNames->getLength() == s_pSupportedServices->getLength()) + && (s_pImplementationNames->getLength() == s_pCreationFunctionPointers->getLength()) + && (s_pImplementationNames->getLength() == s_pFactoryFunctionPointers->getLength()), + "OModuleRegistration::revokeComponent : inconsistent state !"); + + sal_Int32 nLen = s_pImplementationNames->getLength(); + const OUString* pImplNames = s_pImplementationNames->getConstArray(); + for (sal_Int32 i=0; i<nLen; ++i, ++pImplNames) + { + if (pImplNames->equals(_rImplementationName)) + { + removeElementAt(*s_pImplementationNames, i); + removeElementAt(*s_pSupportedServices, i); + removeElementAt(*s_pCreationFunctionPointers, i); + removeElementAt(*s_pFactoryFunctionPointers, i); + break; + } + } + + if (s_pImplementationNames->getLength() == 0) + { + delete s_pImplementationNames; s_pImplementationNames = NULL; + delete s_pSupportedServices; s_pSupportedServices = NULL; + delete s_pCreationFunctionPointers; s_pCreationFunctionPointers = NULL; + delete s_pFactoryFunctionPointers; s_pFactoryFunctionPointers = NULL; + } +} + +//-------------------------------------------------------------------------- +sal_Bool OModuleRegistration::writeComponentInfos( + const Reference< XMultiServiceFactory >& /*_rxServiceManager*/, + const Reference< XRegistryKey >& _rxRootKey) +{ + OSL_ENSHURE(_rxRootKey.is(), "OModuleRegistration::writeComponentInfos : invalid argument !"); + + if (!s_pImplementationNames) + { + OSL_ASSERT("OModuleRegistration::writeComponentInfos : have no class infos ! Are you sure called this method at the right time ?"); + return sal_True; + } + OSL_ENSHURE(s_pImplementationNames && s_pSupportedServices && s_pCreationFunctionPointers && s_pFactoryFunctionPointers, + "OModuleRegistration::writeComponentInfos : inconsistent state (the pointers) !"); + OSL_ENSHURE( (s_pImplementationNames->getLength() == s_pSupportedServices->getLength()) + && (s_pImplementationNames->getLength() == s_pCreationFunctionPointers->getLength()) + && (s_pImplementationNames->getLength() == s_pFactoryFunctionPointers->getLength()), + "OModuleRegistration::writeComponentInfos : inconsistent state !"); + + sal_Int32 nLen = s_pImplementationNames->getLength(); + const OUString* pImplName = s_pImplementationNames->getConstArray(); + const Sequence< OUString >* pServices = s_pSupportedServices->getConstArray(); + + OUString sRootKey("/", 1, RTL_TEXTENCODING_ASCII_US); + for (sal_Int32 i=0; i<nLen; ++i, ++pImplName, ++pServices) + { + OUString aMainKeyName(sRootKey); + aMainKeyName += *pImplName; + aMainKeyName += OUString::createFromAscii("/UNO/SERVICES"); + + try + { + Reference< XRegistryKey > xNewKey( _rxRootKey->createKey(aMainKeyName) ); + + const OUString* pService = pServices->getConstArray(); + for (sal_uInt32 j=0; j<pServices->getLength(); ++j, ++pService) + xNewKey->createKey(*pService); + } + catch(...) + { + OSL_ASSERT("OModuleRegistration::writeComponentInfos : something went wrong while creating the keys !"); + return sal_False; + } + } + + return sal_True; +} + +//-------------------------------------------------------------------------- +Reference< XInterface > OModuleRegistration::getComponentFactory( + const ::rtl::OUString& _rImplementationName, + const Reference< XMultiServiceFactory >& _rxServiceManager) +{ + OSL_ENSHURE(_rxServiceManager.is(), "OModuleRegistration::getComponentFactory : invalid argument (service manager) !"); + OSL_ENSHURE(_rImplementationName.getLength(), "OModuleRegistration::getComponentFactory : invalid argument (implementation name) !"); + + if (!s_pImplementationNames) + { + OSL_ASSERT("OModuleRegistration::getComponentFactory : have no class infos ! Are you sure called this method at the right time ?"); + return NULL; + } + OSL_ENSHURE(s_pImplementationNames && s_pSupportedServices && s_pCreationFunctionPointers && s_pFactoryFunctionPointers, + "OModuleRegistration::getComponentFactory : inconsistent state (the pointers) !"); + OSL_ENSHURE( (s_pImplementationNames->getLength() == s_pSupportedServices->getLength()) + && (s_pImplementationNames->getLength() == s_pCreationFunctionPointers->getLength()) + && (s_pImplementationNames->getLength() == s_pFactoryFunctionPointers->getLength()), + "OModuleRegistration::getComponentFactory : inconsistent state !"); + + + Reference< XInterface > xReturn; + + + sal_Int32 nLen = s_pImplementationNames->getLength(); + const OUString* pImplName = s_pImplementationNames->getConstArray(); + const Sequence< OUString >* pServices = s_pSupportedServices->getConstArray(); + const sal_Int64* pComponentFunction = s_pCreationFunctionPointers->getConstArray(); + const sal_Int64* pFactoryFunction = s_pFactoryFunctionPointers->getConstArray(); + + for (sal_Int32 i=0; i<nLen; ++i, ++pImplName, ++pServices, ++pComponentFunction, ++pFactoryFunction) + { + if (pImplName->equals(_rImplementationName)) + { + const FactoryInstantiation FactoryInstantiationFunction = reinterpret_cast<const FactoryInstantiation>(*pFactoryFunction); + const ComponentInstantiation ComponentInstantiationFunction = reinterpret_cast<const ComponentInstantiation>(*pComponentFunction); + + xReturn = FactoryInstantiationFunction( _rxServiceManager, *pImplName, ComponentInstantiationFunction, *pServices); + if (xReturn.is()) + { + xReturn->acquire(); + return xReturn.get(); + } + } + } + + return NULL; +} + + diff --git a/dbaccess/source/shared/stringconstants.cxx b/dbaccess/source/shared/stringconstants.cxx new file mode 100644 index 000000000000..9b497fabdd05 --- /dev/null +++ b/dbaccess/source/shared/stringconstants.cxx @@ -0,0 +1,266 @@ +/************************************************************************* + * + * $RCSfile: stringconstants.cxx,v $ + * + * $Revision: 1.1.1.1 $ + * + * last change: $Author: hr $ $Date: 2000-09-18 16:14:56 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 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 + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#include "stringconstants.hrc" + +namespace dbaccess +{ +//============================================================ +//= property names +//============================================================ +IMPLEMENT_CONSTASCII_USTRING(PROPERTY_TITLE, "Title"); +IMPLEMENT_CONSTASCII_USTRING(PROPERTY_URL, "URL"); +IMPLEMENT_CONSTASCII_USTRING(PROPERTY_INFO, "Info"); +IMPLEMENT_CONSTASCII_USTRING(PROPERTY_ISPASSWORDREQUIRED, "IsPasswordRequired"); +IMPLEMENT_CONSTASCII_USTRING(PROPERTY_TABLEFILTER, "TableFilter"); +IMPLEMENT_CONSTASCII_USTRING(PROPERTY_TABLETYPEFILTER, "TableTypeFilter"); +IMPLEMENT_CONSTASCII_USTRING(PROPERTY_NAME, "Name"); +IMPLEMENT_CONSTASCII_USTRING(PROPERTY_SCHEMANAME, "SchemaName"); +IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CATALOGNAME, "CatalogName"); +IMPLEMENT_CONSTASCII_USTRING(PROPERTY_PRIVILEGES, "Privileges"); +IMPLEMENT_CONSTASCII_USTRING(PROPERTY_USE_ESCAPE_PROCESSING, "EscapeProcessing"); +IMPLEMENT_CONSTASCII_USTRING(PROPERTY_COMMAND, "Command"); +IMPLEMENT_CONSTASCII_USTRING(PROPERTY_TYPE, "Type"); +IMPLEMENT_CONSTASCII_USTRING(PROPERTY_TYPENAME, "TypeName"); +IMPLEMENT_CONSTASCII_USTRING(PROPERTY_PRECISION, "Precision"); +IMPLEMENT_CONSTASCII_USTRING(PROPERTY_SCALE, "Scale"); +IMPLEMENT_CONSTASCII_USTRING(PROPERTY_ISNULLABLE, "IsNullable"); +IMPLEMENT_CONSTASCII_USTRING(PROPERTY_ISAUTOINCREMENT, "IsAutoIncrement"); +IMPLEMENT_CONSTASCII_USTRING(PROPERTY_ISROWVERSION, "IsRowVersion"); +IMPLEMENT_CONSTASCII_USTRING(PROPERTY_DESCRIPTION, "Description"); +IMPLEMENT_CONSTASCII_USTRING(PROPERTY_DEFAULTVALUE, "DefaultValue"); +IMPLEMENT_CONSTASCII_USTRING(PROPERTY_NUMBERFORMAT, "FormatKey"); +IMPLEMENT_CONSTASCII_USTRING(PROPERTY_QUERYTIMEOUT, "QueryTimeOut"); +IMPLEMENT_CONSTASCII_USTRING(PROPERTY_MAXFIELDSIZE, "MaxFieldSize"); +IMPLEMENT_CONSTASCII_USTRING(PROPERTY_MAXROWS, "MaxRows"); +IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CURSORNAME, "CursorName"); +IMPLEMENT_CONSTASCII_USTRING(PROPERTY_RESULTSETCONCURRENCY, "ResultSetConcurrency"); +IMPLEMENT_CONSTASCII_USTRING(PROPERTY_RESULTSETTYPE, "ResultSetType"); +IMPLEMENT_CONSTASCII_USTRING(PROPERTY_FETCHDIRECTION, "FetchDirection"); +IMPLEMENT_CONSTASCII_USTRING(PROPERTY_FETCHSIZE, "FetchSize"); +IMPLEMENT_CONSTASCII_USTRING(PROPERTY_USEBOOKMARKS, "UseBookmarks"); +IMPLEMENT_CONSTASCII_USTRING(PROPERTY_ISSEARCHABLE, "IsSearchable"); +IMPLEMENT_CONSTASCII_USTRING(PROPERTY_ISCURRENCY, "IsCurrency"); +IMPLEMENT_CONSTASCII_USTRING(PROPERTY_ISSIGNED, "IsSigned"); +IMPLEMENT_CONSTASCII_USTRING(PROPERTY_DISPLAYSIZE, "DisplaySize"); +IMPLEMENT_CONSTASCII_USTRING(PROPERTY_LABEL, "Label"); +IMPLEMENT_CONSTASCII_USTRING(PROPERTY_ISREADONLY, "IsReadOnly"); +IMPLEMENT_CONSTASCII_USTRING(PROPERTY_ISWRITABLE, "IsWritable"); +IMPLEMENT_CONSTASCII_USTRING(PROPERTY_ISDEFINITELYWRITABLE, "IsDefinitelyWritable"); +IMPLEMENT_CONSTASCII_USTRING(PROPERTY_VALUE, "Value"); +IMPLEMENT_CONSTASCII_USTRING(PROPERTY_TABLENAME, "TableName"); +IMPLEMENT_CONSTASCII_USTRING(PROPERTY_ISCASESENSITIVE, "IsCaseSensitive"); +IMPLEMENT_CONSTASCII_USTRING(PROPERTY_SERVICENAME, "ServiceName"); +IMPLEMENT_CONSTASCII_USTRING(PROPERTY_ISBOOKMARKABLE, "IsBookmarkable"); +IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CANUPDATEINSERTEDROWS, "CanUpdateInsertedRows"); +IMPLEMENT_CONSTASCII_USTRING(PROPERTY_ISSET, "IsSet"); +IMPLEMENT_CONSTASCII_USTRING(PROPERTY_ISOUTPARAMETER, "IsOutParameter"); +IMPLEMENT_CONSTASCII_USTRING(PROPERTY_NUMBERFORMATSSUPPLIER, "NumberFormatsSupplier"); +IMPLEMENT_CONSTASCII_USTRING(PROPERTY_ISCALCULATED, "IsCalculated"); +IMPLEMENT_CONSTASCII_USTRING(PROPERTY_DATASOURCENAME, "DataSourceName"); +IMPLEMENT_CONSTASCII_USTRING(PROPERTY_TRANSACTIONISOLATION, "TransactionIsolation"); +IMPLEMENT_CONSTASCII_USTRING(PROPERTY_TYPEMAP, "TypeMap"); +IMPLEMENT_CONSTASCII_USTRING(PROPERTY_USER, "User"); +IMPLEMENT_CONSTASCII_USTRING(PROPERTY_PASSWORD, "Password"); +IMPLEMENT_CONSTASCII_USTRING(PROPERTY_COMMANDTYPE, "CommandType"); +IMPLEMENT_CONSTASCII_USTRING(PROPERTY_ACTIVECOMMAND, "ActiveCommand"); +IMPLEMENT_CONSTASCII_USTRING(PROPERTY_ACTIVECONNECTION, "ActiveConnection"); +IMPLEMENT_CONSTASCII_USTRING(PROPERTY_ISINSERTONLY, "IsInsertOnly"); +IMPLEMENT_CONSTASCII_USTRING(PROPERTY_FILTER, "Filter"); +IMPLEMENT_CONSTASCII_USTRING(PROPERTY_APPLYFILTER, "ApplyFilter"); +IMPLEMENT_CONSTASCII_USTRING(PROPERTY_ORDER, "Order"); +IMPLEMENT_CONSTASCII_USTRING(PROPERTY_ISMODIFIED, "IsModified"); +IMPLEMENT_CONSTASCII_USTRING(PROPERTY_ISNEW, "IsNew"); +IMPLEMENT_CONSTASCII_USTRING(PROPERTY_ROWCOUNT, "RowCount"); +IMPLEMENT_CONSTASCII_USTRING(PROPERTY_ISROWCOUNTFINAL, "IsRowCountFinal"); +IMPLEMENT_CONSTASCII_USTRING(PROPERTY_HELPFILENAME, "HelpFileName"); +IMPLEMENT_CONSTASCII_USTRING(PROPERTY_WIDTH, "Width"); +IMPLEMENT_CONSTASCII_USTRING(PROPERTY_ROW_HEIGHT, "RowHeight"); +IMPLEMENT_CONSTASCII_USTRING(PROPERTY_FORMATKEY, "FormatKey"); +IMPLEMENT_CONSTASCII_USTRING(PROPERTY_ALIGN, "Align"); +IMPLEMENT_CONSTASCII_USTRING(PROPERTY_FONT, "FontDescriptor"); +IMPLEMENT_CONSTASCII_USTRING(PROPERTY_TEXTCOLOR, "TextColor"); +IMPLEMENT_CONSTASCII_USTRING(PROPERTY_BOUNDFIELD, "BoundField"); +IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CONTROLSOURCE, "DataField"); +IMPLEMENT_CONSTASCII_USTRING(PROPERTY_REALNAME, "RealName"); +IMPLEMENT_CONSTASCII_USTRING(PROPERTY_HIDDEN, "IsHidden"); +IMPLEMENT_CONSTASCII_USTRING(PROPERTY_DOCUMENTLOCATION, "DocumentLocation"); +IMPLEMENT_CONSTASCII_USTRING(PROPERTY_UPDATE_TABLENAME, "UpdateTableName"); +IMPLEMENT_CONSTASCII_USTRING(PROPERTY_UPDATE_SCHEMANAME, "UpdateSchemaName"); +IMPLEMENT_CONSTASCII_USTRING(PROPERTY_UPDATE_CATALOGNAME, "UpdateCatalogName"); +IMPLEMENT_CONSTASCII_USTRING(PROPERTY_RELATIVEPOSITION, "RelativePosition"); +IMPLEMENT_CONSTASCII_USTRING(PROPERTY_CONTROLMODEL, "ControlModel"); +IMPLEMENT_CONSTASCII_USTRING(PROPERTY_ISASCENDING, "IsAscending"); +IMPLEMENT_CONSTASCII_USTRING(PROPERTY_RELATEDCOLUMN, "RelatedColumn"); +IMPLEMENT_CONSTASCII_USTRING(PROPERTY_ISUNIQUE, "IsUnique"); +IMPLEMENT_CONSTASCII_USTRING(PROPERTY_ISPRIMARYKEYINDEX, "IsPrimaryKeyIndex"); +IMPLEMENT_CONSTASCII_USTRING(PROPERTY_IGNORERESULT, "IgnoreResult"); +IMPLEMENT_CONSTASCII_USTRING(PROPERTY_UPDATERULE, "UpdateRule"); +IMPLEMENT_CONSTASCII_USTRING(PROPERTY_DELETERULE, "DeleteRule"); +IMPLEMENT_CONSTASCII_USTRING(PROPERTY_REFERENCEDTABLE, "ReferencedTable"); +IMPLEMENT_CONSTASCII_USTRING(PROPERTY_REFERENCEDCOLUMN, "ReferencedColumn"); + +//============================================================ +//= service names +//============================================================ +IMPLEMENT_CONSTASCII_USTRING(SERVICE_SDBC_RESULTSET, "com.sun.star.sdbc.ResultSet"); +IMPLEMENT_CONSTASCII_USTRING(SERVICE_SDBC_ROWSET, "com.sun.star.sdbc.RowSet"); +IMPLEMENT_CONSTASCII_USTRING(SERVICE_SDBC_STATEMENT, "com.sun.star.sdbc.Statement"); +IMPLEMENT_CONSTASCII_USTRING(SERVICE_SDBC_PREPAREDSTATEMENT, "com.sun.star.sdbc.PreparedStatement"); +IMPLEMENT_CONSTASCII_USTRING(SERVICE_SDBC_CALLABLESTATEMENT, "com.sun.star.sdbc.CallableStatement"); +IMPLEMENT_CONSTASCII_USTRING(SERVICE_SDBC_CONNECTION, "com.sun.star.sdbc.Connection"); +IMPLEMENT_CONSTASCII_USTRING(SERVICE_SDBCX_CONTAINER, "com.sun.star.sdbcx.Container"); +IMPLEMENT_CONSTASCII_USTRING(SERVICE_SDBCX_TABLE, "com.sun.star.sdbcx.Table"); +IMPLEMENT_CONSTASCII_USTRING(SERVICE_SDBCX_RESULTSET, "com.sun.star.sdbcx.ResultSet"); +IMPLEMENT_CONSTASCII_USTRING(SERVICE_SDB_CONNECTION, "com.sun.star.sdb.Connection"); +IMPLEMENT_CONSTASCII_USTRING(SERVICE_SDBCX_COLUMN, "com.sun.star.sdbcx.Column"); +IMPLEMENT_CONSTASCII_USTRING(SERVICE_SDBCX_COLUMNDESCRIPTOR, "com.sun.star.sdbcx.ColumnDescriptor"); +IMPLEMENT_CONSTASCII_USTRING(SERVICE_SDB_COLUMNSETTINGS, "com.sun.star.sdb.ColumnSettings"); +IMPLEMENT_CONSTASCII_USTRING(SERVICE_SDB_RESULTCOLUMN, "com.sun.star.sdb.ResultColumn"); +IMPLEMENT_CONSTASCII_USTRING(SERVICE_SDB_DATACOLUMN, "com.sun.star.sdb.DataColumn"); +IMPLEMENT_CONSTASCII_USTRING(SERVICE_SDB_DATABASECONTEXT, "com.sun.star.sdb.DatabaseContext"); +IMPLEMENT_CONSTASCII_USTRING(SERVICE_SDB_DATASOURCE, "com.sun.star.sdb.DataSource"); +IMPLEMENT_CONSTASCII_USTRING(SERVICE_SDB_RESULTSET, "com.sun.star.sdb.ResultSet"); +IMPLEMENT_CONSTASCII_USTRING(SERVICE_SDB_ROWSET, "com.sun.star.sdb.RowSet"); +IMPLEMENT_CONSTASCII_USTRING(SERVICE_SDB_STATEMENT, "com.sun.star.sdb.Statement"); +IMPLEMENT_CONSTASCII_USTRING(SERVICE_SDB_PREPAREDSTATMENT, "com.sun.star.sdb.PreparedStatement"); +IMPLEMENT_CONSTASCII_USTRING(SERVICE_SDB_CALLABLESTATEMENT, "com.sun.star.sdbc.CallableStatement"); +IMPLEMENT_CONSTASCII_USTRING(SERVICE_SDB_SQLQUERYCOMPOSER, "com.sun.star.sdb.SQLQueryComposer"); +IMPLEMENT_CONSTASCII_USTRING(SERVICE_SDB_DATASETTINGS, "com.sun.star.sdb.DefinitionSettings"); +IMPLEMENT_CONSTASCII_USTRING(SERVICE_SDB_QUERYDESCRIPTOR, "com.sun.star.sdb.QueryDescriptor"); +IMPLEMENT_CONSTASCII_USTRING(SERVICE_SDB_QUERY, "com.sun.star.sdb.Query"); +IMPLEMENT_CONSTASCII_USTRING(SERVICE_SDB_QUERYDEFINITION, "com.sun.star.sdb.QueryDefinition"); +IMPLEMENT_CONSTASCII_USTRING(SERVICE_SDBCX_COLUMNS, "com.sun.star.sdbcx.Columns"); +IMPLEMENT_CONSTASCII_USTRING(SERVICE_SDBCX_TABLES, "com.sun.star.sdbcx.Tables"); +IMPLEMENT_CONSTASCII_USTRING(SERVICE_SDB_QUERIES, "com.sun.star.sdb.Queries"); +IMPLEMENT_CONSTASCII_USTRING(SERVICE_SDBC_DRIVERMANAGER, "com.sun.star.sdbc.DriverManager"); +IMPLEMENT_CONSTASCII_USTRING(SERVICE_SDBCX_INDEXCOLUMN, "com.sun.star.sdbcx.IndexColumn"); +IMPLEMENT_CONSTASCII_USTRING(SERVICE_SDBCX_KEYCOLUMN, "com.sun.star.sdbcx.KeyColumn"); + + +//============================================================ +//= configuration key names +//============================================================ +IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_CONTAINERLEMENT_TITLE, "Title"); +IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_CONTAINERLEMENT_OBJECT, "Object"); + +IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_DBLINK_CONNECTURL, "ConnectURL"); +IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_DBLINK_USER, "User"); +IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_DBLINK_TABLEFILTER, "TableFilter"); +IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_DBLINK_TABLETYEFILTER, "TableTypeFilter"); +IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_DBLINK_LOGINTIMEOUT, "LoginTimeout"); +IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_DBLINK_PASSWORDREQUIRED, "PasswordRequired"); +IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_DBLINK_FORMDOCUMENTS, "Documents/Forms"); +IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_DBLINK_REPORTDOCUMENTS, "Documents/Reports"); +IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_DBLINK_QUERYDOCUMENTS, "Documents/Queries"); +IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_DBLINK_DOCUMENTLOCAITON, "DocumentLocation"); + +IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_QRYDESCR_COMMAND, "Command"); +IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_QRYDESCR_USE_ESCAPE_PROCESSING, "EscapeProcessing"); +IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_QRYDESCR_UPDATE_TABLENAME, "UpdateTableName"); +IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_QRYDESCR_UPDATE_SCHEMANAME, "UpdateSchemaName"); +IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_QRYDESCR_UPDATE_CATALOGNAME, "UpdateCatalogName"); +IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_QRYDESCR_COLUMNS, "Columns"); + +IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_DEFSET_ROW_HEIGHT, "RowHeight"); +IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_DEFSET_TEXTCOLOR, "TextColor"); +IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FILTER, "Filter"); +IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_DEFSET_APPLYFILTER, "ApplyFilter"); +IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_DEFSET_ORDER, "Order"); +IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_NAME, "FontDescriptor/Name"); +IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_HEIGHT, "FontDescriptor/Height"); +IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_WIDTH, "FontDescriptor/Width"); +IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_STYLENAME, "FontDescriptor/StyleName"); +IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_FAMILY, "FontDescriptor/Family"); +IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_CHARSET, "FontDescriptor/CharSet"); +IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_PITCH, "FontDescriptor/Pitch"); +IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_CHARACTERWIDTH, "FontDescriptor/CharacterWidth"); +IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_WEIGHT, "FontDescriptor/Weight"); +IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_SLANT, "FontDescriptor/Slant"); +IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_UNDERLINE, "FontDescriptor/Underline"); +IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_STRIKEOUT, "FontDescriptor/Strikeout"); +IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_ORIENTATION, "FontDescriptor/Orientation"); +IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_KERNING, "FontDescriptor/Kerning"); +IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_WORDLINEMODE, "FontDescriptor/WordLineMode"); +IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_TYPE, "FontDescriptor/Type"); +IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_DEFSET_FONT_ROOTNODE, "FontDescriptor"); + +IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_COLUMN_ALIGNMENT, "Alignment"); +IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_COLUMN_WIDTH, "Width"); +//IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_COLUMN_DESCRIPTION, "Description"); +//IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_COLUMN_DEFAULTVALUE, "DefaultValue"); +IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_COLUMN_NUMBERFORMAT, "NumberFormat"); +IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_COLUMN_RELPOSITION, "RelativePosition"); +IMPLEMENT_CONSTASCII_USTRING(CONFIGKEY_COLUMN_HIDDEN, "Hidden"); + +//============================================================ +//= SQLSTATE +//============================================================ +IMPLEMENT_CONSTASCII_USTRING(SQLSTATE_GENERAL, "01000"); +IMPLEMENT_CONSTASCII_USTRING(SQLSTATE_SEQUENCE, "HY010"); + + +//============================================================ +//= error messages +//============================================================ +IMPLEMENT_CONSTASCII_USTRING(ERRORMSG_SEQUENCE, "Function sequence error"); +} + diff --git a/dbaccess/util/dba.map b/dbaccess/util/dba.map new file mode 100644 index 000000000000..9a3ed2329fc1 --- /dev/null +++ b/dbaccess/util/dba.map @@ -0,0 +1,8 @@ +DBACCESS_1_0 { + global: + component_getImplementationEnvironment; + component_writeInfo; + component_getFactory; + local: + *; +}; diff --git a/dbaccess/util/makefile.mk b/dbaccess/util/makefile.mk new file mode 100644 index 000000000000..7c3979e1e0c7 --- /dev/null +++ b/dbaccess/util/makefile.mk @@ -0,0 +1,131 @@ +#************************************************************************* +# +# $RCSfile: makefile.mk,v $ +# +# $Revision: 1.1.1.1 $ +# +# last change: $Author: hr $ $Date: 2000-09-18 16:14:56 $ +# +# The Contents of this file are made available subject to the terms of +# either of the following licenses +# +# - GNU Lesser General Public License Version 2.1 +# - Sun Industry Standards Source License Version 1.1 +# +# Sun Microsystems Inc., October, 2000 +# +# GNU Lesser General Public License Version 2.1 +# ============================================= +# Copyright 2000 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 +# +# +# Sun Industry Standards Source License Version 1.1 +# ================================================= +# The contents of this file are subject to the Sun Industry Standards +# Source License Version 1.1 (the "License"); You may not use this file +# except in compliance with the License. You may obtain a copy of the +# License at http://www.openoffice.org/license.html. +# +# Software provided under this License is provided on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, +# WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, +# MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. +# See the License for the specific provisions governing your rights and +# obligations concerning the Software. +# +# The Initial Developer of the Original Code is: Sun Microsystems, Inc. +# +# Copyright: 2000 by Sun Microsystems, Inc. +# +# All Rights Reserved. +# +# Contributor(s): _______________________________________ +# +# +# +#************************************************************************* + +PRJ=.. +PRJNAME=dbaccess +TARGET=dba +USE_LDUMP2=TRUE + +USE_DEFFILE=TRUE + +# --- Settings ---------------------------------- + +.INCLUDE : svpre.mk +.INCLUDE : settings.mk +.INCLUDE : sv.mk + +LDUMP=ldump2.exe + +# --- Library ----------------------------------- + +LIB1TARGET=$(SLB)$/dbaccess.lib +LIB1FILES=\ + $(SLB)$/api.lib \ + $(SLB)$/dataaccess.lib \ + $(SLB)$/misc.lib \ + $(SLB)$/core_resource.lib \ + $(SLB)$/shared.lib + +SHL1TARGET=$(TARGET)$(UPD)$(DLLPOSTFIX) +SHL1VERSIONMAP= $(TARGET).map + +SHL1STDLIBS= \ + $(SALLIB) \ + $(OSLLIB) \ + $(ONELIB) \ + $(STORELIB) \ + $(TOOLSLIB) \ + $(VOSLIB) \ + $(CPPUHELPERLIB) \ + $(CPPULIB) \ + $(UNOTOOLSLIB) \ + $(VCLLIB) \ + $(SVLLIB) \ + $(CONNECTIVITYLIB) + + +SHL1LIBS=$(LIB1TARGET) +SHL1DEF=$(MISC)$/$(SHL1TARGET).def +DEF1EXPORTFILE=$(TARGET).dxp + +#SHL1DEPN=\ + makefile.mk + +ALL: \ + $(LIB1TARGET) \ + ALLTAR + +# === .res file ========================================================== +RES1FILELIST=\ + $(SRS)$/core_strings.srs \ + +RESLIB1NAME=$(TARGET) +RESLIB1SRSFILES=$(RES1FILELIST) + +DEF1NAME= $(SHL1TARGET) +DEF1EXPORTFILE= exports.dxp + + +# --- Targets ---------------------------------- + +.INCLUDE : target.mk + |