summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladimir Glazounov <vg@openoffice.org>2005-03-10 14:16:34 +0000
committerVladimir Glazounov <vg@openoffice.org>2005-03-10 14:16:34 +0000
commit5929527fee846979c18813c99da9b6dbb08d15d4 (patch)
tree8bc5c32380340b2cfa8e5a3fa440522ff0b3079e
parent6abead6cc2e7cfdd563e51ff96d9ca3fa43ddcab (diff)
INTEGRATION: CWS dba24 (1.20.32); FILE MERGED
2005/02/09 08:07:33 oj 1.20.32.1: #i26950# remove the need for XNamed
-rw-r--r--connectivity/inc/connectivity/sdbcx/VCollection.hxx35
1 files changed, 18 insertions, 17 deletions
diff --git a/connectivity/inc/connectivity/sdbcx/VCollection.hxx b/connectivity/inc/connectivity/sdbcx/VCollection.hxx
index e38423b19453..88d63c23f345 100644
--- a/connectivity/inc/connectivity/sdbcx/VCollection.hxx
+++ b/connectivity/inc/connectivity/sdbcx/VCollection.hxx
@@ -2,9 +2,9 @@
*
* $RCSfile: VCollection.hxx,v $
*
- * $Revision: 1.20 $
+ * $Revision: 1.21 $
*
- * last change: $Author: rt $ $Date: 2004-10-22 08:40:54 $
+ * last change: $Author: vg $ $Date: 2005-03-10 15:16:34 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -71,9 +71,6 @@
#ifndef _COM_SUN_STAR_CONTAINER_XINDEXACCESS_HPP_
#include <com/sun/star/container/XIndexAccess.hpp>
#endif
-#ifndef _COM_SUN_STAR_CONTAINER_XNAMED_HPP_
-#include <com/sun/star/container/XNamed.hpp>
-#endif
#ifndef _COM_SUN_STAR_CONTAINER_XENUMERATIONACCESS_HPP_
#include <com/sun/star/container/XEnumerationAccess.hpp>
#endif
@@ -128,8 +125,6 @@ namespace connectivity
{
// the class OCollection is base class for collections :-)
- // all elements <strong> must </strong> support the XNamed interface
-
typedef ::cppu::ImplHelper10< ::com::sun::star::container::XNameAccess,
::com::sun::star::container::XIndexAccess,
::com::sun::star::container::XEnumerationAccess,
@@ -141,7 +136,7 @@ namespace connectivity
::com::sun::star::sdbcx::XDrop,
::com::sun::star::lang::XServiceInfo> OCollectionBase;
- typedef ::com::sun::star::uno::Reference< ::com::sun::star::container::XNamed > Object_BASE;
+ typedef ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > ObjectType;
class SAL_NO_VTABLE IObjectCollection
{
@@ -153,7 +148,7 @@ namespace connectivity
virtual void swap() = 0;
virtual void clear() = 0;
virtual void reFill(const TStringVector &_rVector) = 0;
- virtual void insert(const ::rtl::OUString& _sName,const Object_BASE& _xObject) = 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;
@@ -162,9 +157,9 @@ namespace connectivity
virtual void disposeElements() = 0;
virtual sal_Int32 findColumn( const ::rtl::OUString& columnName ) = 0;
virtual ::rtl::OUString findColumnAtIndex( sal_Int32 _nIndex) = 0;
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNamed > getObject(sal_Int32 _nIndex) = 0;
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNamed > getObject(const ::rtl::OUString& columnName) = 0;
- virtual void setObject(sal_Int32 _nIndex,const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNamed >& _xObject) = 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;
};
//************************************************************
@@ -187,19 +182,25 @@ namespace connectivity
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 ::com::sun::star::uno::Reference< ::com::sun::star::container::XNamed > createObject(const ::rtl::OUString& _rName) = 0;
+ 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 > createEmptyObject();
// return an object which is the copy of the argument
- virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNamed > cloneObject(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _xDescriptor);
+ virtual ObjectType cloneObject(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _xDescriptor);
virtual void appendObject( 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);
+
OCollection(::cppu::OWeakObject& _rParent,
sal_Bool _bCase,
::osl::Mutex& _rMutex,
@@ -214,7 +215,7 @@ namespace connectivity
/** insert a new element into the collection
*/
- void insertElement(const ::rtl::OUString& _sElementName,const Object_BASE& _xElement);
+ void insertElement(const ::rtl::OUString& _sElementName,const ObjectType& _xElement);
/** return the name of element at index _nIndex
*/
@@ -227,9 +228,9 @@ namespace connectivity
/** return the object, if not existent it creates it.
@param _nIndex
The index of the object to create.
- @return ::com::sun::star::uno::Reference<::com::sun::star::container::XNamed >
+ @return ObjectType
*/
- ::com::sun::star::uno::Reference< ::com::sun::star::container::XNamed > getObject(sal_Int32 _nIndex);
+ ObjectType getObject(sal_Int32 _nIndex);
public:
virtual ~OCollection();