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;
68 ,m_aPropertyChangeListeners( _rMutex )
78 assert( _rProvider &&
"NULL factory not allowed." );
81 "PropertyChangeNotifier::registerProvider: factory for this ID already present!" );
89 OSL_ENSURE( provPos,
"PropertyChangeNotifier::notifyPropertyChange: no factory!" );
93 const OUString & sPropertyName( provPos->getPropertyName() );
97 if ( !pPropListeners && !pAllListeners )
102 PropertyChangeEvent
aEvent;
105 aEvent.PropertyName = provPos->getPropertyName();
106 provPos->getCurrentValue(
aEvent.NewValue );
108 if ( pPropListeners )
109 pPropListeners->
notifyEach( &XPropertyChangeListener::propertyChange,
aEvent );
111 pAllListeners->
notifyEach( &XPropertyChangeListener::propertyChange,
aEvent );
void notifyEach(void(SAL_CALL ListenerT::*NotificationMethod)(const EventT &), const EventT &Event)
sal_Int32 addInterface(const key &rKey, const css::uno::Reference< listener > &rListener)
sal_Int32 removeInterface(const key &rKey, const css::uno::Reference< listener > &rListener)
void disposeAndClear(const css::lang::EventObject &rEvt)
OInterfaceContainerHelper3< listener > * getContainer(const key &rKey) const
void addPropertyChangeListener(const OUString &_rPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &_rxListener)
PropertyChangeNotifier(::cppu::OWeakObject &_rOwner, ::osl::Mutex &_rMutex)
constructs a notifier instance
~PropertyChangeNotifier()
::cppu::OWeakObject & m_rContext
o3tl::enumarray< ShapePropertyProviderId, std::unique_ptr< PropertyValueProvider > > m_aProviders
void disposing()
is called to dispose the instance
void removePropertyChangeListener(const OUString &_rPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &_rxListener)
void registerProvider(const ShapePropertyProviderId _eProperty, std::unique_ptr< PropertyValueProvider > _rProvider)
registers an PropertyValueProvider
comphelper::OMultiTypeInterfaceContainerHelperVar3< css::beans::XPropertyChangeListener, OUString > m_aPropertyChangeListeners
void notifyPropertyChange(const ShapePropertyProviderId _eProperty) const
notifies changes in the given property to all registered listeners
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