24 using ::com::sun::star::uno::Reference;
25 using ::com::sun::star::uno::UNO_QUERY;
26 using ::com::sun::star::uno::Sequence;
27 using ::com::sun::star::frame::XDispatchProviderInterception;
28 using ::com::sun::star::frame::XDispatchProviderInterceptor;
29 using ::com::sun::star::lang::XComponent;
30 using ::com::sun::star::util::URL;
31 using ::com::sun::star::frame::XDispatch;
32 using ::com::sun::star::frame::DispatchDescriptor;
33 using ::com::sun::star::frame::XDispatchProvider;
34 using ::com::sun::star::lang::EventObject;
37 const Reference< XDispatchProviderInterception >& _rxToIntercept,
DispatchInterceptor* _pMaster )
40 ,
m_pMutex( _pMaster && _pMaster->getInterceptorMutex() ? _pMaster->getInterceptorMutex() : &m_aFallback )
41 ,m_xIntercepted(_rxToIntercept)
46 ::osl::MutexGuard aGuard( *
m_pMutex );
48 if (_rxToIntercept.is())
50 _rxToIntercept->registerDispatchProviderInterceptor(static_cast<XDispatchProviderInterceptor*>(
this));
53 Reference< XComponent> xInterceptedComponent(_rxToIntercept, UNO_QUERY);
54 if (xInterceptedComponent.is())
56 xInterceptedComponent->addEventListener(
this);
66 if (!rBHelper.bDisposed)
74 ::osl::MutexGuard aGuard( *
m_pMutex );
75 Reference< XDispatch> xResult;
88 Sequence< Reference< XDispatch > > SAL_CALL
91 ::osl::MutexGuard aGuard( *
m_pMutex );
92 Sequence< Reference< XDispatch> > aReturn(aDescripts.getLength());
93 std::transform(aDescripts.begin(), aDescripts.end(), aReturn.begin(),
94 [
this](
const DispatchDescriptor& rDescript) -> Reference< XDispatch> {
95 return queryDispatch(rDescript.FeatureURL, rDescript.FrameName, rDescript.SearchFlags); });
102 ::osl::MutexGuard aGuard( *
m_pMutex );
109 ::osl::MutexGuard aGuard( *
m_pMutex );
116 ::osl::MutexGuard aGuard( *
m_pMutex );
123 ::osl::MutexGuard aGuard( *
m_pMutex );
132 Reference< XDispatchProviderInterception > xIntercepted(
m_xIntercepted.get(), UNO_QUERY);
133 if (Source.Source == xIntercepted)
141 ::osl::MutexGuard aGuard( *
m_pMutex );
142 OSL_ENSURE(
m_bListening,
"DispatchInterceptionMultiplexer::ImplDetach: invalid call!");
145 Reference< XDispatchProviderInterception > xIntercepted(
m_xIntercepted.get(), UNO_QUERY);
146 if (xIntercepted.is())
147 xIntercepted->releaseDispatchProviderInterceptor(static_cast<XDispatchProviderInterceptor*>(
this));
164 Reference< XComponent> xInterceptedComponent(
m_xIntercepted.get(), UNO_QUERY);
165 if (xInterceptedComponent.is())
166 xInterceptedComponent->removeEventListener(static_cast<XEventListener*>(
this));