1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/uriloader/base/nsIWebProgress.idl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,153 @@ 1.4 +/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- 1.5 + * 1.6 + * This Source Code Form is subject to the terms of the Mozilla Public 1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.8 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.9 + 1.10 +#include "nsISupports.idl" 1.11 + 1.12 +interface nsIDOMWindow; 1.13 +interface nsIWebProgressListener; 1.14 + 1.15 +/** 1.16 + * The nsIWebProgress interface is used to add or remove nsIWebProgressListener 1.17 + * instances to observe the loading of asynchronous requests (usually in the 1.18 + * context of a DOM window). 1.19 + * 1.20 + * nsIWebProgress instances may be arranged in a parent-child configuration, 1.21 + * corresponding to the parent-child configuration of their respective DOM 1.22 + * windows. However, in some cases a nsIWebProgress instance may not have an 1.23 + * associated DOM window. The parent-child relationship of nsIWebProgress 1.24 + * instances is not made explicit by this interface, but the relationship may 1.25 + * exist in some implementations. 1.26 + * 1.27 + * A nsIWebProgressListener instance receives notifications for the 1.28 + * nsIWebProgress instance to which it added itself, and it may also receive 1.29 + * notifications from any nsIWebProgress instances that are children of that 1.30 + * nsIWebProgress instance. 1.31 + */ 1.32 +[scriptable, uuid(bd0efb3b-1c81-4fb0-b16d-576a2be48a95)] 1.33 +interface nsIWebProgress : nsISupports 1.34 +{ 1.35 + /** 1.36 + * The following flags may be combined to form the aNotifyMask parameter for 1.37 + * the addProgressListener method. They limit the set of events that are 1.38 + * delivered to an nsIWebProgressListener instance. 1.39 + */ 1.40 + 1.41 + /** 1.42 + * These flags indicate the state transistions to observe, corresponding to 1.43 + * nsIWebProgressListener::onStateChange. 1.44 + * 1.45 + * NOTIFY_STATE_REQUEST 1.46 + * Only receive the onStateChange event if the aStateFlags parameter 1.47 + * includes nsIWebProgressListener::STATE_IS_REQUEST. 1.48 + * 1.49 + * NOTIFY_STATE_DOCUMENT 1.50 + * Only receive the onStateChange event if the aStateFlags parameter 1.51 + * includes nsIWebProgressListener::STATE_IS_DOCUMENT. 1.52 + * 1.53 + * NOTIFY_STATE_NETWORK 1.54 + * Only receive the onStateChange event if the aStateFlags parameter 1.55 + * includes nsIWebProgressListener::STATE_IS_NETWORK. 1.56 + * 1.57 + * NOTIFY_STATE_WINDOW 1.58 + * Only receive the onStateChange event if the aStateFlags parameter 1.59 + * includes nsIWebProgressListener::STATE_IS_WINDOW. 1.60 + * 1.61 + * NOTIFY_STATE_ALL 1.62 + * Receive all onStateChange events. 1.63 + */ 1.64 + const unsigned long NOTIFY_STATE_REQUEST = 0x00000001; 1.65 + const unsigned long NOTIFY_STATE_DOCUMENT = 0x00000002; 1.66 + const unsigned long NOTIFY_STATE_NETWORK = 0x00000004; 1.67 + const unsigned long NOTIFY_STATE_WINDOW = 0x00000008; 1.68 + const unsigned long NOTIFY_STATE_ALL = 0x0000000f; 1.69 + 1.70 + /** 1.71 + * These flags indicate the other events to observe, corresponding to the 1.72 + * other four methods defined on nsIWebProgressListener. 1.73 + * 1.74 + * NOTIFY_PROGRESS 1.75 + * Receive onProgressChange events. 1.76 + * 1.77 + * NOTIFY_STATUS 1.78 + * Receive onStatusChange events. 1.79 + * 1.80 + * NOTIFY_SECURITY 1.81 + * Receive onSecurityChange events. 1.82 + * 1.83 + * NOTIFY_LOCATION 1.84 + * Receive onLocationChange events. 1.85 + * 1.86 + * NOTIFY_REFRESH 1.87 + * Receive onRefreshAttempted events. 1.88 + * This is defined on nsIWebProgressListener2. 1.89 + */ 1.90 + const unsigned long NOTIFY_PROGRESS = 0x00000010; 1.91 + const unsigned long NOTIFY_STATUS = 0x00000020; 1.92 + const unsigned long NOTIFY_SECURITY = 0x00000040; 1.93 + const unsigned long NOTIFY_LOCATION = 0x00000080; 1.94 + const unsigned long NOTIFY_REFRESH = 0x00000100; 1.95 + 1.96 + /** 1.97 + * This flag enables all notifications. 1.98 + */ 1.99 + const unsigned long NOTIFY_ALL = 0x000001ff; 1.100 + 1.101 + /** 1.102 + * Registers a listener to receive web progress events. 1.103 + * 1.104 + * @param aListener 1.105 + * The listener interface to be called when a progress event occurs. 1.106 + * This object must also implement nsISupportsWeakReference. 1.107 + * @param aNotifyMask 1.108 + * The types of notifications to receive. 1.109 + * 1.110 + * @throw NS_ERROR_INVALID_ARG 1.111 + * Indicates that aListener was either null or that it does not 1.112 + * support weak references. 1.113 + * @throw NS_ERROR_FAILURE 1.114 + * Indicates that aListener was already registered. 1.115 + */ 1.116 + void addProgressListener(in nsIWebProgressListener aListener, 1.117 + in unsigned long aNotifyMask); 1.118 + 1.119 + /** 1.120 + * Removes a previously registered listener of progress events. 1.121 + * 1.122 + * @param aListener 1.123 + * The listener interface previously registered with a call to 1.124 + * addProgressListener. 1.125 + * 1.126 + * @throw NS_ERROR_FAILURE 1.127 + * Indicates that aListener was not registered. 1.128 + */ 1.129 + void removeProgressListener(in nsIWebProgressListener aListener); 1.130 + 1.131 + /** 1.132 + * The DOM window associated with this nsIWebProgress instance. 1.133 + * 1.134 + * @throw NS_ERROR_FAILURE 1.135 + * Indicates that there is no associated DOM window. 1.136 + */ 1.137 + readonly attribute nsIDOMWindow DOMWindow; 1.138 + readonly attribute uint64_t DOMWindowID; 1.139 + 1.140 + /** 1.141 + * Indicates whether DOMWindow.top == DOMWindow. 1.142 + */ 1.143 + readonly attribute boolean isTopLevel; 1.144 + 1.145 + /** 1.146 + * Indicates whether or not a document is currently being loaded 1.147 + * in the context of this nsIWebProgress instance. 1.148 + */ 1.149 + readonly attribute boolean isLoadingDocument; 1.150 + 1.151 + /** 1.152 + * Contains a load type as specified by the load* constants in 1.153 + * nsIDocShellLoadInfo.idl. 1.154 + */ 1.155 + readonly attribute unsigned long loadType; 1.156 +};