nsIWebProgress.h 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250
  1. /*
  2. * DO NOT EDIT. THIS FILE IS GENERATED FROM c:/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 nsIWebProgress : public nsISupports {
  40. public:
  41. NS_DEFINE_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. enum { NOTIFY_PROGRESS = 16U };
  92. enum { NOTIFY_STATUS = 32U };
  93. enum { NOTIFY_SECURITY = 64U };
  94. enum { NOTIFY_LOCATION = 128U };
  95. /**
  96. * This flag enables all notifications.
  97. */
  98. enum { NOTIFY_ALL = 255U };
  99. /**
  100. * Registers a listener to receive web progress events.
  101. *
  102. * @param aListener
  103. * The listener interface to be called when a progress event occurs.
  104. * This object must also implement nsISupportsWeakReference.
  105. * @param aNotifyMask
  106. * The types of notifications to receive.
  107. *
  108. * @throw NS_ERROR_INVALID_ARG
  109. * Indicates that aListener was either null or that it does not
  110. * support weak references.
  111. * @throw NS_ERROR_FAILURE
  112. * Indicates that aListener was already registered.
  113. */
  114. /* void addProgressListener (in nsIWebProgressListener aListener, in unsigned long aNotifyMask); */
  115. NS_IMETHOD AddProgressListener(nsIWebProgressListener *aListener, PRUint32 aNotifyMask) = 0;
  116. /**
  117. * Removes a previously registered listener of progress events.
  118. *
  119. * @param aListener
  120. * The listener interface previously registered with a call to
  121. * addProgressListener.
  122. *
  123. * @throw NS_ERROR_FAILURE
  124. * Indicates that aListener was not registered.
  125. */
  126. /* void removeProgressListener (in nsIWebProgressListener aListener); */
  127. NS_IMETHOD RemoveProgressListener(nsIWebProgressListener *aListener) = 0;
  128. /**
  129. * The DOM window associated with this nsIWebProgress instance.
  130. *
  131. * @throw NS_ERROR_FAILURE
  132. * Indicates that there is no associated DOM window.
  133. */
  134. /* readonly attribute nsIDOMWindow DOMWindow; */
  135. NS_IMETHOD GetDOMWindow(nsIDOMWindow * *aDOMWindow) = 0;
  136. /**
  137. * Indicates whether or not a document is currently being loaded
  138. * in the context of this nsIWebProgress instance.
  139. */
  140. /* readonly attribute PRBool isLoadingDocument; */
  141. NS_IMETHOD GetIsLoadingDocument(PRBool *aIsLoadingDocument) = 0;
  142. };
  143. /* Use this macro when declaring classes that implement this interface. */
  144. #define NS_DECL_NSIWEBPROGRESS \
  145. NS_IMETHOD AddProgressListener(nsIWebProgressListener *aListener, PRUint32 aNotifyMask); \
  146. NS_IMETHOD RemoveProgressListener(nsIWebProgressListener *aListener); \
  147. NS_IMETHOD GetDOMWindow(nsIDOMWindow * *aDOMWindow); \
  148. NS_IMETHOD GetIsLoadingDocument(PRBool *aIsLoadingDocument);
  149. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  150. #define NS_FORWARD_NSIWEBPROGRESS(_to) \
  151. NS_IMETHOD AddProgressListener(nsIWebProgressListener *aListener, PRUint32 aNotifyMask) { return _to AddProgressListener(aListener, aNotifyMask); } \
  152. NS_IMETHOD RemoveProgressListener(nsIWebProgressListener *aListener) { return _to RemoveProgressListener(aListener); } \
  153. NS_IMETHOD GetDOMWindow(nsIDOMWindow * *aDOMWindow) { return _to GetDOMWindow(aDOMWindow); } \
  154. NS_IMETHOD GetIsLoadingDocument(PRBool *aIsLoadingDocument) { return _to GetIsLoadingDocument(aIsLoadingDocument); }
  155. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  156. #define NS_FORWARD_SAFE_NSIWEBPROGRESS(_to) \
  157. NS_IMETHOD AddProgressListener(nsIWebProgressListener *aListener, PRUint32 aNotifyMask) { return !_to ? NS_ERROR_NULL_POINTER : _to->AddProgressListener(aListener, aNotifyMask); } \
  158. NS_IMETHOD RemoveProgressListener(nsIWebProgressListener *aListener) { return !_to ? NS_ERROR_NULL_POINTER : _to->RemoveProgressListener(aListener); } \
  159. NS_IMETHOD GetDOMWindow(nsIDOMWindow * *aDOMWindow) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetDOMWindow(aDOMWindow); } \
  160. NS_IMETHOD GetIsLoadingDocument(PRBool *aIsLoadingDocument) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetIsLoadingDocument(aIsLoadingDocument); }
  161. #if 0
  162. /* Use the code below as a template for the implementation class for this interface. */
  163. /* Header file */
  164. class nsWebProgress : public nsIWebProgress
  165. {
  166. public:
  167. NS_DECL_ISUPPORTS
  168. NS_DECL_NSIWEBPROGRESS
  169. nsWebProgress();
  170. private:
  171. ~nsWebProgress();
  172. protected:
  173. /* additional members */
  174. };
  175. /* Implementation file */
  176. NS_IMPL_ISUPPORTS1(nsWebProgress, nsIWebProgress)
  177. nsWebProgress::nsWebProgress()
  178. {
  179. /* member initializers and constructor code */
  180. }
  181. nsWebProgress::~nsWebProgress()
  182. {
  183. /* destructor code */
  184. }
  185. /* void addProgressListener (in nsIWebProgressListener aListener, in unsigned long aNotifyMask); */
  186. NS_IMETHODIMP nsWebProgress::AddProgressListener(nsIWebProgressListener *aListener, PRUint32 aNotifyMask)
  187. {
  188. return NS_ERROR_NOT_IMPLEMENTED;
  189. }
  190. /* void removeProgressListener (in nsIWebProgressListener aListener); */
  191. NS_IMETHODIMP nsWebProgress::RemoveProgressListener(nsIWebProgressListener *aListener)
  192. {
  193. return NS_ERROR_NOT_IMPLEMENTED;
  194. }
  195. /* readonly attribute nsIDOMWindow DOMWindow; */
  196. NS_IMETHODIMP nsWebProgress::GetDOMWindow(nsIDOMWindow * *aDOMWindow)
  197. {
  198. return NS_ERROR_NOT_IMPLEMENTED;
  199. }
  200. /* readonly attribute PRBool isLoadingDocument; */
  201. NS_IMETHODIMP nsWebProgress::GetIsLoadingDocument(PRBool *aIsLoadingDocument)
  202. {
  203. return NS_ERROR_NOT_IMPLEMENTED;
  204. }
  205. /* End of implementation class template. */
  206. #endif
  207. #endif /* __gen_nsIWebProgress_h__ */