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 )
39 ,
m_pMutex( _pMaster && _pMaster->getInterceptorMutex() ? _pMaster->getInterceptorMutex() : &m_aFallback )
40 ,m_xIntercepted(_rxToIntercept)
45 ::osl::MutexGuard aGuard( *
m_pMutex );
47 if (_rxToIntercept.is())
49 _rxToIntercept->registerDispatchProviderInterceptor(
static_cast<XDispatchProviderInterceptor*
>(
this));
52 Reference< XComponent> xInterceptedComponent(_rxToIntercept, UNO_QUERY);
53 if (xInterceptedComponent.is())
55 xInterceptedComponent->addEventListener(
this);
65 if (!rBHelper.bDisposed)
73 ::osl::MutexGuard aGuard( *
m_pMutex );
74 Reference< XDispatch> xResult;
87 Sequence< Reference< XDispatch > > SAL_CALL
90 ::osl::MutexGuard aGuard( *
m_pMutex );
91 Sequence< Reference< XDispatch> > aReturn(aDescripts.getLength());
92 std::transform(aDescripts.begin(), aDescripts.end(), aReturn.getArray(),
93 [
this](
const DispatchDescriptor& rDescript) -> Reference< XDispatch> {
94 return queryDispatch(rDescript.FeatureURL, rDescript.FrameName, rDescript.SearchFlags); });
101 ::osl::MutexGuard aGuard( *
m_pMutex );
108 ::osl::MutexGuard aGuard( *
m_pMutex );
115 ::osl::MutexGuard aGuard( *
m_pMutex );
122 ::osl::MutexGuard aGuard( *
m_pMutex );
131 Reference< XDispatchProviderInterception > xIntercepted(
m_xIntercepted.get(), UNO_QUERY);
132 if (
Source.Source == xIntercepted)
140 ::osl::MutexGuard aGuard( *
m_pMutex );
141 OSL_ENSURE(
m_bListening,
"DispatchInterceptionMultiplexer::ImplDetach: invalid call!");
144 Reference< XDispatchProviderInterception > xIntercepted(
m_xIntercepted.get(), UNO_QUERY);
145 if (xIntercepted.is())
146 xIntercepted->releaseDispatchProviderInterceptor(
static_cast<XDispatchProviderInterceptor*
>(
this));
163 Reference< XComponent> xInterceptedComponent(
m_xIntercepted.get(), UNO_QUERY);
164 if (xInterceptedComponent.is())
165 xInterceptedComponent->removeEventListener(
static_cast<XEventListener*
>(
this));