netwerk/base/public/nsIProgressEventSink.idl

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/netwerk/base/public/nsIProgressEventSink.idl	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,80 @@
     1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +#include "nsISupports.idl"
    1.10 +
    1.11 +interface nsIURI;
    1.12 +interface nsIRequest;
    1.13 +
    1.14 +/**
    1.15 + * nsIProgressEventSink
    1.16 + *
    1.17 + * This interface is used to asynchronously convey channel status and progress
    1.18 + * information that is generally not critical to the processing of the channel.
    1.19 + * The information is intended to be displayed to the user in some meaningful
    1.20 + * way.
    1.21 + *
    1.22 + * An implementation of this interface can be passed to a channel via the
    1.23 + * channel's notificationCallbacks attribute.  See nsIChannel for more info.
    1.24 + *
    1.25 + * The channel will begin passing notifications to the progress event sink
    1.26 + * after its asyncOpen method has been called.  Notifications will cease once
    1.27 + * the channel calls its listener's onStopRequest method or once the channel
    1.28 + * is canceled (via nsIRequest::cancel).
    1.29 + *
    1.30 + * NOTE: This interface is actually not specific to channels and may be used
    1.31 + * with other implementations of nsIRequest.
    1.32 + */
    1.33 +[scriptable, uuid(D974C99E-4148-4df9-8D98-DE834A2F6462)]
    1.34 +interface nsIProgressEventSink : nsISupports
    1.35 +{
    1.36 +    /**
    1.37 +     * Called to notify the event sink that progress has occurred for the
    1.38 +     * given request.
    1.39 +     *
    1.40 +     * @param aRequest
    1.41 +     *        the request being observed (may QI to nsIChannel).
    1.42 +     * @param aContext
    1.43 +     *        if aRequest is a channel, then this parameter is the listener
    1.44 +     *        context passed to nsIChannel::asyncOpen.
    1.45 +     * @param aProgress
    1.46 +     *        numeric value in the range 0 to aProgressMax indicating the
    1.47 +     *        number of bytes transfered thus far.
    1.48 +     * @param aProgressMax
    1.49 +     *        numeric value indicating maximum number of bytes that will be
    1.50 +     *        transfered (or 0xFFFFFFFFFFFFFFFF if total is unknown).
    1.51 +     */
    1.52 +    void onProgress(in nsIRequest aRequest,
    1.53 +                    in nsISupports aContext,
    1.54 +                    in unsigned long long aProgress,
    1.55 +                    in unsigned long long aProgressMax);
    1.56 +
    1.57 +    /**
    1.58 +     * Called to notify the event sink with a status message for the given
    1.59 +     * request.
    1.60 +     *
    1.61 +     * @param aRequest
    1.62 +     *        the request being observed (may QI to nsIChannel).
    1.63 +     * @param aContext
    1.64 +     *        if aRequest is a channel, then this parameter is the listener
    1.65 +     *        context passed to nsIChannel::asyncOpen.
    1.66 +     * @param aStatus
    1.67 +     *        status code (not necessarily an error code) indicating the
    1.68 +     *        state of the channel (usually the state of the underlying
    1.69 +     *        transport).  see nsISocketTransport for socket specific status
    1.70 +     *        codes.
    1.71 +     * @param aStatusArg
    1.72 +     *        status code argument to be used with the string bundle service
    1.73 +     *        to convert the status message into localized, human readable
    1.74 +     *        text.  the meaning of this parameter is specific to the value
    1.75 +     *        of the status code.  for socket status codes, this parameter
    1.76 +     *        indicates the host:port associated with the status code.
    1.77 +     */
    1.78 +    void onStatus(in nsIRequest aRequest,
    1.79 +                  in nsISupports aContext,
    1.80 +                  in nsresult aStatus,
    1.81 +                  in wstring aStatusArg);
    1.82 +
    1.83 +};

mercurial