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 __FRAMEWORK_DISPATCH_INTERACTION_HXX_
21 #define __FRAMEWORK_DISPATCH_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/document/AmbigousFilterRequest.hpp>
32 #include <com/sun/star/uno/RuntimeException.hpp>
34 #include <rtl/ustring.hxx>
35 #include <cppuhelper/implbase1.hxx>
36 #include <com/sun/star/uno/Reference.hxx>
37 #include <com/sun/star/uno/Sequence.hxx>
38 #include <framework/fwedllapi.h>
42 /*-************************************************************************************************************//**
43 @short special request for interaction to ask user for right filter
44 @descr These helper can be used to ask user for right filter, if filter detection failed.
45 It capsulate communication with any interaction handler and supports an easy
46 access on interaction results for user of these class.
47 Use it and forget complex mechanism of interaction ...
49 @example RequestFilterSelect* pRequest = new RequestFilterSelect;
50 Reference< XInteractionRequest > xRequest ( pRequest );
51 xInteractionHandler->handle( xRequest );
52 if( ! pRequest.isAbort() )
54 OUString sFilter = pRequest->getFilter();
57 @implements XInteractionRequest
61 @devstatus ready to use
62 @threadsafe no (used on once position only!)
63 *//*-*************************************************************************************************************/
64 class RequestFilterSelect_Impl
;
65 class FWE_DLLPUBLIC RequestFilterSelect
67 RequestFilterSelect_Impl
* pImp
;
70 RequestFilterSelect( const OUString
& sURL
);
71 ~RequestFilterSelect();
72 sal_Bool
isAbort () const;
73 OUString
getFilter() const;
74 com::sun::star::uno::Reference
< ::com::sun::star::task::XInteractionRequest
> GetRequest();
77 /*-************************************************************************************************************//**
78 @short special request for interaction
79 @descr User must decide between a preselected and another detected filter.
80 It capsulate communication with any interaction handler and supports an easy
81 access on interaction results for user of these class.
83 @implements XInteractionRequest
87 @devstatus ready to use
88 @threadsafe no (used on once position only!)
89 *//*-*************************************************************************************************************/
90 class FWE_DLLPUBLIC InteractionRequest
93 static com::sun::star::uno::Reference
< ::com::sun::star::task::XInteractionRequest
>
94 CreateRequest( const ::com::sun::star::uno::Any
& aRequest
,
95 const ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Reference
< ::com::sun::star::task::XInteractionContinuation
> > lContinuations
);
99 } // namespace framework
101 #endif // #define __FRAMEWORK_DISPATCH_INTERACTION_HXX_
103 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */