LibreOffice Module framework (master) 1
|
implements a helper to support interception with additional functionality. More...
#include <interceptionhelper.hxx>
Classes | |
struct | InterceptorInfo |
bind an interceptor component to its URL pattern registration. More... | |
class | InterceptorList |
implements a list of items of type InterceptorInfo, and provides some special functions on it. More... | |
Public Member Functions | |
InterceptionHelper (const css::uno::Reference< css::frame::XFrame > &xOwner, rtl::Reference< DispatchProvider > xSlave) | |
creates a new interception helper instance. More... | |
virtual css::uno::Reference< css::frame::XDispatch > SAL_CALL | queryDispatch (const css::util::URL &aURL, const OUString &sTargetFrameName, sal_Int32 nSearchFlags) override |
query for a dispatch, which implements the requested feature. More... | |
virtual css::uno::Sequence< css::uno::Reference< css::frame::XDispatch > > SAL_CALL | queryDispatches (const css::uno::Sequence< css::frame::DispatchDescriptor > &lDescriptor) override |
implements an optimized queryDispatch() for remote. More... | |
virtual void SAL_CALL | registerDispatchProviderInterceptor (const css::uno::Reference< css::frame::XDispatchProviderInterceptor > &xInterceptor) override |
register an interceptor. More... | |
virtual void SAL_CALL | releaseDispatchProviderInterceptor (const css::uno::Reference< css::frame::XDispatchProviderInterceptor > &xInterceptor) override |
release an interceptor. More... | |
virtual void SAL_CALL | disposing (const css::lang::EventObject &aEvent) override |
Is called from our owner frame, in case he will be disposed. More... | |
rtl::Reference< DispatchProvider > | GetSlave () const |
Private Member Functions | |
virtual | ~InterceptionHelper () override |
standard destructor. More... | |
Private Attributes | |
css::uno::WeakReference< css::frame::XFrame > | m_xOwnerWeak |
reference to the frame, which uses this instance to implement its own interception. More... | |
rtl::Reference< DispatchProvider > | m_xSlave |
this interception helper implements the top level master of an interceptor list ... but this member is the lowest possible slave! More... | |
InterceptorList | m_lInterceptionRegs |
contains all registered interceptor objects. More... | |
implements a helper to support interception with additional functionality.
@descr This helper implements the complete XDispatchProviderInterception interface with master/slave functionality AND using of optional features like registration of URL pattern!
Definition at line 49 of file interceptionhelper.hxx.
framework::InterceptionHelper::InterceptionHelper | ( | const css::uno::Reference< css::frame::XFrame > & | xOwner, |
rtl::Reference< DispatchProvider > | xSlave | ||
) |
creates a new interception helper instance.
xOwner | points to the frame, which use this instances to support its own interception interfaces. |
xSlave | an outside creates dispatch provider, which has to be used here as lowest slave "interceptor". |
Definition at line 34 of file interceptionhelper.cxx.
|
overrideprivatevirtual |
standard destructor.
@descr This method destruct an instance of this class and clear some member. This method is protected, because it's not allowed to use this class as a direct member! You MUST use a dynamical instance (pointer). That's the reason for a protected dtor.
Definition at line 41 of file interceptionhelper.cxx.
|
overridevirtual |
Is called from our owner frame, in case he will be disposed.
@descr We have to release all references to him then. Normally we will die by ref count too...
Definition at line 222 of file interceptionhelper.cxx.
References aEvent, m_lInterceptionRegs, m_xOwnerWeak, and releaseDispatchProviderInterceptor().
|
inline |
Definition at line 250 of file interceptionhelper.hxx.
References m_xSlave.
|
overridevirtual |
query for a dispatch, which implements the requested feature.
@descr We search inside our list of interception registrations, to locate any interested interceptor. In case no interceptor exists or nobody is interested on this URL our lowest slave will be used.
aURL | describes the requested dispatch functionality. |
sTargetFrameName | the name of the target frame or a special name like "_blank", "_top" ... Won't be used here ... but may by one of our registered interceptor objects or our slave. |
nSearchFlags | optional search parameter for targeting, if sTargetFrameName isn't a special one. |
Definition at line 45 of file interceptionhelper.cxx.
References aURL, framework::InterceptionHelper::InterceptorList::findByPattern(), m_lInterceptionRegs, and m_xSlave.
Referenced by queryDispatches().
|
overridevirtual |
implements an optimized queryDispatch() for remote.
@descr It capsulate more than one queryDispatch() requests and return a list of dispatch objects as result. Because both lists (in and out) correspond together, it's not allowed to pack it - means suppress NULL references!
lDescriptor | a list of queryDispatch() arguments. |
Definition at line 91 of file interceptionhelper.cxx.
References i, and queryDispatch().
|
overridevirtual |
register an interceptor.
@descr Somebody can register himself to intercept all or some special dispatches. It's depend from his supported interfaces. If he implement XInterceptorInfo he his called for some special URLs only - otherwise we call it for every request!
xInterceptor | reference to interceptor, which wishes to be registered here. |
A | RuntimeException if the given reference is NULL! |
Definition at line 104 of file interceptionhelper.cxx.
References framework::InterceptionHelper::InterceptorInfo::lURLPattern, m_lInterceptionRegs, m_xOwnerWeak, m_xSlave, and framework::InterceptionHelper::InterceptorInfo::xInterceptor.
|
overridevirtual |
release an interceptor.
@descr Remove the registered interceptor from our internal list and delete all special information about it.
xInterceptor | reference to the interceptor, which wishes to be deregistered. |
A | RuntimeException if the given reference is NULL! |
Definition at line 164 of file interceptionhelper.cxx.
References framework::InterceptionHelper::InterceptorList::findByReference(), m_lInterceptionRegs, m_xOwnerWeak, and TOOLS_WARN_EXCEPTION.
Referenced by disposing().
|
private |
contains all registered interceptor objects.
Definition at line 138 of file interceptionhelper.hxx.
Referenced by disposing(), queryDispatch(), registerDispatchProviderInterceptor(), and releaseDispatchProviderInterceptor().
|
private |
reference to the frame, which uses this instance to implement its own interception.
@descr We hold a weak reference only, to make disposing operations easy.
Definition at line 131 of file interceptionhelper.hxx.
Referenced by disposing(), registerDispatchProviderInterceptor(), and releaseDispatchProviderInterceptor().
|
private |
this interception helper implements the top level master of an interceptor list ... but this member is the lowest possible slave!
Definition at line 135 of file interceptionhelper.hxx.
Referenced by GetSlave(), queryDispatch(), and registerDispatchProviderInterceptor().