LibreOffice Module comphelper (master)  1
Public Types | Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
comphelper::OPropertyArrayAggregationHelper Class Referencefinal

#include <propagg.hxx>

Inheritance diagram for comphelper::OPropertyArrayAggregationHelper:
[legend]
Collaboration diagram for comphelper::OPropertyArrayAggregationHelper:
[legend]

Public Types

enum  PropertyOrigin {
  PropertyOrigin::Aggregate,
  PropertyOrigin::Delegator,
  PropertyOrigin::Unknown
}
 

Public Member Functions

 OPropertyArrayAggregationHelper (const css::uno::Sequence< css::beans::Property > &_rProperties, const css::uno::Sequence< css::beans::Property > &_rAggProperties, IPropertyInfoService *_pInfoService=nullptr, sal_Int32 _nFirstAggregateId=DEFAULT_AGGREGATE_PROPERTY_ID)
 construct the object. More...
 
virtual sal_Bool SAL_CALL fillPropertyMembersByHandle (OUString *_pPropName, sal_Int16 *_pAttributes, sal_Int32 _nHandle) override
 inherited from IPropertyArrayHelper More...
 
virtual css::uno::Sequence< css::beans::Property > SAL_CALL getProperties () override
 inherited from IPropertyArrayHelper More...
 
virtual css::beans::Property SAL_CALL getPropertyByName (const OUString &_rPropertyName) override
 inherited from IPropertyArrayHelper More...
 
virtual sal_Bool SAL_CALL hasPropertyByName (const OUString &_rPropertyName) override
 inherited from IPropertyArrayHelper More...
 
virtual sal_Int32 SAL_CALL getHandleByName (const OUString &_rPropertyName) override
 inherited from IPropertyArrayHelper More...
 
virtual sal_Int32 SAL_CALL fillHandles (sal_Int32 *_pHandles, const css::uno::Sequence< OUString > &_rPropNames) override
 inherited from IPropertyArrayHelper More...
 
bool fillAggregatePropertyInfoByHandle (OUString *_pPropName, sal_Int32 *_pOriginalHandle, sal_Int32 _nHandle) const
 returns information about a property of the aggregate. More...
 
bool getPropertyByHandle (sal_Int32 _nHandle, css::beans::Property &_rProperty) const
 returns information about a property given by handle More...
 
PropertyOrigin classifyProperty (const OUString &_rName)
 prefer this one over the XPropertySetInfo of the aggregate! More...
 
- Public Member Functions inherited from cppu::IPropertyArrayHelper
virtual ~IPropertyArrayHelper ()
 
virtual sal_Bool SAL_CALL fillPropertyMembersByHandle (::rtl::OUString *pPropName, sal_Int16 *pAttributes, sal_Int32 nHandle)=0
 
virtual css::beans::Property SAL_CALL getPropertyByName (const ::rtl::OUString &rPropertyName)=0
 
virtual sal_Bool SAL_CALL hasPropertyByName (const ::rtl::OUString &rPropertyName)=0
 
virtual sal_Int32 SAL_CALL getHandleByName (const ::rtl::OUString &rPropertyName)=0
 
virtual sal_Int32 SAL_CALL fillHandles (sal_Int32 *pHandles, const css::uno::Sequence< ::rtl::OUString > &rPropNames)=0
 

Private Member Functions

const css::beans::Property * findPropertyByName (const OUString &_rName) const
 

Private Attributes

std::vector< css::beans::Property > m_aProperties
 
internal::PropertyAccessorMap m_aPropertyAccessors
 

Friends

class OPropertySetAggregationHelper
 

Additional Inherited Members

- Static Public Member Functions inherited from cppu::IPropertyArrayHelper
static void *SAL_CALL operator new (size_t nSize)
 
static void SAL_CALL operator delete (void *pMem)
 
static void *SAL_CALL operator new (size_t, void *pMem)
 
static void SAL_CALL operator delete (void *, void *)
 

Detailed Description

Definition at line 92 of file propagg.hxx.

Member Enumeration Documentation

Enumerator
Aggregate 
Delegator 
Unknown 

Definition at line 161 of file propagg.hxx.

Constructor & Destructor Documentation

comphelper::OPropertyArrayAggregationHelper::OPropertyArrayAggregationHelper ( const css::uno::Sequence< css::beans::Property > &  _rProperties,
const css::uno::Sequence< css::beans::Property > &  _rAggProperties,
IPropertyInfoService _pInfoService = nullptr,
sal_Int32  _nFirstAggregateId = DEFAULT_AGGREGATE_PROPERTY_ID 
)

construct the object.

Parameters
_rPropertiesthe properties of the object doing the aggregation. These properties are used without any checks, so the caller has to ensure that the names and handles are valid.
_rAggPropertiesthe properties of the aggregate, usually got via a call to getProperties on the XPropertySetInfo of the aggregate. The names of the properties are used without any checks, so the caller has to ensure that there are no doubles. The handles are stored for later quick access, but the outside-handles the aggregate properties get depend from the following two parameters.
_pInfoServiceIf not NULL, the object pointed to is used to calc handles which should be used for referring the aggregate's properties from outside. If one of the properties returned from the info service conflict with other handles already present (e.g. through _rProperties), the property is handled as if -1 was returned. If NULL (or, for a special property, a call to getPreferredPropertyId returns -1), the aggregate property(ies) get a new handle which they can be referred by from outside.
_nFirstAggregateIdif the object is about to create new handles for the aggregate properties, it uses id's ascending from this given id. No checks are made if the handle range determined by _nFirstAggregateId conflicts with other handles within _rProperties.

