22#include <osl/diagnose.h>
42 const css::uno::Reference< css::task::XInteractionRequest >&)
49 const css::uno::Type& aType )
51 const css::uno::Reference< css::task::XInteractionContinuation >* pContinuations = std::find_if(lContinuations.begin(), lContinuations.end(),
52 [&aType](
const css::uno::Reference< css::task::XInteractionContinuation >& rContinuation) {
53 css::uno::Reference< css::uno::XInterface > xCheck(rContinuation, css::uno::UNO_QUERY);
54 return xCheck->queryInterface(aType).hasValue();
56 if (pContinuations != lContinuations.end())
57 return *pContinuations;
59 return css::uno::Reference< css::task::XInteractionContinuation >();
87 OSL_FAIL(
"InterceptedInteraction::handle()\nCould intercept this interaction request - but can't locate the right continuation!");
98 css::uno::Any aRequest = xRequest->getRequest();
99 const css::uno::Type& aRequestType = aRequest.getValueType();
100 css::uno::Sequence< css::uno::Reference< css::task::XInteractionContinuation > > lContinuations = xRequest->getContinuations();
107 return rInterception.Request.getValueType().isAssignableFrom(aRequestType);
122 if (xContinuation.is())
124 xContinuation->select();
css::uno::Reference< css::task::XInteractionHandler > m_xInterceptedHandler
reference to the intercepted interaction handler.
UCBHELPER_DLLPRIVATE void impl_handleDefault(const css::uno::Reference< css::task::XInteractionRequest > &xRequest)
implements the default handling:
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.
void setInterceptedHandler(const css::uno::Reference< css::task::XInteractionHandler > &xInterceptedHandler)
initialize a new instance with the interaction handler, which should be intercepted.
void setInterceptions(::std::vector< InterceptedRequest > &&lInterceptions)
set a new list of intercepted interactions.
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.
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.
UCBHELPER_DLLPRIVATE EInterceptionState impl_interceptRequest(const css::uno::Reference< css::task::XInteractionRequest > &xRequest)
implements the interception of requests.
::std::vector< InterceptedRequest > m_lInterceptions
these list contains the requests, which should be intercepted.
InterceptedInteraction()
initialize a new instance with default values.
EInterceptionState
represent the different states, which can occur as result of an interception.
@ E_NOT_INTERCEPTED
none of the specified interceptions match the incoming request
@ E_NO_CONTINUATION_FOUND
the request could be intercepted - but the specified continuation could not be located.
@ E_INTERCEPTED
the request could be intercepted and the specified continuation could be selected successfully.
css::uno::Type Continuation
specify the fix continuation, which must be selected, if the interaction could be intercepted success...