PageRenderTime 8768ms CodeModel.GetById 38ms RepoModel.GetById 40ms app.codeStats 0ms

/gecko_sdk/idl/nsIWebProgress.idl

http://firefox-mac-pdf.googlecode.com/
IDL | 178 lines | 23 code | 10 blank | 145 comment | 0 complexity | 5364357c34bc7d8af0b918fcc871cfef MD5 | raw file
  1. /* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  2. *
  3. * ***** BEGIN LICENSE BLOCK *****
  4. * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  5. *
  6. * The contents of this file are subject to the Mozilla Public License Version
  7. * 1.1 (the "License"); you may not use this file except in compliance with
  8. * the License. You may obtain a copy of the License at
  9. * http://www.mozilla.org/MPL/
  10. *
  11. * Software distributed under the License is distributed on an "AS IS" basis,
  12. * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  13. * for the specific language governing rights and limitations under the
  14. * License.
  15. *
  16. * The Original Code is the Mozilla browser.
  17. *
  18. * The Initial Developer of the Original Code is
  19. * Netscape Communications, Inc.
  20. * Portions created by the Initial Developer are Copyright (C) 1999
  21. * the Initial Developer. All Rights Reserved.
  22. *
  23. * Contributor(s):
  24. * Travis Bogard <travis@netscape.com>
  25. * Darin Fisher <darin@meer.net>
  26. * Mark Pilgrim <pilgrim@gmail.com>
  27. *
  28. * Alternatively, the contents of this file may be used under the terms of
  29. * either of the GNU General Public License Version 2 or later (the "GPL"),
  30. * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  31. * in which case the provisions of the GPL or the LGPL are applicable instead
  32. * of those above. If you wish to allow use of your version of this file only
  33. * under the terms of either the GPL or the LGPL, and not to allow others to
  34. * use your version of this file under the terms of the MPL, indicate your
  35. * decision by deleting the provisions above and replace them with the notice
  36. * and other provisions required by the GPL or the LGPL. If you do not delete
  37. * the provisions above, a recipient may use your version of this file under
  38. * the terms of any one of the MPL, the GPL or the LGPL.
  39. *
  40. * ***** END LICENSE BLOCK ***** */
  41. #include "nsISupports.idl"
  42. interface nsIDOMWindow;
  43. interface nsIWebProgressListener;
  44. /**
  45. * The nsIWebProgress interface is used to add or remove nsIWebProgressListener
  46. * instances to observe the loading of asynchronous requests (usually in the
  47. * context of a DOM window).
  48. *
  49. * nsIWebProgress instances may be arranged in a parent-child configuration,
  50. * corresponding to the parent-child configuration of their respective DOM
  51. * windows. However, in some cases a nsIWebProgress instance may not have an
  52. * associated DOM window. The parent-child relationship of nsIWebProgress
  53. * instances is not made explicit by this interface, but the relationship may
  54. * exist in some implementations.
  55. *
  56. * A nsIWebProgressListener instance receives notifications for the
  57. * nsIWebProgress instance to which it added itself, and it may also receive
  58. * notifications from any nsIWebProgress instances that are children of that
  59. * nsIWebProgress instance.
  60. *
  61. * @status FROZEN
  62. */
  63. [scriptable, uuid(570F39D0-EFD0-11d3-B093-00A024FFC08C)]
  64. interface nsIWebProgress : nsISupports
  65. {
  66. /**
  67. * The following flags may be combined to form the aNotifyMask parameter for
  68. * the addProgressListener method. They limit the set of events that are
  69. * delivered to an nsIWebProgressListener instance.
  70. */
  71. /**
  72. * These flags indicate the state transistions to observe, corresponding to
  73. * nsIWebProgressListener::onStateChange.
  74. *
  75. * NOTIFY_STATE_REQUEST
  76. * Only receive the onStateChange event if the aStateFlags parameter
  77. * includes nsIWebProgressListener::STATE_IS_REQUEST.
  78. *
  79. * NOTIFY_STATE_DOCUMENT
  80. * Only receive the onStateChange event if the aStateFlags parameter
  81. * includes nsIWebProgressListener::STATE_IS_DOCUMENT.
  82. *
  83. * NOTIFY_STATE_NETWORK
  84. * Only receive the onStateChange event if the aStateFlags parameter
  85. * includes nsIWebProgressListener::STATE_IS_NETWORK.
  86. *
  87. * NOTIFY_STATE_WINDOW
  88. * Only receive the onStateChange event if the aStateFlags parameter
  89. * includes nsIWebProgressListener::STATE_IS_WINDOW.
  90. *
  91. * NOTIFY_STATE_ALL
  92. * Receive all onStateChange events.
  93. */
  94. const unsigned long NOTIFY_STATE_REQUEST = 0x00000001;
  95. const unsigned long NOTIFY_STATE_DOCUMENT = 0x00000002;
  96. const unsigned long NOTIFY_STATE_NETWORK = 0x00000004;
  97. const unsigned long NOTIFY_STATE_WINDOW = 0x00000008;
  98. const unsigned long NOTIFY_STATE_ALL = 0x0000000f;
  99. /**
  100. * These flags indicate the other events to observe, corresponding to the
  101. * other four methods defined on nsIWebProgressListener.
  102. *
  103. * NOTIFY_PROGRESS
  104. * Receive onProgressChange events.
  105. *
  106. * NOTIFY_STATUS
  107. * Receive onStatusChange events.
  108. *
  109. * NOTIFY_SECURITY
  110. * Receive onSecurityChange events.
  111. *
  112. * NOTIFY_LOCATION
  113. * Receive onLocationChange events.
  114. *
  115. * NOTIFY_REFRESH
  116. * Receive onRefreshAttempted events.
  117. * This is defined on nsIWebProgressListener2.
  118. */
  119. const unsigned long NOTIFY_PROGRESS = 0x00000010;
  120. const unsigned long NOTIFY_STATUS = 0x00000020;
  121. const unsigned long NOTIFY_SECURITY = 0x00000040;
  122. const unsigned long NOTIFY_LOCATION = 0x00000080;
  123. const unsigned long NOTIFY_REFRESH = 0x00000100;
  124. /**
  125. * This flag enables all notifications.
  126. */
  127. const unsigned long NOTIFY_ALL = 0x000001ff;
  128. /**
  129. * Registers a listener to receive web progress events.
  130. *
  131. * @param aListener
  132. * The listener interface to be called when a progress event occurs.
  133. * This object must also implement nsISupportsWeakReference.
  134. * @param aNotifyMask
  135. * The types of notifications to receive.
  136. *
  137. * @throw NS_ERROR_INVALID_ARG
  138. * Indicates that aListener was either null or that it does not
  139. * support weak references.
  140. * @throw NS_ERROR_FAILURE
  141. * Indicates that aListener was already registered.
  142. */
  143. void addProgressListener(in nsIWebProgressListener aListener,
  144. in unsigned long aNotifyMask);
  145. /**
  146. * Removes a previously registered listener of progress events.
  147. *
  148. * @param aListener
  149. * The listener interface previously registered with a call to
  150. * addProgressListener.
  151. *
  152. * @throw NS_ERROR_FAILURE
  153. * Indicates that aListener was not registered.
  154. */
  155. void removeProgressListener(in nsIWebProgressListener aListener);
  156. /**
  157. * The DOM window associated with this nsIWebProgress instance.
  158. *
  159. * @throw NS_ERROR_FAILURE
  160. * Indicates that there is no associated DOM window.
  161. */
  162. readonly attribute nsIDOMWindow DOMWindow;
  163. /**
  164. * Indicates whether or not a document is currently being loaded
  165. * in the context of this nsIWebProgress instance.
  166. */
  167. readonly attribute PRBool isLoadingDocument;
  168. };