LibreOffice Module comphelper (master) 1
|
#include <propagg.hxx>
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::OPropertyAccessor > | 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 *) |
Definition at line 89 of file propagg.hxx.
|
strong |
Enumerator | |
---|---|
Aggregate | |
Delegator | |
Unknown |
Definition at line 158 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 59 of file propagg.cxx.
References comphelper::IPropertyInfoService::getPreferredPropertyId(), inserted(), m_aProperties, m_aPropertyAccessors, 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 124 of file propagg.cxx.
References Aggregate, Delegator, m_aProperties, m_aPropertyAccessors, Property, and Unknown.
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 202 of file propagg.cxx.
References i, m_aProperties, and m_aPropertyAccessors.
|
overridevirtual |
inherited from IPropertyArrayHelper
Definition at line 228 of file propagg.cxx.
References i, m_aProperties, and Property.
|
overridevirtual |
inherited from IPropertyArrayHelper
Definition at line 173 of file propagg.cxx.
References i, m_aProperties, and m_aPropertyAccessors.
|
private |
Definition at line 160 of file propagg.cxx.
References m_aProperties, and Property.
Referenced by getHandleByName(), getPropertyByName(), and hasPropertyByName().
|
overridevirtual |
inherited from IPropertyArrayHelper
Definition at line 166 of file propagg.cxx.
References findPropertyByName(), and Property.
|
overridevirtual |
inherited from IPropertyArrayHelper
Implements cppu::IPropertyArrayHelper.
Definition at line 222 of file propagg.cxx.
References comphelper::containerToSequence(), and m_aProperties.
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.
|
overridevirtual |
inherited from IPropertyArrayHelper
Definition at line 143 of file propagg.cxx.
References findPropertyByName(), and Property.
|
overridevirtual |
inherited from IPropertyArrayHelper
Definition at line 154 of file propagg.cxx.
References findPropertyByName().
|
friend |
Definition at line 91 of file propagg.hxx.
|
private |
Definition at line 93 of file propagg.hxx.
Referenced by classifyProperty(), fillAggregatePropertyInfoByHandle(), fillHandles(), fillPropertyMembersByHandle(), findPropertyByName(), getProperties(), getPropertyByHandle(), and OPropertyArrayAggregationHelper().
|
private |
Definition at line 94 of file propagg.hxx.
Referenced by classifyProperty(), fillAggregatePropertyInfoByHandle(), fillPropertyMembersByHandle(), getPropertyByHandle(), and OPropertyArrayAggregationHelper().