/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ #include "nsISupports.idl" interface nsIWebProgress; interface nsIRequest; interface nsIURI; /** * The nsIWebProgressListener interface is implemented by clients wishing to * listen in on the progress associated with the loading of asynchronous * requests in the context of a nsIWebProgress instance as well as any child * nsIWebProgress instances. nsIWebProgress.idl describes the parent-child * relationship of nsIWebProgress instances. */ [scriptable, uuid(a9df523b-efe2-421e-9d8e-3d7f807dda4c)] interface nsIWebProgressListener : nsISupports { /** * State Transition Flags * * These flags indicate the various states that requests may transition * through as they are being loaded. These flags are mutually exclusive. * * For any given request, onStateChange is called once with the STATE_START * flag, zero or more times with the STATE_TRANSFERRING flag or once with the * STATE_REDIRECTING flag, and then finally once with the STATE_STOP flag. * NOTE: For document requests, a second STATE_STOP is generated (see the * description of STATE_IS_WINDOW for more details). * * STATE_START * This flag indicates the start of a request. This flag is set when a * request is initiated. The request is complete when onStateChange is * called for the same request with the STATE_STOP flag set. * * STATE_REDIRECTING * This flag indicates that a request is being redirected. The request * passed to onStateChange is the request that is being redirected. When a * redirect occurs, a new request is generated automatically to process the * new request. Expect a corresponding STATE_START event for the new * request, and a STATE_STOP for the redirected request. * * STATE_TRANSFERRING * This flag indicates that data for a request is being transferred to an * end consumer. This flag indicates that the request has been targeted, * and that the user may start seeing content corresponding to the request. * * STATE_NEGOTIATING * This flag is not used. * * STATE_STOP * This flag indicates the completion of a request. The aStatus parameter * to onStateChange indicates the final status of the request. */ const unsigned long STATE_START = 0x00000001; const unsigned long STATE_REDIRECTING = 0x00000002; const unsigned long STATE_TRANSFERRING = 0x00000004; const unsigned long STATE_NEGOTIATING = 0x00000008; const unsigned long STATE_STOP = 0x00000010; /** * State Type Flags * * These flags further describe the entity for which the state transition is * occuring. These flags are NOT mutually exclusive (i.e., an onStateChange * event may indicate some combination of these flags). * * STATE_IS_REQUEST * This flag indicates that the state transition is for a request, which * includes but is not limited to document requests. (See below for a * description of document requests.) Other types of requests, such as * requests for inline content (e.g., images and stylesheets) are * considered normal requests. * * STATE_IS_DOCUMENT * This flag indicates that the state transition is for a document request. * This flag is set in addition to STATE_IS_REQUEST. A document request * supports the nsIChannel interface and its loadFlags attribute includes * the nsIChannel::LOAD_DOCUMENT_URI flag. * * A document request does not complete until all requests associated with * the loading of its corresponding document have completed. This includes * other document requests (e.g., corresponding to HTML