1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_FRAMEWORK_INTERACTION_HXX
21 #define INCLUDED_FRAMEWORK_INTERACTION_HXX
23 #include <com/sun/star/task/XInteractionRequest.hpp>
24 #include <com/sun/star/task/XInteractionContinuation.hpp>
25 #include <com/sun/star/task/XInteractionAbort.hpp>
26 #include <com/sun/star/task/XInteractionApprove.hpp>
27 #include <com/sun/star/task/XInteractionDisapprove.hpp>
28 #include <com/sun/star/task/XInteractionRetry.hpp>
29 #include <com/sun/star/document/XInteractionFilterSelect.hpp>
30 #include <com/sun/star/document/NoSuchFilterRequest.hpp>
31 #include <com/sun/star/uno/RuntimeException.hpp>
33 #include <rtl/ustring.hxx>
34 #include <cppuhelper/implbase1.hxx>
35 #include <com/sun/star/uno/Reference.hxx>
36 #include <com/sun/star/uno/Sequence.hxx>
37 #include <framework/fwedllapi.h>
41 /*-************************************************************************************************************
42 @short special request for interaction to ask user for right filter
43 @descr These helper can be used to ask user for right filter, if filter detection failed.
44 It capsulate communication with any interaction handler and supports an easy
45 access on interaction results for user of these class.
46 Use it and forget complex mechanism of interaction ...
48 @example RequestFilterSelect* pRequest = new RequestFilterSelect;
49 Reference< XInteractionRequest > xRequest ( pRequest );
50 xInteractionHandler->handle( xRequest );
51 if( ! pRequest.isAbort() )
53 OUString sFilter = pRequest->getFilter();
56 @implements XInteractionRequest
60 @devstatus ready to use
61 @threadsafe no (used on once position only!)
62 *//*-*************************************************************************************************************/
63 class RequestFilterSelect_Impl
;
64 class FWE_DLLPUBLIC RequestFilterSelect
66 RequestFilterSelect_Impl
* pImp
;
69 RequestFilterSelect( const OUString
& sURL
);
70 ~RequestFilterSelect();
71 bool isAbort () const;
72 OUString
getFilter() const;
73 com::sun::star::uno::Reference
< ::com::sun::star::task::XInteractionRequest
> GetRequest();
76 /*-************************************************************************************************************
77 @short special request for interaction
78 @descr User must decide between a preselected and another detected filter.
79 It capsulate communication with any interaction handler and supports an easy
80 access on interaction results for user of these class.
82 @implements XInteractionRequest
86 @devstatus ready to use
87 @threadsafe no (used on once position only!)
88 *//*-*************************************************************************************************************/
89 class FWE_DLLPUBLIC InteractionRequest
92 static com::sun::star::uno::Reference
< ::com::sun::star::task::XInteractionRequest
>
93 CreateRequest( const ::com::sun::star::uno::Any
& aRequest
,
94 const ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Reference
< ::com::sun::star::task::XInteractionContinuation
> >& lContinuations
);
98 } // namespace framework
100 #endif // #define INCLUDED_FRAMEWORK_INTERACTION_HXX
102 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */