LibreOffice Module comphelper (master) 1
Public Types | Public Member Functions | Static Public Member Functions | List of all members
comphelper::AccessibleEventNotifier Class Reference

#include <accessibleeventnotifier.hxx>

Public Types

typedef sal_uInt32 TClientId
 

Public Member Functions

 AccessibleEventNotifier ()=delete
 
 ~AccessibleEventNotifier ()=delete
 
 AccessibleEventNotifier (const AccessibleEventNotifier &)=delete
 
AccessibleEventNotifieroperator= (const AccessibleEventNotifier &)=delete
 

Static Public Member Functions

static TClientId registerClient ()
 registers a client of this class, means a broadcaster of AccessibleEvents More...
 
static void revokeClient (const TClientId _nClient)
 revokes a broadcaster of AccessibleEvents More...
 
static void revokeClientNotifyDisposing (const TClientId _nClient, const css::uno::Reference< css::uno::XInterface > &_rxEventSource)
 revokes a client, with additionally notifying a disposing event to all listeners registered for this client More...
 
static sal_Int32 addEventListener (const TClientId _nClient, const css::uno::Reference< css::accessibility::XAccessibleEventListener > &_rxListener)
 registers a listener for the given client More...
 
static sal_Int32 removeEventListener (const TClientId _nClient, const css::uno::Reference< css::accessibility::XAccessibleEventListener > &_rxListener)
 revokes a listener for the given client More...
 
static void addEvent (const TClientId _nClient, const css::accessibility::AccessibleEventObject &_rEvent)
 adds an event, which is to be broadcasted, to the queue More...
 
static void shutdown ()
 

Detailed Description

Definition at line 32 of file accessibleeventnotifier.hxx.

Member Typedef Documentation

◆ TClientId

Definition at line 35 of file accessibleeventnotifier.hxx.

Constructor & Destructor Documentation

◆ AccessibleEventNotifier() [1/2]

comphelper::AccessibleEventNotifier::AccessibleEventNotifier ( )
delete

◆ ~AccessibleEventNotifier()

comphelper::AccessibleEventNotifier::~AccessibleEventNotifier ( )
delete

◆ AccessibleEventNotifier() [2/2]

comphelper::AccessibleEventNotifier::AccessibleEventNotifier ( const AccessibleEventNotifier )
delete

Member Function Documentation

◆ addEvent()

void comphelper::AccessibleEventNotifier::addEvent ( const TClientId  _nClient,
const css::accessibility::AccessibleEventObject &  _rEvent 
)
static

adds an event, which is to be broadcasted, to the queue

Parameters
_nClientthe id of the client which needs to broadcast the event

Definition at line 239 of file accessibleeventnotifier.cxx.

References Exception, comphelper::OInterfaceIteratorHelper4< ListenerT >::hasMoreElements(), and comphelper::OInterfaceIteratorHelper4< ListenerT >::next().

Referenced by comphelper::OCommonAccessibleComponent::NotifyAccessibleEvent(), and comphelper::OAccessibleContextWrapper::notifyTranslatedEvent().

◆ addEventListener()

sal_Int32 comphelper::AccessibleEventNotifier::addEventListener ( const TClientId  _nClient,
const css::uno::Reference< css::accessibility::XAccessibleEventListener > &  _rxListener 
)
static

registers a listener for the given client

Parameters
_nClientthe id of the client for which a listener should be registered
Returns
the number of event listeners currently registered for this client

Definition at line 207 of file accessibleeventnotifier.cxx.

Referenced by comphelper::OCommonAccessibleComponent::addAccessibleEventListener(), and comphelper::OAccessibleContextWrapper::addAccessibleEventListener().

◆ operator=()

AccessibleEventNotifier & comphelper::AccessibleEventNotifier::operator= ( const AccessibleEventNotifier )
delete

◆ registerClient()

AccessibleEventNotifier::TClientId comphelper::AccessibleEventNotifier::registerClient ( )
static

registers a client of this class, means a broadcaster of AccessibleEvents

No precaution is taken to care for disposal of this component. When the component dies, it must call <member>revokeClient</member> or <member>revokeClientNotifyDisposing</member> explicitly itself.

Definition at line 151 of file accessibleeventnotifier.cxx.

Referenced by comphelper::OCommonAccessibleComponent::addAccessibleEventListener(), and comphelper::OAccessibleContextWrapper::addAccessibleEventListener().

◆ removeEventListener()

sal_Int32 comphelper::AccessibleEventNotifier::removeEventListener ( const TClientId  _nClient,
const css::uno::Reference< css::accessibility::XAccessibleEventListener > &  _rxListener 
)
static

revokes a listener for the given client

Parameters
_nClientthe id of the client for which a listener should be revoked
Returns
the number of event listeners currently registered for this client

Definition at line 223 of file accessibleeventnotifier.cxx.

Referenced by comphelper::OCommonAccessibleComponent::removeAccessibleEventListener(), and comphelper::OAccessibleContextWrapper::removeAccessibleEventListener().

◆ revokeClient()

void comphelper::AccessibleEventNotifier::revokeClient ( const TClientId  _nClient)
static

revokes a broadcaster of AccessibleEvents

Note that no disposing event is fired when you use this method, the client is simply revoked. You can for instance revoke a client if the last listener for it is revoked, but the client itself is not disposed.
When the client is disposed, you should prefer <member>revokeClientNotifyDisposing</member>

Any possibly pending events for this client are removed from the queue.

@seealso revokeClientNotifyDisposing

Definition at line 165 of file accessibleeventnotifier.cxx.

Referenced by comphelper::OCommonAccessibleComponent::removeAccessibleEventListener(), and comphelper::OAccessibleContextWrapper::removeAccessibleEventListener().

◆ revokeClientNotifyDisposing()

void comphelper::AccessibleEventNotifier::revokeClientNotifyDisposing ( const TClientId  _nClient,
const css::uno::Reference< css::uno::XInterface > &  _rxEventSource 
)
static

revokes a client, with additionally notifying a disposing event to all listeners registered for this client

Any other possibly pending events for this client are removed from the queue

Parameters
_nClientthe id of the client which should be revoked
_rxEventSourcethe source to be notified together with the <member scope="com.sun.star.lang">XComponent::disposing</member> call.

Definition at line 179 of file accessibleeventnotifier.cxx.

References aListeners.

Referenced by comphelper::OCommonAccessibleComponent::disposing(), and comphelper::OAccessibleContextWrapper::disposing().

◆ shutdown()

void comphelper::AccessibleEventNotifier::shutdown ( )
static

Definition at line 266 of file accessibleeventnotifier.cxx.


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