LibreOffice Module comphelper (master)
1
|
#include <propagg.hxx>
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... | |
![]() | |
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 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 *) |
Definition at line 93 of file propagg.hxx.
Enumerator | |
---|---|
Aggregate | |
Delegator | |
Unknown |
Definition at line 162 of file propagg.hxx.
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.
_rProperties | the 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. |
_rAggProperties | the 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. |
_pInfoService | If 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. |
_nFirstAggregateId | if 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 58 of file propagg.cxx.
References comphelper::IPropertyInfoService::getPreferredPropertyId(), inserted(), nHandle, x, and y.
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 121 of file propagg.cxx.
References Property.
bool comphelper::OPropertyArrayAggregationHelper::fillAggregatePropertyInfoByHandle | ( | OUString * | _pPropName, |
sal_Int32 * | _pOriginalHandle, | ||
sal_Int32 | _nHandle | ||
) | const |
returns information about a property of the aggregate.
_pPropName | points to a string to receive the property name. No name is returned if this is NULL. |
_pOriginalHandle | points to a sal_Int32 to receive the original property handle. No original handle is returned if this is NULL. |
_nHandle | the handle of the property as got by, for instance, fillHandles |
Definition at line 199 of file propagg.cxx.
References i.
|
overridevirtual |
inherited from IPropertyArrayHelper
Definition at line 225 of file propagg.cxx.
|
overridevirtual |
|
private |
Definition at line 157 of file propagg.cxx.
References Property.
|
overridevirtual |
inherited from IPropertyArrayHelper
Definition at line 163 of file propagg.cxx.
References Property.
|
overridevirtual |
inherited from IPropertyArrayHelper
Implements cppu::IPropertyArrayHelper.
Definition at line 219 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 187 of file propagg.cxx.
References pos.
|
overridevirtual |
inherited from IPropertyArrayHelper
Definition at line 140 of file propagg.cxx.
References Property.
|
overridevirtual |
inherited from IPropertyArrayHelper
Definition at line 151 of file propagg.cxx.
|
friend |
Definition at line 95 of file propagg.hxx.
|
private |
Definition at line 97 of file propagg.hxx.
|
private |
Definition at line 98 of file propagg.hxx.