stillreadwriteinteraction.cxx (dde7d3fa) stillreadwriteinteraction.cxx (9c0c1533)
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 23 unchanged lines hidden (view full) ---

32#ifndef __COM_SUN_STAR_TASK_XINTERACTIONABORT_HPP__
33#include <com/sun/star/task/XInteractionAbort.hpp>
34#endif
35
36#ifndef __COM_SUN_STAR_UCB_UNSUPPORTEDDATASINKEXCEPTION_HPP__
37#include <com/sun/star/ucb/UnsupportedDataSinkException.hpp>
38#endif
39
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 23 unchanged lines hidden (view full) ---

32#ifndef __COM_SUN_STAR_TASK_XINTERACTIONABORT_HPP__
33#include <com/sun/star/task/XInteractionAbort.hpp>
34#endif
35
36#ifndef __COM_SUN_STAR_UCB_UNSUPPORTEDDATASINKEXCEPTION_HPP__
37#include <com/sun/star/ucb/UnsupportedDataSinkException.hpp>
38#endif
39
40#include <com/sun/star/ucb/AuthenticationRequest.hpp>
41
40namespace comphelper{
41
42 namespace css = ::com::sun::star;
43
42namespace comphelper{
43
44 namespace css = ::com::sun::star;
45
44StillReadWriteInteraction::StillReadWriteInteraction(const css::uno::Reference< css::task::XInteractionHandler >& xHandler)
46 StillReadWriteInteraction::StillReadWriteInteraction(const css::uno::Reference< css::task::XInteractionHandler >& xHandler,
47 const css::uno::Reference< css::task::XInteractionHandler >& xAuthenticationHandler)
45 : m_bUsed (sal_False)
46 , m_bHandledByMySelf (sal_False)
47 , m_bHandledByInternalHandler(sal_False)
48 : m_bUsed (sal_False)
49 , m_bHandledByMySelf (sal_False)
50 , m_bHandledByInternalHandler(sal_False)
51 , m_xAuthenticationHandler(xAuthenticationHandler)
48{
49 ::std::vector< ::ucbhelper::InterceptedInteraction::InterceptedRequest > lInterceptions;
50 ::ucbhelper::InterceptedInteraction::InterceptedRequest aInterceptedRequest;
51
52 aInterceptedRequest.Handle = HANDLE_INTERACTIVEIOEXCEPTION;
53 aInterceptedRequest.Request <<= css::ucb::InteractiveIOException();
54 aInterceptedRequest.Continuation = ::getCppuType(static_cast< css::uno::Reference< css::task::XInteractionAbort >* >(0));
55 aInterceptedRequest.MatchExact = sal_False;
56 lInterceptions.push_back(aInterceptedRequest);
57
58 aInterceptedRequest.Handle = HANDLE_UNSUPPORTEDDATASINKEXCEPTION;
59 aInterceptedRequest.Request <<= css::ucb::UnsupportedDataSinkException();
60 aInterceptedRequest.Continuation = ::getCppuType(static_cast< css::uno::Reference< css::task::XInteractionAbort >* >(0));
61 aInterceptedRequest.MatchExact = sal_False;
62 lInterceptions.push_back(aInterceptedRequest);
52{
53 ::std::vector< ::ucbhelper::InterceptedInteraction::InterceptedRequest > lInterceptions;
54 ::ucbhelper::InterceptedInteraction::InterceptedRequest aInterceptedRequest;
55
56 aInterceptedRequest.Handle = HANDLE_INTERACTIVEIOEXCEPTION;
57 aInterceptedRequest.Request <<= css::ucb::InteractiveIOException();
58 aInterceptedRequest.Continuation = ::getCppuType(static_cast< css::uno::Reference< css::task::XInteractionAbort >* >(0));
59 aInterceptedRequest.MatchExact = sal_False;
60 lInterceptions.push_back(aInterceptedRequest);
61
62 aInterceptedRequest.Handle = HANDLE_UNSUPPORTEDDATASINKEXCEPTION;
63 aInterceptedRequest.Request <<= css::ucb::UnsupportedDataSinkException();
64 aInterceptedRequest.Continuation = ::getCppuType(static_cast< css::uno::Reference< css::task::XInteractionAbort >* >(0));
65 aInterceptedRequest.MatchExact = sal_False;
66 lInterceptions.push_back(aInterceptedRequest);
63
67
68 aInterceptedRequest.Handle = HANDLE_AUTHENTICATIONREQUESTEXCEPTION;
69 aInterceptedRequest.Request <<= css::ucb::AuthenticationRequest();
70 aInterceptedRequest.Continuation = ::getCppuType(static_cast< css::uno::Reference< css::task::XInteractionAbort >* >(0));
71 aInterceptedRequest.MatchExact = sal_False;
72 lInterceptions.push_back(aInterceptedRequest);
73
64 setInterceptedHandler(xHandler);
65 setInterceptions(lInterceptions);
66}
67
68void StillReadWriteInteraction::resetInterceptions()
69{
70 setInterceptions(::std::vector< ::ucbhelper::InterceptedInteraction::InterceptedRequest >());
71}

--- 37 unchanged lines hidden (view full) ---

109 }
110 break;
111
112 case HANDLE_UNSUPPORTEDDATASINKEXCEPTION:
113 {
114 bAbort = sal_True;
115 }
116 break;
74 setInterceptedHandler(xHandler);
75 setInterceptions(lInterceptions);
76}
77
78void StillReadWriteInteraction::resetInterceptions()
79{
80 setInterceptions(::std::vector< ::ucbhelper::InterceptedInteraction::InterceptedRequest >());
81}

--- 37 unchanged lines hidden (view full) ---

119 }
120 break;
121
122 case HANDLE_UNSUPPORTEDDATASINKEXCEPTION:
123 {
124 bAbort = sal_True;
125 }
126 break;
127 case HANDLE_AUTHENTICATIONREQUESTEXCEPTION:
128 {
129//use internal authentication dedicated handler and return
130 if (m_xAuthenticationHandler.is())
131 {
132 m_xAuthenticationHandler->handle(xRequest);
133 return ::ucbhelper::InterceptedInteraction::E_INTERCEPTED;
134 }
135 else //simply abort
136 bAbort = sal_True;;
137 }
138 break;
117 }
118
119 // handle interaction by ourself
120 if (bAbort)
121 {
122 m_bHandledByMySelf = sal_True;
123 css::uno::Reference< css::task::XInteractionContinuation > xAbort = ::ucbhelper::InterceptedInteraction::extractContinuation(
124 xRequest->getContinuations(),

--- 16 unchanged lines hidden ---
139 }
140
141 // handle interaction by ourself
142 if (bAbort)
143 {
144 m_bHandledByMySelf = sal_True;
145 css::uno::Reference< css::task::XInteractionContinuation > xAbort = ::ucbhelper::InterceptedInteraction::extractContinuation(
146 xRequest->getContinuations(),

--- 16 unchanged lines hidden ---