PageRenderTime 47ms CodeModel.GetById 23ms RepoModel.GetById 1ms app.codeStats 0ms

/gecko_api/include/nsIWebProgress.h

http://firefox-mac-pdf.googlecode.com/
C Header | 258 lines | 85 code | 45 blank | 128 comment | 0 complexity | 72e11d72276d082698550e33868a17d0 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/nsIWebProgress.idl
  3. */
  4. #ifndef __gen_nsIWebProgress_h__
  5. #define __gen_nsIWebProgress_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 nsIDOMWindow; /* forward declaration */
  14. class nsIWebProgressListener; /* forward declaration */
  15. /* starting interface: nsIWebProgress */
  16. #define NS_IWEBPROGRESS_IID_STR "570f39d0-efd0-11d3-b093-00a024ffc08c"
  17. #define NS_IWEBPROGRESS_IID \
  18. {0x570f39d0, 0xefd0, 0x11d3, \
  19. { 0xb0, 0x93, 0x00, 0xa0, 0x24, 0xff, 0xc0, 0x8c }}
  20. /**
  21. * The nsIWebProgress interface is used to add or remove nsIWebProgressListener
  22. * instances to observe the loading of asynchronous requests (usually in the
  23. * context of a DOM window).
  24. *
  25. * nsIWebProgress instances may be arranged in a parent-child configuration,
  26. * corresponding to the parent-child configuration of their respective DOM
  27. * windows. However, in some cases a nsIWebProgress instance may not have an
  28. * associated DOM window. The parent-child relationship of nsIWebProgress
  29. * instances is not made explicit by this interface, but the relationship may
  30. * exist in some implementations.
  31. *
  32. * A nsIWebProgressListener instance receives notifications for the
  33. * nsIWebProgress instance to which it added itself, and it may also receive
  34. * notifications from any nsIWebProgress instances that are children of that
  35. * nsIWebProgress instance.
  36. *
  37. * @status FROZEN
  38. */
  39. class NS_NO_VTABLE NS_SCRIPTABLE nsIWebProgress : public nsISupports {
  40. public:
  41. NS_DECLARE_STATIC_IID_ACCESSOR(NS_IWEBPROGRESS_IID)
  42. /**
  43. * The following flags may be combined to form the aNotifyMask parameter for
  44. * the addProgressListener method. They limit the set of events that are
  45. * delivered to an nsIWebProgressListener instance.
  46. */
  47. /**
  48. * These flags indicate the state transistions to observe, corresponding to
  49. * nsIWebProgressListener::onStateChange.
  50. *
  51. * NOTIFY_STATE_REQUEST
  52. * Only receive the onStateChange event if the aStateFlags parameter
  53. * includes nsIWebProgressListener::STATE_IS_REQUEST.
  54. *
  55. * NOTIFY_STATE_DOCUMENT
  56. * Only receive the onStateChange event if the aStateFlags parameter
  57. * includes nsIWebProgressListener::STATE_IS_DOCUMENT.
  58. *
  59. * NOTIFY_STATE_NETWORK
  60. * Only receive the onStateChange event if the aStateFlags parameter
  61. * includes nsIWebProgressListener::STATE_IS_NETWORK.
  62. *
  63. * NOTIFY_STATE_WINDOW
  64. * Only receive the onStateChange event if the aStateFlags parameter
  65. * includes nsIWebProgressListener::STATE_IS_WINDOW.
  66. *
  67. * NOTIFY_STATE_ALL
  68. * Receive all onStateChange events.
  69. */
  70. enum { NOTIFY_STATE_REQUEST = 1U };
  71. enum { NOTIFY_STATE_DOCUMENT = 2U };
  72. enum { NOTIFY_STATE_NETWORK = 4U };
  73. enum { NOTIFY_STATE_WINDOW = 8U };
  74. enum { NOTIFY_STATE_ALL = 15U };
  75. /**
  76. * These flags indicate the other events to observe, corresponding to the
  77. * other four methods defined on nsIWebProgressListener.
  78. *
  79. * NOTIFY_PROGRESS
  80. * Receive onProgressChange events.
  81. *
  82. * NOTIFY_STATUS
  83. * Receive onStatusChange events.
  84. *
  85. * NOTIFY_SECURITY
  86. * Receive onSecurityChange events.
  87. *
  88. * NOTIFY_LOCATION
  89. * Receive onLocationChange events.
  90. *
  91. * NOTIFY_REFRESH
  92. * Receive onRefreshAttempted events.
  93. * This is defined on nsIWebProgressListener2.
  94. */
  95. enum { NOTIFY_PROGRESS = 16U };
  96. enum { NOTIFY_STATUS = 32U };
  97. enum { NOTIFY_SECURITY = 64U };
  98. enum { NOTIFY_LOCATION = 128U };
  99. enum { NOTIFY_REFRESH = 256U };
  100. /**
  101. * This flag enables all notifications.
  102. */
  103. enum { NOTIFY_ALL = 511U };
  104. /**
  105. * Registers a listener to receive web progress events.
  106. *
  107. * @param aListener
  108. * The listener interface to be called when a progress event occurs.
  109. * This object must also implement nsISupportsWeakReference.
  110. * @param aNotifyMask
  111. * The types of notifications to receive.
  112. *
  113. * @throw NS_ERROR_INVALID_ARG
  114. * Indicates that aListener was either null or that it does not
  115. * support weak references.
  116. * @throw NS_ERROR_FAILURE
  117. * Indicates that aListener was already registered.
  118. */
  119. /* void addProgressListener (in nsIWebProgressListener aListener, in unsigned long aNotifyMask); */
  120. NS_SCRIPTABLE NS_IMETHOD AddProgressListener(nsIWebProgressListener *aListener, PRUint32 aNotifyMask) = 0;
  121. /**
  122. * Removes a previously registered listener of progress events.
  123. *
  124. * @param aListener
  125. * The listener interface previously registered with a call to
  126. * addProgressListener.
  127. *
  128. * @throw NS_ERROR_FAILURE
  129. * Indicates that aListener was not registered.
  130. */
  131. /* void removeProgressListener (in nsIWebProgressListener aListener); */
  132. NS_SCRIPTABLE NS_IMETHOD RemoveProgressListener(nsIWebProgressListener *aListener) = 0;
  133. /**
  134. * The DOM window associated with this nsIWebProgress instance.
  135. *
  136. * @throw NS_ERROR_FAILURE
  137. * Indicates that there is no associated DOM window.
  138. */
  139. /* readonly attribute nsIDOMWindow DOMWindow; */
  140. NS_SCRIPTABLE NS_IMETHOD GetDOMWindow(nsIDOMWindow * *aDOMWindow) = 0;
  141. /**
  142. * Indicates whether or not a document is currently being loaded
  143. * in the context of this nsIWebProgress instance.
  144. */
  145. /* readonly attribute PRBool isLoadingDocument; */
  146. NS_SCRIPTABLE NS_IMETHOD GetIsLoadingDocument(PRBool *aIsLoadingDocument) = 0;
  147. };
  148. NS_DEFINE_STATIC_IID_ACCESSOR(nsIWebProgress, NS_IWEBPROGRESS_IID)
  149. /* Use this macro when declaring classes that implement this interface. */
  150. #define NS_DECL_NSIWEBPROGRESS \
  151. NS_SCRIPTABLE NS_IMETHOD AddProgressListener(nsIWebProgressListener *aListener, PRUint32 aNotifyMask); \
  152. NS_SCRIPTABLE NS_IMETHOD RemoveProgressListener(nsIWebProgressListener *aListener); \
  153. NS_SCRIPTABLE NS_IMETHOD GetDOMWindow(nsIDOMWindow * *aDOMWindow); \
  154. NS_SCRIPTABLE NS_IMETHOD GetIsLoadingDocument(PRBool *aIsLoadingDocument);
  155. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  156. #define NS_FORWARD_NSIWEBPROGRESS(_to) \
  157. NS_SCRIPTABLE NS_IMETHOD AddProgressListener(nsIWebProgressListener *aListener, PRUint32 aNotifyMask) { return _to AddProgressListener(aListener, aNotifyMask); } \
  158. NS_SCRIPTABLE NS_IMETHOD RemoveProgressListener(nsIWebProgressListener *aListener) { return _to RemoveProgressListener(aListener); } \
  159. NS_SCRIPTABLE NS_IMETHOD GetDOMWindow(nsIDOMWindow * *aDOMWindow) { return _to GetDOMWindow(aDOMWindow); } \
  160. NS_SCRIPTABLE NS_IMETHOD GetIsLoadingDocument(PRBool *aIsLoadingDocument) { return _to GetIsLoadingDocument(aIsLoadingDocument); }
  161. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  162. #define NS_FORWARD_SAFE_NSIWEBPROGRESS(_to) \
  163. NS_SCRIPTABLE NS_IMETHOD AddProgressListener(nsIWebProgressListener *aListener, PRUint32 aNotifyMask) { return !_to ? NS_ERROR_NULL_POINTER : _to->AddProgressListener(aListener, aNotifyMask); } \
  164. NS_SCRIPTABLE NS_IMETHOD RemoveProgressListener(nsIWebProgressListener *aListener) { return !_to ? NS_ERROR_NULL_POINTER : _to->RemoveProgressListener(aListener); } \
  165. NS_SCRIPTABLE NS_IMETHOD GetDOMWindow(nsIDOMWindow * *aDOMWindow) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetDOMWindow(aDOMWindow); } \
  166. NS_SCRIPTABLE NS_IMETHOD GetIsLoadingDocument(PRBool *aIsLoadingDocument) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetIsLoadingDocument(aIsLoadingDocument); }
  167. #if 0
  168. /* Use the code below as a template for the implementation class for this interface. */
  169. /* Header file */
  170. class nsWebProgress : public nsIWebProgress
  171. {
  172. public:
  173. NS_DECL_ISUPPORTS
  174. NS_DECL_NSIWEBPROGRESS
  175. nsWebProgress();
  176. private:
  177. ~nsWebProgress();
  178. protected:
  179. /* additional members */
  180. };
  181. /* Implementation file */
  182. NS_IMPL_ISUPPORTS1(nsWebProgress, nsIWebProgress)
  183. nsWebProgress::nsWebProgress()
  184. {
  185. /* member initializers and constructor code */
  186. }
  187. nsWebProgress::~nsWebProgress()
  188. {
  189. /* destructor code */
  190. }
  191. /* void addProgressListener (in nsIWebProgressListener aListener, in unsigned long aNotifyMask); */
  192. NS_IMETHODIMP nsWebProgress::AddProgressListener(nsIWebProgressListener *aListener, PRUint32 aNotifyMask)
  193. {
  194. return NS_ERROR_NOT_IMPLEMENTED;
  195. }
  196. /* void removeProgressListener (in nsIWebProgressListener aListener); */
  197. NS_IMETHODIMP nsWebProgress::RemoveProgressListener(nsIWebProgressListener *aListener)
  198. {
  199. return NS_ERROR_NOT_IMPLEMENTED;
  200. }
  201. /* readonly attribute nsIDOMWindow DOMWindow; */
  202. NS_IMETHODIMP nsWebProgress::GetDOMWindow(nsIDOMWindow * *aDOMWindow)
  203. {
  204. return NS_ERROR_NOT_IMPLEMENTED;
  205. }
  206. /* readonly attribute PRBool isLoadingDocument; */
  207. NS_IMETHODIMP nsWebProgress::GetIsLoadingDocument(PRBool *aIsLoadingDocument)
  208. {
  209. return NS_ERROR_NOT_IMPLEMENTED;
  210. }
  211. /* End of implementation class template. */
  212. #endif
  213. #endif /* __gen_nsIWebProgress_h__ */