michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "nsISupports.idl" michael@0: michael@0: interface nsIURI; michael@0: interface nsIRequest; michael@0: michael@0: /** michael@0: * nsIProgressEventSink michael@0: * michael@0: * This interface is used to asynchronously convey channel status and progress michael@0: * information that is generally not critical to the processing of the channel. michael@0: * The information is intended to be displayed to the user in some meaningful michael@0: * way. michael@0: * michael@0: * An implementation of this interface can be passed to a channel via the michael@0: * channel's notificationCallbacks attribute. See nsIChannel for more info. michael@0: * michael@0: * The channel will begin passing notifications to the progress event sink michael@0: * after its asyncOpen method has been called. Notifications will cease once michael@0: * the channel calls its listener's onStopRequest method or once the channel michael@0: * is canceled (via nsIRequest::cancel). michael@0: * michael@0: * NOTE: This interface is actually not specific to channels and may be used michael@0: * with other implementations of nsIRequest. michael@0: */ michael@0: [scriptable, uuid(D974C99E-4148-4df9-8D98-DE834A2F6462)] michael@0: interface nsIProgressEventSink : nsISupports michael@0: { michael@0: /** michael@0: * Called to notify the event sink that progress has occurred for the michael@0: * given request. michael@0: * michael@0: * @param aRequest michael@0: * the request being observed (may QI to nsIChannel). michael@0: * @param aContext michael@0: * if aRequest is a channel, then this parameter is the listener michael@0: * context passed to nsIChannel::asyncOpen. michael@0: * @param aProgress michael@0: * numeric value in the range 0 to aProgressMax indicating the michael@0: * number of bytes transfered thus far. michael@0: * @param aProgressMax michael@0: * numeric value indicating maximum number of bytes that will be michael@0: * transfered (or 0xFFFFFFFFFFFFFFFF if total is unknown). michael@0: */ michael@0: void onProgress(in nsIRequest aRequest, michael@0: in nsISupports aContext, michael@0: in unsigned long long aProgress, michael@0: in unsigned long long aProgressMax); michael@0: michael@0: /** michael@0: * Called to notify the event sink with a status message for the given michael@0: * request. michael@0: * michael@0: * @param aRequest michael@0: * the request being observed (may QI to nsIChannel). michael@0: * @param aContext michael@0: * if aRequest is a channel, then this parameter is the listener michael@0: * context passed to nsIChannel::asyncOpen. michael@0: * @param aStatus michael@0: * status code (not necessarily an error code) indicating the michael@0: * state of the channel (usually the state of the underlying michael@0: * transport). see nsISocketTransport for socket specific status michael@0: * codes. michael@0: * @param aStatusArg michael@0: * status code argument to be used with the string bundle service michael@0: * to convert the status message into localized, human readable michael@0: * text. the meaning of this parameter is specific to the value michael@0: * of the status code. for socket status codes, this parameter michael@0: * indicates the host:port associated with the status code. michael@0: */ michael@0: void onStatus(in nsIRequest aRequest, michael@0: in nsISupports aContext, michael@0: in nsresult aStatus, michael@0: in wstring aStatusArg); michael@0: michael@0: };