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