1
/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
3
* The contents of this file are subject to the Mozilla Public
4
* License Version 1.1 (the "License"); you may not use this file
5
* except in compliance with the License. You may obtain a copy of
6
* the License at http://www.mozilla.org/MPL/
8
* Software distributed under the License is distributed on an "AS
9
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
10
* implied. See the License for the specific language governing
11
* rights and limitations under the License.
13
* The Original Code is the Mozilla browser.
15
* The Initial Developer of the Original Code is Netscape
16
* Communications, Inc. Portions created by Netscape are
17
* Copyright (C) 1999, Mozilla. All Rights Reserved.
20
* Travis Bogard <travis@netscape.com>
23
#include "nsISupports.idl"
26
* The nsIWebProgressListener interface is implemented by clients wishing to
27
* listen in on the progress associated with the loading of documents.
29
* @status UNDER_REVIEW
32
interface nsIWebProgress;
36
[scriptable, uuid(570F39D1-EFD0-11d3-B093-00A024FFC08C)]
37
interface nsIWebProgressListener : nsISupports
40
* Progress state transition bits.
41
* These flags indicate the various states that documents and requests
42
* may transition through as they are being loaded.
44
const unsigned long STATE_START = 0x00000001;
45
const unsigned long STATE_REDIRECTING = 0x00000002;
46
const unsigned long STATE_TRANSFERRING = 0x00000004;
47
const unsigned long STATE_NEGOTIATING = 0x00000008;
48
const unsigned long STATE_STOP = 0x00000010;
51
* Progress State type bits.
52
* These flags indicate whether the transition is occuring on a document
53
* or an individual request within the document.
55
const unsigned long STATE_IS_REQUEST = 0x00010000;
56
const unsigned long STATE_IS_DOCUMENT = 0x00020000;
57
const unsigned long STATE_IS_NETWORK = 0x00040000;
58
const unsigned long STATE_IS_WINDOW = 0x00080000;
63
const unsigned long STATE_IS_INSECURE = 0x00000004;
64
const unsigned long STATE_IS_BROKEN = 0x00000001;
65
const unsigned long STATE_IS_SECURE = 0x00000002;
67
const unsigned long STATE_SECURE_HIGH = 0x00040000;
68
const unsigned long STATE_SECURE_MED = 0x00010000;
69
const unsigned long STATE_SECURE_LOW = 0x00020000;
73
* Notification indicating the state has changed for one of the requests
74
* associated with the document loaded.
76
* @param aWebProgress The nsIWebProgress instance that fired the
79
* @param aRequest The nsIRequest which has changed state.
81
* @param aStateFlags Flags indicating the state change.
83
* @param aStatus Error status code associated with the state change.
84
* This parameter should be ignored unless the status flag includes the
85
* STATE_STOP bit. The status code will indicate success / failure of the
86
* request associated with the state change.
88
* @return NS_OK should always be returned.
90
void onStateChange(in nsIWebProgress aWebProgress,
91
in nsIRequest aRequest,
92
in unsigned long aStateFlags,
96
* Notification that the progress has changed for one of the requests being
99
* @param aWebProgress The nsIWebProgress instance that fired the
102
* @param aRequest The nsIRequest that has new progress.
104
* @param aCurSelfProgress The current progress for aRequest.
106
* @param aMaxSelfProgress The maximum progress for aRequest. If this
107
* value is not known then -1 is passed.
109
* @param aCurTotalProgress The current progress for all the requests
112
* @param aMaxTotalProgress The total progress for all the requests being
113
* monitored. If this value is not known then
116
* @return NS_OK should always be returned.
118
void onProgressChange(in nsIWebProgress aWebProgress,
119
in nsIRequest aRequest,
120
in long aCurSelfProgress,
121
in long aMaxSelfProgress,
122
in long aCurTotalProgress,
123
in long aMaxTotalProgress);
125
* Called when the window being watched changes the location that is currently.
126
* This is not when a load is requested, but rather once it is verified that
127
* the load is going to occur in the given window. For instance, a load that
128
* starts in a window might send progress and status messages, for the new site
129
* but it will not send the onLocationChange until we are sure we are loading
130
* this new page here.
132
* @param location The URI of the location that is being loaded.
134
* @return NS_OK should always be returned.
136
void onLocationChange(in nsIWebProgress aWebProgress,
137
in nsIRequest aRequest,
141
* Notification that the status has changed. The status message is usually
142
* printed in the status bar of the browser.
144
* @return NS_OK should always be returned.
146
void onStatusChange(in nsIWebProgress aWebProgress,
147
in nsIRequest aRequest,
149
in wstring aMessage);
153
* Notification called for security progress.
154
* This method will be called on security transitions (eg HTTP -> HTTPS,
155
* HTTPS -> HTTP, FOO -> https) and after document load completion.
156
* It might also be called if an error occurs during network loading.
158
* These notification will only occur if a security package is installed.
160
* @return NS_OK should always be returned.
164
void onSecurityChange(in nsIWebProgress aWebProgress,
165
in nsIRequest aRequest,
166
in unsigned long state);