Source code

Revision control

Other Tools

1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
/* This Source Code Form is subject to the terms of the Mozilla Public
3
* License, v. 2.0. If a copy of the MPL was not distributed with this
4
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5
6
#include "nsISupports.idl"
7
8
interface nsIURI;
9
interface nsIRequest;
10
11
/**
12
* nsIProgressEventSink
13
*
14
* This interface is used to asynchronously convey channel status and progress
15
* information that is generally not critical to the processing of the channel.
16
* The information is intended to be displayed to the user in some meaningful
17
* way.
18
*
19
* An implementation of this interface can be passed to a channel via the
20
* channel's notificationCallbacks attribute. See nsIChannel for more info.
21
*
22
* The channel will begin passing notifications to the progress event sink
23
* after its asyncOpen method has been called. Notifications will cease once
24
* the channel calls its listener's onStopRequest method or once the channel
25
* is canceled (via nsIRequest::cancel).
26
*
27
* NOTE: This interface is actually not specific to channels and may be used
28
* with other implementations of nsIRequest.
29
*/
30
[scriptable, uuid(87d55fba-cb7e-4f38-84c1-5c6c2b2a55e9)]
31
interface nsIProgressEventSink : nsISupports
32
{
33
/**
34
* Called to notify the event sink that progress has occurred for the
35
* given request.
36
*
37
* @param aRequest
38
* the request being observed (may QI to nsIChannel).
39
* @param aContext
40
* if aRequest is a channel, then this parameter is the listener
41
* context passed to nsIChannel::asyncOpen.
42
* @param aProgress
43
* numeric value in the range 0 to aProgressMax indicating the
44
* number of bytes transfered thus far.
45
* @param aProgressMax
46
* numeric value indicating maximum number of bytes that will be
47
* transfered (or -1 if total is unknown).
48
*/
49
void onProgress(in nsIRequest aRequest,
50
in nsISupports aContext,
51
in long long aProgress,
52
in long long aProgressMax);
53
54
/**
55
* Called to notify the event sink with a status message for the given
56
* request.
57
*
58
* @param aRequest
59
* the request being observed (may QI to nsIChannel).
60
* @param aContext
61
* if aRequest is a channel, then this parameter is the listener
62
* context passed to nsIChannel::asyncOpen.
63
* @param aStatus
64
* status code (not necessarily an error code) indicating the
65
* state of the channel (usually the state of the underlying
66
* transport). see nsISocketTransport for socket specific status
67
* codes.
68
* @param aStatusArg
69
* status code argument to be used with the string bundle service
70
* to convert the status message into localized, human readable
71
* text. the meaning of this parameter is specific to the value
72
* of the status code. for socket status codes, this parameter
73
* indicates the host:port associated with the status code.
74
*/
75
void onStatus(in nsIRequest aRequest,
76
in nsISupports aContext,
77
in nsresult aStatus,
78
in wstring aStatusArg);
79
80
};