1 /* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
3 * ***** BEGIN LICENSE BLOCK *****
4 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
6 * The contents of this file are subject to the Mozilla Public License Version
7 * 1.1 (the "License"); you may not use this file except in compliance with
8 * the License. You may obtain a copy of the License at
9 * http://www.mozilla.org/MPL/
11 * Software distributed under the License is distributed on an "AS IS" basis,
12 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13 * for the specific language governing rights and limitations under the
16 * The Original Code is the Mozilla browser.
18 * The Initial Developer of the Original Code is
19 * Netscape Communications, Inc.
20 * Portions created by the Initial Developer are Copyright (C) 1999
21 * the Initial Developer. All Rights Reserved.
24 * Mark Pilgrim <pilgrim@gmail.com>
26 * Alternatively, the contents of this file may be used under the terms of
27 * either of the GNU General Public License Version 2 or later (the "GPL"),
28 * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
29 * in which case the provisions of the GPL or the LGPL are applicable instead
30 * of those above. If you wish to allow use of your version of this file only
31 * under the terms of either the GPL or the LGPL, and not to allow others to
32 * use your version of this file under the terms of the MPL, indicate your
33 * decision by deleting the provisions above and replace them with the notice
34 * and other provisions required by the GPL or the LGPL. If you do not delete
35 * the provisions above, a recipient may use your version of this file under
36 * the terms of any one of the MPL, the GPL or the LGPL.
38 * ***** END LICENSE BLOCK ***** */
40 #include
"nsISupports.idl"
44 [scriptable
, uuid(cb0ad623
-6b46
-4c09
-a473
-c1d6ca63d3c7
)]
45 interface nsIRefreshURI
: nsISupports
{
47 * Load a uri after waiting for aMillis milliseconds. If the docshell
48 * is busy loading a page currently, the refresh request will be
49 * queued and executed when the current load finishes.
51 * @param aUri The uri to refresh.
52 * @param aMillis The number of milliseconds to wait.
53 * @param aRepeat Flag to indicate if the uri is to be
54 * repeatedly refreshed every aMillis milliseconds.
55 * @param aMetaRefresh Flag to indicate if this is a Meta refresh.
57 void refreshURI
(in nsIURI aURI
, in long aMillis
, in boolean aRepeat
,
58 in boolean aMetaRefresh
);
61 * Loads a URI immediately as if it were a refresh.
63 * @param aURI The URI to refresh.
64 * @param aMillis The number of milliseconds by which this refresh would
65 * be delayed if it were not being forced.
66 * @param aMetaRefresh Flag to indicate if this is a meta refresh.
68 void forceRefreshURI
(in nsIURI aURI
, in long aMillis
, in boolean aMetaRefresh
);
71 * Checks the passed in channel to see if there is a refresh header,
72 * if there is, will setup a timer to refresh the uri found
73 * in the header. If docshell is busy loading a page currently, the
74 * request will be queued and executed when the current page
77 * Returns the NS_REFRESHURI_HEADER_FOUND success code if a refresh
78 * header was found and successfully setup.
80 * @param aChannel The channel to be parsed.
82 void setupRefreshURI
(in nsIChannel aChannel
);
85 * Parses the passed in header string and sets up a refreshURI if
86 * a "refresh" header is found. If docshell is busy loading a page
87 * currently, the request will be queued and executed when
88 * the current page finishes loading.
90 * @param aBaseURI base URI to resolve refresh uri with.
91 * @param aHeader The meta refresh header string.
93 void setupRefreshURIFromHeader
(in nsIURI aBaseURI
, in ACString aHeader
);
96 * Cancels all timer loads.
98 void cancelRefreshURITimers
();
101 * True when there are pending refreshes, false otherwise.
103 readonly attribute
boolean refreshPending
;
108 * This success code indicates that a refresh header was found and
109 * successfully setup.
112 #define NS_REFRESHURI_HEADER_FOUND \
113 NS_ERROR_GENERATE_SUCCESS
(NS_ERROR_MODULE_URILOADER
, \