This abstract class maps the methods of the interfaces XMultiPropertySet, XFastPropertySet and XPropertySet to the methods getInfoHelper, convertFastPropertyValue, setFastPropertyValue_NoBroadcast and getFastPropertyValue.
More...
|
| OPropertySetHelper (OBroadcastHelper &rBHelper) |
|
| OPropertySetHelper (OBroadcastHelper &rBHelper, bool bIgnoreRuntimeExceptionsWhileFiring) |
| Constructor. More...
|
|
| OPropertySetHelper (OBroadcastHelper &rBHelper, IEventNotificationHook *i_pFireEvents, bool bIgnoreRuntimeExceptionsWhileFiring=false) |
| Constructor. More...
|
|
virtual css::uno::Any | queryInterface (const css::uno::Type &rType) SAL_OVERRIDE |
| Only returns a reference to XMultiPropertySet, XFastPropertySet, XPropertySet and XEventListener. More...
|
|
css::uno::Sequence< css::uno::Type > | getTypes () |
| eases implementing XTypeProvider::getTypes, returns the types of XMultiPropertySet, XFastPropertySet, XPropertySet More...
|
|
void | disposing () |
| Send a disposing notification to the listeners in the containers aBoundLC and aVetoableLC. More...
|
|
virtual void | setPropertyValue (const ::rtl::OUString &rPropertyName, const css::uno::Any &aValue) SAL_OVERRIDE |
| Throw UnknownPropertyException or PropertyVetoException if the property with the name rPropertyName does not exist or is readonly. More...
|
|
virtual css::uno::Any | getPropertyValue (const ::rtl::OUString &aPropertyName) SAL_OVERRIDE |
| Throw UnknownPropertyException if the property with the name rPropertyName does not exist. More...
|
|
virtual void | addPropertyChangeListener (const ::rtl::OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &aListener) SAL_OVERRIDE |
| Ignored if the property is not bound. More...
|
|
virtual void | removePropertyChangeListener (const ::rtl::OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &aListener) SAL_OVERRIDE |
| Ignored if the property is not bound. More...
|
|
virtual void | addVetoableChangeListener (const ::rtl::OUString &aPropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) SAL_OVERRIDE |
| Ignored if the property is not constrained. More...
|
|
virtual void | removeVetoableChangeListener (const ::rtl::OUString &aPropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) SAL_OVERRIDE |
| Ignored if the property is not constrained. More...
|
|
virtual void | setFastPropertyValue (sal_Int32 nHandle, const css::uno::Any &rValue) SAL_OVERRIDE |
| Throw UnknownPropertyException or PropertyVetoException if the property with the name rPropertyName does not exist or is readonly. More...
|
|
virtual css::uno::Any | getFastPropertyValue (sal_Int32 nHandle) SAL_OVERRIDE |
|
virtual void | setPropertyValues (const css::uno::Sequence< ::rtl::OUString > &PropertyNames, const css::uno::Sequence< css::uno::Any > &Values) SAL_OVERRIDE |
|
virtual css::uno::Sequence< css::uno::Any > | getPropertyValues (const css::uno::Sequence< ::rtl::OUString > &PropertyNames) SAL_OVERRIDE |
|
virtual void | addPropertiesChangeListener (const css::uno::Sequence< ::rtl::OUString > &PropertyNames, const css::uno::Reference< css::beans::XPropertiesChangeListener > &Listener) SAL_OVERRIDE |
|
virtual void | removePropertiesChangeListener (const css::uno::Reference< css::beans::XPropertiesChangeListener > &Listener) SAL_OVERRIDE |
|
virtual void | firePropertiesChangeEvent (const css::uno::Sequence< ::rtl::OUString > &PropertyNames, const css::uno::Reference< css::beans::XPropertiesChangeListener > &Listener) SAL_OVERRIDE |
|
|
void | fire (sal_Int32 *pnHandles, const css::uno::Any *pNewValues, const css::uno::Any *pOldValues, sal_Int32 nCount, sal_Bool bVetoable) |
| This method fire events to all registered property listeners. More...
|
|
void | setFastPropertyValues (sal_Int32 nSeqLen, sal_Int32 *pHandles, const css::uno::Any *pValues, sal_Int32 nHitCount) |
| Set multiple properties with the handles. More...
|
|
virtual IPropertyArrayHelper & | getInfoHelper ()=0 |
| This abstract method must return the name to index table. More...
|
|
virtual sal_Bool | convertFastPropertyValue (css::uno::Any &rConvertedValue, css::uno::Any &rOldValue, sal_Int32 nHandle, const css::uno::Any &rValue)=0 |
| Converted the value rValue and return the result in rConvertedValue and the old value in rOldValue. More...
|
|
virtual void | setFastPropertyValue_NoBroadcast (sal_Int32 nHandle, const css::uno::Any &rValue)=0 |
| The same as setFastPropertyValue; nHandle is always valid. More...
|
|
virtual void | getFastPropertyValue (css::uno::Any &rValue, sal_Int32 nHandle) const =0 |
| The same as getFastPropertyValue, but return the value through rValue and nHandle is always valid. More...
|
|
void | setDependentFastPropertyValue (sal_Int32 i_handle, const css::uno::Any &i_value) |
| sets an dependent property's value More...
|
|
| ~OPropertySetHelper () |
| You must call disposing before destruction. More...
|
|
This abstract class maps the methods of the interfaces XMultiPropertySet, XFastPropertySet and XPropertySet to the methods getInfoHelper, convertFastPropertyValue, setFastPropertyValue_NoBroadcast and getFastPropertyValue.
You must derive from this class and override the methods. It provides a standard implementation of the XPropertySetInfo. The XPropertiesChangeListener are inserted in the rBHelper.aLC structure. The XPropertyChangeListener and XVetoableChangeListener with no names are inserted in the rBHelper.aLC structure. So it is possible to advise property listeners with the connection point interfaces. But only listeners that listen to all property changes.
void cppu::OPropertySetHelper::setDependentFastPropertyValue |
( |
sal_Int32 |
i_handle, |
|
|
const css::uno::Any & |
i_value |
|
) |
| |
|
protected |
sets an dependent property's value
Sometimes setting a given property needs to implicitly modify another property's value. Calling |setPropertyValue| from within |setFastPropertyValue_NoBroadcast| is not an option here, as it would notify the property listeners while our mutex is still locked. Setting the dependent property's value directly (e.g. by calling |setFastPropertyValue_NoBroadcast| recursively) is not an option, too, since it would miss firing the property change event.
So, in such cases, you use |setDependentFastPropertyValue| from within |setFastPropertyValue_NoBroadcast|. It will convert and actually set the property value (invoking |convertFastPropertyValue| and |setFastPropertyValue_NoBroadcast| for the given handle and value), and add the property change event to the list of events to be notified when the bottom-most |setFastPropertyValue_NoBroadcast| on the stack returns.
Note: The method will not invoke veto listeners for the property.
Note: It's the caller's responsibility to ensure that our mutex is locked. This is canonically given when the method is invoked from within |setFastPropertyValue_NoBroadcast|, in other contexts, you might need to take own measures.