/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- * * ***** BEGIN LICENSE BLOCK ***** * Version: MPL 1.1/GPL 2.0/LGPL 2.1 * * The contents of this file are subject to the Mozilla Public License Version * 1.1 (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * http://www.mozilla.org/MPL/ * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. * * The Original Code is the Mozilla browser. * * The Initial Developer of the Original Code is * Netscape Communications, Inc. * Portions created by the Initial Developer are Copyright (C) 1999 * the Initial Developer. All Rights Reserved. * * Contributor(s): * Travis Bogard * Darin Fisher * * Alternatively, the contents of this file may be used under the terms of * either of the GNU General Public License Version 2 or later (the "GPL"), * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), * in which case the provisions of the GPL or the LGPL are applicable instead * of those above. If you wish to allow use of your version of this file only * under the terms of either the GPL or the LGPL, and not to allow others to * use your version of this file under the terms of the MPL, indicate your * decision by deleting the provisions above and replace them with the notice * and other provisions required by the GPL or the LGPL. If you do not delete * the provisions above, a recipient may use your version of this file under * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ #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. * * @status FROZEN */ [scriptable, uuid(570F39D1-EFD0-11d3-B093-00A024FFC08C)] 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