Version 5.2.6.1, tag libreoffice-5.2.6.1
[LibreOffice.git] / offapi / com / sun / star / task / InteractionHandler.idl
blob48f8dd7360dce7b4f61771c014894ac7d943863f
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 __com_sun_star_task_InteractionHandler_idl__
21 #define __com_sun_star_task_InteractionHandler_idl__
23 module com { module sun { module star {
24 module task { published interface XInteractionHandler2; };
25 module awt { published interface XWindow; };
26 }; }; };
28 module com { module sun { module star { module task {
30 /** An interaction request handler that lets the user handle requests via GUI dialogs.
32 <p>The interaction handler service has a number of <a href="#built_in_handler">built-in handlers</a>, responsible
33 for a lot of well known interactions. Additionally, there's a configuration module which allows to
34 <a href="#configuring_handlers">configure additional handlers</a>, responsible for arbitrary requests.</a></p>
36 <a name="built_in_handler"></a>
37 <h3>Built-in Handlers</h3>
38 The following well-known requests can be dealt with by the built-in handlers:
39 <UL>
40 <LI>com::sun::star::ucb::AuthenticationRequest</LI>
41 <LI>com::sun::star::ucb::CertificateValidationRequest</LI>
42 <LI>com::sun::star::ucb::InteractiveAugmentedIOException*</LI>
43 <LI>com::sun::star::ucb::InteractiveFileIOException*</LI>
44 <LI>com::sun::star::ucb::InteractiveIOException*</LI>
45 <LI>com::sun::star::ucb::InteractiveNetworkConnectException*</LI>
46 <LI>com::sun::star::ucb::InteractiveNetworkException*</LI>
47 <LI>com::sun::star::ucb::InteractiveNetworkGeneralException*</LI>
48 <LI>com::sun::star::ucb::InteractiveNetworkOffLineException*</LI>
49 <LI>com::sun::star::ucb::InteractiveNetworkReadException*</LI>
50 <LI>com::sun::star::ucb::InteractiveNetworkResolveNameException*</LI>
51 <LI>com::sun::star::ucb::InteractiveNetworkWriteException*</LI>
52 <LI>com::sun::star::ucb::InteractiveWrongMediumException*</LI>
53 <LI>com::sun::star::task::PasswordRequest</LI>
54 <LI>com::sun::star::java::WrongJavaVersionException*</LI>
55 <LI>com::sun::star::task::DocumentMacroConfirmationRequest</LI>
56 </UL>
57 The requests marked with an asterisk are only handled if (a) their
58 continuations match certain restrictions (see below), and (b) the
59 necessary resource strings are available (this can be exploited by
60 applications that carry only a subset of all resource files with
61 them).</P>
63 <P>The continuation restrictions are as follows: Let <VAR>C</VAR> be the
64 subset of the provided continuations that are of type
65 com::sun::star::task::XInteractionApprove,
66 com::sun::star::task::XInteractionDisapprove,
67 com::sun::star::task::XInteractionRetry, or
68 com::sun::star::task::XInteractionAbort (or of a
69 derived type). All other continuations are ignored for these requests.
70 The request is only handled if the set <VAR>C</VAR> is any of the
71 following:
72 <UL>
73 <LI>Abort</LI>
74 <LI>Retry, Abort</LI>
75 <LI>Approve</LI>
76 <LI>Approve, Abort</LI>
77 <LI>Approve, Disapprove</LI>
78 <LI>Approve, Disapprove, Abort</LI>
79 </UL></P>
81 <P>An
82 com::sun::star::ucb::InteractiveAugmentedIOException
83 carries with it a sequence of arguments, which should be
84 com::sun::star::beans::PropertyValues. The following
85 details which properties are interpreted by the interaction handler,
86 depending on the request's
87 com::sun::star::ucb::IOErrorCode:
88 <DL>
89 <DT><code>"Uri"</code></DT>
90 <DD>All error codes except
91 com::sun::star::ucb::IOErrorCode::DIFFERENT_DEVICES.
92 The URI of the involved resource (a `string`).</DD>
94 <DT><code>"ResourceName"</code></DT>
95 <DD>All error codes except
96 com::sun::star::ucb::IOErrorCode::DIFFERENT_DEVICES.
97 A name for the involved resource (a `string`) that might be
98 more meaningful to the user than the URI. For example, a
99 (platform-dependent) path notation for file system resources.</DD>
101 <DT><code>"ResourceType"</code></DT>
102 <DD>com::sun::star::ucb::IOErrorCode::DEVICE_NOT_READY
104 com::sun::star::ucb::IOErrorCode::NOT_EXISTING
105 only. An identifier for the type of resource involved (a
106 `string`). Currently understood values are
107 <code>"volume"</code> (e.g., a file system volume) and
108 <code>"folder"</code> (i.e., a resource that contains other
109 resources).</DD>
111 <DT><code>"Removable"</code></DT>
112 <DD>com::sun::star::ucb::IOErrorCode::NOT_EXISTING
113 only. A flag indicating whether the resource resides on a storage
114 medium that can be removed by the user (a `boolean`).</DD>
116 <DT><code>"Folder"</code></DT>
117 <DD>com::sun::star::ucb::IOErrorCode::CANT_CREATE
118 only. The name of the folder in which a resource cannot be created (a
119 `string`).</DD>
121 <DT><code>"Volume"</code> and <code>"OtherVolume"</code></DT>
122 <DD>com::sun::star::ucb::IOErrorCode::DIFFERENT_DEVICES
123 only. The names of the two volumes involved (two
124 `string`s).</DD>
125 </DL></P>
127 <a name="configuring_handlers"></a>
128 <h3>Configuring additional Handlers</h3>
130 <p>It is possible to configure additional interaction handlers, to which certain requests can be delegated. The
131 configuration node <code>/org.openoffice.Interaction/InteractionHandlers</code> is evaluated and respected
132 by the <code>InteractionHandler</code> implementation.</p>
134 <p>A custom interaction handler can declare itself responsible for an arbitrary number of UNO types, specified
135 by full-qualified type name. Also, for each type, it can specify whether it is responsible for only this particular
136 type, or all possibly existent derived types.</p>
138 <p>Whenever the <code>InteractionHandler</code> encounters a request it cannot fulfill itself, it will examine
139 the configuration, to find a handler implementation for the request, and delegate it to the first matching
140 handler.</p>
142 <p>If multiple custom interaction handlers declare themselves responsible for the same request type, it is not
143 defined which handler will actually be invoked. Thus, when deploying a custom interaction handler, ensure
144 that the types you specify are general enough to cover all requests you want to handle, but also specific
145 enough to not cover requests which other handlers might be interested in.</p>
147 published service InteractionHandler : XInteractionHandler2
149 /** Creates an instance.
151 @param parent denotes the parent window for any GUI dialogs the
152 interaction handler pops up; may be null.
154 createWithParent([in] com::sun::star::awt::XWindow parent);
156 /** Creates an instance with an additional context.
158 @param parent denotes the parent window for any GUI dialogs the
159 interaction handler pops up; may be null.
161 @param context is a textual description of the current context (used,
162 e.g., as a first line of text in error boxes).
164 createWithParentAndContext([in] com::sun::star::awt::XWindow parent, [in] string context);
167 }; }; }; };
169 #endif
171 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */