LibreOffice Module comphelper (master) 1
Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
comphelper::OPropertyContainerHelper Class Reference

helper class for managing property values, and implementing most of the X*Property* interfaces More...

#include <propertycontainerhelper.hxx>

Inheritance diagram for comphelper::OPropertyContainerHelper:
[legend]

Protected Member Functions

 OPropertyContainerHelper ()
 
 ~OPropertyContainerHelper ()
 
void registerProperty (const OUString &_rName, sal_Int32 _nHandle, sal_Int32 _nAttributes, void *_pPointerToMember, const css::uno::Type &_rMemberType)
 register a property. More...
 
void registerMayBeVoidProperty (const OUString &_rName, sal_Int32 _nHandle, sal_Int32 _nAttributes, css::uno::Any *_pPointerToMember, const css::uno::Type &_rExpectedType)
 register a property. More...
 
void registerPropertyNoMember (const OUString &_rName, sal_Int32 _nHandle, sal_Int32 _nAttributes, const css::uno::Type &_rType, css::uno::Any const &_pInitialValue)
 register a property. More...
 
void revokeProperty (sal_Int32 _nHandle)
 revokes a previously registered property More...
 
bool isRegisteredProperty (sal_Int32 _nHandle) const
 checks whether a property with the given handle has been registered More...
 
bool isRegisteredProperty (const OUString &_rName) const
 checks whether a property with the given name has been registered More...
 
bool convertFastPropertyValue (css::uno::Any &rConvertedValue, css::uno::Any &rOldValue, sal_Int32 nHandle, const css::uno::Any &rValue)
 
void setFastPropertyValue (sal_Int32 nHandle, const css::uno::Any &rValue)
 
void getFastPropertyValue (css::uno::Any &rValue, sal_Int32 nHandle) const
 
void describeProperties (css::uno::Sequence< css::beans::Property > &_rProps) const
 appends the descriptions of all properties which were registered 'til that moment to the given sequence, keeping the array sorted (by name) @precond the given sequence is already sorted by name More...
 
const css::beans::Property & getProperty (const OUString &_rName) const
 retrieves the description for a registered property More...
 

Private Types

typedef ::std::vector< css::uno::Any > PropertyContainer
 
typedef ::std::vector< PropertyDescriptionProperties
 
typedef Properties::iterator PropertiesIterator
 
typedef Properties::const_iterator ConstPropertiesIterator
 

Private Member Functions

COMPHELPER_DLLPRIVATE void implPushBackProperty (const PropertyDescription &_rProp)
 insertion of _rProp into m_aProperties, keeping the sort order More...
 
COMPHELPER_DLLPRIVATE PropertiesIterator searchHandle (sal_Int32 _nHandle)
 search the PropertyDescription for the given handle (within m_aProperties) More...
 
 OPropertyContainerHelper (const OPropertyContainerHelper &)=delete
 
OPropertyContainerHelperoperator= (const OPropertyContainerHelper &)=delete
 

Private Attributes

PropertyContainer m_aHoldProperties
 
Properties m_aProperties
 

Detailed Description

helper class for managing property values, and implementing most of the X*Property* interfaces

The property values are usually held in derived classes, but can also be given to the responsibility of this class here.

For more information, see http://wiki.openoffice.org/wiki/Development/Cpp/Helper/PropertyContainerHelper.

Definition at line 74 of file propertycontainerhelper.hxx.

Member Typedef Documentation

◆ ConstPropertiesIterator

typedef Properties::const_iterator comphelper::OPropertyContainerHelper::ConstPropertiesIterator
private

Definition at line 83 of file propertycontainerhelper.hxx.

◆ Properties

Definition at line 81 of file propertycontainerhelper.hxx.

◆ PropertiesIterator

typedef Properties::iterator comphelper::OPropertyContainerHelper::PropertiesIterator
private

Definition at line 82 of file propertycontainerhelper.hxx.

◆ PropertyContainer

typedef ::std::vector< css::uno::Any > comphelper::OPropertyContainerHelper::PropertyContainer
private

Definition at line 76 of file propertycontainerhelper.hxx.

Constructor & Destructor Documentation

◆ OPropertyContainerHelper() [1/2]

comphelper::OPropertyContainerHelper::OPropertyContainerHelper ( )
protected

Definition at line 64 of file propertycontainerhelper.cxx.

◆ ~OPropertyContainerHelper()

comphelper::OPropertyContainerHelper::~OPropertyContainerHelper ( )
protected

Definition at line 69 of file propertycontainerhelper.cxx.

◆ OPropertyContainerHelper() [2/2]

comphelper::OPropertyContainerHelper::OPropertyContainerHelper ( const OPropertyContainerHelper )
privatedelete

Member Function Documentation

◆ convertFastPropertyValue()

bool comphelper::OPropertyContainerHelper::convertFastPropertyValue ( css::uno::Any &  rConvertedValue,
css::uno::Any &  rOldValue,
sal_Int32  nHandle,
const css::uno::Any &  rValue 
)
protected

◆ describeProperties()

void comphelper::OPropertyContainerHelper::describeProperties ( css::uno::Sequence< css::beans::Property > &  _rProps) const
protected

appends the descriptions of all properties which were registered 'til that moment to the given sequence, keeping the array sorted (by name) @precond the given sequence is already sorted by name

Parameters
_rPropsinitial property sequence which is to be extended

Definition at line 458 of file propertycontainerhelper.cxx.

References begin, end, m_aProperties, and Property.

◆ getFastPropertyValue()

void comphelper::OPropertyContainerHelper::getFastPropertyValue ( css::uno::Any &  rValue,
sal_Int32  nHandle 
) const
protected

◆ getProperty()

const Property & comphelper::OPropertyContainerHelper::getProperty ( const OUString &  _rName) const
protected

retrieves the description for a registered property

Exceptions
css::beans::UnknownPropertyExceptionif no property with the given name is registered

Definition at line 444 of file propertycontainerhelper.cxx.

References m_aProperties, pos, and Property.

◆ implPushBackProperty()

void comphelper::OPropertyContainerHelper::implPushBackProperty ( const PropertyDescription _rProp)
private

insertion of _rProp into m_aProperties, keeping the sort order

Definition at line 177 of file propertycontainerhelper.cxx.

References comphelper::PropertyDescription::aProperty, m_aProperties, and pos.

Referenced by registerMayBeVoidProperty(), registerProperty(), and registerPropertyNoMember().

◆ isRegisteredProperty() [1/2]

bool comphelper::OPropertyContainerHelper::isRegisteredProperty ( const OUString &  _rName) const
protected

checks whether a property with the given name has been registered

Definition at line 150 of file propertycontainerhelper.cxx.

References m_aProperties.

◆ isRegisteredProperty() [2/2]

bool comphelper::OPropertyContainerHelper::isRegisteredProperty ( sal_Int32  _nHandle) const
protected

checks whether a property with the given handle has been registered

Definition at line 144 of file propertycontainerhelper.cxx.

References m_aProperties, and searchHandle().

◆ operator=()

OPropertyContainerHelper & comphelper::OPropertyContainerHelper::operator= ( const OPropertyContainerHelper )
privatedelete

◆ registerMayBeVoidProperty()

void comphelper::OPropertyContainerHelper::registerMayBeVoidProperty ( const OUString &  _rName,
sal_Int32  _nHandle,
sal_Int32  _nAttributes,
css::uno::Any *  _pPointerToMember,
const css::uno::Type &  _rExpectedType 
)
protected

register a property.

The property is represented through a css::uno::Any member of the derived class which calls this method.

Parameters
_rNamethe name of the property
_nHandlethe handle of the property
_nAttributesthe attributes of the property
_pPointerToMemberthe pointer to the member representing the property within the derived class, which has to be a css::uno::Any.
_rExpectedTypethe expected type of the property. NOT the type of the object to which _pPointerToMember points (this is always an Any).

Definition at line 102 of file propertycontainerhelper.cxx.

References comphelper::PropertyDescription::aLocation, comphelper::PropertyDescription::aProperty, comphelper::PropertyDescription::DerivedClassAnyType, comphelper::PropertyDescription::eLocated, implPushBackProperty(), comphelper::PropertyDescription::LocationAccess::pDerivedClassMember, and Property.

◆ registerProperty()

void comphelper::OPropertyContainerHelper::registerProperty ( const OUString &  _rName,
sal_Int32  _nHandle,
sal_Int32  _nAttributes,
void *  _pPointerToMember,
const css::uno::Type &  _rMemberType 
)
protected

register a property.

The property is represented through a member of the derived class which calls this method.

Parameters
_rNamethe name of the property
_nHandlethe handle of the property
_nAttributesthe attributes of the property
_pPointerToMemberthe pointer to the member representing the property within the derived class.
_rMemberTypethe cppu type of the property represented by the object to which _pPointerToMember points.

Definition at line 74 of file propertycontainerhelper.cxx.

References comphelper::PropertyDescription::aLocation, comphelper::PropertyDescription::aProperty, comphelper::PropertyDescription::DerivedClassRealType, comphelper::PropertyDescription::eLocated, implPushBackProperty(), comphelper::PropertyDescription::LocationAccess::pDerivedClassMember, and Property.

◆ registerPropertyNoMember()

void comphelper::OPropertyContainerHelper::registerPropertyNoMember ( const OUString &  _rName,
sal_Int32  _nHandle,
sal_Int32  _nAttributes,
const css::uno::Type &  _rType,
css::uno::Any const &  _pInitialValue 
)
protected

register a property.

The repository will create an own object holding this property, so there is no need to declare an extra member in your derived class

Parameters
_rNamethe name of the property
_nHandlethe handle of the property
_nAttributesthe attributes of the property
_rTypethe type of the property
_pInitialValuethe initial value of the property. May be void if _nAttributes includes the css::beans::PropertyAttribute::MAYBEVOID flag. Else it must contain a value compatible with the type described by _rType.

Definition at line 123 of file propertycontainerhelper.cxx.

References comphelper::PropertyDescription::aLocation, comphelper::PropertyDescription::aProperty, comphelper::PropertyDescription::eLocated, comphelper::PropertyDescription::HoldMyself, implPushBackProperty(), m_aHoldProperties, comphelper::PropertyDescription::LocationAccess::nOwnClassVectorIndex, and Property.

◆ revokeProperty()

void comphelper::OPropertyContainerHelper::revokeProperty ( sal_Int32  _nHandle)
protected

revokes a previously registered property

Exceptions
css::beans::UnknownPropertyExceptionif no property with the given handle is registered

Definition at line 93 of file propertycontainerhelper.cxx.

References m_aProperties, and searchHandle().

◆ searchHandle()

OPropertyContainerHelper::PropertiesIterator comphelper::OPropertyContainerHelper::searchHandle ( sal_Int32  _nHandle)
private

◆ setFastPropertyValue()

void comphelper::OPropertyContainerHelper::setFastPropertyValue ( sal_Int32  nHandle,
const css::uno::Any &  rValue 
)
protected

Member Data Documentation

◆ m_aHoldProperties

PropertyContainer comphelper::OPropertyContainerHelper::m_aHoldProperties
private

◆ m_aProperties

Properties comphelper::OPropertyContainerHelper::m_aProperties
private

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