OLD | NEW |
(Empty) | |
| 1 /* |
| 2 * DO NOT EDIT. THIS FILE IS GENERATED FROM c:/builds/tinderbox/XR-Mozilla1.8.0
-Release/WINNT_5.2_Depend/mozilla/uriloader/base/nsIWebProgress.idl |
| 3 */ |
| 4 |
| 5 #ifndef __gen_nsIWebProgress_h__ |
| 6 #define __gen_nsIWebProgress_h__ |
| 7 |
| 8 |
| 9 #ifndef __gen_nsISupports_h__ |
| 10 #include "nsISupports.h" |
| 11 #endif |
| 12 |
| 13 /* For IDL files that don't want to include root IDL files. */ |
| 14 #ifndef NS_NO_VTABLE |
| 15 #define NS_NO_VTABLE |
| 16 #endif |
| 17 class nsIDOMWindow; /* forward declaration */ |
| 18 |
| 19 class nsIWebProgressListener; /* forward declaration */ |
| 20 |
| 21 |
| 22 /* starting interface: nsIWebProgress */ |
| 23 #define NS_IWEBPROGRESS_IID_STR "570f39d0-efd0-11d3-b093-00a024ffc08c" |
| 24 |
| 25 #define NS_IWEBPROGRESS_IID \ |
| 26 {0x570f39d0, 0xefd0, 0x11d3, \ |
| 27 { 0xb0, 0x93, 0x00, 0xa0, 0x24, 0xff, 0xc0, 0x8c }} |
| 28 |
| 29 /** |
| 30 * The nsIWebProgress interface is used to add or remove nsIWebProgressListener |
| 31 * instances to observe the loading of asynchronous requests (usually in the |
| 32 * context of a DOM window). |
| 33 * |
| 34 * nsIWebProgress instances may be arranged in a parent-child configuration, |
| 35 * corresponding to the parent-child configuration of their respective DOM |
| 36 * windows. However, in some cases a nsIWebProgress instance may not have an |
| 37 * associated DOM window. The parent-child relationship of nsIWebProgress |
| 38 * instances is not made explicit by this interface, but the relationship may |
| 39 * exist in some implementations. |
| 40 * |
| 41 * A nsIWebProgressListener instance receives notifications for the |
| 42 * nsIWebProgress instance to which it added itself, and it may also receive |
| 43 * notifications from any nsIWebProgress instances that are children of that |
| 44 * nsIWebProgress instance. |
| 45 * |
| 46 * @status FROZEN |
| 47 */ |
| 48 class NS_NO_VTABLE nsIWebProgress : public nsISupports { |
| 49 public: |
| 50 |
| 51 NS_DEFINE_STATIC_IID_ACCESSOR(NS_IWEBPROGRESS_IID) |
| 52 |
| 53 /** |
| 54 * The following flags may be combined to form the aNotifyMask parameter for |
| 55 * the addProgressListener method. They limit the set of events that are |
| 56 * delivered to an nsIWebProgressListener instance. |
| 57 */ |
| 58 /** |
| 59 * These flags indicate the state transistions to observe, corresponding to |
| 60 * nsIWebProgressListener::onStateChange. |
| 61 * |
| 62 * NOTIFY_STATE_REQUEST |
| 63 * Only receive the onStateChange event if the aStateFlags parameter |
| 64 * includes nsIWebProgressListener::STATE_IS_REQUEST. |
| 65 * |
| 66 * NOTIFY_STATE_DOCUMENT |
| 67 * Only receive the onStateChange event if the aStateFlags parameter |
| 68 * includes nsIWebProgressListener::STATE_IS_DOCUMENT. |
| 69 * |
| 70 * NOTIFY_STATE_NETWORK |
| 71 * Only receive the onStateChange event if the aStateFlags parameter |
| 72 * includes nsIWebProgressListener::STATE_IS_NETWORK. |
| 73 * |
| 74 * NOTIFY_STATE_WINDOW |
| 75 * Only receive the onStateChange event if the aStateFlags parameter |
| 76 * includes nsIWebProgressListener::STATE_IS_WINDOW. |
| 77 * |
| 78 * NOTIFY_STATE_ALL |
| 79 * Receive all onStateChange events. |
| 80 */ |
| 81 enum { NOTIFY_STATE_REQUEST = 1U }; |
| 82 |
| 83 enum { NOTIFY_STATE_DOCUMENT = 2U }; |
| 84 |
| 85 enum { NOTIFY_STATE_NETWORK = 4U }; |
| 86 |
| 87 enum { NOTIFY_STATE_WINDOW = 8U }; |
| 88 |
| 89 enum { NOTIFY_STATE_ALL = 15U }; |
| 90 |
| 91 /** |
| 92 * These flags indicate the other events to observe, corresponding to the |
| 93 * other four methods defined on nsIWebProgressListener. |
| 94 * |
| 95 * NOTIFY_PROGRESS |
| 96 * Receive onProgressChange events. |
| 97 * |
| 98 * NOTIFY_STATUS |
| 99 * Receive onStatusChange events. |
| 100 * |
| 101 * NOTIFY_SECURITY |
| 102 * Receive onSecurityChange events. |
| 103 * |
| 104 * NOTIFY_LOCATION |
| 105 * Receive onLocationChange events. |
| 106 */ |
| 107 enum { NOTIFY_PROGRESS = 16U }; |
| 108 |
| 109 enum { NOTIFY_STATUS = 32U }; |
| 110 |
| 111 enum { NOTIFY_SECURITY = 64U }; |
| 112 |
| 113 enum { NOTIFY_LOCATION = 128U }; |
| 114 |
| 115 /** |
| 116 * This flag enables all notifications. |
| 117 */ |
| 118 enum { NOTIFY_ALL = 255U }; |
| 119 |
| 120 /** |
| 121 * Registers a listener to receive web progress events. |
| 122 * |
| 123 * @param aListener |
| 124 * The listener interface to be called when a progress event occurs. |
| 125 * This object must also implement nsISupportsWeakReference. |
| 126 * @param aNotifyMask |
| 127 * The types of notifications to receive. |
| 128 * |
| 129 * @throw NS_ERROR_INVALID_ARG |
| 130 * Indicates that aListener was either null or that it does not |
| 131 * support weak references. |
| 132 * @throw NS_ERROR_FAILURE |
| 133 * Indicates that aListener was already registered. |
| 134 */ |
| 135 /* void addProgressListener (in nsIWebProgressListener aListener, in unsigned
long aNotifyMask); */ |
| 136 NS_IMETHOD AddProgressListener(nsIWebProgressListener *aListener, PRUint32 aNo
tifyMask) = 0; |
| 137 |
| 138 /** |
| 139 * Removes a previously registered listener of progress events. |
| 140 * |
| 141 * @param aListener |
| 142 * The listener interface previously registered with a call to |
| 143 * addProgressListener. |
| 144 * |
| 145 * @throw NS_ERROR_FAILURE |
| 146 * Indicates that aListener was not registered. |
| 147 */ |
| 148 /* void removeProgressListener (in nsIWebProgressListener aListener); */ |
| 149 NS_IMETHOD RemoveProgressListener(nsIWebProgressListener *aListener) = 0; |
| 150 |
| 151 /** |
| 152 * The DOM window associated with this nsIWebProgress instance. |
| 153 * |
| 154 * @throw NS_ERROR_FAILURE |
| 155 * Indicates that there is no associated DOM window. |
| 156 */ |
| 157 /* readonly attribute nsIDOMWindow DOMWindow; */ |
| 158 NS_IMETHOD GetDOMWindow(nsIDOMWindow * *aDOMWindow) = 0; |
| 159 |
| 160 /** |
| 161 * Indicates whether or not a document is currently being loaded |
| 162 * in the context of this nsIWebProgress instance. |
| 163 */ |
| 164 /* readonly attribute PRBool isLoadingDocument; */ |
| 165 NS_IMETHOD GetIsLoadingDocument(PRBool *aIsLoadingDocument) = 0; |
| 166 |
| 167 }; |
| 168 |
| 169 /* Use this macro when declaring classes that implement this interface. */ |
| 170 #define NS_DECL_NSIWEBPROGRESS \ |
| 171 NS_IMETHOD AddProgressListener(nsIWebProgressListener *aListener, PRUint32 aNo
tifyMask); \ |
| 172 NS_IMETHOD RemoveProgressListener(nsIWebProgressListener *aListener); \ |
| 173 NS_IMETHOD GetDOMWindow(nsIDOMWindow * *aDOMWindow); \ |
| 174 NS_IMETHOD GetIsLoadingDocument(PRBool *aIsLoadingDocument); |
| 175 |
| 176 /* Use this macro to declare functions that forward the behavior of this interfa
ce to another object. */ |
| 177 #define NS_FORWARD_NSIWEBPROGRESS(_to) \ |
| 178 NS_IMETHOD AddProgressListener(nsIWebProgressListener *aListener, PRUint32 aNo
tifyMask) { return _to AddProgressListener(aListener, aNotifyMask); } \ |
| 179 NS_IMETHOD RemoveProgressListener(nsIWebProgressListener *aListener) { return
_to RemoveProgressListener(aListener); } \ |
| 180 NS_IMETHOD GetDOMWindow(nsIDOMWindow * *aDOMWindow) { return _to GetDOMWindow(
aDOMWindow); } \ |
| 181 NS_IMETHOD GetIsLoadingDocument(PRBool *aIsLoadingDocument) { return _to GetIs
LoadingDocument(aIsLoadingDocument); } |
| 182 |
| 183 /* Use this macro to declare functions that forward the behavior of this interfa
ce to another object in a safe way. */ |
| 184 #define NS_FORWARD_SAFE_NSIWEBPROGRESS(_to) \ |
| 185 NS_IMETHOD AddProgressListener(nsIWebProgressListener *aListener, PRUint32 aNo
tifyMask) { return !_to ? NS_ERROR_NULL_POINTER : _to->AddProgressListener(aList
ener, aNotifyMask); } \ |
| 186 NS_IMETHOD RemoveProgressListener(nsIWebProgressListener *aListener) { return
!_to ? NS_ERROR_NULL_POINTER : _to->RemoveProgressListener(aListener); } \ |
| 187 NS_IMETHOD GetDOMWindow(nsIDOMWindow * *aDOMWindow) { return !_to ? NS_ERROR_N
ULL_POINTER : _to->GetDOMWindow(aDOMWindow); } \ |
| 188 NS_IMETHOD GetIsLoadingDocument(PRBool *aIsLoadingDocument) { return !_to ? NS
_ERROR_NULL_POINTER : _to->GetIsLoadingDocument(aIsLoadingDocument); } |
| 189 |
| 190 #if 0 |
| 191 /* Use the code below as a template for the implementation class for this interf
ace. */ |
| 192 |
| 193 /* Header file */ |
| 194 class nsWebProgress : public nsIWebProgress |
| 195 { |
| 196 public: |
| 197 NS_DECL_ISUPPORTS |
| 198 NS_DECL_NSIWEBPROGRESS |
| 199 |
| 200 nsWebProgress(); |
| 201 |
| 202 private: |
| 203 ~nsWebProgress(); |
| 204 |
| 205 protected: |
| 206 /* additional members */ |
| 207 }; |
| 208 |
| 209 /* Implementation file */ |
| 210 NS_IMPL_ISUPPORTS1(nsWebProgress, nsIWebProgress) |
| 211 |
| 212 nsWebProgress::nsWebProgress() |
| 213 { |
| 214 /* member initializers and constructor code */ |
| 215 } |
| 216 |
| 217 nsWebProgress::~nsWebProgress() |
| 218 { |
| 219 /* destructor code */ |
| 220 } |
| 221 |
| 222 /* void addProgressListener (in nsIWebProgressListener aListener, in unsigned lo
ng aNotifyMask); */ |
| 223 NS_IMETHODIMP nsWebProgress::AddProgressListener(nsIWebProgressListener *aListen
er, PRUint32 aNotifyMask) |
| 224 { |
| 225 return NS_ERROR_NOT_IMPLEMENTED; |
| 226 } |
| 227 |
| 228 /* void removeProgressListener (in nsIWebProgressListener aListener); */ |
| 229 NS_IMETHODIMP nsWebProgress::RemoveProgressListener(nsIWebProgressListener *aLis
tener) |
| 230 { |
| 231 return NS_ERROR_NOT_IMPLEMENTED; |
| 232 } |
| 233 |
| 234 /* readonly attribute nsIDOMWindow DOMWindow; */ |
| 235 NS_IMETHODIMP nsWebProgress::GetDOMWindow(nsIDOMWindow * *aDOMWindow) |
| 236 { |
| 237 return NS_ERROR_NOT_IMPLEMENTED; |
| 238 } |
| 239 |
| 240 /* readonly attribute PRBool isLoadingDocument; */ |
| 241 NS_IMETHODIMP nsWebProgress::GetIsLoadingDocument(PRBool *aIsLoadingDocument) |
| 242 { |
| 243 return NS_ERROR_NOT_IMPLEMENTED; |
| 244 } |
| 245 |
| 246 /* End of implementation class template. */ |
| 247 #endif |
| 248 |
| 249 |
| 250 #endif /* __gen_nsIWebProgress_h__ */ |
OLD | NEW |