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