Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(95)

Side by Side Diff: gecko-sdk/include/nsIWebProgressListener.h

Issue 20346: Version 1.8 of gecko-sdk. Downloaded from here:... (Closed) Base URL: svn://chrome-svn/chrome/trunk/deps/third_party/
Patch Set: Created 11 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « gecko-sdk/include/nsIWebProgress.h ('k') | gecko-sdk/include/nsIWindowCreator.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
1 /*
2 * DO NOT EDIT. THIS FILE IS GENERATED FROM c:/builds/tinderbox/XR-Mozilla1.8.0 -Release/WINNT_5.2_Depend/mozilla/uriloader/base/nsIWebProgressListener.idl
3 */
4
5 #ifndef __gen_nsIWebProgressListener_h__
6 #define __gen_nsIWebProgressListener_h__
7
8
9 #ifndef __gen_nsISupports_h__
10 #include "nsISupports.h"
11 #endif
12
13 /* For IDL files that don't want to include root IDL files. */
14 #ifndef NS_NO_VTABLE
15 #define NS_NO_VTABLE
16 #endif
17 class nsIWebProgress; /* forward declaration */
18
19 class nsIRequest; /* forward declaration */
20
21 class nsIURI; /* forward declaration */
22
23
24 /* starting interface: nsIWebProgressListener */
25 #define NS_IWEBPROGRESSLISTENER_IID_STR "570f39d1-efd0-11d3-b093-00a024ffc08c"
26
27 #define NS_IWEBPROGRESSLISTENER_IID \
28 {0x570f39d1, 0xefd0, 0x11d3, \
29 { 0xb0, 0x93, 0x00, 0xa0, 0x24, 0xff, 0xc0, 0x8c }}
30
31 /**
32 * The nsIWebProgressListener interface is implemented by clients wishing to
33 * listen in on the progress associated with the loading of asynchronous
34 * requests in the context of a nsIWebProgress instance as well as any child
35 * nsIWebProgress instances. nsIWebProgress.idl describes the parent-child
36 * relationship of nsIWebProgress instances.
37 *
38 * @status FROZEN
39 */
40 class NS_NO_VTABLE nsIWebProgressListener : public nsISupports {
41 public:
42
43 NS_DEFINE_STATIC_IID_ACCESSOR(NS_IWEBPROGRESSLISTENER_IID)
44
45 /**
46 * State Transition Flags
47 *
48 * These flags indicate the various states that requests may transition
49 * through as they are being loaded. These flags are mutually exclusive.
50 *
51 * For any given request, onStateChange is called once with the STATE_START
52 * flag, zero or more times with the STATE_TRANSFERRING flag or once with the
53 * STATE_REDIRECTING flag, and then finally once with the STATE_STOP flag.
54 * NOTE: For document requests, a second STATE_STOP is generated (see the
55 * description of STATE_IS_WINDOW for more details).
56 *
57 * STATE_START
58 * This flag indicates the start of a request. This flag is set when a
59 * request is initiated. The request is complete when onStateChange is
60 * called for the same request with the STATE_STOP flag set.
61 *
62 * STATE_REDIRECTING
63 * This flag indicates that a request is being redirected. The request
64 * passed to onStateChange is the request that is being redirected. When a
65 * redirect occurs, a new request is generated automatically to process the
66 * new request. Expect a corresponding STATE_START event for the new
67 * request, and a STATE_STOP for the redirected request.
68 *
69 * STATE_TRANSFERRING
70 * This flag indicates that data for a request is being transferred to an
71 * end consumer. This flag indicates that the request has been targeted,
72 * and that the user may start seeing content corresponding to the request.
73 *
74 * STATE_NEGOTIATING
75 * This flag is not used.
76 *
77 * STATE_STOP
78 * This flag indicates the completion of a request. The aStatus parameter
79 * to onStateChange indicates the final status of the request.
80 */
81 enum { STATE_START = 1U };
82
83 enum { STATE_REDIRECTING = 2U };
84
85 enum { STATE_TRANSFERRING = 4U };
86
87 enum { STATE_NEGOTIATING = 8U };
88
89 enum { STATE_STOP = 16U };
90
91 /**
92 * State Type Flags
93 *
94 * These flags further describe the entity for which the state transition is
95 * occuring. These flags are NOT mutually exclusive (i.e., an onStateChange
96 * event may indicate some combination of these flags).
97 *
98 * STATE_IS_REQUEST
99 * This flag indicates that the state transition is for a request, which
100 * includes but is not limited to document requests. (See below for a
101 * description of document requests.) Other types of requests, such as
102 * requests for inline content (e.g., images and stylesheets) are
103 * considered normal requests.
104 *
105 * STATE_IS_DOCUMENT
106 * This flag indicates that the state transition is for a document request.
107 * This flag is set in addition to STATE_IS_REQUEST. A document request
108 * supports the nsIChannel interface and its loadFlags attribute includes
109 * the nsIChannel::LOAD_DOCUMENT_URI flag.
110 *
111 * A document request does not complete until all requests associated with
112 * the loading of its corresponding document have completed. This includes
113 * other document requests (e.g., corresponding to HTML <iframe> elements).
114 * The document corresponding to a document request is available via the
115 * DOMWindow attribute of onStateChange's aWebProgress parameter.
116 *
117 * STATE_IS_NETWORK
118 * This flag indicates that the state transition corresponds to the start
119 * or stop of activity in the indicated nsIWebProgress instance. This flag
120 * is accompanied by either STATE_START or STATE_STOP, and it may be
121 * combined with other State Type Flags.
122 *
123 * Unlike STATE_IS_WINDOW, this flag is only set when activity within the
124 * nsIWebProgress instance being observed starts or stops. If activity
125 * only occurs in a child nsIWebProgress instance, then this flag will be
126 * set to indicate the start and stop of that activity.
127 *
128 * For example, in the case of navigation within a single frame of a HTML
129 * frameset, a nsIWebProgressListener instance attached to the
130 * nsIWebProgress of the frameset window will receive onStateChange calls
131 * with the STATE_IS_NETWORK flag set to indicate the start and stop of
132 * said navigation. In other words, an observer of an outer window can
133 * determine when activity, that may be constrained to a child window or
134 * set of child windows, starts and stops.
135 *
136 * STATE_IS_WINDOW
137 * This flag indicates that the state transition corresponds to the start
138 * or stop of activity in the indicated nsIWebProgress instance. This flag
139 * is accompanied by either STATE_START or STATE_STOP, and it may be
140 * combined with other State Type Flags.
141 *
142 * This flag is similar to STATE_IS_DOCUMENT. However, when a document
143 * request completes, two onStateChange calls with STATE_STOP are
144 * generated. The document request is passed as aRequest to both calls.
145 * The first has STATE_IS_REQUEST and STATE_IS_DOCUMENT set, and the second
146 * has the STATE_IS_WINDOW flag set (and possibly the STATE_IS_NETWORK flag
147 * set as well -- see above for a description of when the STATE_IS_NETWORK
148 * flag may be set). This second STATE_STOP event may be useful as a way
149 * to partition the work that occurs when a document request completes.
150 */
151 enum { STATE_IS_REQUEST = 65536U };
152
153 enum { STATE_IS_DOCUMENT = 131072U };
154
155 enum { STATE_IS_NETWORK = 262144U };
156
157 enum { STATE_IS_WINDOW = 524288U };
158
159 /**
160 * State Modifier Flags
161 *
162 * These flags further describe the transition which is occuring. These
163 * flags are NOT mutually exclusive (i.e., an onStateChange event may
164 * indicate some combination of these flags).
165 *
166 * STATE_RESTORING
167 * This flag indicates that the state transition corresponds to the start
168 * or stop of activity for restoring a previously-rendered presentation.
169 * As such, there is no actual network activity associated with this
170 * request, and any modifications made to the document or presentation
171 * when it was originally loaded will still be present.
172 */
173 enum { STATE_RESTORING = 16777216U };
174
175 /**
176 * State Security Flags
177 *
178 * These flags describe the security state reported by a call to the
179 * onSecurityChange method. These flags are mutually exclusive.
180 *
181 * STATE_IS_INSECURE
182 * This flag indicates that the data corresponding to the request
183 * was received over an insecure channel.
184 *
185 * STATE_IS_BROKEN
186 * This flag indicates an unknown security state. This may mean that the
187 * request is being loaded as part of a page in which some content was
188 * received over an insecure channel.
189 *
190 * STATE_IS_SECURE
191 * This flag indicates that the data corresponding to the request was
192 * received over a secure channel. The degree of security is expressed by
193 * STATE_SECURE_HIGH, STATE_SECURE_MED, or STATE_SECURE_LOW.
194 */
195 enum { STATE_IS_INSECURE = 4U };
196
197 enum { STATE_IS_BROKEN = 1U };
198
199 enum { STATE_IS_SECURE = 2U };
200
201 /**
202 * Security Strength Flags
203 *
204 * These flags describe the security strength and accompany STATE_IS_SECURE
205 * in a call to the onSecurityChange method. These flags are mutually
206 * exclusive.
207 *
208 * These flags are not meant to provide a precise description of data
209 * transfer security. These are instead intended as a rough indicator that
210 * may be used to, for example, color code a security indicator or otherwise
211 * provide basic data transfer security feedback to the user.
212 *
213 * STATE_SECURE_HIGH
214 * This flag indicates a high degree of security.
215 *
216 * STATE_SECURE_MED
217 * This flag indicates a medium degree of security.
218 *
219 * STATE_SECURE_LOW
220 * This flag indicates a low degree of security.
221 */
222 enum { STATE_SECURE_HIGH = 262144U };
223
224 enum { STATE_SECURE_MED = 65536U };
225
226 enum { STATE_SECURE_LOW = 131072U };
227
228 /**
229 * Notification indicating the state has changed for one of the requests
230 * associated with aWebProgress.
231 *
232 * @param aWebProgress
233 * The nsIWebProgress instance that fired the notification
234 * @param aRequest
235 * The nsIRequest that has changed state.
236 * @param aStateFlags
237 * Flags indicating the new state. This value is a combination of one
238 * of the State Transition Flags and one or more of the State Type
239 * Flags defined above. Any undefined bits are reserved for future
240 * use.
241 * @param aStatus
242 * Error status code associated with the state change. This parameter
243 * should be ignored unless aStateFlags includes the STATE_STOP bit.
244 * The status code indicates success or failure of the request
245 * associated with the state change. NOTE: aStatus may be a success
246 * code even for server generated errors, such as the HTTP 404 error.
247 * In such cases, the request itself should be queried for extended
248 * error information (e.g., for HTTP requests see nsIHttpChannel).
249 */
250 /* void onStateChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in unsigned long aStateFlags, in nsresult aStatus); */
251 NS_IMETHOD OnStateChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, P RUint32 aStateFlags, nsresult aStatus) = 0;
252
253 /**
254 * Notification that the progress has changed for one of the requests
255 * associated with aWebProgress. Progress totals are reset to zero when all
256 * requests in aWebProgress complete (corresponding to onStateChange being
257 * called with aStateFlags including the STATE_STOP and STATE_IS_WINDOW
258 * flags).
259 *
260 * @param aWebProgress
261 * The nsIWebProgress instance that fired the notification.
262 * @param aRequest
263 * The nsIRequest that has new progress.
264 * @param aCurSelfProgress
265 * The current progress for aRequest.
266 * @param aMaxSelfProgress
267 * The maximum progress for aRequest.
268 * @param aCurTotalProgress
269 * The current progress for all requests associated with aWebProgress.
270 * @param aMaxTotalProgress
271 * The total progress for all requests associated with aWebProgress.
272 *
273 * NOTE: If any progress value is unknown, or if its value would exceed the
274 * maximum value of type long, then its value is replaced with -1.
275 *
276 * NOTE: If the object also implements nsIWebProgressListener2 and the caller
277 * knows about that interface, this function will not be called. Instead,
278 * nsIWebProgressListener2::onProgressChange64 will be called.
279 */
280 /* void onProgressChange (in nsIWebProgress aWebProgress, in nsIRequest aReque st, in long aCurSelfProgress, in long aMaxSelfProgress, in long aCurTotalProgres s, in long aMaxTotalProgress); */
281 NS_IMETHOD OnProgressChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest , PRInt32 aCurSelfProgress, PRInt32 aMaxSelfProgress, PRInt32 aCurTotalProgress, PRInt32 aMaxTotalProgress) = 0;
282
283 /**
284 * Called when the location of the window being watched changes. This is not
285 * when a load is requested, but rather once it is verified that the load is
286 * going to occur in the given window. For instance, a load that starts in a
287 * window might send progress and status messages for the new site, but it
288 * will not send the onLocationChange until we are sure that we are loading
289 * this new page here.
290 *
291 * @param aWebProgress
292 * The nsIWebProgress instance that fired the notification.
293 * @param aRequest
294 * The associated nsIRequest. This may be null in some cases.
295 * @param aLocation
296 * The URI of the location that is being loaded.
297 */
298 /* void onLocationChange (in nsIWebProgress aWebProgress, in nsIRequest aReque st, in nsIURI aLocation); */
299 NS_IMETHOD OnLocationChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest , nsIURI *aLocation) = 0;
300
301 /**
302 * Notification that the status of a request has changed. The status message
303 * is intended to be displayed to the user (e.g., in the status bar of the
304 * browser).
305 *
306 * @param aWebProgress
307 * The nsIWebProgress instance that fired the notification.
308 * @param aRequest
309 * The nsIRequest that has new status.
310 * @param aStatus
311 * This value is not an error code. Instead, it is a numeric value
312 * that indicates the current status of the request. This interface
313 * does not define the set of possible status codes. NOTE: Some
314 * status values are defined by nsITransport and nsISocketTransport.
315 * @param aMessage
316 * Localized text corresponding to aStatus.
317 */
318 /* void onStatusChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest , in nsresult aStatus, in wstring aMessage); */
319 NS_IMETHOD OnStatusChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, nsresult aStatus, const PRUnichar *aMessage) = 0;
320
321 /**
322 * Notification called for security progress. This method will be called on
323 * security transitions (eg HTTP -> HTTPS, HTTPS -> HTTP, FOO -> HTTPS) and
324 * after document load completion. It might also be called if an error
325 * occurs during network loading.
326 *
327 * @param aWebProgress
328 * The nsIWebProgress instance that fired the notification.
329 * @param aRequest
330 * The nsIRequest that has new security state.
331 * @param aState
332 * A value composed of the Security State Flags and the Security
333 * Strength Flags listed above. Any undefined bits are reserved for
334 * future use.
335 *
336 * NOTE: These notifications will only occur if a security package is
337 * installed.
338 */
339 /* void onSecurityChange (in nsIWebProgress aWebProgress, in nsIRequest aReque st, in unsigned long aState); */
340 NS_IMETHOD OnSecurityChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest , PRUint32 aState) = 0;
341
342 };
343
344 /* Use this macro when declaring classes that implement this interface. */
345 #define NS_DECL_NSIWEBPROGRESSLISTENER \
346 NS_IMETHOD OnStateChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, P RUint32 aStateFlags, nsresult aStatus); \
347 NS_IMETHOD OnProgressChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest , PRInt32 aCurSelfProgress, PRInt32 aMaxSelfProgress, PRInt32 aCurTotalProgress, PRInt32 aMaxTotalProgress); \
348 NS_IMETHOD OnLocationChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest , nsIURI *aLocation); \
349 NS_IMETHOD OnStatusChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, nsresult aStatus, const PRUnichar *aMessage); \
350 NS_IMETHOD OnSecurityChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest , PRUint32 aState);
351
352 /* Use this macro to declare functions that forward the behavior of this interfa ce to another object. */
353 #define NS_FORWARD_NSIWEBPROGRESSLISTENER(_to) \
354 NS_IMETHOD OnStateChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, P RUint32 aStateFlags, nsresult aStatus) { return _to OnStateChange(aWebProgress, aRequest, aStateFlags, aStatus); } \
355 NS_IMETHOD OnProgressChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest , PRInt32 aCurSelfProgress, PRInt32 aMaxSelfProgress, PRInt32 aCurTotalProgress, PRInt32 aMaxTotalProgress) { return _to OnProgressChange(aWebProgress, aRequest , aCurSelfProgress, aMaxSelfProgress, aCurTotalProgress, aMaxTotalProgress); } \
356 NS_IMETHOD OnLocationChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest , nsIURI *aLocation) { return _to OnLocationChange(aWebProgress, aRequest, aLoca tion); } \
357 NS_IMETHOD OnStatusChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, nsresult aStatus, const PRUnichar *aMessage) { return _to OnStatusChange(aWebPro gress, aRequest, aStatus, aMessage); } \
358 NS_IMETHOD OnSecurityChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest , PRUint32 aState) { return _to OnSecurityChange(aWebProgress, aRequest, aState) ; }
359
360 /* Use this macro to declare functions that forward the behavior of this interfa ce to another object in a safe way. */
361 #define NS_FORWARD_SAFE_NSIWEBPROGRESSLISTENER(_to) \
362 NS_IMETHOD OnStateChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, P RUint32 aStateFlags, nsresult aStatus) { return !_to ? NS_ERROR_NULL_POINTER : _ to->OnStateChange(aWebProgress, aRequest, aStateFlags, aStatus); } \
363 NS_IMETHOD OnProgressChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest , PRInt32 aCurSelfProgress, PRInt32 aMaxSelfProgress, PRInt32 aCurTotalProgress, PRInt32 aMaxTotalProgress) { return !_to ? NS_ERROR_NULL_POINTER : _to->OnProgr essChange(aWebProgress, aRequest, aCurSelfProgress, aMaxSelfProgress, aCurTotalP rogress, aMaxTotalProgress); } \
364 NS_IMETHOD OnLocationChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest , nsIURI *aLocation) { return !_to ? NS_ERROR_NULL_POINTER : _to->OnLocationChan ge(aWebProgress, aRequest, aLocation); } \
365 NS_IMETHOD OnStatusChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, nsresult aStatus, const PRUnichar *aMessage) { return !_to ? NS_ERROR_NULL_POINT ER : _to->OnStatusChange(aWebProgress, aRequest, aStatus, aMessage); } \
366 NS_IMETHOD OnSecurityChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest , PRUint32 aState) { return !_to ? NS_ERROR_NULL_POINTER : _to->OnSecurityChange (aWebProgress, aRequest, aState); }
367
368 #if 0
369 /* Use the code below as a template for the implementation class for this interf ace. */
370
371 /* Header file */
372 class nsWebProgressListener : public nsIWebProgressListener
373 {
374 public:
375 NS_DECL_ISUPPORTS
376 NS_DECL_NSIWEBPROGRESSLISTENER
377
378 nsWebProgressListener();
379
380 private:
381 ~nsWebProgressListener();
382
383 protected:
384 /* additional members */
385 };
386
387 /* Implementation file */
388 NS_IMPL_ISUPPORTS1(nsWebProgressListener, nsIWebProgressListener)
389
390 nsWebProgressListener::nsWebProgressListener()
391 {
392 /* member initializers and constructor code */
393 }
394
395 nsWebProgressListener::~nsWebProgressListener()
396 {
397 /* destructor code */
398 }
399
400 /* void onStateChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, i n unsigned long aStateFlags, in nsresult aStatus); */
401 NS_IMETHODIMP nsWebProgressListener::OnStateChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRUint32 aStateFlags, nsresult aStatus)
402 {
403 return NS_ERROR_NOT_IMPLEMENTED;
404 }
405
406 /* void onProgressChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest , in long aCurSelfProgress, in long aMaxSelfProgress, in long aCurTotalProgress, in long aMaxTotalProgress); */
407 NS_IMETHODIMP nsWebProgressListener::OnProgressChange(nsIWebProgress *aWebProgre ss, nsIRequest *aRequest, PRInt32 aCurSelfProgress, PRInt32 aMaxSelfProgress, PR Int32 aCurTotalProgress, PRInt32 aMaxTotalProgress)
408 {
409 return NS_ERROR_NOT_IMPLEMENTED;
410 }
411
412 /* void onLocationChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest , in nsIURI aLocation); */
413 NS_IMETHODIMP nsWebProgressListener::OnLocationChange(nsIWebProgress *aWebProgre ss, nsIRequest *aRequest, nsIURI *aLocation)
414 {
415 return NS_ERROR_NOT_IMPLEMENTED;
416 }
417
418 /* void onStatusChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in nsresult aStatus, in wstring aMessage); */
419 NS_IMETHODIMP nsWebProgressListener::OnStatusChange(nsIWebProgress *aWebProgress , nsIRequest *aRequest, nsresult aStatus, const PRUnichar *aMessage)
420 {
421 return NS_ERROR_NOT_IMPLEMENTED;
422 }
423
424 /* void onSecurityChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest , in unsigned long aState); */
425 NS_IMETHODIMP nsWebProgressListener::OnSecurityChange(nsIWebProgress *aWebProgre ss, nsIRequest *aRequest, PRUint32 aState)
426 {
427 return NS_ERROR_NOT_IMPLEMENTED;
428 }
429
430 /* End of implementation class template. */
431 #endif
432
433
434 #endif /* __gen_nsIWebProgressListener_h__ */
OLDNEW
« no previous file with comments | « gecko-sdk/include/nsIWebProgress.h ('k') | gecko-sdk/include/nsIWindowCreator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698