LibreOffice Module ucbhelper (master) 1
|
#include <interceptedinteraction.hxx>
Classes | |
struct | InterceptedRequest |
Public Types | |
enum | EInterceptionState { E_NOT_INTERCEPTED , E_NO_CONTINUATION_FOUND , E_INTERCEPTED } |
represent the different states, which can occur as result of an interception. More... | |
Public Member Functions | |
InterceptedInteraction () | |
initialize a new instance with default values. More... | |
void | setInterceptedHandler (const css::uno::Reference< css::task::XInteractionHandler > &xInterceptedHandler) |
initialize a new instance with the interaction handler, which should be intercepted. More... | |
void | setInterceptions (::std::vector< InterceptedRequest > &&lInterceptions) |
set a new list of intercepted interactions. More... | |
virtual void SAL_CALL | handle (const css::uno::Reference< css::task::XInteractionRequest > &xRequest) override |
implements the default handling of this class... or can be overwritten by any derived class. More... | |
Static Public Member Functions | |
static css::uno::Reference< css::task::XInteractionContinuation > | extractContinuation (const css::uno::Sequence< css::uno::Reference< css::task::XInteractionContinuation > > &lContinuations, const css::uno::Type &aType) |
extract a requested continuation from the list of available ones. More... | |
Protected Member Functions | |
virtual EInterceptionState | intercepted (const InterceptedRequest &rRequest, const css::uno::Reference< css::task::XInteractionRequest > &xOrgRequest) |
can be overwritten by a derived class to handle interceptions outside. More... | |
Protected Attributes | |
css::uno::Reference< css::task::XInteractionHandler > | m_xInterceptedHandler |
reference to the intercepted interaction handler. More... | |
::std::vector< InterceptedRequest > | m_lInterceptions |
these list contains the requests, which should be intercepted. More... | |
Private Member Functions | |
UCBHELPER_DLLPRIVATE void | impl_handleDefault (const css::uno::Reference< css::task::XInteractionRequest > &xRequest) |
implements the default handling: More... | |
UCBHELPER_DLLPRIVATE EInterceptionState | impl_interceptRequest (const css::uno::Reference< css::task::XInteractionRequest > &xRequest) |
implements the interception of requests. More... | |
Definition at line 47 of file interceptedinteraction.hxx.
represent the different states, which can occur as result of an interception.
Definition at line 103 of file interceptedinteraction.hxx.
ucbhelper::InterceptedInteraction::InterceptedInteraction | ( | ) |
initialize a new instance with default values.
Definition at line 26 of file interceptedinteraction.cxx.
|
static |
extract a requested continuation from the list of available ones.
lContinuations | the list of available continuations. |
aType | is used to locate the right continuation, by checking its interface type. |
Definition at line 48 of file interceptedinteraction.cxx.
Referenced by impl_interceptRequest().
|
overridevirtual |
implements the default handling of this class... or can be overwritten by any derived class.
@descr If no further class is derived from this one -> the default implementation is used. Then the internal list of requests is used to handle different interactions automatically. (see impl_interceptRequest())
If this method was overwritten by a derived implementation -> the new implementation has to do everything by itself. Of course it can access all members/helpers and work with it. But the default implementation is not used automatically then.
xRequest | the interaction request, which should be intercepted. |
Definition at line 62 of file interceptedinteraction.cxx.
References impl_handleDefault().
|
private |
implements the default handling:
Definition at line 67 of file interceptedinteraction.cxx.
References E_INTERCEPTED, E_NO_CONTINUATION_FOUND, E_NOT_INTERCEPTED, impl_interceptRequest(), and m_xInterceptedHandler.
Referenced by handle().
|
private |
implements the interception of requests.
@descr The incoming request will be analyzed, if it match any request of the m_lIntercepions list. If an interception could be found, its continuation will be searched and selected.
The method return the state of that operation. But it doesn't call the intercepted and here set interaction handler. That has to be done in the outside method.
xRequest | the interaction request, which should be intercepted. |
Definition at line 96 of file interceptedinteraction.cxx.
References ucbhelper::InterceptedInteraction::InterceptedRequest::Continuation, E_INTERCEPTED, E_NO_CONTINUATION_FOUND, E_NOT_INTERCEPTED, extractContinuation(), intercepted(), and m_lInterceptions.
Referenced by impl_handleDefault().
|
protectedvirtual |
can be overwritten by a derived class to handle interceptions outside.
@descr This base implementation checks, if the request could be intercepted successfully. Then this method intercepted() is called. The default implementation returns "NOT_INTERCEPTED" every time. So the method impl_interceptRequest() uses the right continuation automatically.
If this method was overwritten and something different "NO_INTERCEPTED" is returned, the method impl_interceptRequest() will return immediately with the result, which is returned by this intercepted() method. Then the continuations must be selected inside the intercepted() call!
rRequest | it points to the intercepted request (means the item of the set interception list). e.g. its "Handle" member can be used to identify it and react very easy, without the need to check the type of the exception ... |
xOrgRequest | points to the original interaction, which was intercepted. It provides access to the exception and the list of possible continuations. |
Definition at line 40 of file interceptedinteraction.cxx.
References E_NOT_INTERCEPTED.
Referenced by impl_interceptRequest().
void ucbhelper::InterceptedInteraction::setInterceptedHandler | ( | const css::uno::Reference< css::task::XInteractionHandler > & | xInterceptedHandler | ) |
initialize a new instance with the interaction handler, which should be intercepted.
xInterceptedHandler | the outside interaction handler, which should be intercepted here. |
Definition at line 30 of file interceptedinteraction.cxx.
References m_xInterceptedHandler.
void ucbhelper::InterceptedInteraction::setInterceptions | ( | ::std::vector< InterceptedRequest > && | lInterceptions | ) |
set a new list of intercepted interactions.
lInterceptions | the list of intercepted requests. |
Definition at line 35 of file interceptedinteraction.cxx.
References m_lInterceptions.
|
protected |
these list contains the requests, which should be intercepted.
Definition at line 132 of file interceptedinteraction.hxx.
Referenced by impl_interceptRequest(), and setInterceptions().
|
protected |
reference to the intercepted interaction handler.
@descr NULL is allowed for this member! All interaction will be aborted then ... expecting th handle() was overwritten by a derived class.
Definition at line 127 of file interceptedinteraction.hxx.
Referenced by impl_handleDefault(), and setInterceptedHandler().