1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements.  See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership.  The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License.  You may obtain a copy of the License at
10 *
11 *   http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied.  See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
20 *************************************************************/
21
22
23
24#ifndef __com_sun_star_task_InteractionHandler_idl__
25#define __com_sun_star_task_InteractionHandler_idl__
26
27module com { module sun { module star {
28    module lang { published interface XInitialization; };
29    module task { published interface XInteractionHandler; };
30}; }; };
31
32module com { module sun { module star { module task {
33
34//============================================================================
35/** An interaction request handler that lets the user handle requests via GUI dialogs.
36
37    <p>The interaction handler service has a numerof of <a href="#built_in_handler">built-in handlers</a>, responsible
38    for a lot of well known interactions. Additionally, there's a configuration module which allows to
39    <a href="#configuring_handlers">configure additional handlers</a>, responsible for arbitrary requests.</a></p>
40
41    <a name="built_in_handler"></a>
42    <h3>Built-in Handlers</h3>
43    The following well-known requests can be dealt with by the built-in handlers:
44    <UL>
45        <LI><type scope="com::sun::star::ucb">AuthenticationRequest</type></LI>
46		<LI><type scope="com::sun::star::ucb">CertificateValidationRequest</type></LI>
47        <LI><type scope="com::sun::star::sync2">BadPartnershipException</type>*</LI>
48        <LI><type scope="com::sun::star::ucb">HandleCookiesRequest</type></LI>
49        <LI><type scope="com::sun::star::ucb">InteractiveAugmentedIOException</type>*</LI>
50        <LI><type scope="com::sun::star::ucb">InteractiveCHAOSException</type>*</LI>
51        <LI><type scope="com::sun::star::ucb">InteractiveFileIOException</type>*</LI>
52        <LI><type scope="com::sun::star::ucb">InteractiveIOException</type>*</LI>
53        <LI><type scope="com::sun::star::ucb">InteractiveNetworkConnectException</type>*</LI>
54        <LI><type scope="com::sun::star::ucb">InteractiveNetworkException</type>*</LI>
55        <LI><type scope="com::sun::star::ucb">InteractiveNetworkGeneralException</type>*</LI>
56        <LI><type scope="com::sun::star::ucb">InteractiveNetworkOffLineException</type>*</LI>
57        <LI><type scope="com::sun::star::ucb">InteractiveNetworkReadException</type>*</LI>
58        <LI><type scope="com::sun::star::ucb">InteractiveNetworkResolveNameException</type>*</LI>
59        <LI><type scope="com::sun::star::ucb">InteractiveNetworkWriteException</type>*</LI>
60        <LI><type scope="com::sun::star::ucb">InteractiveWrongMediumException</type>*</LI>
61        <LI><type scope="com::sun::star::task">PasswordRequest</type></LI>
62        <LI><type scope="com::sun::star::java">WrongJavaVersionException</type>*</LI>
63        <LI><type scope="com::sun::star::task">DocumentMacroConfirmationRequest</type></LI>
64    </UL>
65    The requests marked with an asterisk are only handled if (a) their
66    continuations match certain restrictions (see below), and (b) the
67    necessary resource strings are available (this can be exploited by
68    applications that carry only a subset of all resource files with
69    them).</P>
70
71    <P>The continuation restrictions are as follows:  Let <VAR>C</VAR> be the
72    subset of the provided continuations that are of type
73    <type scope="com::sun::star::task">XInteractionApprove</type>,
74    <type scope="com::sun::star::task">XInteractionDisapprove</type>,
75    <type scope="com::sun::star::task">XInteractionRetry</type>, or
76    <type scope="com::sun::star::task">XInteractionAbort</type> (or of a
77    derived type).  All other continuations are ignored for these requests.
78    The request is only handled if the set <VAR>C</VAR> is any of the
79    following:
80    <UL>
81        <LI>Abort</LI>
82        <LI>Retry, Abort</LI>
83        <LI>Approve</LI>
84        <LI>Approve, Abort</LI>
85        <LI>Approve, Disapprove</LI>
86        <LI>Approve, Disapprove, Abort</LI>
87    </UL></P>
88
89    <P>An
90    <type scope="com::sun::star::ucb">InteractiveAugmentedIOException</type>
91    carries with it a sequence of arguments, which should be
92    <type scope="com::sun::star::beans">PropertyValue</type>s.  The following
93    details which properties are interpreted by the interaction handler,
94    depending on the request's
95    <type scope="com::sun::star::ucb">IOErrorCode</type>:
96    <DL>
97    	<DT><code>"Uri"</code></DT>
98        <DD>All error codes except
99        <const scope="com::sun::star::ucb">IOErrorCode::DIFFERENT_DEVICES</const>.
100        The URI of the involved resource (a <atom>string</atom>).</DD>
101
102        <DT><code>"ResourceName"</code></DT>
103        <DD>All error codes except
104        <const scope="com::sun::star::ucb">IOErrorCode::DIFFERENT_DEVICES</const>.
105        A name for the involved resource (a <atom>string</atom>) that might be
106        more meaningful to the user than the URI.  For example, a
107        (platform-dependent) path notation for file system resources.</DD>
108
109        <DT><code>"ResourceType"</code></DT>
110        <DD><const scope="com::sun::star::ucb">IOErrorCode::DEVICE_NOT_READY</const>
111        and
112        <const scope="com::sun::star::ucb">IOErrorCode::NOT_EXISTING</const>
113        only.  An identifier for the type of resource involved (a
114        <atom>string</atom>).  Currently understood values are
115        <code>"volume"</code> (e.g., a file system volume) and
116        <code>"folder"</code> (i.e., a resource that contains other
117        resources).</DD>
118
119        <DT><code>"Removable"</code></DT>
120        <DD><const scope="com::sun::star::ucb">IOErrorCode::NOT_EXISTING</const>
121        only.  A flag indicating whether the resource resides on a storage
122        medium that can be removed by the user (a <atom>boolean</atom>).</DD>
123
124        <DT><code>"Folder"</code></DT>
125        <DD><const scope="com::sun::star::ucb">IOErrorCode::CANT_CREATE</const>
126        only.  The name of the foler in which a resource cannot be created (a
127        <atom>string</atom>).</DD>
128
129        <DT><code>"Volume"</code> and <code>"OtherVolume"</code></DT>
130        <DD><const scope="com::sun::star::ucb">IOErrorCode::DIFFERENT_DEVICES</const>
131        only.  The names of the two volumes involved (two
132        <atom>string</atom>s).</DD>
133    </DL></P>
134
135    <a name="configuring_handlers"></a>
136    <h3>Configurating additional Handlers</h3>
137
138    <p>It is possible to configure additional interaction handlers, to which certain requests can be delegated. The
139    configuration node <code>/org.openoffice.Interaction/InteractionHandlers</code> is evaluated and respected
140    by the <code>InteractionHandler</code> implementation.</p>
141
142    <p>A custom interaction handler can declare itself responsible for an arbitrary number of UNO types, specified
143    by full-qualified type name. Also, for each type, it can specify whether it is responsible for only this particular
144    type, or all possibly existent derived types.</p>
145
146    <p>Whenever the <code>InteractionHandler</code> encounteres a request it cannot fulfill itself, it will examine
147    the configuration, to find a handler implementation for the request, and delegate it to the first matching
148    handler.</p>
149
150    <p>If multiple custom interaction handlers declare themself responsible for the same request type, it is not
151    defined which handler will actully be invoked. Thus, when deploying a custom interaction handler, ensure
152    that the types you specify are general enough to cover all requests you want to handle, but also specific
153    enough to not cover requests which other handlers might be interested in.</p>
154 */
155published service InteractionHandler
156{
157    //------------------------------------------------------------------------
158    /** Handle an interaction request.
159     */
160    interface com::sun::star::task::XInteractionHandler;
161
162    //------------------------------------------------------------------------
163    /** Initialize the interaction handler.
164
165        <P>The arguments must be a sequence of
166        <type scope="com::sun::star::beans">PropertyValue</type>s.  The
167        currently supported properties are:
168        <UL>
169            <LI><code>"Parent"</code> of type
170            <type scope="com::sun::star::awt">XWindow</type> denotes the
171            parent window for any GUI dialogs the interaction handler pops up;
172            it is strongly recommended that this property is supplied;</LI>
173            <LI><code>"Context"</code> of type <atom>string</atom> is a
174            textual description of the current context (used, e.g., as a first
175            line of text in error boxes); this property is optional.</LI>
176        </UL></P>
177     */
178    interface com::sun::star::lang::XInitialization;
179};
180
181}; }; }; };
182
183#endif
184