LibreOffice Module comphelper (master) 1
|
helper class for managing property values, and implementing most of the X*Property* interfaces More...
#include <propertycontainerhelper.hxx>
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< PropertyDescription > | Properties |
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 | |
OPropertyContainerHelper & | operator= (const OPropertyContainerHelper &)=delete |
Private Attributes | |
PropertyContainer | m_aHoldProperties |
Properties | m_aProperties |
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.
|
private |
Definition at line 83 of file propertycontainerhelper.hxx.
|
private |
Definition at line 81 of file propertycontainerhelper.hxx.
|
private |
Definition at line 82 of file propertycontainerhelper.hxx.
|
private |
Definition at line 76 of file propertycontainerhelper.hxx.
|
protected |
Definition at line 64 of file propertycontainerhelper.cxx.
|
protected |
Definition at line 69 of file propertycontainerhelper.cxx.
|
privatedelete |
|
protected |
Definition at line 210 of file propertycontainerhelper.cxx.
References Any, comphelper::PropertyDescription::DerivedClassAnyType, comphelper::PropertyDescription::DerivedClassRealType, comphelper::PropertyDescription::HoldMyself, m_aHoldProperties, m_aProperties, searchHandle(), uno_type_assignData(), and uno_type_equalData().
Referenced by comphelper::OPropertyContainer::convertFastPropertyValue().
|
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
_rProps | initial property sequence which is to be extended |
Definition at line 458 of file propertycontainerhelper.cxx.
References begin, end, m_aProperties, and Property.
|
protected |
Definition at line 396 of file propertycontainerhelper.cxx.
References Any, comphelper::PropertyDescription::DerivedClassAnyType, comphelper::PropertyDescription::DerivedClassRealType, comphelper::PropertyDescription::HoldMyself, m_aHoldProperties, m_aProperties, and searchHandle().
Referenced by comphelper::OPropertyContainer::getFastPropertyValue().
|
protected |
retrieves the description for a registered property
css::beans::UnknownPropertyException | if no property with the given name is registered |
Definition at line 444 of file propertycontainerhelper.cxx.
References m_aProperties, pos, and Property.
|
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().
|
protected |
checks whether a property with the given name has been registered
Definition at line 150 of file propertycontainerhelper.cxx.
References m_aProperties.
|
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().
|
privatedelete |
|
protected |
register a property.
The property is represented through a css::uno::Any member of the derived class which calls this method.
_rName | the name of the property |
_nHandle | the handle of the property |
_nAttributes | the attributes of the property |
_pPointerToMember | the pointer to the member representing the property within the derived class, which has to be a css::uno::Any. |
_rExpectedType | the 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.
|
protected |
register a property.
The property is represented through a member of the derived class which calls this method.
_rName | the name of the property |
_nHandle | the handle of the property |
_nAttributes | the attributes of the property |
_pPointerToMember | the pointer to the member representing the property within the derived class. |
_rMemberType | the 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.
|
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
_rName | the name of the property |
_nHandle | the handle of the property |
_nAttributes | the attributes of the property |
_rType | the type of the property |
_pInitialValue | the 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.
|
protected |
revokes a previously registered property
css::beans::UnknownPropertyException | if no property with the given handle is registered |
Definition at line 93 of file propertycontainerhelper.cxx.
References m_aProperties, and searchHandle().
|
private |
search the PropertyDescription for the given handle (within m_aProperties)
Definition at line 425 of file propertycontainerhelper.cxx.
References comphelper::PropertyDescription::aProperty, and m_aProperties.
Referenced by convertFastPropertyValue(), getFastPropertyValue(), isRegisteredProperty(), revokeProperty(), and setFastPropertyValue().
|
protected |
Definition at line 356 of file propertycontainerhelper.cxx.
References Any, comphelper::PropertyDescription::DerivedClassAnyType, comphelper::PropertyDescription::DerivedClassRealType, comphelper::PropertyDescription::HoldMyself, m_aHoldProperties, m_aProperties, searchHandle(), and uno_type_assignData().
Referenced by comphelper::OPropertyContainer::setFastPropertyValue_NoBroadcast().
|
private |
Definition at line 77 of file propertycontainerhelper.hxx.
Referenced by convertFastPropertyValue(), getFastPropertyValue(), registerPropertyNoMember(), and setFastPropertyValue().
|
private |
Definition at line 84 of file propertycontainerhelper.hxx.
Referenced by convertFastPropertyValue(), describeProperties(), getFastPropertyValue(), getProperty(), implPushBackProperty(), isRegisteredProperty(), revokeProperty(), searchHandle(), and setFastPropertyValue().