LibreOffice Module forms (master) 1
Public Member Functions | Private Attributes | List of all members
PropertyChangeNotifier Struct Reference

a helper class for notifying property changes in a <type>PropertySetBase</type> instance. More...

#include <propertysetbase.hxx>

Collaboration diagram for PropertyChangeNotifier:
[legend]

Public Member Functions

 PropertyChangeNotifier (const PropertySetBase &rPropertySet, sal_Int32 nHandle)
 constructs a PropertyChangeNotifier More...
 
 ~PropertyChangeNotifier ()
 

Private Attributes

const PropertySetBasem_rPropertySet
 
sal_Int32 m_nHandle
 
css::uno::Any m_aOldValue
 

Detailed Description

a helper class for notifying property changes in a <type>PropertySetBase</type> instance.

You can create an instance of this class on the stack of a method which is to programmatically change the value of a property. In its constructor, the instance will acquire the current property value, and in its destructor, it will notify the change of this property's value (if necessary).

You do not need this class if you are modifying property values by using the X(Fast|Multi)PropertSet methods, since those already care for property notifications. You only need it if you're changing the internal representation of your property directly.

Also note that usually, notifications in the UNO world should be done without a locked mutex. So if you use this class in conjunction with a <type>MutexGuard</type>, ensure that you first instantiate the <type>PropertyChangeNotifier</type>, and then the <type>MutexGuard</type>, so your mutex is released before the notification happens.

Definition at line 306 of file propertysetbase.hxx.

Constructor & Destructor Documentation

◆ PropertyChangeNotifier()

PropertyChangeNotifier::PropertyChangeNotifier ( const PropertySetBase rPropertySet,
sal_Int32  nHandle 
)
inline

constructs a PropertyChangeNotifier

Parameters
rPropertySetthe property set implementation whose property is going to be changed. Note that this property set implementation must live at least as long as the PropertyChangeNotifier instance does.
nHandlethe handle of the property which is going to be changed. Must be a valid property handle for the given <arg>rPropertySet</arg>

Definition at line 323 of file propertysetbase.hxx.

References PropertySetBase::getCurrentPropertyValueByHandle(), m_aOldValue, m_nHandle, m_rPropertySet, and nHandle.

◆ ~PropertyChangeNotifier()

PropertyChangeNotifier::~PropertyChangeNotifier ( )
inline

Member Data Documentation

◆ m_aOldValue

css::uno::Any PropertyChangeNotifier::m_aOldValue
private

Definition at line 311 of file propertysetbase.hxx.

Referenced by PropertyChangeNotifier(), and ~PropertyChangeNotifier().

◆ m_nHandle

sal_Int32 PropertyChangeNotifier::m_nHandle
private

Definition at line 310 of file propertysetbase.hxx.

Referenced by PropertyChangeNotifier(), and ~PropertyChangeNotifier().

◆ m_rPropertySet

const PropertySetBase& PropertyChangeNotifier::m_rPropertySet
private

Definition at line 309 of file propertysetbase.hxx.

Referenced by PropertyChangeNotifier(), and ~PropertyChangeNotifier().


The documentation for this struct was generated from the following file: