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