PageRenderTime 262ms CodeModel.GetById 116ms app.highlight 9ms RepoModel.GetById 132ms app.codeStats 0ms

/gecko_api/include/nsIWebProgressListener.h

http://firefox-mac-pdf.googlecode.com/
C++ Header | 448 lines | 100 code | 54 blank | 294 comment | 0 complexity | 5d03c5455366c4ef7e2429a1dff92527 MD5 | raw file
  1/*
  2 * DO NOT EDIT.  THIS FILE IS GENERATED FROM /builds/tinderbox/XR-Trunk/Darwin_8.8.4_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
 17class nsIWebProgress; /* forward declaration */
 18
 19class nsIRequest; /* forward declaration */
 20
 21class 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 */
 40class NS_NO_VTABLE NS_SCRIPTABLE nsIWebProgressListener : public nsISupports {
 41 public: 
 42
 43  NS_DECLARE_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    * State bits for EV == Extended Validation == High Assurance
230    *
231    * These flags describe the level of identity verification
232    * in a call to the onSecurityChange method. 
233    *
234    * STATE_IDENTITY_EV_TOPLEVEL
235    *   The topmost document uses an EV cert.
236    *   NOTE: Available since Gecko 1.9
237    */
238  enum { STATE_IDENTITY_EV_TOPLEVEL = 1048576U };
239
240  /**
241   * Notification indicating the state has changed for one of the requests
242   * associated with aWebProgress.
243   *
244   * @param aWebProgress
245   *        The nsIWebProgress instance that fired the notification
246   * @param aRequest
247   *        The nsIRequest that has changed state.
248   * @param aStateFlags
249   *        Flags indicating the new state.  This value is a combination of one
250   *        of the State Transition Flags and one or more of the State Type
251   *        Flags defined above.  Any undefined bits are reserved for future
252   *        use.
253   * @param aStatus
254   *        Error status code associated with the state change.  This parameter
255   *        should be ignored unless aStateFlags includes the STATE_STOP bit.
256   *        The status code indicates success or failure of the request
257   *        associated with the state change.  NOTE: aStatus may be a success
258   *        code even for server generated errors, such as the HTTP 404 error.
259   *        In such cases, the request itself should be queried for extended
260   *        error information (e.g., for HTTP requests see nsIHttpChannel).
261   */
262  /* void onStateChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in unsigned long aStateFlags, in nsresult aStatus); */
263  NS_SCRIPTABLE NS_IMETHOD OnStateChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRUint32 aStateFlags, nsresult aStatus) = 0;
264
265  /**
266   * Notification that the progress has changed for one of the requests
267   * associated with aWebProgress.  Progress totals are reset to zero when all
268   * requests in aWebProgress complete (corresponding to onStateChange being
269   * called with aStateFlags including the STATE_STOP and STATE_IS_WINDOW
270   * flags).
271   *
272   * @param aWebProgress
273   *        The nsIWebProgress instance that fired the notification.
274   * @param aRequest
275   *        The nsIRequest that has new progress.
276   * @param aCurSelfProgress
277   *        The current progress for aRequest.
278   * @param aMaxSelfProgress
279   *        The maximum progress for aRequest.
280   * @param aCurTotalProgress
281   *        The current progress for all requests associated with aWebProgress.
282   * @param aMaxTotalProgress
283   *        The total progress for all requests associated with aWebProgress.
284   *
285   * NOTE: If any progress value is unknown, or if its value would exceed the
286   * maximum value of type long, then its value is replaced with -1.
287   *
288   * NOTE: If the object also implements nsIWebProgressListener2 and the caller
289   * knows about that interface, this function will not be called. Instead,
290   * nsIWebProgressListener2::onProgressChange64 will be called.
291   */
292  /* void onProgressChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in long aCurSelfProgress, in long aMaxSelfProgress, in long aCurTotalProgress, in long aMaxTotalProgress); */
293  NS_SCRIPTABLE NS_IMETHOD OnProgressChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRInt32 aCurSelfProgress, PRInt32 aMaxSelfProgress, PRInt32 aCurTotalProgress, PRInt32 aMaxTotalProgress) = 0;
294
295  /**
296   * Called when the location of the window being watched changes.  This is not
297   * when a load is requested, but rather once it is verified that the load is
298   * going to occur in the given window.  For instance, a load that starts in a
299   * window might send progress and status messages for the new site, but it
300   * will not send the onLocationChange until we are sure that we are loading
301   * this new page here.
302   *
303   * @param aWebProgress
304   *        The nsIWebProgress instance that fired the notification.
305   * @param aRequest
306   *        The associated nsIRequest.  This may be null in some cases.
307   * @param aLocation
308   *        The URI of the location that is being loaded.
309   */
310  /* void onLocationChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in nsIURI aLocation); */
311  NS_SCRIPTABLE NS_IMETHOD OnLocationChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, nsIURI *aLocation) = 0;
312
313  /**
314   * Notification that the status of a request has changed.  The status message
315   * is intended to be displayed to the user (e.g., in the status bar of the
316   * browser).
317   *
318   * @param aWebProgress
319   *        The nsIWebProgress instance that fired the notification.
320   * @param aRequest
321   *        The nsIRequest that has new status.
322   * @param aStatus
323   *        This value is not an error code.  Instead, it is a numeric value
324   *        that indicates the current status of the request.  This interface
325   *        does not define the set of possible status codes.  NOTE: Some
326   *        status values are defined by nsITransport and nsISocketTransport.
327   * @param aMessage
328   *        Localized text corresponding to aStatus.
329   */
330  /* void onStatusChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in nsresult aStatus, in wstring aMessage); */
331  NS_SCRIPTABLE NS_IMETHOD OnStatusChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, nsresult aStatus, const PRUnichar *aMessage) = 0;
332
333  /**
334   * Notification called for security progress.  This method will be called on
335   * security transitions (eg HTTP -> HTTPS, HTTPS -> HTTP, FOO -> HTTPS) and
336   * after document load completion.  It might also be called if an error
337   * occurs during network loading.
338   *
339   * @param aWebProgress
340   *        The nsIWebProgress instance that fired the notification.
341   * @param aRequest
342   *        The nsIRequest that has new security state.
343   * @param aState
344   *        A value composed of the Security State Flags and the Security
345   *        Strength Flags listed above.  Any undefined bits are reserved for
346   *        future use.
347   *
348   * NOTE: These notifications will only occur if a security package is
349   * installed.
350   */
351  /* void onSecurityChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in unsigned long aState); */
352  NS_SCRIPTABLE NS_IMETHOD OnSecurityChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRUint32 aState) = 0;
353
354};
355
356  NS_DEFINE_STATIC_IID_ACCESSOR(nsIWebProgressListener, NS_IWEBPROGRESSLISTENER_IID)
357
358/* Use this macro when declaring classes that implement this interface. */
359#define NS_DECL_NSIWEBPROGRESSLISTENER \
360  NS_SCRIPTABLE NS_IMETHOD OnStateChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRUint32 aStateFlags, nsresult aStatus); \
361  NS_SCRIPTABLE NS_IMETHOD OnProgressChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRInt32 aCurSelfProgress, PRInt32 aMaxSelfProgress, PRInt32 aCurTotalProgress, PRInt32 aMaxTotalProgress); \
362  NS_SCRIPTABLE NS_IMETHOD OnLocationChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, nsIURI *aLocation); \
363  NS_SCRIPTABLE NS_IMETHOD OnStatusChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, nsresult aStatus, const PRUnichar *aMessage); \
364  NS_SCRIPTABLE NS_IMETHOD OnSecurityChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRUint32 aState); 
365
366/* Use this macro to declare functions that forward the behavior of this interface to another object. */
367#define NS_FORWARD_NSIWEBPROGRESSLISTENER(_to) \
368  NS_SCRIPTABLE NS_IMETHOD OnStateChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRUint32 aStateFlags, nsresult aStatus) { return _to OnStateChange(aWebProgress, aRequest, aStateFlags, aStatus); } \
369  NS_SCRIPTABLE NS_IMETHOD OnProgressChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRInt32 aCurSelfProgress, PRInt32 aMaxSelfProgress, PRInt32 aCurTotalProgress, PRInt32 aMaxTotalProgress) { return _to OnProgressChange(aWebProgress, aRequest, aCurSelfProgress, aMaxSelfProgress, aCurTotalProgress, aMaxTotalProgress); } \
370  NS_SCRIPTABLE NS_IMETHOD OnLocationChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, nsIURI *aLocation) { return _to OnLocationChange(aWebProgress, aRequest, aLocation); } \
371  NS_SCRIPTABLE NS_IMETHOD OnStatusChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, nsresult aStatus, const PRUnichar *aMessage) { return _to OnStatusChange(aWebProgress, aRequest, aStatus, aMessage); } \
372  NS_SCRIPTABLE NS_IMETHOD OnSecurityChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRUint32 aState) { return _to OnSecurityChange(aWebProgress, aRequest, aState); } 
373
374/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
375#define NS_FORWARD_SAFE_NSIWEBPROGRESSLISTENER(_to) \
376  NS_SCRIPTABLE NS_IMETHOD OnStateChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRUint32 aStateFlags, nsresult aStatus) { return !_to ? NS_ERROR_NULL_POINTER : _to->OnStateChange(aWebProgress, aRequest, aStateFlags, aStatus); } \
377  NS_SCRIPTABLE NS_IMETHOD OnProgressChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRInt32 aCurSelfProgress, PRInt32 aMaxSelfProgress, PRInt32 aCurTotalProgress, PRInt32 aMaxTotalProgress) { return !_to ? NS_ERROR_NULL_POINTER : _to->OnProgressChange(aWebProgress, aRequest, aCurSelfProgress, aMaxSelfProgress, aCurTotalProgress, aMaxTotalProgress); } \
378  NS_SCRIPTABLE NS_IMETHOD OnLocationChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, nsIURI *aLocation) { return !_to ? NS_ERROR_NULL_POINTER : _to->OnLocationChange(aWebProgress, aRequest, aLocation); } \
379  NS_SCRIPTABLE NS_IMETHOD OnStatusChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, nsresult aStatus, const PRUnichar *aMessage) { return !_to ? NS_ERROR_NULL_POINTER : _to->OnStatusChange(aWebProgress, aRequest, aStatus, aMessage); } \
380  NS_SCRIPTABLE NS_IMETHOD OnSecurityChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRUint32 aState) { return !_to ? NS_ERROR_NULL_POINTER : _to->OnSecurityChange(aWebProgress, aRequest, aState); } 
381
382#if 0
383/* Use the code below as a template for the implementation class for this interface. */
384
385/* Header file */
386class nsWebProgressListener : public nsIWebProgressListener
387{
388public:
389  NS_DECL_ISUPPORTS
390  NS_DECL_NSIWEBPROGRESSLISTENER
391
392  nsWebProgressListener();
393
394private:
395  ~nsWebProgressListener();
396
397protected:
398  /* additional members */
399};
400
401/* Implementation file */
402NS_IMPL_ISUPPORTS1(nsWebProgressListener, nsIWebProgressListener)
403
404nsWebProgressListener::nsWebProgressListener()
405{
406  /* member initializers and constructor code */
407}
408
409nsWebProgressListener::~nsWebProgressListener()
410{
411  /* destructor code */
412}
413
414/* void onStateChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in unsigned long aStateFlags, in nsresult aStatus); */
415NS_IMETHODIMP nsWebProgressListener::OnStateChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRUint32 aStateFlags, nsresult aStatus)
416{
417    return NS_ERROR_NOT_IMPLEMENTED;
418}
419
420/* void onProgressChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in long aCurSelfProgress, in long aMaxSelfProgress, in long aCurTotalProgress, in long aMaxTotalProgress); */
421NS_IMETHODIMP nsWebProgressListener::OnProgressChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRInt32 aCurSelfProgress, PRInt32 aMaxSelfProgress, PRInt32 aCurTotalProgress, PRInt32 aMaxTotalProgress)
422{
423    return NS_ERROR_NOT_IMPLEMENTED;
424}
425
426/* void onLocationChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in nsIURI aLocation); */
427NS_IMETHODIMP nsWebProgressListener::OnLocationChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, nsIURI *aLocation)
428{
429    return NS_ERROR_NOT_IMPLEMENTED;
430}
431
432/* void onStatusChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in nsresult aStatus, in wstring aMessage); */
433NS_IMETHODIMP nsWebProgressListener::OnStatusChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, nsresult aStatus, const PRUnichar *aMessage)
434{
435    return NS_ERROR_NOT_IMPLEMENTED;
436}
437
438/* void onSecurityChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in unsigned long aState); */
439NS_IMETHODIMP nsWebProgressListener::OnSecurityChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRUint32 aState)
440{
441    return NS_ERROR_NOT_IMPLEMENTED;
442}
443
444/* End of implementation class template. */
445#endif
446
447
448#endif /* __gen_nsIWebProgressListener_h__ */