LibreOffice Module comphelper (master)
1
|
helper class for simple notification of the form LISTENER::METHOD( EVENT ) More...
#include <listenernotification.hxx>
Public Types | |
typedef LISTENER | ListenerClass |
typedef EVENT | EventClass |
Public Member Functions | |
typedef | void (SAL_CALL LISTENER::*NotificationMethod)(const EventClass &) |
OSimpleListenerContainer (::osl::Mutex &_rMutex) | |
void | addListener (const css::uno::Reference< ListenerClass > &_rxListener) |
void | removeListener (const css::uno::Reference< ListenerClass > &_rxListener) |
void | notify (const EventClass &_rEvent, NotificationMethod _pNotify) |
typed notification More... | |
Private Member Functions | |
virtual bool | implNotify (const css::uno::Reference< css::lang::XEventListener > &_rxListener, const css::lang::EventObject &_rEvent) override |
call a single listener More... | |
Private Attributes | |
NotificationMethod | m_pNotificationMethod |
Additional Inherited Members | |
![]() | |
OListenerContainer (::osl::Mutex &_rMutex) | |
virtual | ~OListenerContainer () |
void | impl_addListener (const css::uno::Reference< css::lang::XEventListener > &_rxListener) |
void | impl_removeListener (const css::uno::Reference< css::lang::XEventListener > &_rxListener) |
bool | impl_notify (const css::lang::EventObject &_rEvent) |
notifies all listeners of the given event, using THB's notification pattern More... | |
void | disposing (const css::lang::EventObject &_rEventSource) |
sends a XEventObject::disposing notification to all listeners, and clears the listener container More... | |
void | clear () |
clears the container without calling <member scope="css::lang">XEventListener::disposing</member> at the listeners More... | |
bool | empty () const |
determines whether the listener container is currently empty More... | |
::std::unique_ptr< ::comphelper::OInterfaceIteratorHelper2 > | createIterator () |
creates an iterator for looping through all registered listeners More... | |
helper class for simple notification of the form LISTENER::METHOD( EVENT )
This class is not threadsafe!
LISTENER | the listener class to call, e.g. css::lang::XEventListener |
EVENT | the event type to notify, e.g. css::lang::EventObject |
Definition at line 156 of file listenernotification.hxx.
typedef EVENT comphelper::OSimpleListenerContainer< LISTENER, EVENT >::EventClass |
Definition at line 160 of file listenernotification.hxx.
typedef LISTENER comphelper::OSimpleListenerContainer< LISTENER, EVENT >::ListenerClass |
Definition at line 159 of file listenernotification.hxx.
|
inline |
Definition at line 167 of file listenernotification.hxx.
|
inline |
Definition at line 173 of file listenernotification.hxx.
|
inlineoverrideprivatevirtual |
call a single listener
css::uno::Exception | if the listener throws an exception during notification. Please don't catch any listener exceptions in your implementation of this method, simply let them pass to the caller. |
_rxListener | specifies the listener to call. Is guaranteed to not be <NULL> |
_rEvent | the event to broadcast. This is the same as passed to <member>notify</member>, so if your base class knows the type passed into <member>notify</member>, it can safely assume that <arg>_rEvent</arg> is also of this type. |
Implements comphelper::OListenerContainer.
Definition at line 193 of file listenernotification.hxx.
|
inline |
typed notification
Definition at line 207 of file listenernotification.hxx.
References comphelper::OListenerContainer::impl_notify().
|
inline |
Definition at line 178 of file listenernotification.hxx.
typedef comphelper::OSimpleListenerContainer< LISTENER, EVENT >::void | ( | SAL_CALL LISTENER::* | NotificationMethod | ) | const |
|
private |
Definition at line 164 of file listenernotification.hxx.
Referenced by comphelper::OSimpleListenerContainer< css::beans::XPropertyChangeListener, css::beans::PropertyChangeEvent >::implNotify().