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 __FRAMEWORK_DISPATCH_INTERACTION_HXX_
25 #define __FRAMEWORK_DISPATCH_INTERACTION_HXX_
26 
27 #include <com/sun/star/task/XInteractionRequest.hpp>
28 #include <com/sun/star/task/XInteractionContinuation.hpp>
29 #include <com/sun/star/task/XInteractionAbort.hpp>
30 #include <com/sun/star/task/XInteractionApprove.hpp>
31 #include <com/sun/star/task/XInteractionDisapprove.hpp>
32 #include <com/sun/star/task/XInteractionRetry.hpp>
33 #include <com/sun/star/document/XInteractionFilterSelect.hpp>
34 #include <com/sun/star/document/NoSuchFilterRequest.hpp>
35 #include <com/sun/star/document/AmbigousFilterRequest.hpp>
36 #include <com/sun/star/uno/RuntimeException.hpp>
37 
38 //_________________________________________________________________________________________________________________
39 //  includes of other projects
40 //_________________________________________________________________________________________________________________
41 #include <rtl/ustring.hxx>
42 #include <cppuhelper/implbase1.hxx>
43 #include <com/sun/star/uno/Reference.hxx>
44 #include <com/sun/star/uno/Sequence.hxx>
45 #include <framework/fwedllapi.h>
46 
47 namespace framework{
48 
49 /*-************************************************************************************************************//**
50     @short          special request for interaction to ask user for right filter
51     @descr          These helper can be used to ask user for right filter, if filter detection failed.
52                     It capsulate communication with any interaction handler and supports an easy
53                     access on interaction results for user of these class.
54                     Use it and forget complex mechanism of interaction ...
55 
56     @example        RequestFilterSelect*             pRequest = new RequestFilterSelect;
57                     Reference< XInteractionRequest > xRequest ( pRequest );
58                     xInteractionHandler->handle( xRequest );
59                     if( ! pRequest.isAbort() )
60                     {
61                         OUString sFilter = pRequest->getFilter();
62                     }
63 
64     @implements     XInteractionRequest
65 
66     @base           WeakImplHelper1
67 
68     @devstatus      ready to use
69     @threadsafe     no (used on once position only!)
70 *//*-*************************************************************************************************************/
71 class RequestFilterSelect_Impl;
72 class FWE_DLLPUBLIC RequestFilterSelect
73 {
74     RequestFilterSelect_Impl* pImp;
75 
76     public:
77         RequestFilterSelect( const ::rtl::OUString& sURL );
78         ~RequestFilterSelect();
79         sal_Bool        isAbort  () const;
80         ::rtl::OUString getFilter() const;
81     com::sun::star::uno::Reference < ::com::sun::star::task::XInteractionRequest > GetRequest();
82 };
83 
84 /*-************************************************************************************************************//**
85     @short          special request for interaction
86     @descr          User must decide between a preselected and another detected filter.
87                     It capsulate communication with any interaction handler and supports an easy
88                     access on interaction results for user of these class.
89 
90     @implements     XInteractionRequest
91 
92     @base           WeakImplHelper1
93 
94     @devstatus      ready to use
95     @threadsafe     no (used on once position only!)
96 *//*-*************************************************************************************************************/
97 class FWE_DLLPUBLIC InteractionRequest
98 {
99 public:
100     static com::sun::star::uno::Reference < ::com::sun::star::task::XInteractionRequest >
101         CreateRequest( const ::com::sun::star::uno::Any& aRequest,
102         const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionContinuation > > lContinuations );
103 };
104 
105 /*-************************************************************************************************************//**
106     @short          special request for interaction
107     @descr          User must decide between a preselected and another detected filter.
108                     It capsulate communication with any interaction handler and supports an easy
109                     access on interaction results for user of these class.
110 
111     @implements     XInteractionRequest
112 
113     @base           WeakImplHelper1
114 
115     @devstatus      ready to use
116     @threadsafe     no (used on once position only!)
117 *//*-*************************************************************************************************************/
118 /*
119 class RequestAmbigousFilter_Impl;
120 class RequestAmbigousFilter             // seems to be unused currently
121 {
122     RequestAmbigousFilter_Impl* pImp;
123 
124     // c++ interface
125 public:
126     RequestAmbigousFilter( const ::rtl::OUString& sURL,
127                             const ::rtl::OUString& sSelectedFilter ,
128                             const ::rtl::OUString& sDetectedFilter );
129     ~RequestAmbigousFilter();
130     sal_Bool        isAbort  () const;
131     ::rtl::OUString getFilter() const;
132     com::sun::star::uno::Reference < ::com::sun::star::task::XInteractionRequest > GetRequest();
133 };
134  */
135 
136 }       //  namespace framework
137 
138 #endif  // #define __FRAMEWORK_DISPATCH_INTERACTION_HXX_
139