1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef __FRAMEWORK_DISPATCH_INTERACTION_HXX_
29 #define __FRAMEWORK_DISPATCH_INTERACTION_HXX_
30 
31 #include <com/sun/star/task/XInteractionRequest.hpp>
32 #include <com/sun/star/task/XInteractionContinuation.hpp>
33 #include <com/sun/star/task/XInteractionAbort.hpp>
34 #include <com/sun/star/task/XInteractionApprove.hpp>
35 #include <com/sun/star/task/XInteractionDisapprove.hpp>
36 #include <com/sun/star/task/XInteractionRetry.hpp>
37 #include <com/sun/star/document/XInteractionFilterSelect.hpp>
38 #include <com/sun/star/document/NoSuchFilterRequest.hpp>
39 #include <com/sun/star/document/AmbigousFilterRequest.hpp>
40 #include <com/sun/star/uno/RuntimeException.hpp>
41 
42 //_________________________________________________________________________________________________________________
43 //  includes of other projects
44 //_________________________________________________________________________________________________________________
45 #include <rtl/ustring.hxx>
46 #include <cppuhelper/implbase1.hxx>
47 #include <com/sun/star/uno/Reference.hxx>
48 #include <com/sun/star/uno/Sequence.hxx>
49 #include <framework/fwedllapi.h>
50 
51 namespace framework{
52 
53 /*-************************************************************************************************************//**
54     @short          special request for interaction to ask user for right filter
55     @descr          These helper can be used to ask user for right filter, if filter detection failed.
56                     It capsulate communication with any interaction handler and supports an easy
57                     access on interaction results for user of these class.
58                     Use it and forget complex mechanism of interaction ...
59 
60     @example        RequestFilterSelect*             pRequest = new RequestFilterSelect;
61                     Reference< XInteractionRequest > xRequest ( pRequest );
62                     xInteractionHandler->handle( xRequest );
63                     if( ! pRequest.isAbort() )
64                     {
65                         OUString sFilter = pRequest->getFilter();
66                     }
67 
68     @implements     XInteractionRequest
69 
70     @base           WeakImplHelper1
71 
72     @devstatus      ready to use
73     @threadsafe     no (used on once position only!)
74 *//*-*************************************************************************************************************/
75 class RequestFilterSelect_Impl;
76 class FWE_DLLPUBLIC RequestFilterSelect
77 {
78     RequestFilterSelect_Impl* pImp;
79 
80     public:
81         RequestFilterSelect( const ::rtl::OUString& sURL );
82         ~RequestFilterSelect();
83         sal_Bool        isAbort  () const;
84         ::rtl::OUString getFilter() const;
85     com::sun::star::uno::Reference < ::com::sun::star::task::XInteractionRequest > GetRequest();
86 };
87 
88 /*-************************************************************************************************************//**
89     @short          special request for interaction
90     @descr          User must decide between a preselected and another detected filter.
91                     It capsulate communication with any interaction handler and supports an easy
92                     access on interaction results for user of these class.
93 
94     @implements     XInteractionRequest
95 
96     @base           WeakImplHelper1
97 
98     @devstatus      ready to use
99     @threadsafe     no (used on once position only!)
100 *//*-*************************************************************************************************************/
101 class FWE_DLLPUBLIC InteractionRequest
102 {
103 public:
104     static com::sun::star::uno::Reference < ::com::sun::star::task::XInteractionRequest >
105         CreateRequest( const ::com::sun::star::uno::Any& aRequest,
106         const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::task::XInteractionContinuation > > lContinuations );
107 };
108 
109 /*-************************************************************************************************************//**
110     @short          special request for interaction
111     @descr          User must decide between a preselected and another detected filter.
112                     It capsulate communication with any interaction handler and supports an easy
113                     access on interaction results for user of these class.
114 
115     @implements     XInteractionRequest
116 
117     @base           WeakImplHelper1
118 
119     @devstatus      ready to use
120     @threadsafe     no (used on once position only!)
121 *//*-*************************************************************************************************************/
122 /*
123 class RequestAmbigousFilter_Impl;
124 class RequestAmbigousFilter             // seems to be unused currently
125 {
126     RequestAmbigousFilter_Impl* pImp;
127 
128     // c++ interface
129 public:
130     RequestAmbigousFilter( const ::rtl::OUString& sURL,
131                             const ::rtl::OUString& sSelectedFilter ,
132                             const ::rtl::OUString& sDetectedFilter );
133     ~RequestAmbigousFilter();
134     sal_Bool        isAbort  () const;
135     ::rtl::OUString getFilter() const;
136     com::sun::star::uno::Reference < ::com::sun::star::task::XInteractionRequest > GetRequest();
137 };
138  */
139 
140 }       //  namespace framework
141 
142 #endif  // #define __FRAMEWORK_DISPATCH_INTERACTION_HXX_
143