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 class  PropertyOrigin {
  Aggregate ,
  Delegator ,
  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::uno::Sequence< css::beans::Property > SAL_CALL getProperties ()=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
 
std::map< sal_Int32, internal::OPropertyAccessorm_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 89 of file propagg.hxx.

Member Enumeration Documentation

◆ PropertyOrigin

Enumerator
Aggregate 
Delegator 
Unknown 

Definition at line 158 of file propagg.hxx.

Constructor & Destructor Documentation

◆ OPropertyArrayAggregationHelper()

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(), m_aProperties, m_aPropertyAccessors, nHandle, x, and y.

Member Function Documentation

◆ classifyProperty()

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 124 of file propagg.cxx.

References Aggregate, Delegator, m_aProperties, m_aPropertyAccessors, Property, and Unknown.

◆ fillAggregatePropertyInfoByHandle()

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 202 of file propagg.cxx.

References i, m_aProperties, and m_aPropertyAccessors.

◆ fillHandles()

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

inherited from IPropertyArrayHelper

Definition at line 228 of file propagg.cxx.

References i, m_aProperties, and Property.

◆ fillPropertyMembersByHandle()

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

inherited from IPropertyArrayHelper

Definition at line 173 of file propagg.cxx.

References i, m_aProperties, and m_aPropertyAccessors.

◆ findPropertyByName()

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

Definition at line 160 of file propagg.cxx.

References m_aProperties, and Property.

Referenced by getHandleByName(), getPropertyByName(), and hasPropertyByName().

◆ getHandleByName()

sal_Int32 comphelper::OPropertyArrayAggregationHelper::getHandleByName ( const OUString &  _rPropertyName)
overridevirtual

inherited from IPropertyArrayHelper

Definition at line 166 of file propagg.cxx.

References findPropertyByName(), and Property.

◆ getProperties()

css::uno::Sequence< css::beans::Property > comphelper::OPropertyArrayAggregationHelper::getProperties ( )
overridevirtual

inherited from IPropertyArrayHelper

Implements cppu::IPropertyArrayHelper.

Definition at line 222 of file propagg.cxx.

References comphelper::containerToSequence(), and m_aProperties.

◆ getPropertyByHandle()

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

returns information about a property given by handle

Definition at line 190 of file propagg.cxx.

References m_aProperties, m_aPropertyAccessors, and pos.

◆ getPropertyByName()

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

inherited from IPropertyArrayHelper

Definition at line 143 of file propagg.cxx.

References findPropertyByName(), and Property.

◆ hasPropertyByName()

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

inherited from IPropertyArrayHelper

Definition at line 154 of file propagg.cxx.

References findPropertyByName().

Friends And Related Function Documentation

◆ OPropertySetAggregationHelper

friend class OPropertySetAggregationHelper
friend

Definition at line 91 of file propagg.hxx.

Member Data Documentation

◆ m_aProperties

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

◆ m_aPropertyAccessors

std::map< sal_Int32, internal::OPropertyAccessor > comphelper::OPropertyArrayAggregationHelper::m_aPropertyAccessors
private

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