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_UCBHELPER_SIMPLEINTERACTIONREQUEST_HXX
21 #define INCLUDED_UCBHELPER_SIMPLEINTERACTIONREQUEST_HXX
23 #include <ucbhelper/interactionrequest.hxx>
24 #include <ucbhelper/ucbhelperdllapi.h>
25 #include <o3tl/typed_flags_set.hxx>
27 /** These are the constants that can be passed to the constructor of class
28 * SimpleInteractionRequest and that are returned by method
29 * SimpleInteractionRequest::getResponse().
32 enum class ContinuationFlags
34 /** The request was not (yet) handled by the interaction handler. */
36 /** The interaction handler selected XInteractionAbort. */
38 /** The interaction handler selected XInteractionRetry. */
40 /** The interaction handler selected XInteractionApprove. */
42 /** The interaction handler selected XInteractionDisapprove. */
47 template <> struct typed_flags
<ContinuationFlags
> : is_typed_flags
<ContinuationFlags
, 0x0f>
55 * This class implements a simple interaction request. The user must not deal
56 * with XInteractionContinuations directly, but can use constants that are
57 * mapped internally to the according objects. This class encapsulates the
58 * standard Interaction Continuations "Abort", "Retry", "Approve" and
59 * "Disapprove". Instances can be passed directly to
60 * XInteractionHandler::handle(...).
62 * @see InteractionRequest
63 * @see InteractionAbort
64 * @see InteractionRetry
65 * @see InteractionApprove
66 * @see InteractionDisapprove
68 class UCBHELPER_DLLPUBLIC SimpleInteractionRequest final
: public ucbhelper::InteractionRequest
74 * @param rRequest is the exception describing the error.
75 * @param nContinuations contains the possible "answers" for the request.
76 * This can be any of the CONTINUATION_* constants combinations
79 SimpleInteractionRequest(const css::uno::Any
& rRequest
, const ContinuationFlags nContinuations
);
82 * After passing this request to XInteractionHandler::handle, this method
83 * returns the continuation that was chosen by the interaction handler.
85 * @return the continuation chosen by an interaction handler or
86 * ContinuationFlags::NONE, if the request was not (yet) handled.
88 ContinuationFlags
getResponse() const;
91 } // namespace ucbhelper
93 #endif /* ! INCLUDED_UCBHELPER_SIMPLEINTERACTIONREQUEST_HXX */
95 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */