PageRenderTime 46ms CodeModel.GetById 11ms RepoModel.GetById 1ms app.codeStats 0ms

/mozilla/mozilla/dist/include/uriloader/nsIWebProgressListener.h

http://kmbrasil.codeplex.com
C++ Header | 434 lines | 98 code | 52 blank | 284 comment | 0 complexity | 48da960080ffad82a2ef0532803d3af3 MD5 | raw file
Possible License(s): MPL-2.0-no-copyleft-exception, GPL-2.0
  1. /*
  2. * DO NOT EDIT. THIS FILE IS GENERATED FROM h:/projects/mozilla/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 nsIWebProgressListener : public nsISupports {
  31. public:
  32. NS_DEFINE_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. * Notification indicating the state has changed for one of the requests
  202. * associated with aWebProgress.
  203. *
  204. * @param aWebProgress
  205. * The nsIWebProgress instance that fired the notification
  206. * @param aRequest
  207. * The nsIRequest that has changed state.
  208. * @param aStateFlags
  209. * Flags indicating the new state. This value is a combination of one
  210. * of the State Transition Flags and one or more of the State Type
  211. * Flags defined above. Any undefined bits are reserved for future
  212. * use.
  213. * @param aStatus
  214. * Error status code associated with the state change. This parameter
  215. * should be ignored unless aStateFlags includes the STATE_STOP bit.
  216. * The status code indicates success or failure of the request
  217. * associated with the state change. NOTE: aStatus may be a success
  218. * code even for server generated errors, such as the HTTP 404 error.
  219. * In such cases, the request itself should be queried for extended
  220. * error information (e.g., for HTTP requests see nsIHttpChannel).
  221. */
  222. /* void onStateChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in unsigned long aStateFlags, in nsresult aStatus); */
  223. NS_IMETHOD OnStateChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRUint32 aStateFlags, nsresult aStatus) = 0;
  224. /**
  225. * Notification that the progress has changed for one of the requests
  226. * associated with aWebProgress. Progress totals are reset to zero when all
  227. * requests in aWebProgress complete (corresponding to onStateChange being
  228. * called with aStateFlags including the STATE_STOP and STATE_IS_WINDOW
  229. * flags).
  230. *
  231. * @param aWebProgress
  232. * The nsIWebProgress instance that fired the notification.
  233. * @param aRequest
  234. * The nsIRequest that has new progress.
  235. * @param aCurSelfProgress
  236. * The current progress for aRequest.
  237. * @param aMaxSelfProgress
  238. * The maximum progress for aRequest.
  239. * @param aCurTotalProgress
  240. * The current progress for all requests associated with aWebProgress.
  241. * @param aMaxTotalProgress
  242. * The total progress for all requests associated with aWebProgress.
  243. *
  244. * NOTE: If any progress value is unknown, or if its value would exceed the
  245. * maximum value of type long, then its value is replaced with -1.
  246. *
  247. * NOTE: If the object also implements nsIWebProgressListener2 and the caller
  248. * knows about that interface, this function will not be called. Instead,
  249. * nsIWebProgressListener2::onProgressChange64 will be called.
  250. */
  251. /* void onProgressChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in long aCurSelfProgress, in long aMaxSelfProgress, in long aCurTotalProgress, in long aMaxTotalProgress); */
  252. NS_IMETHOD OnProgressChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRInt32 aCurSelfProgress, PRInt32 aMaxSelfProgress, PRInt32 aCurTotalProgress, PRInt32 aMaxTotalProgress) = 0;
  253. /**
  254. * Called when the location of the window being watched changes. This is not
  255. * when a load is requested, but rather once it is verified that the load is
  256. * going to occur in the given window. For instance, a load that starts in a
  257. * window might send progress and status messages for the new site, but it
  258. * will not send the onLocationChange until we are sure that we are loading
  259. * this new page here.
  260. *
  261. * @param aWebProgress
  262. * The nsIWebProgress instance that fired the notification.
  263. * @param aRequest
  264. * The associated nsIRequest. This may be null in some cases.
  265. * @param aLocation
  266. * The URI of the location that is being loaded.
  267. */
  268. /* void onLocationChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in nsIURI aLocation); */
  269. NS_IMETHOD OnLocationChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, nsIURI *aLocation) = 0;
  270. /**
  271. * Notification that the status of a request has changed. The status message
  272. * is intended to be displayed to the user (e.g., in the status bar of the
  273. * browser).
  274. *
  275. * @param aWebProgress
  276. * The nsIWebProgress instance that fired the notification.
  277. * @param aRequest
  278. * The nsIRequest that has new status.
  279. * @param aStatus
  280. * This value is not an error code. Instead, it is a numeric value
  281. * that indicates the current status of the request. This interface
  282. * does not define the set of possible status codes. NOTE: Some
  283. * status values are defined by nsITransport and nsISocketTransport.
  284. * @param aMessage
  285. * Localized text corresponding to aStatus.
  286. */
  287. /* void onStatusChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in nsresult aStatus, in wstring aMessage); */
  288. NS_IMETHOD OnStatusChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, nsresult aStatus, const PRUnichar *aMessage) = 0;
  289. /**
  290. * Notification called for security progress. This method will be called on
  291. * security transitions (eg HTTP -> HTTPS, HTTPS -> HTTP, FOO -> HTTPS) and
  292. * after document load completion. It might also be called if an error
  293. * occurs during network loading.
  294. *
  295. * @param aWebProgress
  296. * The nsIWebProgress instance that fired the notification.
  297. * @param aRequest
  298. * The nsIRequest that has new security state.
  299. * @param aState
  300. * A value composed of the Security State Flags and the Security
  301. * Strength Flags listed above. Any undefined bits are reserved for
  302. * future use.
  303. *
  304. * NOTE: These notifications will only occur if a security package is
  305. * installed.
  306. */
  307. /* void onSecurityChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in unsigned long aState); */
  308. NS_IMETHOD OnSecurityChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRUint32 aState) = 0;
  309. };
  310. /* Use this macro when declaring classes that implement this interface. */
  311. #define NS_DECL_NSIWEBPROGRESSLISTENER \
  312. NS_IMETHOD OnStateChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRUint32 aStateFlags, nsresult aStatus); \
  313. NS_IMETHOD OnProgressChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRInt32 aCurSelfProgress, PRInt32 aMaxSelfProgress, PRInt32 aCurTotalProgress, PRInt32 aMaxTotalProgress); \
  314. NS_IMETHOD OnLocationChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, nsIURI *aLocation); \
  315. NS_IMETHOD OnStatusChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, nsresult aStatus, const PRUnichar *aMessage); \
  316. NS_IMETHOD OnSecurityChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRUint32 aState);
  317. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  318. #define NS_FORWARD_NSIWEBPROGRESSLISTENER(_to) \
  319. NS_IMETHOD OnStateChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRUint32 aStateFlags, nsresult aStatus) { return _to OnStateChange(aWebProgress, aRequest, aStateFlags, aStatus); } \
  320. NS_IMETHOD OnProgressChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRInt32 aCurSelfProgress, PRInt32 aMaxSelfProgress, PRInt32 aCurTotalProgress, PRInt32 aMaxTotalProgress) { return _to OnProgressChange(aWebProgress, aRequest, aCurSelfProgress, aMaxSelfProgress, aCurTotalProgress, aMaxTotalProgress); } \
  321. NS_IMETHOD OnLocationChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, nsIURI *aLocation) { return _to OnLocationChange(aWebProgress, aRequest, aLocation); } \
  322. NS_IMETHOD OnStatusChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, nsresult aStatus, const PRUnichar *aMessage) { return _to OnStatusChange(aWebProgress, aRequest, aStatus, aMessage); } \
  323. NS_IMETHOD OnSecurityChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRUint32 aState) { return _to OnSecurityChange(aWebProgress, aRequest, aState); }
  324. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  325. #define NS_FORWARD_SAFE_NSIWEBPROGRESSLISTENER(_to) \
  326. NS_IMETHOD OnStateChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRUint32 aStateFlags, nsresult aStatus) { return !_to ? NS_ERROR_NULL_POINTER : _to->OnStateChange(aWebProgress, aRequest, aStateFlags, aStatus); } \
  327. 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); } \
  328. NS_IMETHOD OnLocationChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, nsIURI *aLocation) { return !_to ? NS_ERROR_NULL_POINTER : _to->OnLocationChange(aWebProgress, aRequest, aLocation); } \
  329. NS_IMETHOD OnStatusChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, nsresult aStatus, const PRUnichar *aMessage) { return !_to ? NS_ERROR_NULL_POINTER : _to->OnStatusChange(aWebProgress, aRequest, aStatus, aMessage); } \
  330. NS_IMETHOD OnSecurityChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRUint32 aState) { return !_to ? NS_ERROR_NULL_POINTER : _to->OnSecurityChange(aWebProgress, aRequest, aState); }
  331. #if 0
  332. /* Use the code below as a template for the implementation class for this interface. */
  333. /* Header file */
  334. class nsWebProgressListener : public nsIWebProgressListener
  335. {
  336. public:
  337. NS_DECL_ISUPPORTS
  338. NS_DECL_NSIWEBPROGRESSLISTENER
  339. nsWebProgressListener();
  340. private:
  341. ~nsWebProgressListener();
  342. protected:
  343. /* additional members */
  344. };
  345. /* Implementation file */
  346. NS_IMPL_ISUPPORTS1(nsWebProgressListener, nsIWebProgressListener)
  347. nsWebProgressListener::nsWebProgressListener()
  348. {
  349. /* member initializers and constructor code */
  350. }
  351. nsWebProgressListener::~nsWebProgressListener()
  352. {
  353. /* destructor code */
  354. }
  355. /* void onStateChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in unsigned long aStateFlags, in nsresult aStatus); */
  356. NS_IMETHODIMP nsWebProgressListener::OnStateChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRUint32 aStateFlags, nsresult aStatus)
  357. {
  358. return NS_ERROR_NOT_IMPLEMENTED;
  359. }
  360. /* void onProgressChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in long aCurSelfProgress, in long aMaxSelfProgress, in long aCurTotalProgress, in long aMaxTotalProgress); */
  361. NS_IMETHODIMP nsWebProgressListener::OnProgressChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRInt32 aCurSelfProgress, PRInt32 aMaxSelfProgress, PRInt32 aCurTotalProgress, PRInt32 aMaxTotalProgress)
  362. {
  363. return NS_ERROR_NOT_IMPLEMENTED;
  364. }
  365. /* void onLocationChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in nsIURI aLocation); */
  366. NS_IMETHODIMP nsWebProgressListener::OnLocationChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, nsIURI *aLocation)
  367. {
  368. return NS_ERROR_NOT_IMPLEMENTED;
  369. }
  370. /* void onStatusChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in nsresult aStatus, in wstring aMessage); */
  371. NS_IMETHODIMP nsWebProgressListener::OnStatusChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, nsresult aStatus, const PRUnichar *aMessage)
  372. {
  373. return NS_ERROR_NOT_IMPLEMENTED;
  374. }
  375. /* void onSecurityChange (in nsIWebProgress aWebProgress, in nsIRequest aRequest, in unsigned long aState); */
  376. NS_IMETHODIMP nsWebProgressListener::OnSecurityChange(nsIWebProgress *aWebProgress, nsIRequest *aRequest, PRUint32 aState)
  377. {
  378. return NS_ERROR_NOT_IMPLEMENTED;
  379. }
  380. /* End of implementation class template. */
  381. #endif
  382. #endif /* __gen_nsIWebProgressListener_h__ */