Definition at line 59 of file propagg.cxx.

References comphelper::IPropertyInfoService::getPreferredPropertyId(), inserted(), x, and y.

Member Function Documentation

OPropertyArrayAggregationHelper::PropertyOrigin comphelper::OPropertyArrayAggregationHelper::classifyProperty ( const OUString &  _rName)

prefer this one over the XPropertySetInfo of the aggregate!

The reason is that OPropertyArrayAggregationHelper is the only instance which really knows which properties of the aggregate are to be exposed.

For instance, some derivee of OPropertySetAggregationHelper may decide to create an OPropertyArrayAggregationHelper which contains only a subset of the aggregate properties. This way, some of the aggregate properties may be hidden to the public.

When using the XPropertySetInfo of the aggregate set to determine the existence of a property, then this would return false positives.

Definition at line 122 of file propagg.cxx.

References Property.

Referenced by comphelper::OPropertySetAggregationHelper::setPropertyValues().

bool comphelper::OPropertyArrayAggregationHelper::fillAggregatePropertyInfoByHandle ( OUString *  _pPropName,
sal_Int32 *  _pOriginalHandle,
sal_Int32  _nHandle 
) const

returns information about a property of the aggregate.

Parameters
_pPropNamepoints to a string to receive the property name. No name is returned if this is NULL.
_pOriginalHandlepoints to a sal_Int32 to receive the original property handle. No original handle is returned if this is NULL.
_nHandlethe handle of the property as got by, for instance, fillHandles
Returns
sal_True, if _nHandle marks an aggregate property, otherwise sal_False

Definition at line 200 of file propagg.cxx.

References i.

Referenced by comphelper::OPropertySetAggregationHelper::getFastPropertyValue(), comphelper::OPropertySetAggregationHelper::getOriginalHandle(), comphelper::OPropertySetAggregationHelper::getPropertyDefault(), comphelper::OPropertySetAggregationHelper::getPropertyState(), comphelper::OPropertySetAggregationHelper::setFastPropertyValue(), and comphelper::OPropertySetAggregationHelper::setPropertyToDefault().

sal_Int32 comphelper::OPropertyArrayAggregationHelper::fillHandles ( sal_Int32 *  _pHandles,
const css::uno::Sequence< OUString > &  _rPropNames 
)
overridevirtual

inherited from IPropertyArrayHelper

Definition at line 226 of file propagg.cxx.

References i, and Property.

sal_Bool comphelper::OPropertyArrayAggregationHelper::fillPropertyMembersByHandle ( OUString *  _pPropName,
sal_Int16 *  _pAttributes,
sal_Int32  _nHandle 
)
overridevirtual

inherited from IPropertyArrayHelper

Definition at line 171 of file propagg.cxx.

References i.

const Property * comphelper::OPropertyArrayAggregationHelper::findPropertyByName ( const OUString &  _rName) const
private

Definition at line 158 of file propagg.cxx.

References Property.

sal_Int32 comphelper::OPropertyArrayAggregationHelper::getHandleByName ( const OUString &  _rPropertyName)
overridevirtual
css::uno::Sequence< css::beans::Property > comphelper::OPropertyArrayAggregationHelper::getProperties ( )
overridevirtual

inherited from IPropertyArrayHelper

Implements cppu::IPropertyArrayHelper.

Definition at line 220 of file propagg.cxx.

References comphelper::containerToSequence().

bool comphelper::OPropertyArrayAggregationHelper::getPropertyByHandle ( sal_Int32  _nHandle,
css::beans::Property &  _rProperty 
) const

returns information about a property given by handle

Definition at line 188 of file propagg.cxx.

Referenced by comphelper::OPropertySetAggregationHelper::convertFastPropertyValue(), and comphelper::OPropertySetAggregationHelper::getPropertyName().

Property comphelper::OPropertyArrayAggregationHelper::getPropertyByName ( const OUString &  _rPropertyName)
overridevirtual

inherited from IPropertyArrayHelper

Definition at line 141 of file propagg.cxx.

References Property.

sal_Bool comphelper::OPropertyArrayAggregationHelper::hasPropertyByName ( const OUString &  _rPropertyName)
overridevirtual

inherited from IPropertyArrayHelper

Definition at line 152 of file propagg.cxx.

Friends And Related Function Documentation

friend class OPropertySetAggregationHelper
friend

Definition at line 94 of file propagg.hxx.

Member Data Documentation

std::vector<css::beans::Property> comphelper::OPropertyArrayAggregationHelper::m_aProperties
private

Definition at line 96 of file propagg.hxx.

internal::PropertyAccessorMap comphelper::OPropertyArrayAggregationHelper::m_aPropertyAccessors
private

Definition at line 97 of file propagg.hxx.


The documentation for this class was generated from the following files: