39 const Reference< XFormOperations >& _rxFormOperations, ::osl::Mutex& _rMutex )
41 ,m_aStatusListeners( _rMutex )
42 ,m_xFormOperations( _rxFormOperations )
43 ,m_aFeatureURL( _rFeatureURL )
44 ,m_nFormFeature( _nFormFeature )
45 ,m_bLastKnownEnabled(
false )
57 _rState.IsEnabled = aState.Enabled;
58 _rState.Requery =
false;
59 _rState.State = aState.State;
65 ::osl::ClearableMutexGuard aGuard(
m_rMutex );
67 FeatureStateEvent aUnoState;
82 FeatureStateEvent aUnoState;
85 if ( _rxListener.is() )
89 _rFreeForNotification.clear();
90 _rxListener->statusChanged( aUnoState );
100 _rFreeForNotification.clear();
106 aIter.
next()->statusChanged( aUnoState );
108 catch(
const DisposedException& )
111 "caught a DisposedException - removing the listener!");
118 "caught a generic exception while notifying a single listener!");
127 ::osl::ClearableMutexGuard aGuard(
m_rMutex );
129 OSL_ENSURE( _rURL.Complete ==
m_aFeatureURL.Complete,
"OSingleFeatureDispatcher::dispatch: not responsible for this URL!" );
141 if ( !_rArguments.hasElements() )
143 xFormOperations->execute( nFormFeature );
148 xFormOperations->executeWithArguments( nFormFeature, aArgs.
getNamedValues() );
164 OSL_ENSURE( _rURL.Complete ==
m_aFeatureURL.Complete,
"OSingleFeatureDispatcher::addStatusListener: unexpected URL!" );
165 OSL_ENSURE( _rxControl.is(),
"OSingleFeatureDispatcher::addStatusListener: senseless call!" );
166 if ( !_rxControl.is() )
169 ::osl::ClearableMutexGuard aGuard(
m_rMutex );
180 OSL_ENSURE( _rURL.Complete ==
m_aFeatureURL.Complete,
"OSingleFeatureDispatcher::removeStatusListener: unexpected URL!" );
181 OSL_ENSURE( _rxControl.is(),
"OSingleFeatureDispatcher::removeStatusListener: senseless call!" );
182 if ( !_rxControl.is() )
185 ::osl::MutexGuard aGuard(
m_rMutex );
const css::util::URL m_aFeatureURL
css::uno::Sequence< css::beans::NamedValue > getNamedValues() const
virtual void SAL_CALL addStatusListener(const css::uno::Reference< css::frame::XStatusListener > &_rxControl, const css::util::URL &_rURL) override
bool hasMoreElements() const
::comphelper::OInterfaceContainerHelper3< css::frame::XStatusListener > m_aStatusListeners
sal_Int32 addInterface(const css::uno::Reference< ListenerT > &rxIFace)
const sal_Int16 m_nFormFeature
virtual void SAL_CALL removeStatusListener(const css::uno::Reference< css::frame::XStatusListener > &_rxControl, const css::util::URL &_rURL) override
virtual void SAL_CALL dispatch(const css::util::URL &_rURL, const css::uno::Sequence< css::beans::PropertyValue > &_rArguments) override
#define DBG_UNHANDLED_EXCEPTION(...)
#define TOOLS_WARN_EXCEPTION(area, stream)
sal_Int32 removeInterface(const css::uno::Reference< ListenerT > &rxIFace)
css::uno::Reference< ListenerT > const & next()
void notifyStatus(const css::uno::Reference< css::frame::XStatusListener > &_rxListener,::osl::ClearableMutexGuard &_rFreeForNotification)
notifies our current state to one or all listeners
css::uno::Reference< css::form::runtime::XFormOperations > m_xFormOperations
void getUnoState(css::frame::FeatureStateEvent &_rState) const
retrieves the current status of our feature, in a format which can be used for UNO notifications ...
void updateAllListeners()
notifies all our listeners of the current state
OSingleFeatureDispatcher(const css::util::URL &_rFeatureURL, const sal_Int16 _nFormFeature, const css::uno::Reference< css::form::runtime::XFormOperations > &_rxFormOperations,::osl::Mutex &_rMutex)
constructs the dispatcher
css::uno::Any m_aLastKnownState
bool m_bDetectedRangeSegmentation false