23#include <com/sun/star/beans/XPropertySet.hpp>
38 using ::com::sun::star::uno::Reference;
39 using ::com::sun::star::uno::UNO_QUERY_THROW;
40 using ::com::sun::star::uno::Exception;
41 using ::com::sun::star::uno::Any;
42 using ::com::sun::star::beans::PropertyChangeEvent;
43 using ::com::sun::star::beans::XPropertyChangeListener;
44 using ::com::sun::star::lang::EventObject;
77 assert( _rProvider &&
"NULL factory not allowed." );
80 "PropertyChangeNotifier::registerProvider: factory for this ID already present!" );
88 OSL_ENSURE( provPos,
"PropertyChangeNotifier::notifyPropertyChange: no factory!" );
92 const OUString & sPropertyName( provPos->getPropertyName() );
96 if ( !pPropListeners && !pAllListeners )
101 PropertyChangeEvent
aEvent;
104 aEvent.PropertyName = provPos->getPropertyName();
105 provPos->getCurrentValue(
aEvent.NewValue );
107 if ( pPropListeners )
108 pPropListeners->
notifyEach( rGuard, &XPropertyChangeListener::propertyChange,
aEvent );
110 pAllListeners->
notifyEach( rGuard, &XPropertyChangeListener::propertyChange,
aEvent );
void notifyEach(std::unique_lock< std::mutex > &rGuard, void(SAL_CALL ListenerT::*NotificationMethod)(const EventT &), const EventT &Event) const
sal_Int32 removeInterface(::std::unique_lock<::std::mutex > &rGuard, const key &rKey, const css::uno::Reference< listener > &rListener)
sal_Int32 addInterface(::std::unique_lock<::std::mutex > &rGuard, const key &rKey, const css::uno::Reference< listener > &rListener)
void disposeAndClear(std::unique_lock< std::mutex > &rGuard, const css::lang::EventObject &rEvt)
OInterfaceContainerHelper4< listener > * getContainer(std::unique_lock< std::mutex > &rGuard, const key &rKey) const
void disposing(std::unique_lock< std::mutex > &rGuard)
is called to dispose the instance
void addPropertyChangeListener(std::unique_lock< std::mutex > &rGuard, const OUString &_rPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &_rxListener)
~PropertyChangeNotifier()
comphelper::OMultiTypeInterfaceContainerHelperVar4< OUString, css::beans::XPropertyChangeListener > m_aPropertyChangeListeners
void notifyPropertyChange(std::unique_lock< std::mutex > &rGuard, const ShapePropertyProviderId _eProperty) const
notifies changes in the given property to all registered listeners
::cppu::OWeakObject & m_rContext
o3tl::enumarray< ShapePropertyProviderId, std::unique_ptr< PropertyValueProvider > > m_aProviders
void removePropertyChangeListener(std::unique_lock< std::mutex > &rGuard, const OUString &_rPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &_rxListener)
PropertyChangeNotifier(::cppu::OWeakObject &_rOwner)
constructs a notifier instance
void registerProvider(const ShapePropertyProviderId _eProperty, std::unique_ptr< PropertyValueProvider > _rProvider)
registers an PropertyValueProvider
Default provider for a property value.
const OUString m_sPropertyName
const OUString & getPropertyName() const
returns the name of the property which this provider is responsible for
::cppu::OWeakObject & m_rContext
virtual ~PropertyValueProvider()
virtual void getCurrentValue(css::uno::Any &_out_rValue) const
returns the current value of the property which the provider is responsible for
#define DBG_UNHANDLED_EXCEPTION(...)
class SAL_NO_VTABLE XPropertySet
const Reference< XComponentContext > & m_rContext