22#include <com/sun/star/ucb/InteractiveIOException.hpp>
24#include <com/sun/star/task/XInteractionAbort.hpp>
26#include <com/sun/star/task/XInteractionApprove.hpp>
28#include <com/sun/star/ucb/UnsupportedDataSinkException.hpp>
30#include <com/sun/star/ucb/AuthenticationRequest.hpp>
32#include <com/sun/star/ucb/CertificateValidationRequest.hpp>
37StillReadWriteInteraction::StillReadWriteInteraction(
const css::uno::Reference< css::task::XInteractionHandler >& xHandler,
38 css::uno::Reference< css::task::XInteractionHandler > xAuxiliaryHandler)
40 , m_bHandledByMySelf (false)
41 , m_xAuxiliaryHandler(
std::move(xAuxiliaryHandler))
43 std::vector< ::ucbhelper::InterceptedInteraction::InterceptedRequest > lInterceptions;
44 lInterceptions.reserve(4);
48 aInterceptedRequest.
Request <<= css::ucb::InteractiveIOException();
50 lInterceptions.push_back(aInterceptedRequest);
53 aInterceptedRequest.
Request <<= css::ucb::UnsupportedDataSinkException();
55 lInterceptions.push_back(aInterceptedRequest);
57 aInterceptedRequest.
Handle = HANDLE_AUTHENTICATIONREQUESTEXCEPTION;
58 aInterceptedRequest.
Request <<= css::ucb::AuthenticationRequest();
60 lInterceptions.push_back(aInterceptedRequest);
62 aInterceptedRequest.
Handle = HANDLE_CERTIFICATEVALIDATIONREQUESTEXCEPTION;
63 aInterceptedRequest.
Request <<= css::ucb::CertificateValidationRequest();
65 lInterceptions.push_back(aInterceptedRequest);
67 setInterceptedHandler(xHandler);
68 setInterceptions(std::move(lInterceptions));
71void StillReadWriteInteraction::resetInterceptions()
73 setInterceptions(std::vector< ::ucbhelper::InterceptedInteraction::InterceptedRequest >());
76void StillReadWriteInteraction::resetErrorStates()
79 m_bHandledByMySelf =
false;
84 const css::uno::Reference< css::task::XInteractionRequest >& xRequest)
91 switch(aRequest.Handle)
95 css::ucb::InteractiveIOException exIO;
96 xRequest->getRequest() >>= exIO;
98 (exIO.Code == css::ucb::IOErrorCode_ACCESS_DENIED )
99 || (exIO.Code == css::ucb::IOErrorCode_LOCKING_VIOLATION )
100 || (exIO.Code == css::ucb::IOErrorCode_NOT_EXISTING )
104 || (exIO.Code == css::ucb::IOErrorCode_NOT_SUPPORTED )
108 || (exIO.Code == css::ucb::IOErrorCode_GENERAL )
119 case HANDLE_CERTIFICATEVALIDATIONREQUESTEXCEPTION:
120 case HANDLE_AUTHENTICATIONREQUESTEXCEPTION:
123 if (m_xAuxiliaryHandler.is())
125 m_xAuxiliaryHandler->handle(xRequest);
126 return ::ucbhelper::InterceptedInteraction::E_INTERCEPTED;
137 m_bHandledByMySelf =
true;
139 xRequest->getContinuations(),
142 return ::ucbhelper::InterceptedInteraction::E_NO_CONTINUATION_FOUND;
144 return ::ucbhelper::InterceptedInteraction::E_INTERCEPTED;
148 if (m_xInterceptedHandler.is())
150 m_xInterceptedHandler->handle(xRequest);
152 return ::ucbhelper::InterceptedInteraction::E_INTERCEPTED;
css::uno::Type const & get()
static css::uno::Reference< css::task::XInteractionContinuation > extractContinuation(const css::uno::Sequence< css::uno::Reference< css::task::XInteractionContinuation > > &lContinuations, const css::uno::Type &aType)
const sal_Int32 HANDLE_INTERACTIVEIOEXCEPTION
Will handle com::sun::star::ucb::InteractiveIOException and derived classes.
const sal_Int32 HANDLE_UNSUPPORTEDDATASINKEXCEPTION
Will handle com::sun::star::ucb::UnsupportedDataSinkException.
css::uno::Type Continuation