summaryrefslogtreecommitdiff
path: root/connectivity/inc/connectivity/sdbcx
diff options
context:
space:
mode:
Diffstat (limited to 'connectivity/inc/connectivity/sdbcx')
-rw-r--r--connectivity/inc/connectivity/sdbcx/IRefreshable.hxx57
-rw-r--r--connectivity/inc/connectivity/sdbcx/VCatalog.hxx132
-rw-r--r--connectivity/inc/connectivity/sdbcx/VCollection.hxx243
-rw-r--r--connectivity/inc/connectivity/sdbcx/VColumn.hxx118
-rw-r--r--connectivity/inc/connectivity/sdbcx/VDescriptor.hxx102
-rw-r--r--connectivity/inc/connectivity/sdbcx/VGroup.hxx113
-rw-r--r--connectivity/inc/connectivity/sdbcx/VIndex.hxx117
-rw-r--r--connectivity/inc/connectivity/sdbcx/VIndexColumn.hxx69
-rw-r--r--connectivity/inc/connectivity/sdbcx/VKey.hxx128
-rw-r--r--connectivity/inc/connectivity/sdbcx/VKeyColumn.hxx71
-rw-r--r--connectivity/inc/connectivity/sdbcx/VTable.hxx148
-rw-r--r--connectivity/inc/connectivity/sdbcx/VTypeDef.hxx47
-rw-r--r--connectivity/inc/connectivity/sdbcx/VUser.hxx107
-rw-r--r--connectivity/inc/connectivity/sdbcx/VView.hxx108
14 files changed, 1560 insertions, 0 deletions
diff --git a/connectivity/inc/connectivity/sdbcx/IRefreshable.hxx b/connectivity/inc/connectivity/sdbcx/IRefreshable.hxx
new file mode 100644
index 000000000000..de3a2b28670c
--- /dev/null
+++ b/connectivity/inc/connectivity/sdbcx/IRefreshable.hxx
@@ -0,0 +1,57 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org 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 version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef _CONNECTIVITY_SDBCX_IREFRESHABLE_HXX_
+#define _CONNECTIVITY_SDBCX_IREFRESHABLE_HXX_
+
+#include "connectivity/CommonTools.hxx"
+#include "connectivity/dbtoolsdllapi.hxx"
+
+namespace connectivity
+{
+ namespace sdbcx
+ {
+ class OOO_DLLPUBLIC_DBTOOLS SAL_NO_VTABLE IRefreshableGroups
+ {
+ public:
+ virtual void refreshGroups() = 0;
+ };
+
+ class OOO_DLLPUBLIC_DBTOOLS SAL_NO_VTABLE IRefreshableUsers
+ {
+ public:
+ virtual void refreshUsers() = 0;
+ };
+
+ class OOO_DLLPUBLIC_DBTOOLS SAL_NO_VTABLE IRefreshableColumns
+ {
+ public:
+ virtual void refreshColumns() = 0;
+ };
+ }
+}
+#endif //_CONNECTIVITY_SDBCX_IREFRESHABLE_HXX_
+
diff --git a/connectivity/inc/connectivity/sdbcx/VCatalog.hxx b/connectivity/inc/connectivity/sdbcx/VCatalog.hxx
new file mode 100644
index 000000000000..672b9f4cfea6
--- /dev/null
+++ b/connectivity/inc/connectivity/sdbcx/VCatalog.hxx
@@ -0,0 +1,132 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org 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 version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _CONNECTIVITY_SDBCX_CATALOG_HXX_
+#define _CONNECTIVITY_SDBCX_CATALOG_HXX_
+
+#include <osl/diagnose.h>
+#include <com/sun/star/sdbcx/XTablesSupplier.hpp>
+#include <com/sun/star/sdbcx/XViewsSupplier.hpp>
+#include <com/sun/star/sdbcx/XUsersSupplier.hpp>
+#include <com/sun/star/sdbcx/XGroupsSupplier.hpp>
+#include <com/sun/star/sdbc/XConnection.hpp>
+#include <com/sun/star/sdbc/XRow.hpp>
+#include <cppuhelper/compbase5.hxx>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include "connectivity/CommonTools.hxx"
+#include "OSubComponent.hxx"
+#include "connectivity/sdbcx/IRefreshable.hxx"
+#include "connectivity/StdTypeDefs.hxx"
+#include "connectivity/dbtoolsdllapi.hxx"
+
+namespace connectivity
+{
+ namespace sdbcx
+ {
+
+ class OCollection;
+ // OCatalog is a general catalog class
+ // other drivers can be derived their catalog from this class when they want to support sdbcx
+ // it holds already tables, views, groups and users
+
+ typedef ::cppu::WeakComponentImplHelper5< ::com::sun::star::sdbcx::XTablesSupplier,
+ ::com::sun::star::sdbcx::XViewsSupplier,
+ ::com::sun::star::sdbcx::XUsersSupplier,
+ ::com::sun::star::sdbcx::XGroupsSupplier,
+ ::com::sun::star::lang::XServiceInfo> OCatalog_BASE;
+
+
+ class OOO_DLLPUBLIC_DBTOOLS SAL_NO_VTABLE OCatalog :
+ public OCatalog_BASE,
+ public IRefreshableGroups,
+ public IRefreshableUsers,
+ public connectivity::OSubComponent<OCatalog, OCatalog_BASE>
+ {
+ friend class connectivity::OSubComponent<OCatalog, OCatalog_BASE>;
+ protected:
+
+ ::osl::Mutex m_aMutex;
+
+ // this members are deleted when the dtor is called
+ // they are hold weak
+ OCollection* m_pTables;
+ OCollection* m_pViews;
+ OCollection* m_pGroups;
+ OCollection* m_pUsers;
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData > m_xMetaData; // just to make things easier
+
+ /** builds the name which should be used to access the object later on in the collection.
+ Will only be called in fillNames.
+ @param _xRow
+ The current row from the resultset given to fillNames.
+ */
+ virtual ::rtl::OUString buildName( const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRow >& _xRow);
+
+ /** fills a vector with the nescessary names which can be used in combination with the collections.
+ For each row buildName will be called.
+ @param _xResult
+ The resultset which should be used to fill the names. Will be disposed after return and set to NULL.
+ @param _rNames
+ The vector who will be filled.
+ */
+ void fillNames(::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet >& _xResult,TStringVector& _rNames);
+
+ public:
+ OCatalog(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection> &_xConnection);
+ virtual ~OCatalog();
+
+ DECLARE_SERVICE_INFO();
+
+ // refreshTables is called when the method getTables had been called
+ // the member m_pTables has to be created
+ virtual void refreshTables() = 0;
+ // refreshViews is called when the method getViews had been called
+ virtual void refreshViews() = 0;
+
+ // the other refresh methods come from base classes IRefreshableGroups and IRefreshableUsers
+
+ // ::cppu::OComponentHelper
+ virtual void SAL_CALL disposing(void);
+ // XInterface
+ void SAL_CALL acquire() throw();
+ void SAL_CALL release() throw();
+ // XTablesSupplier
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL getTables( ) throw(::com::sun::star::uno::RuntimeException);
+ // XViewsSupplier
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL getViews( ) throw(::com::sun::star::uno::RuntimeException);
+ // XUsersSupplier
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL getUsers( ) throw(::com::sun::star::uno::RuntimeException);
+ // XGroupsSupplier
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL getGroups( ) throw(::com::sun::star::uno::RuntimeException);
+
+ };
+ }
+}
+
+#endif // _CONNECTIVITY_SDBCX_CATALOG_HXX_
+
diff --git a/connectivity/inc/connectivity/sdbcx/VCollection.hxx b/connectivity/inc/connectivity/sdbcx/VCollection.hxx
new file mode 100644
index 000000000000..58fd6f8d0e2c
--- /dev/null
+++ b/connectivity/inc/connectivity/sdbcx/VCollection.hxx
@@ -0,0 +1,243 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org 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 version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _CONNECTIVITY_SDBCX_COLLECTION_HXX_
+#define _CONNECTIVITY_SDBCX_COLLECTION_HXX_
+
+#include <cppuhelper/implbase10.hxx>
+#include <com/sun/star/container/XNameAccess.hpp>
+#include <com/sun/star/container/XIndexAccess.hpp>
+#include <com/sun/star/container/XEnumerationAccess.hpp>
+#include <com/sun/star/container/XEnumeration.hpp>
+#include <com/sun/star/beans/XPropertySet.hpp>
+#include <com/sun/star/util/XRefreshable.hpp>
+#include <com/sun/star/lang/XComponent.hpp>
+#include <com/sun/star/sdbcx/XDataDescriptorFactory.hpp>
+#include <com/sun/star/sdbcx/XAppend.hpp>
+#include <com/sun/star/sdbcx/XDrop.hpp>
+#include <com/sun/star/sdbc/XColumnLocate.hpp>
+#include <comphelper/stl_types.hxx>
+#include <cppuhelper/interfacecontainer.h>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include "connectivity/CommonTools.hxx"
+#include <com/sun/star/container/XContainer.hpp>
+#include "connectivity/StdTypeDefs.hxx"
+#include "connectivity/dbtoolsdllapi.hxx"
+#include <memory>
+
+
+namespace connectivity
+{
+ namespace sdbcx
+ {
+
+ // the class OCollection is base class for collections :-)
+ typedef ::cppu::ImplHelper10< ::com::sun::star::container::XNameAccess,
+ ::com::sun::star::container::XIndexAccess,
+ ::com::sun::star::container::XEnumerationAccess,
+ ::com::sun::star::container::XContainer,
+ ::com::sun::star::sdbc::XColumnLocate,
+ ::com::sun::star::util::XRefreshable,
+ ::com::sun::star::sdbcx::XDataDescriptorFactory,
+ ::com::sun::star::sdbcx::XAppend,
+ ::com::sun::star::sdbcx::XDrop,
+ ::com::sun::star::lang::XServiceInfo> OCollectionBase;
+
+ typedef ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > ObjectType;
+
+ class OOO_DLLPUBLIC_DBTOOLS SAL_NO_VTABLE IObjectCollection
+ {
+ public:
+ virtual void reserve(size_t nLength) = 0;
+ virtual bool exists(const ::rtl::OUString& _sName ) = 0;
+ virtual bool empty() = 0;
+ virtual void swapAll() = 0;
+ virtual void swap() = 0;
+ virtual void clear() = 0;
+ virtual void reFill(const TStringVector &_rVector) = 0;
+ virtual void insert(const ::rtl::OUString& _sName,const ObjectType& _xObject) = 0;
+ virtual bool rename(const ::rtl::OUString _sOldName,const ::rtl::OUString _sNewName) = 0;
+ virtual sal_Int32 size() = 0;
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > getElementNames() = 0;
+ virtual ::rtl::OUString getName(sal_Int32 _nIndex) = 0;
+ virtual void disposeAndErase(sal_Int32 _nIndex) = 0;
+ virtual void disposeElements() = 0;
+ virtual sal_Int32 findColumn( const ::rtl::OUString& columnName ) = 0;
+ virtual ::rtl::OUString findColumnAtIndex( sal_Int32 _nIndex) = 0;
+ virtual ObjectType getObject(sal_Int32 _nIndex) = 0;
+ virtual ObjectType getObject(const ::rtl::OUString& columnName) = 0;
+ virtual void setObject(sal_Int32 _nIndex,const ObjectType& _xObject) = 0;
+ virtual sal_Bool isCaseSensitive() const = 0;
+ };
+ //************************************************************
+ // OCollection
+ //************************************************************
+ class OOO_DLLPUBLIC_DBTOOLS SAL_NO_VTABLE OCollection :
+ public OCollectionBase
+ {
+ protected:
+ ::std::auto_ptr<IObjectCollection> m_pElements;
+
+ ::cppu::OInterfaceContainerHelper m_aContainerListeners;
+ ::cppu::OInterfaceContainerHelper m_aRefreshListeners;
+
+ protected:
+ ::cppu::OWeakObject& m_rParent; // parent of the collection
+ ::osl::Mutex& m_rMutex; // mutex of the parent
+ sal_Bool m_bUseIndexOnly; // is only TRUE when only an indexaccess is needed
+
+ // the implementing class should refresh their elements
+ virtual void impl_refresh() throw(::com::sun::star::uno::RuntimeException) = 0;
+
+ // will be called when a object was requested by one of the accessing methods like getByIndex
+ virtual ObjectType createObject(const ::rtl::OUString& _rName) = 0;
+
+ // will be called when a new object should be generated by a call of createDataDescriptor
+ // the returned object is empty will be filled outside and added to the collection
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > createDescriptor();
+
+ /** appends an object described by a descriptor, under a given name
+ @param _rForName
+ is the name under which the object should be appended. Guaranteed to not be empty.
+ This is passed for convenience only, since it's the result of a call of
+ getNameForObject for the given descriptor
+ @param descriptor
+ describes the object to append
+ @return
+ the new object which is to be inserted into the collection. This might be the result
+ of a call of <code>createObject( _rForName )</code>, or a clone of the descriptor.
+ */
+ virtual ObjectType appendObject( const ::rtl::OUString& _rForName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& descriptor );
+
+ // called when XDrop was called
+ virtual void dropObject(sal_Int32 _nPos,const ::rtl::OUString _sElementName);
+
+ /** returns the name for the object. The default implementation ask for the property NAME. If this doesn't satisfy, it has to be overloaded.
+ @param _xObject The object where the name should be extracted.
+ @return The name of the object.
+ */
+ virtual ::rtl::OUString getNameForObject(const ObjectType& _xObject);
+
+ /** clones the given descriptor
+
+ The method calls createDescriptor to create a new, empty descriptor, and then copies all properties from
+ _descriptor to the new object, which is returned.
+
+ This method might come handy in derived classes for implementing appendObject, when the object
+ is not actually appended to any backend (e.g. for the columns collection of a descriptor object itself,
+ where there is not yet a database backend to append the column to).
+ */
+ ObjectType cloneDescriptor( const ObjectType& _descriptor );
+
+ OCollection(::cppu::OWeakObject& _rParent,
+ sal_Bool _bCase,
+ ::osl::Mutex& _rMutex,
+ const TStringVector &_rVector,
+ sal_Bool _bUseIndexOnly = sal_False,
+ sal_Bool _bUseHardRef = sal_True);
+
+ /** clear the name map
+ <p>Does <em>not</em> dispose the objects hold by the collection.</p>
+ */
+ void clear_NoDispose();
+
+ /** insert a new element into the collection
+ */
+ void insertElement(const ::rtl::OUString& _sElementName,const ObjectType& _xElement);
+
+ /** return the name of element at index _nIndex
+ */
+ inline ::rtl::OUString getElementName(sal_Int32 _nIndex)
+ {
+ return m_pElements->findColumnAtIndex(_nIndex);
+ }
+
+
+ /** return the object, if not existent it creates it.
+ @param _nIndex
+ The index of the object to create.
+ @return ObjectType
+ */
+ ObjectType getObject(sal_Int32 _nIndex);
+
+ public:
+ virtual ~OCollection();
+ DECLARE_SERVICE_INFO();
+
+ void reFill(const TStringVector &_rVector);
+ inline sal_Bool isCaseSensitive() const { return m_pElements->isCaseSensitive(); }
+ void renameObject(const ::rtl::OUString _sOldName,const ::rtl::OUString _sNewName);
+
+ // only the name is identical to ::cppu::OComponentHelper
+ virtual void SAL_CALL disposing(void);
+ // dispatch the refcounting to the parent
+ virtual void SAL_CALL acquire() throw();
+ virtual void SAL_CALL release() throw();
+
+ // XInterface
+ virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes() throw (::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::container::XElementAccess
+ virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw(::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL hasElements( ) throw(::com::sun::star::uno::RuntimeException);
+ // ::com::sun::star::container::XIndexAccess
+ virtual sal_Int32 SAL_CALL getCount( ) throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Any SAL_CALL getByIndex( sal_Int32 Index ) throw(::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+
+ // ::com::sun::star::container::XNameAccess
+ virtual ::com::sun::star::uno::Any SAL_CALL getByName( const ::rtl::OUString& aName ) throw(::com::sun::star::container::NoSuchElementException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getElementNames( ) throw(::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL hasByName( const ::rtl::OUString& aName ) throw(::com::sun::star::uno::RuntimeException);
+ // XEnumerationAccess
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL createEnumeration( ) throw(::com::sun::star::uno::RuntimeException);
+ // ::com::sun::star::util::XRefreshable
+ virtual void SAL_CALL refresh( ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL addRefreshListener( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XRefreshListener >& l ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeRefreshListener( const ::com::sun::star::uno::Reference< ::com::sun::star::util::XRefreshListener >& l ) throw(::com::sun::star::uno::RuntimeException);
+ // XDataDescriptorFactory
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > SAL_CALL createDataDescriptor( ) throw(::com::sun::star::uno::RuntimeException);
+ // XAppend
+ virtual void SAL_CALL appendByDescriptor( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& descriptor ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::container::ElementExistException, ::com::sun::star::uno::RuntimeException);
+ // XDrop
+ virtual void SAL_CALL dropByName( const ::rtl::OUString& elementName ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL dropByIndex( sal_Int32 index ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+ // XColumnLocate
+ virtual sal_Int32 SAL_CALL findColumn( const ::rtl::OUString& columnName ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
+ // ::com::sun::star::container::XContainer
+ virtual void SAL_CALL addContainerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener >& xListener ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL removeContainerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener >& xListener ) throw(::com::sun::star::uno::RuntimeException);
+ private:
+ void notifyElementRemoved(const ::rtl::OUString& _sName);
+ void disposeElements();
+ void dropImpl(sal_Int32 _nIndex,sal_Bool _bReallyDrop = sal_True);
+ };
+ }
+}
+#endif // _CONNECTIVITY_SDBCX_COLLECTION_HXX_
+
+
diff --git a/connectivity/inc/connectivity/sdbcx/VColumn.hxx b/connectivity/inc/connectivity/sdbcx/VColumn.hxx
new file mode 100644
index 000000000000..0a8c5498cf60
--- /dev/null
+++ b/connectivity/inc/connectivity/sdbcx/VColumn.hxx
@@ -0,0 +1,118 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org 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 version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef _CONNECTIVITY_SDBCX_COLUMN_HXX_
+#define _CONNECTIVITY_SDBCX_COLUMN_HXX_
+
+#include <com/sun/star/sdbcx/XDataDescriptorFactory.hpp>
+#include <com/sun/star/container/XNamed.hpp>
+#include <comphelper/IdPropArrayHelper.hxx>
+#include <cppuhelper/compbase2.hxx>
+#include <cppuhelper/implbase1.hxx>
+#include "connectivity/CommonTools.hxx"
+#include <comphelper/broadcasthelper.hxx>
+#include "connectivity/sdbcx/VDescriptor.hxx"
+#include "connectivity/dbtoolsdllapi.hxx"
+#include <com/sun/star/lang/XServiceInfo.hpp>
+
+namespace connectivity
+{
+ namespace sdbcx
+ {
+ class OColumn;
+ typedef ::comphelper::OIdPropertyArrayUsageHelper<OColumn> OColumn_PROP;
+
+ typedef ::cppu::WeakComponentImplHelper2< ::com::sun::star::container::XNamed,
+ ::com::sun::star::lang::XServiceInfo> OColumnDescriptor_BASE;
+ typedef ::cppu::ImplHelper1< ::com::sun::star::sdbcx::XDataDescriptorFactory > OColumn_BASE;
+
+
+ class OOO_DLLPUBLIC_DBTOOLS OColumn :
+ public comphelper::OBaseMutex,
+ public OColumn_BASE,
+ public OColumnDescriptor_BASE,
+ public OColumn_PROP,
+ public ODescriptor
+ {
+ protected:
+ ::rtl::OUString m_TypeName;
+ ::rtl::OUString m_Description;
+ ::rtl::OUString m_DefaultValue;
+
+ sal_Int32 m_IsNullable;
+ sal_Int32 m_Precision;
+ sal_Int32 m_Scale;
+ sal_Int32 m_Type;
+
+ sal_Bool m_IsAutoIncrement;
+ sal_Bool m_IsRowVersion;
+ sal_Bool m_IsCurrency;
+
+ using OColumnDescriptor_BASE::rBHelper;
+ virtual ::cppu::IPropertyArrayHelper* createArrayHelper( sal_Int32 _nId) const;
+ virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
+
+ virtual ~OColumn();
+ public:
+ virtual void SAL_CALL acquire() throw();
+ virtual void SAL_CALL release() throw();
+
+ OColumn( sal_Bool _bCase);
+ OColumn( const ::rtl::OUString& _Name,
+ const ::rtl::OUString& _TypeName,
+ const ::rtl::OUString& _DefaultValue,
+ const ::rtl::OUString& _Description,
+ sal_Int32 _IsNullable,
+ sal_Int32 _Precision,
+ sal_Int32 _Scale,
+ sal_Int32 _Type,
+ sal_Bool _IsAutoIncrement,
+ sal_Bool _IsRowVersion,
+ sal_Bool _IsCurrency,
+ sal_Bool _bCase);
+
+ DECLARE_SERVICE_INFO();
+ //XInterface
+ virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+ //XTypeProvider
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
+ // ODescriptor
+ virtual void construct();
+ // ::cppu::OComponentHelper
+ virtual void SAL_CALL disposing(void);
+ // XPropertySet
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
+ // XNamed
+ virtual ::rtl::OUString SAL_CALL getName( ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setName( const ::rtl::OUString& aName ) throw(::com::sun::star::uno::RuntimeException);
+ // XDataDescriptorFactory
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > SAL_CALL createDataDescriptor( ) throw(::com::sun::star::uno::RuntimeException);
+ };
+ }
+}
+
+#endif // _CONNECTIVITY_SDBCX_COLUMN_HXX_
+
diff --git a/connectivity/inc/connectivity/sdbcx/VDescriptor.hxx b/connectivity/inc/connectivity/sdbcx/VDescriptor.hxx
new file mode 100644
index 000000000000..99b251d17f42
--- /dev/null
+++ b/connectivity/inc/connectivity/sdbcx/VDescriptor.hxx
@@ -0,0 +1,102 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org 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 version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _CONNECTIVITY_SDBCX_DESCRIPTOR_HXX_
+#define _CONNECTIVITY_SDBCX_DESCRIPTOR_HXX_
+
+#include <comphelper/propertycontainer.hxx>
+#include <com/sun/star/beans/PropertyAttribute.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <cppuhelper/typeprovider.hxx>
+#include <com/sun/star/lang/XUnoTunnel.hpp>
+#include <comphelper/stl_types.hxx>
+#include "connectivity/dbtoolsdllapi.hxx"
+
+namespace connectivity
+{
+ namespace sdbcx
+ {
+ // =========================================================================
+ // = ODescriptor
+ // =========================================================================
+ typedef ::comphelper::OPropertyContainer ODescriptor_PBASE;
+ class OOO_DLLPUBLIC_DBTOOLS ODescriptor
+ :public ODescriptor_PBASE
+ ,public ::com::sun::star::lang::XUnoTunnel
+ {
+ protected:
+ ::rtl::OUString m_Name;
+
+ /** helper for derived classes to implement OPropertyArrayUsageHelper::createArrayHelper
+
+ This method just calls describeProperties, and flags all properties as READONLY if and
+ only if we do *not* act as descriptor, but as final object.
+
+ @seealso isNew
+ */
+ ::cppu::IPropertyArrayHelper* doCreateArrayHelper() const;
+
+ private:
+ comphelper::UStringMixEqual m_aCase;
+ sal_Bool m_bNew;
+
+ public:
+ ODescriptor(::cppu::OBroadcastHelper& _rBHelper,sal_Bool _bCase, sal_Bool _bNew = sal_False);
+
+ virtual ~ODescriptor();
+
+ sal_Bool isNew() const { return m_bNew; }
+ sal_Bool getNew() const { return m_bNew; }
+ virtual void setNew(sal_Bool _bNew);
+
+ sal_Bool isCaseSensitive() const { return m_aCase.isCaseSensitive(); }
+
+ virtual void construct();
+
+ // XInterface
+ virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // compare
+ inline sal_Bool operator == ( const ::rtl::OUString & _rRH )
+ {
+ return m_aCase(m_Name,_rRH);
+ }
+
+ // com::sun::star::lang::XUnoTunnel
+ virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException);
+ static ::com::sun::star::uno::Sequence< sal_Int8 > getUnoTunnelImplementationId();
+
+ static ODescriptor* getImplementation( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxSomeComp );
+ // retrieves the ODescriptor implementation of a given UNO component, and returns its ->isNew flag
+ static sal_Bool isNew( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxDescriptor );
+ };
+ }
+
+}
+#endif // _CONNECTIVITY_SDBCX_DESCRIPTOR_HXX_
+
diff --git a/connectivity/inc/connectivity/sdbcx/VGroup.hxx b/connectivity/inc/connectivity/sdbcx/VGroup.hxx
new file mode 100644
index 000000000000..b65b4cd2fda4
--- /dev/null
+++ b/connectivity/inc/connectivity/sdbcx/VGroup.hxx
@@ -0,0 +1,113 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org 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 version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _CONNECTIVITY_SDBCX_GROUP_HXX_
+#define _CONNECTIVITY_SDBCX_GROUP_HXX_
+
+#include <osl/diagnose.h>
+
+
+#include <com/sun/star/sdbcx/XUsersSupplier.hpp>
+#include <com/sun/star/sdbcx/XAuthorizable.hpp>
+#include <com/sun/star/container/XNamed.hpp>
+#include <comphelper/proparrhlp.hxx>
+#include <cppuhelper/compbase4.hxx>
+//#ifndef _CONNECTIVITY_COMMONTOOLS_HXX_
+//#include "connectivity/CommonTools.hxx"
+//#endif
+#include <comphelper/broadcasthelper.hxx>
+#include "connectivity/sdbcx/VCollection.hxx"
+#include <comphelper/propertycontainer.hxx>
+#include "connectivity/sdbcx/IRefreshable.hxx"
+#include "connectivity/sdbcx/VDescriptor.hxx"
+#include "connectivity/dbtoolsdllapi.hxx"
+#include <com/sun/star/lang/XServiceInfo.hpp>
+
+namespace connectivity
+{
+ namespace sdbcx
+ {
+ typedef OCollection OUsers;
+
+ typedef ::cppu::WeakComponentImplHelper4< ::com::sun::star::sdbcx::XUsersSupplier,
+ ::com::sun::star::sdbcx::XAuthorizable,
+ ::com::sun::star::container::XNamed,
+ ::com::sun::star::lang::XServiceInfo> OGroup_BASE;
+
+ class OOO_DLLPUBLIC_DBTOOLS OGroup :
+ public comphelper::OBaseMutex,
+ public OGroup_BASE,
+ public IRefreshableUsers,
+ public ::comphelper::OPropertyArrayUsageHelper<OGroup>,
+ public ODescriptor
+ {
+ protected:
+ OUsers* m_pUsers;
+
+ using OGroup_BASE::rBHelper;
+
+ // OPropertyArrayUsageHelper
+ virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const;
+ // OPropertySetHelper
+ virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper();
+ public:
+ OGroup(sal_Bool _bCase);
+ OGroup( const ::rtl::OUString& _Name,sal_Bool _bCase);
+ virtual ~OGroup();
+ DECLARE_SERVICE_INFO();
+
+ // XInterface
+ virtual void SAL_CALL acquire() throw();
+ virtual void SAL_CALL release() throw();
+
+ //XInterface
+ virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+ //XTypeProvider
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ::cppu::OComponentHelper
+ virtual void SAL_CALL disposing(void);
+ // XPropertySet
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
+ // XUsersSupplier
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL getUsers( ) throw(::com::sun::star::uno::RuntimeException);
+ // XAuthorizable
+ virtual sal_Int32 SAL_CALL getPrivileges( const ::rtl::OUString& objName, sal_Int32 objType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL getGrantablePrivileges( const ::rtl::OUString& objName, sal_Int32 objType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL grantPrivileges( const ::rtl::OUString& objName, sal_Int32 objType, sal_Int32 objPrivileges ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL revokePrivileges( const ::rtl::OUString& objName, sal_Int32 objType, sal_Int32 objPrivileges ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
+
+ // XNamed
+ virtual ::rtl::OUString SAL_CALL getName( ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setName( const ::rtl::OUString& aName ) throw(::com::sun::star::uno::RuntimeException);
+ };
+ }
+}
+
+#endif // _CONNECTIVITY_SDBCX_GROUP_HXX_
+
+
diff --git a/connectivity/inc/connectivity/sdbcx/VIndex.hxx b/connectivity/inc/connectivity/sdbcx/VIndex.hxx
new file mode 100644
index 000000000000..b0669fdda540
--- /dev/null
+++ b/connectivity/inc/connectivity/sdbcx/VIndex.hxx
@@ -0,0 +1,117 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org 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 version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _CONNECTIVITY_SDBCX_INDEX_HXX_
+#define _CONNECTIVITY_SDBCX_INDEX_HXX_
+
+//#ifndef _OSL_DIAGNOSE_H_
+//#include <osl/diagnose.h>
+//#endif
+#include <com/sun/star/sdbcx/XDataDescriptorFactory.hpp>
+#include <com/sun/star/sdbcx/XColumnsSupplier.hpp>
+#include <com/sun/star/container/XNamed.hpp>
+#include <comphelper/IdPropArrayHelper.hxx>
+#include <cppuhelper/compbase2.hxx>
+#include "connectivity/CommonTools.hxx"
+#include <comphelper/broadcasthelper.hxx>
+#include "connectivity/sdbcx/VTypeDef.hxx"
+#include "connectivity/sdbcx/IRefreshable.hxx"
+#include "connectivity/sdbcx/VDescriptor.hxx"
+#include "connectivity/dbtoolsdllapi.hxx"
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/sdbcx/XDataDescriptorFactory.hpp>
+#include <cppuhelper/implbase1.hxx>
+
+namespace connectivity
+{
+ namespace sdbcx
+ {
+ class OCollection;
+ class OIndex;
+ typedef ::cppu::ImplHelper1< ::com::sun::star::sdbcx::XDataDescriptorFactory > OIndex_BASE;
+ typedef ::comphelper::OIdPropertyArrayUsageHelper<OIndex> OIndex_PROP;
+
+ class OOO_DLLPUBLIC_DBTOOLS OIndex :
+ public comphelper::OBaseMutex,
+ public ODescriptor_BASE,
+ public IRefreshableColumns,
+ public OIndex_PROP,
+ public ODescriptor,
+ public OIndex_BASE
+ {
+ protected:
+ ::rtl::OUString m_Catalog;
+ sal_Bool m_IsUnique;
+ sal_Bool m_IsPrimaryKeyIndex;
+ sal_Bool m_IsClustered;
+
+ OCollection* m_pColumns;
+
+ using ODescriptor_BASE::rBHelper;
+ virtual void refreshColumns();
+ // OPropertyArrayUsageHelper
+ virtual ::cppu::IPropertyArrayHelper* createArrayHelper( sal_Int32 _nId) const;
+ virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
+ public:
+ OIndex(sal_Bool _bCase);
+ OIndex( const ::rtl::OUString& _Name,
+ const ::rtl::OUString& _Catalog,
+ sal_Bool _isUnique,
+ sal_Bool _isPrimaryKeyIndex,
+ sal_Bool _isClustered,
+ sal_Bool _bCase);
+
+ virtual ~OIndex( );
+
+ DECLARE_SERVICE_INFO();
+
+ //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();
+ virtual void SAL_CALL release() throw();
+ //XTypeProvider
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
+ // ODescriptor
+ virtual void construct();
+ // ::cppu::OComponentHelper
+ virtual void SAL_CALL disposing(void);
+ // XPropertySet
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
+ // XColumnsSupplier
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL getColumns( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // XNamed
+ virtual ::rtl::OUString SAL_CALL getName( ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setName( const ::rtl::OUString& aName ) throw(::com::sun::star::uno::RuntimeException);
+ // XDataDescriptorFactory
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > SAL_CALL createDataDescriptor( ) throw(::com::sun::star::uno::RuntimeException);
+ };
+ }
+}
+
+#endif // _CONNECTIVITY_SDBCX_INDEX_HXX_
+
diff --git a/connectivity/inc/connectivity/sdbcx/VIndexColumn.hxx b/connectivity/inc/connectivity/sdbcx/VIndexColumn.hxx
new file mode 100644
index 000000000000..da836b772f30
--- /dev/null
+++ b/connectivity/inc/connectivity/sdbcx/VIndexColumn.hxx
@@ -0,0 +1,69 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org 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 version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _CONNECTIVITY_SDBCX_INDEXCOLUMN_HXX_
+#define _CONNECTIVITY_SDBCX_INDEXCOLUMN_HXX_
+
+#include "connectivity/dbtoolsdllapi.hxx"
+#include "connectivity/sdbcx/VColumn.hxx"
+
+namespace connectivity
+{
+ namespace sdbcx
+ {
+ class OIndexColumn;
+ typedef ::comphelper::OIdPropertyArrayUsageHelper<OIndexColumn> OIndexColumn_PROP;
+
+ class OOO_DLLPUBLIC_DBTOOLS OIndexColumn :
+ public OColumn, public OIndexColumn_PROP
+ {
+ protected:
+ sal_Bool m_IsAscending;
+ virtual ::cppu::IPropertyArrayHelper* createArrayHelper( sal_Int32 _nId) const;
+ virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
+ public:
+ OIndexColumn( sal_Bool _bCase);
+ OIndexColumn( sal_Bool _IsAscending,
+ const ::rtl::OUString& _Name,
+ const ::rtl::OUString& _TypeName,
+ const ::rtl::OUString& _DefaultValue,
+ sal_Int32 _IsNullable,
+ sal_Int32 _Precision,
+ sal_Int32 _Scale,
+ sal_Int32 _Type,
+ sal_Bool _IsAutoIncrement,
+ sal_Bool _IsRowVersion,
+ sal_Bool _IsCurrency,
+ sal_Bool _bCase);
+
+ virtual void construct();
+ DECLARE_SERVICE_INFO();
+ };
+ }
+}
+#endif // _CONNECTIVITY_SDBCX_INDEXCOLUMN_HXX_
+
diff --git a/connectivity/inc/connectivity/sdbcx/VKey.hxx b/connectivity/inc/connectivity/sdbcx/VKey.hxx
new file mode 100644
index 000000000000..e4969cbced18
--- /dev/null
+++ b/connectivity/inc/connectivity/sdbcx/VKey.hxx
@@ -0,0 +1,128 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org 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 version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _CONNECTIVITY_SDBCX_KEY_HXX_
+#define _CONNECTIVITY_SDBCX_KEY_HXX_
+
+
+#include <comphelper/IdPropArrayHelper.hxx>
+#include "connectivity/CommonTools.hxx"
+#include <comphelper/broadcasthelper.hxx>
+#include "connectivity/sdbcx/VTypeDef.hxx"
+#include <com/sun/star/container/XNamed.hpp>
+#include "connectivity/sdbcx/IRefreshable.hxx"
+#include "connectivity/sdbcx/VDescriptor.hxx"
+#include "connectivity/dbtoolsdllapi.hxx"
+#include <cppuhelper/implbase1.hxx>
+#include <com/sun/star/sdbcx/XDataDescriptorFactory.hpp>
+#include <boost/shared_ptr.hpp>
+
+namespace connectivity
+{
+ namespace sdbcx
+ {
+
+ struct OOO_DLLPUBLIC_DBTOOLS KeyProperties
+ {
+ ::std::vector< ::rtl::OUString> m_aKeyColumnNames;
+ ::rtl::OUString m_ReferencedTable;
+ sal_Int32 m_Type;
+ sal_Int32 m_UpdateRule;
+ sal_Int32 m_DeleteRule;
+ KeyProperties(const ::rtl::OUString& _ReferencedTable,
+ sal_Int32 _Type,
+ sal_Int32 _UpdateRule,
+ sal_Int32 _DeleteRule)
+ :m_ReferencedTable(_ReferencedTable),
+ m_Type(_Type),
+ m_UpdateRule(_UpdateRule),
+ m_DeleteRule(_DeleteRule)
+ {}
+ KeyProperties():m_Type(0),m_UpdateRule(0),m_DeleteRule(0){}
+ };
+ typedef ::boost::shared_ptr< KeyProperties > TKeyProperties;
+ typedef ::cppu::ImplHelper1< ::com::sun::star::sdbcx::XDataDescriptorFactory > OKey_BASE;
+ class OCollection;
+
+ class OOO_DLLPUBLIC_DBTOOLS OKey :
+ public comphelper::OBaseMutex,
+ public ODescriptor_BASE,
+ public IRefreshableColumns,
+ public ::comphelper::OIdPropertyArrayUsageHelper<OKey>,
+ public ODescriptor,
+ public OKey_BASE
+ {
+ protected:
+ TKeyProperties m_aProps;
+ OCollection* m_pColumns;
+
+ using ODescriptor_BASE::rBHelper;
+ // OPropertyArrayUsageHelper
+ virtual ::cppu::IPropertyArrayHelper* createArrayHelper( sal_Int32 _nId) const;
+ // OPropertySetHelper
+ virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper();
+ public:
+ OKey(sal_Bool _bCase);
+ OKey(const ::rtl::OUString& _Name,const TKeyProperties& _rProps,sal_Bool _bCase);
+ /*OKey( const ::rtl::OUString& _Name,
+ const ::rtl::OUString& _ReferencedTable,
+ sal_Int32 _Type,
+ sal_Int32 _UpdateRule,
+ sal_Int32 _DeleteRule,
+ sal_Bool _bCase);*/
+
+ virtual ~OKey( );
+
+ DECLARE_SERVICE_INFO();
+ //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();
+ virtual void SAL_CALL release() throw();
+ //XTypeProvider
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
+ // ODescriptor
+ virtual void construct();
+
+ // ::cppu::OComponentHelper
+ virtual void SAL_CALL disposing();
+ // XPropertySet
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
+ // XColumnsSupplier
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL getColumns( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // XNamed
+ virtual ::rtl::OUString SAL_CALL getName( ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setName( const ::rtl::OUString& aName ) throw(::com::sun::star::uno::RuntimeException);
+ // XDataDescriptorFactory
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > SAL_CALL createDataDescriptor( ) throw(::com::sun::star::uno::RuntimeException);
+ };
+ }
+}
+
+#endif // _CONNECTIVITY_SDBCX_KEY_HXX_
+
+
diff --git a/connectivity/inc/connectivity/sdbcx/VKeyColumn.hxx b/connectivity/inc/connectivity/sdbcx/VKeyColumn.hxx
new file mode 100644
index 000000000000..a3526cc68028
--- /dev/null
+++ b/connectivity/inc/connectivity/sdbcx/VKeyColumn.hxx
@@ -0,0 +1,71 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org 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 version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _CONNECTIVITY_SDBCX_KEYCOLUMN_HXX_
+#define _CONNECTIVITY_SDBCX_KEYCOLUMN_HXX_
+
+#include "connectivity/dbtoolsdllapi.hxx"
+#include "connectivity/sdbcx/VColumn.hxx"
+
+namespace connectivity
+{
+ namespace sdbcx
+ {
+ class OKeyColumn;
+ typedef ::comphelper::OIdPropertyArrayUsageHelper<OKeyColumn> OKeyColumn_PROP;
+
+ class OOO_DLLPUBLIC_DBTOOLS OKeyColumn :
+ public OColumn, public OKeyColumn_PROP
+ {
+ protected:
+ ::rtl::OUString m_ReferencedColumn;
+ virtual ::cppu::IPropertyArrayHelper* createArrayHelper( sal_Int32 _nId) const;
+ virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
+ public:
+ OKeyColumn(sal_Bool _bCase);
+ OKeyColumn( const ::rtl::OUString& _ReferencedColumn,
+ const ::rtl::OUString& _Name,
+ const ::rtl::OUString& _TypeName,
+ const ::rtl::OUString& _DefaultValue,
+ sal_Int32 _IsNullable,
+ sal_Int32 _Precision,
+ sal_Int32 _Scale,
+ sal_Int32 _Type,
+ sal_Bool _IsAutoIncrement,
+ sal_Bool _IsRowVersion,
+ sal_Bool _IsCurrency,
+ sal_Bool _bCase);
+ // just to make it not inline
+ virtual ~OKeyColumn();
+
+ virtual void construct();
+ DECLARE_SERVICE_INFO();
+ };
+ }
+}
+#endif // _CONNECTIVITY_SDBCX_KEYCOLUMN_HXX_
+
diff --git a/connectivity/inc/connectivity/sdbcx/VTable.hxx b/connectivity/inc/connectivity/sdbcx/VTable.hxx
new file mode 100644
index 000000000000..c1ced96b4195
--- /dev/null
+++ b/connectivity/inc/connectivity/sdbcx/VTable.hxx
@@ -0,0 +1,148 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org 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 version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _CONNECTIVITY_SDBCX_TABLE_HXX_
+#define _CONNECTIVITY_SDBCX_TABLE_HXX_
+
+#include <com/sun/star/sdbcx/XDataDescriptorFactory.hpp>
+#include <com/sun/star/sdbcx/XIndexesSupplier.hpp>
+#include <com/sun/star/sdbcx/XRename.hpp>
+#include <com/sun/star/sdbcx/XAlterTable.hpp>
+#include <com/sun/star/sdbcx/XColumnsSupplier.hpp>
+#include <com/sun/star/sdbcx/XKeysSupplier.hpp>
+#include <comphelper/IdPropArrayHelper.hxx>
+#include <cppuhelper/compbase4.hxx>
+#include <cppuhelper/implbase4.hxx>
+#include <comphelper/broadcasthelper.hxx>
+#include <com/sun/star/container/XNamed.hpp>
+#include "connectivity/sdbcx/IRefreshable.hxx"
+#include "connectivity/sdbcx/VDescriptor.hxx"
+#include "connectivity/CommonTools.hxx"
+#include "connectivity/dbtoolsdllapi.hxx"
+#include <com/sun/star/sdbc/XDatabaseMetaData.hpp>
+
+namespace connectivity
+{
+ namespace sdbcx
+ {
+
+ class OTable;
+ class OCollection;
+
+ typedef ::cppu::WeakComponentImplHelper4< ::com::sun::star::sdbcx::XColumnsSupplier,
+ ::com::sun::star::sdbcx::XKeysSupplier,
+ ::com::sun::star::container::XNamed,
+ ::com::sun::star::lang::XServiceInfo> OTableDescriptor_BASE;
+
+ typedef ::cppu::ImplHelper4< ::com::sun::star::sdbcx::XDataDescriptorFactory,
+ ::com::sun::star::sdbcx::XIndexesSupplier,
+ ::com::sun::star::sdbcx::XRename,
+ ::com::sun::star::sdbcx::XAlterTable > OTable_BASE;
+
+ typedef ::comphelper::OIdPropertyArrayUsageHelper<OTable> OTable_PROP;
+
+
+ class OOO_DLLPUBLIC_DBTOOLS OTable :
+ public comphelper::OBaseMutex,
+ public OTable_BASE,
+ public OTableDescriptor_BASE,
+ public IRefreshableColumns,
+ public OTable_PROP,
+ public ODescriptor
+ {
+ protected:
+ ::rtl::OUString m_CatalogName;
+ ::rtl::OUString m_SchemaName;
+ ::rtl::OUString m_Description;
+ ::rtl::OUString m_Type;
+
+ OCollection* m_pKeys;
+ OCollection* m_pColumns;
+ OCollection* m_pIndexes;
+ OCollection* m_pTables; // must hold his own container to notify him when renaming
+
+ using OTableDescriptor_BASE::rBHelper;
+
+ // OPropertyArrayUsageHelper
+ virtual ::cppu::IPropertyArrayHelper* createArrayHelper(sal_Int32 _nId ) const;
+ // OPropertySetHelper
+ virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper();
+ public:
+ OTable( OCollection* _pTables,
+ sal_Bool _bCase);
+ OTable( OCollection* _pTables,
+ sal_Bool _bCase,
+ const ::rtl::OUString& _Name,
+ const ::rtl::OUString& _Type,
+ const ::rtl::OUString& _Description = ::rtl::OUString(),
+ const ::rtl::OUString& _SchemaName = ::rtl::OUString(),
+ const ::rtl::OUString& _CatalogName = ::rtl::OUString());
+
+ virtual ~OTable();
+
+ DECLARE_SERVICE_INFO();
+ //XInterface
+ virtual void SAL_CALL acquire() throw();
+ virtual void SAL_CALL release() throw();
+ virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException);
+ //XTypeProvider
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // ODescriptor
+ virtual void construct();
+ virtual void refreshColumns();
+ virtual void refreshKeys();
+ virtual void refreshIndexes();
+ // ::cppu::OComponentHelper
+ virtual void SAL_CALL disposing(void);
+ // XPropertySet
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
+ // XColumnsSupplier
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL getColumns( ) throw(::com::sun::star::uno::RuntimeException);
+ // XKeysSupplier
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > SAL_CALL getKeys( ) throw(::com::sun::star::uno::RuntimeException);
+ // XNamed
+ virtual ::rtl::OUString SAL_CALL getName() throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setName( const ::rtl::OUString& aName ) throw(::com::sun::star::uno::RuntimeException);
+ // XDataDescriptorFactory
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > SAL_CALL createDataDescriptor( void ) throw(::com::sun::star::uno::RuntimeException);
+ // XIndexesSupplier
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL getIndexes( ) throw(::com::sun::star::uno::RuntimeException);
+ // XRename
+ virtual void SAL_CALL rename( const ::rtl::OUString& newName ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::container::ElementExistException, ::com::sun::star::uno::RuntimeException);
+ // XAlterTable
+ virtual void SAL_CALL alterColumnByName( const ::rtl::OUString& colName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& descriptor ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::container::NoSuchElementException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL alterColumnByIndex( sal_Int32 index, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& descriptor ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+
+ // helper method
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData> getMetaData() const;
+ };
+ }
+}
+
+#endif // _CONNECTIVITY_SDBCX_TABLE_HXX_
+
diff --git a/connectivity/inc/connectivity/sdbcx/VTypeDef.hxx b/connectivity/inc/connectivity/sdbcx/VTypeDef.hxx
new file mode 100644
index 000000000000..386cb254a69c
--- /dev/null
+++ b/connectivity/inc/connectivity/sdbcx/VTypeDef.hxx
@@ -0,0 +1,47 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org 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 version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _CONNECTIVITY_SDBCX_TYPEDEF_HXX_
+#define _CONNECTIVITY_SDBCX_TYPEDEF_HXX_
+
+#include <com/sun/star/sdbcx/XColumnsSupplier.hpp>
+#include <cppuhelper/compbase3.hxx>
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/container/XNamed.hpp>
+
+namespace connectivity
+{
+ namespace sdbcx
+ {
+ typedef ::cppu::WeakComponentImplHelper3< ::com::sun::star::sdbcx::XColumnsSupplier,
+ ::com::sun::star::container::XNamed,
+ ::com::sun::star::lang::XServiceInfo> ODescriptor_BASE;
+ }
+}
+
+#endif // _CONNECTIVITY_SDBCX_TYPEDEF_HXX_
+
diff --git a/connectivity/inc/connectivity/sdbcx/VUser.hxx b/connectivity/inc/connectivity/sdbcx/VUser.hxx
new file mode 100644
index 000000000000..529926bd0229
--- /dev/null
+++ b/connectivity/inc/connectivity/sdbcx/VUser.hxx
@@ -0,0 +1,107 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org 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 version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _CONNECTIVITY_SDBCX_USER_HXX_
+#define _CONNECTIVITY_SDBCX_USER_HXX_
+
+#include <osl/diagnose.h>
+#include <com/sun/star/sdbcx/XUser.hpp>
+#include <com/sun/star/sdbcx/XGroupsSupplier.hpp>
+#include <comphelper/proparrhlp.hxx>
+#include <cppuhelper/compbase4.hxx>
+#include "connectivity/CommonTools.hxx"
+#include <comphelper/broadcasthelper.hxx>
+#include "connectivity/sdbcx/VCollection.hxx"
+#include <com/sun/star/container/XNamed.hpp>
+#include "connectivity/sdbcx/IRefreshable.hxx"
+#include "connectivity/sdbcx/VDescriptor.hxx"
+#include "connectivity/dbtoolsdllapi.hxx"
+
+namespace connectivity
+{
+ namespace sdbcx
+ {
+ typedef OCollection OGroups;
+
+ typedef ::cppu::WeakComponentImplHelper4< ::com::sun::star::sdbcx::XUser,
+ ::com::sun::star::sdbcx::XGroupsSupplier,
+ ::com::sun::star::container::XNamed,
+ ::com::sun::star::lang::XServiceInfo> OUser_BASE;
+
+ class OOO_DLLPUBLIC_DBTOOLS OUser :
+ public comphelper::OBaseMutex,
+ public OUser_BASE,
+ public IRefreshableGroups,
+ public ::comphelper::OPropertyArrayUsageHelper<OUser>,
+ public ODescriptor
+ {
+ protected:
+ OGroups* m_pGroups;
+
+ using OUser_BASE::rBHelper;
+
+ // OPropertyArrayUsageHelper
+ virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const;
+ // OPropertySetHelper
+ virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper();
+ public:
+ OUser(sal_Bool _bCase);
+ OUser(const ::rtl::OUString& _Name,sal_Bool _bCase);
+
+ virtual ~OUser( );
+
+ DECLARE_SERVICE_INFO();
+
+ // ::cppu::OComponentHelper
+ virtual void SAL_CALL disposing(void);
+ //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();
+ virtual void SAL_CALL release() throw();
+ //XTypeProvider
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
+ // XPropertySet
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
+ // XUser
+ virtual void SAL_CALL changePassword( const ::rtl::OUString& objPassword, const ::rtl::OUString& newPassword ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
+ // XAuthorizable
+ virtual sal_Int32 SAL_CALL getPrivileges( const ::rtl::OUString& objName, sal_Int32 objType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL getGrantablePrivileges( const ::rtl::OUString& objName, sal_Int32 objType ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL grantPrivileges( const ::rtl::OUString& objName, sal_Int32 objType, sal_Int32 objPrivileges ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL revokePrivileges( const ::rtl::OUString& objName, sal_Int32 objType, sal_Int32 objPrivileges ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
+ // XGroupsSupplier
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL getGroups( ) throw(::com::sun::star::uno::RuntimeException);
+
+ // XNamed
+ virtual ::rtl::OUString SAL_CALL getName( ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setName( const ::rtl::OUString& aName ) throw(::com::sun::star::uno::RuntimeException);
+ };
+ }
+}
+
+#endif // _CONNECTIVITY_SDBCX_USER_HXX_
+
diff --git a/connectivity/inc/connectivity/sdbcx/VView.hxx b/connectivity/inc/connectivity/sdbcx/VView.hxx
new file mode 100644
index 000000000000..ab386ad7c284
--- /dev/null
+++ b/connectivity/inc/connectivity/sdbcx/VView.hxx
@@ -0,0 +1,108 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2000, 2010 Oracle and/or its affiliates.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org 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 version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+
+#ifndef _CONNECTIVITY_SDBCX_VIEW_HXX_
+#define _CONNECTIVITY_SDBCX_VIEW_HXX_
+
+#include <osl/diagnose.h>
+#include <com/sun/star/sdbcx/XDataDescriptorFactory.hpp>
+#include <com/sun/star/sdbc/XDatabaseMetaData.hpp>
+#include <comphelper/proparrhlp.hxx>
+#include <cppuhelper/compbase1.hxx>
+#include "connectivity/CommonTools.hxx"
+#include <cppuhelper/interfacecontainer.h>
+#include <com/sun/star/container/XNamed.hpp>
+#include "connectivity/sdbcx/VDescriptor.hxx"
+#include "connectivity/dbtoolsdllapi.hxx"
+#include <comphelper/IdPropArrayHelper.hxx>
+#include <cppuhelper/implbase2.hxx>
+
+namespace connectivity
+{
+ namespace sdbcx
+ {
+
+ typedef ::cppu::WeakImplHelper2< ::com::sun::star::lang::XServiceInfo,
+ ::com::sun::star::container::XNamed> OView_BASE;
+
+
+
+ class OOO_DLLPUBLIC_DBTOOLS OView :
+ public ::comphelper::OMutexAndBroadcastHelper,
+ public OView_BASE,
+ public ::comphelper::OIdPropertyArrayUsageHelper<OView>,
+ public ODescriptor
+ {
+ protected:
+ ::rtl::OUString m_CatalogName;
+ ::rtl::OUString m_SchemaName;
+ ::rtl::OUString m_Command;
+ sal_Int32 m_CheckOption;
+ // need for the getName method
+ ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData > m_xMetaData;
+
+ // OPropertyArrayUsageHelper
+ virtual ::cppu::IPropertyArrayHelper* createArrayHelper( sal_Int32 _nId) const;
+ // OPropertySetHelper
+ virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper();
+
+ public:
+ DECLARE_SERVICE_INFO();
+
+ OView(sal_Bool _bCase,const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData >& _xMetaData);
+ OView( sal_Bool _bCase,
+ const ::rtl::OUString& _rName,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XDatabaseMetaData >& _xMetaData,
+ sal_Int32 _nCheckOption = 0,
+ const ::rtl::OUString& _rCommand = ::rtl::OUString(),
+ const ::rtl::OUString& _rSchemaName = ::rtl::OUString(),
+ const ::rtl::OUString& _rCatalogName = ::rtl::OUString());
+ virtual ~OView();
+
+ // ODescriptor
+ virtual void construct();
+
+ // ::cppu::OComponentHelper
+ virtual void SAL_CALL disposing(void);
+
+ // 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();
+ virtual void SAL_CALL release() throw();
+ //XTypeProvider
+ virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > SAL_CALL getTypes( ) throw(::com::sun::star::uno::RuntimeException);
+ // XPropertySet
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
+ // XNamed
+ virtual ::rtl::OUString SAL_CALL getName( ) throw(::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setName( const ::rtl::OUString& ) throw(::com::sun::star::uno::RuntimeException);
+ };
+ }
+}
+
+#endif // _CONNECTIVITY_SDBCX_VIEW_HXX_
+