LibreOffice Module svx (master)  1
Classes | Public Member Functions | Private Types | 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]

Classes

struct  ShapePropertyHash
 

Public Member Functions

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

Private Types

typedef std::unordered_map< ShapeProperty, std::shared_ptr< IPropertyValueProvider >, ShapePropertyHashPropertyProviders
 

Private Member Functions

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

Private Attributes

::cppu::OWeakObjectm_rContext
 
PropertyProviders m_aProviders
 
comphelper::OMultiTypeInterfaceContainerHelperVar2< OUString > 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 98 of file shapepropertynotifier.hxx.

Member Typedef Documentation

Definition at line 141 of file shapepropertynotifier.hxx.

Constructor & Destructor Documentation

PropertyChangeNotifier::PropertyChangeNotifier ( ::cppu::OWeakObject _rOwner,
::osl::Mutex &  _rMutex 
)

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 69 of file shapepropertynotifier.cxx.

References m_rContext.

PropertyChangeNotifier::~PropertyChangeNotifier ( )

Definition at line 75 of file shapepropertynotifier.cxx.

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

Member Function Documentation

void PropertyChangeNotifier::addPropertyChangeListener ( const OUString &  _rPropertyName,
const css::uno::Reference< css::beans::XPropertyChangeListener > &  _rxListener 
)
void PropertyChangeNotifier::disposing ( )
void PropertyChangeNotifier::notifyPropertyChange ( const ShapeProperty  _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 89 of file shapepropertynotifier.cxx.

References aEvent, DBG_UNHANDLED_EXCEPTION, Exception, comphelper::OMultiTypeInterfaceContainerHelperVar2< key, hashImpl, equalImpl >::getContainer(), m_aPropertyChangeListeners, m_aProviders, m_rContext, and comphelper::OInterfaceContainerHelper2::notifyEach().

Referenced by SdrObject::notifyShapePropertyChange().

PropertyChangeNotifier& svx::PropertyChangeNotifier::operator= ( const PropertyChangeNotifier )
privatedelete
void PropertyChangeNotifier::registerProvider ( const ShapeProperty  _eProperty,
const std::shared_ptr< IPropertyValueProvider > &  _rProvider 
)

registers an IPropertyValueProvider

Definition at line 79 of file shapepropertynotifier.cxx.

References ENSURE_OR_THROW, and m_aProviders.

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

Member Data Documentation

comphelper::OMultiTypeInterfaceContainerHelperVar2<OUString> svx::PropertyChangeNotifier::m_aPropertyChangeListeners
private
PropertyProviders svx::PropertyChangeNotifier::m_aProviders
private

Definition at line 143 of file shapepropertynotifier.hxx.

Referenced by notifyPropertyChange(), and registerProvider().

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

Definition at line 142 of file shapepropertynotifier.hxx.

Referenced by disposing(), and notifyPropertyChange().


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