Branch libreoffice-5-0-4
[LibreOffice.git] / include / ucbhelper / simpleinteractionrequest.hxx
blobf6806052c0bc2d2575fc9b6d205b828ed207a897
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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>
26 namespace ucbhelper {
28 /** These are the constants that can be passed to the constructor of class
29 * SimpleInteractionRequest and that are returned by method
30 * SimpleInteractionRequest::getResponse().
33 /** The request was not (yet) handled by the interaction handler. */
34 static const sal_Int32 CONTINUATION_UNKNOWN = 0;
36 /** The interaction handler selected XInteractionAbort. */
37 static const sal_Int32 CONTINUATION_ABORT = 1;
39 /** The interaction handler selected XInteractionRetry. */
40 static const sal_Int32 CONTINUATION_RETRY = 2;
42 /** The interaction handler selected XInteractionApprove. */
43 static const sal_Int32 CONTINUATION_APPROVE = 4;
45 /** The interaction handler selected XInteractionDisapprove. */
46 static const sal_Int32 CONTINUATION_DISAPPROVE = 8;
48 /**
49 * This class implements a simple interaction request. The user must not deal
50 * with XInteractionContinuations directly, but can use constants that are
51 * mapped internally to the according objects. This class encapsulates the
52 * standard Interaction Continuations "Abort", "Retry", "Approve" and
53 * "Disaprrove". Instances can be passed directly to
54 * XInteractionHandler::handle(...).
56 * @see InteractionRequest
57 * @see InteractionAbort
58 * @see InteractionRetry
59 * @see InteractionApprove
60 * @see InteractionDisapprove
62 class UCBHELPER_DLLPUBLIC SimpleInteractionRequest : public ucbhelper::InteractionRequest
64 public:
65 /**
66 * Constructor.
68 * @param rRequest is the exception describing the error.
69 * @param nContinuations contains the possible "answers" for the request.
70 * This can be any of the CONTINUATION_* constants combinations
71 * listed above.
73 SimpleInteractionRequest( const com::sun::star::uno::Any & rRequest,
74 const sal_Int32 nContinuations );
76 /**
77 * After passing this request to XInteractionHandler::handle, this method
78 * returns the continuation that was chosen by the interaction handler.
80 * @return the continuation chosen by an interaction handler or
81 * CONTINUATION_UNKNOWN, if the request was not (yet) handled.
83 sal_Int32 getResponse() const;
86 } // namespace ucbhelper
88 #endif /* ! INCLUDED_UCBHELPER_SIMPLEINTERACTIONREQUEST_HXX */
90 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */