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
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef _COMPHELPER_STILLREADWRITEINTERACTION_HXX_
25 #define _COMPHELPER_STRILLREADWRITEINTERACTION_HXX_
26 
27 //_______________________________________________
28 // includes
29 #include <ucbhelper/interceptedinteraction.hxx>
30 
31 #ifndef __COM_SUN_STAR_TASK_XINTERACTIONHANDLER_HPP__
32 #include <com/sun/star/task/XInteractionHandler.hpp>
33 #endif
34 
35 #include <ucbhelper/interceptedinteraction.hxx>
36 #include "comphelper/comphelperdllapi.h"
37 
38 //_______________________________________________
39 // namespace
40 
41 namespace comphelper{
42 class COMPHELPER_DLLPUBLIC StillReadWriteInteraction : public ::ucbhelper::InterceptedInteraction
43 {
44 private:
45 	static const sal_Int32 HANDLE_INTERACTIVEIOEXCEPTION       = 0;
46 	static const sal_Int32 HANDLE_UNSUPPORTEDDATASINKEXCEPTION = 1;
47     static const sal_Int32 HANDLE_AUTHENTICATIONREQUESTEXCEPTION = 2;
48 
49 	sal_Bool m_bUsed;
50 	sal_Bool m_bHandledByMySelf;
51 	sal_Bool m_bHandledByInternalHandler;
52 
53 public:
54 	StillReadWriteInteraction(const com::sun::star::uno::Reference< com::sun::star::task::XInteractionHandler >& xHandler,
55                               const com::sun::star::uno::Reference< com::sun::star::task::XInteractionHandler >& xAuthenticationHandler);
56 
57 	void resetInterceptions();
58 	void resetErrorStates();
59 	sal_Bool wasWriteError();
60 
61 protected:
62     ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionHandler > m_xAuthenticationHandler;
63 
64 private:
65 	virtual ucbhelper::InterceptedInteraction::EInterceptionState intercepted(const ::ucbhelper::InterceptedInteraction::InterceptedRequest&                         aRequest,
66 		const ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionRequest >& xRequest);
67 
68 };
69 }
70 #endif
71