LibreOffice Module svx (master) 1
Public Member Functions | Private Member Functions | Private Attributes | List of all members
svx::OSingleFeatureDispatcher Class Referencefinal

#include <formfeaturedispatcher.hxx>

Inheritance diagram for svx::OSingleFeatureDispatcher:
[legend]
Collaboration diagram for svx::OSingleFeatureDispatcher:
[legend]

Public Member Functions

 OSingleFeatureDispatcher (css::util::URL _aFeatureURL, const sal_Int16 _nFormFeature, const css::uno::Reference< css::form::runtime::XFormOperations > &_rxFormOperations, ::osl::Mutex &_rMutex)
 constructs the dispatcher More...
 
void updateAllListeners ()
 notifies all our listeners of the current state More...
 

Private Member Functions

virtual void SAL_CALL dispatch (const css::util::URL &_rURL, const css::uno::Sequence< css::beans::PropertyValue > &_rArguments) override
 
virtual void SAL_CALL addStatusListener (const css::uno::Reference< css::frame::XStatusListener > &_rxControl, const css::util::URL &_rURL) override
 
virtual void SAL_CALL removeStatusListener (const css::uno::Reference< css::frame::XStatusListener > &_rxControl, const css::util::URL &_rURL) override
 
void notifyStatus (const css::uno::Reference< css::frame::XStatusListener > &_rxListener, ::osl::ClearableMutexGuard &_rFreeForNotification)
 notifies our current state to one or all listeners More...
 
void getUnoState (css::frame::FeatureStateEvent &_rState) const
 retrieves the current status of our feature, in a format which can be used for UNO notifications More...
 

Private Attributes

::osl::Mutex & m_rMutex
 
::comphelper::OInterfaceContainerHelper3< css::frame::XStatusListener > m_aStatusListeners
 
css::uno::Reference< css::form::runtime::XFormOperations > m_xFormOperations
 
const css::util::URL m_aFeatureURL
 
css::uno::Any m_aLastKnownState
 
const sal_Int16 m_nFormFeature
 
bool m_bLastKnownEnabled
 

Detailed Description

Definition at line 36 of file formfeaturedispatcher.hxx.

Constructor & Destructor Documentation

◆ OSingleFeatureDispatcher()

svx::OSingleFeatureDispatcher::OSingleFeatureDispatcher ( css::util::URL  _aFeatureURL,
const sal_Int16  _nFormFeature,
const css::uno::Reference< css::form::runtime::XFormOperations > &  _rxFormOperations,
::osl::Mutex &  _rMutex 
)

constructs the dispatcher

Parameters
_rFeatureURLthe URL of the feature which this instance is responsible for
_nFeatureIdthe feature which this instance is responsible for
_rControllerthe controller which is responsible for providing the state of feature of this instance, and for executing it. After disposing the dispatcher instance, the controller will not be accessed anymore
See also
dispose

Definition at line 39 of file formfeaturedispatcher.cxx.

References m_rMutex.

Member Function Documentation

◆ addStatusListener()

void SAL_CALL svx::OSingleFeatureDispatcher::addStatusListener ( const css::uno::Reference< css::frame::XStatusListener > &  _rxControl,
const css::util::URL &  _rURL 
)
overrideprivatevirtual

◆ dispatch()

void SAL_CALL svx::OSingleFeatureDispatcher::dispatch ( const css::util::URL &  _rURL,
const css::uno::Sequence< css::beans::PropertyValue > &  _rArguments 
)
overrideprivatevirtual

◆ getUnoState()

void svx::OSingleFeatureDispatcher::getUnoState ( css::frame::FeatureStateEvent &  _rState) const
private

retrieves the current status of our feature, in a format which can be used for UNO notifications

@precond our mutex is locked

Definition at line 51 of file formfeaturedispatcher.cxx.

References m_aFeatureURL, m_nFormFeature, and m_xFormOperations.

Referenced by notifyStatus(), and updateAllListeners().

◆ notifyStatus()

void svx::OSingleFeatureDispatcher::notifyStatus ( const css::uno::Reference< css::frame::XStatusListener > &  _rxListener,
::osl::ClearableMutexGuard &  _rFreeForNotification 
)
private

notifies our current state to one or all listeners

Parameters
_rxListenerthe listener to notify. May be NULL, in this case all our listeners will be notified with the current state
_rFreeForNotificationa guard which currently locks our mutex, and which is to be cleared for actually doing the notification(s)

Definition at line 81 of file formfeaturedispatcher.cxx.

References Exception, getUnoState(), comphelper::OInterfaceIteratorHelper3< class ListenerT >::hasMoreElements(), m_aStatusListeners, comphelper::OInterfaceIteratorHelper3< class ListenerT >::next(), comphelper::OInterfaceIteratorHelper3< class ListenerT >::remove(), and TOOLS_WARN_EXCEPTION.

Referenced by addStatusListener(), and updateAllListeners().

◆ removeStatusListener()

void SAL_CALL svx::OSingleFeatureDispatcher::removeStatusListener ( const css::uno::Reference< css::frame::XStatusListener > &  _rxControl,
const css::util::URL &  _rURL 
)
overrideprivatevirtual

◆ updateAllListeners()

void svx::OSingleFeatureDispatcher::updateAllListeners ( )

notifies all our listeners of the current state

Definition at line 64 of file formfeaturedispatcher.cxx.

References getUnoState(), m_aLastKnownState, m_bLastKnownEnabled, m_rMutex, and notifyStatus().

Member Data Documentation

◆ m_aFeatureURL

const css::util::URL svx::OSingleFeatureDispatcher::m_aFeatureURL
private

◆ m_aLastKnownState

css::uno::Any svx::OSingleFeatureDispatcher::m_aLastKnownState
private

Definition at line 99 of file formfeaturedispatcher.hxx.

Referenced by updateAllListeners().

◆ m_aStatusListeners

::comphelper::OInterfaceContainerHelper3<css::frame::XStatusListener> svx::OSingleFeatureDispatcher::m_aStatusListeners
private

Definition at line 95 of file formfeaturedispatcher.hxx.

Referenced by addStatusListener(), notifyStatus(), and removeStatusListener().

◆ m_bLastKnownEnabled

bool svx::OSingleFeatureDispatcher::m_bLastKnownEnabled
private

Definition at line 101 of file formfeaturedispatcher.hxx.

Referenced by updateAllListeners().

◆ m_nFormFeature

const sal_Int16 svx::OSingleFeatureDispatcher::m_nFormFeature
private

Definition at line 100 of file formfeaturedispatcher.hxx.

Referenced by dispatch(), and getUnoState().

◆ m_rMutex

::osl::Mutex& svx::OSingleFeatureDispatcher::m_rMutex
private

◆ m_xFormOperations

css::uno::Reference< css::form::runtime::XFormOperations > svx::OSingleFeatureDispatcher::m_xFormOperations
private

Definition at line 97 of file formfeaturedispatcher.hxx.

Referenced by dispatch(), and getUnoState().


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