LibreOffice Module svx (master) 1
Public Member Functions | Private Member Functions | Private Attributes | List of all members
svx::PropertyChangeNotifier Class Reference

helper class for notifying XPropertyChangeListeners More...

#include <shapepropertynotifier.hxx>

Collaboration diagram for svx::PropertyChangeNotifier:
[legend]

Public Member Functions

 PropertyChangeNotifier (::cppu::OWeakObject &_rOwner)
 constructs a notifier instance More...
 
 ~PropertyChangeNotifier ()
 
void addPropertyChangeListener (std::unique_lock< std::mutex > &rGuard, const OUString &_rPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &_rxListener)
 
void removePropertyChangeListener (std::unique_lock< std::mutex > &rGuard, const OUString &_rPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &_rxListener)
 
void registerProvider (const ShapePropertyProviderId _eProperty, std::unique_ptr< PropertyValueProvider > _rProvider)
 registers an PropertyValueProvider More...
 
void notifyPropertyChange (std::unique_lock< std::mutex > &rGuard, const ShapePropertyProviderId _eProperty) const
 notifies changes in the given property to all registered listeners More...
 
void disposing (std::unique_lock< std::mutex > &rGuard)
 is called to dispose the instance More...
 

Private Member Functions

 PropertyChangeNotifier (const PropertyChangeNotifier &)=delete
 
PropertyChangeNotifieroperator= (const PropertyChangeNotifier &)=delete
 

Private Attributes

::cppu::OWeakObjectm_rContext
 
o3tl::enumarray< ShapePropertyProviderId, std::unique_ptr< PropertyValueProvider > > m_aProviders
 
comphelper::OMultiTypeInterfaceContainerHelperVar4< OUString, css::beans::XPropertyChangeListener > m_aPropertyChangeListeners
 

Detailed Description

helper class for notifying XPropertyChangeListeners

The class is intended to be held as member of the class which does the property change broadcasting.

Definition at line 96 of file shapepropertynotifier.hxx.

Constructor & Destructor Documentation

◆ PropertyChangeNotifier() [1/2]

PropertyChangeNotifier::PropertyChangeNotifier ( ::cppu::OWeakObject _rOwner)

constructs a notifier instance

Parameters
_rOwnerthe owner instance of the notifier. Will be used as css.lang.EventObject.Source when notifying events.

Definition at line 66 of file shapepropertynotifier.cxx.

References m_rContext.

◆ ~PropertyChangeNotifier()

PropertyChangeNotifier::~PropertyChangeNotifier ( )

Definition at line 71 of file shapepropertynotifier.cxx.

◆ PropertyChangeNotifier() [2/2]

svx::PropertyChangeNotifier::PropertyChangeNotifier ( const PropertyChangeNotifier )
privatedelete

Member Function Documentation

◆ addPropertyChangeListener()

void PropertyChangeNotifier::addPropertyChangeListener ( std::unique_lock< std::mutex > &  rGuard,
const OUString &  _rPropertyName,
const css::uno::Reference< css::beans::XPropertyChangeListener > &  _rxListener 
)

◆ disposing()

void PropertyChangeNotifier::disposing ( std::unique_lock< std::mutex > &  rGuard)

◆ notifyPropertyChange()

void PropertyChangeNotifier::notifyPropertyChange ( std::unique_lock< std::mutex > &  rGuard,
const ShapePropertyProviderId  _eProperty 
) const

notifies changes in the given property to all registered listeners

If no property value provider for the given property ID is registered, this is worth an assertion in a non-product build, and otherwise ignored.

Definition at line 85 of file shapepropertynotifier.cxx.

References aEvent, DBG_UNHANDLED_EXCEPTION, Exception, comphelper::OMultiTypeInterfaceContainerHelperVar4< class key, class listener, class equalImpl >::getContainer(), m_aPropertyChangeListeners, m_aProviders, m_rContext, and comphelper::OInterfaceContainerHelper4< class ListenerT >::notifyEach().

◆ operator=()

PropertyChangeNotifier & svx::PropertyChangeNotifier::operator= ( const PropertyChangeNotifier )
privatedelete

◆ registerProvider()

void PropertyChangeNotifier::registerProvider ( const ShapePropertyProviderId  _eProperty,
std::unique_ptr< PropertyValueProvider _rProvider 
)

registers an PropertyValueProvider

Definition at line 75 of file shapepropertynotifier.cxx.

References m_aProviders.

◆ removePropertyChangeListener()

void PropertyChangeNotifier::removePropertyChangeListener ( std::unique_lock< std::mutex > &  rGuard,
const OUString &  _rPropertyName,
const css::uno::Reference< css::beans::XPropertyChangeListener > &  _rxListener 
)

Member Data Documentation

◆ m_aPropertyChangeListeners

comphelper::OMultiTypeInterfaceContainerHelperVar4<OUString, css::beans::XPropertyChangeListener> svx::PropertyChangeNotifier::m_aPropertyChangeListeners
private

◆ m_aProviders

o3tl::enumarray<ShapePropertyProviderId, std::unique_ptr<PropertyValueProvider> > svx::PropertyChangeNotifier::m_aProviders
private

Definition at line 132 of file shapepropertynotifier.hxx.

Referenced by notifyPropertyChange(), and registerProvider().

◆ m_rContext

::cppu::OWeakObject& svx::PropertyChangeNotifier::m_rContext
private

Definition at line 131 of file shapepropertynotifier.hxx.

Referenced by disposing(), and notifyPropertyChange().


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