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