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 nsIChannel; michael@0: interface nsIPrincipal; michael@0: interface nsIURI; michael@0: michael@0: [scriptable, uuid(a5e61a3c-51bd-45be-ac0c-e87b71860656)] michael@0: interface nsIRefreshURI : nsISupports { michael@0: /** michael@0: * Load a uri after waiting for aMillis milliseconds. If the docshell michael@0: * is busy loading a page currently, the refresh request will be michael@0: * queued and executed when the current load finishes. michael@0: * michael@0: * @param aUri The uri to refresh. michael@0: * @param aMillis The number of milliseconds to wait. michael@0: * @param aRepeat Flag to indicate if the uri is to be michael@0: * repeatedly refreshed every aMillis milliseconds. michael@0: * @param aMetaRefresh Flag to indicate if this is a Meta refresh. michael@0: */ michael@0: void refreshURI(in nsIURI aURI, in long aMillis, in boolean aRepeat, michael@0: in boolean aMetaRefresh); michael@0: michael@0: /** michael@0: * Loads a URI immediately as if it were a refresh. michael@0: * michael@0: * @param aURI The URI to refresh. michael@0: * @param aMillis The number of milliseconds by which this refresh would michael@0: * be delayed if it were not being forced. michael@0: * @param aMetaRefresh Flag to indicate if this is a meta refresh. michael@0: */ michael@0: void forceRefreshURI(in nsIURI aURI, in long aMillis, in boolean aMetaRefresh); michael@0: michael@0: /** michael@0: * Checks the passed in channel to see if there is a refresh header, michael@0: * if there is, will setup a timer to refresh the uri found michael@0: * in the header. If docshell is busy loading a page currently, the michael@0: * request will be queued and executed when the current page michael@0: * finishes loading. michael@0: * michael@0: * Returns the NS_REFRESHURI_HEADER_FOUND success code if a refresh michael@0: * header was found and successfully setup. michael@0: * michael@0: * @param aChannel The channel to be parsed. michael@0: */ michael@0: void setupRefreshURI(in nsIChannel aChannel); michael@0: michael@0: /** michael@0: * Parses the passed in header string and sets up a refreshURI if michael@0: * a "refresh" header is found. If docshell is busy loading a page michael@0: * currently, the request will be queued and executed when michael@0: * the current page finishes loading. michael@0: * michael@0: * @param aBaseURI base URI to resolve refresh uri with. michael@0: * @param principal the associated principal michael@0: * @param aHeader The meta refresh header string. michael@0: */ michael@0: void setupRefreshURIFromHeader(in nsIURI aBaseURI, in nsIPrincipal principal, in ACString aHeader); michael@0: michael@0: /** michael@0: * Cancels all timer loads. michael@0: */ michael@0: void cancelRefreshURITimers(); michael@0: michael@0: /** michael@0: * True when there are pending refreshes, false otherwise. michael@0: */ michael@0: readonly attribute boolean refreshPending; michael@0: };