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/ref.hxx>
34 #include <rtl/ustring.hxx>
35 #include <rtl/ref.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
59 @devstatus ready to use
60 @threadsafe no (used on once position only!)
61 *//*-*************************************************************************************************************/
62 class RequestFilterSelect_Impl
;
63 class FWE_DLLPUBLIC RequestFilterSelect
65 rtl::Reference
<RequestFilterSelect_Impl
> mxImpl
;
68 RequestFilterSelect( const OUString
& sURL
);
69 ~RequestFilterSelect();
70 bool isAbort () const;
71 OUString
getFilter() const;
72 css::uno::Reference
< css::task::XInteractionRequest
> GetRequest();
75 /*-************************************************************************************************************
76 @short special request for interaction
77 @descr User must decide between a preselected and another detected filter.
78 It capsulate communication with any interaction handler and supports an easy
79 access on interaction results for user of these class.
81 @implements XInteractionRequest
83 @devstatus ready to use
84 @threadsafe no (used on once position only!)
85 *//*-*************************************************************************************************************/
86 class FWE_DLLPUBLIC InteractionRequest
89 static css::uno::Reference
< css::task::XInteractionRequest
> CreateRequest(
90 const css::uno::Any
& aRequest
,
91 const css::uno::Sequence
< css::uno::Reference
< css::task::XInteractionContinuation
> >& lContinuations
);
95 } // namespace framework
97 #endif // #define INCLUDED_FRAMEWORK_INTERACTION_HXX
99 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */