IC for JSOP_CALLELEM (bug 604031, r=dmandelin).
[mozilla-central.git] / docshell / base / nsIWebNavigation.idl
blob40bba8fc331e2747c32619bb347c2c950f811816
1 /* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 * ***** BEGIN LICENSE BLOCK *****
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
5 * The contents of this file are subject to the Mozilla Public License Version
6 * 1.1 (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 * http://www.mozilla.org/MPL/
10 * Software distributed under the License is distributed on an "AS IS" basis,
11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 * for the specific language governing rights and limitations under the
13 * License.
15 * The Original Code is the Mozilla browser.
17 * The Initial Developer of the Original Code is
18 * Netscape Communications, Inc.
19 * Portions created by the Initial Developer are Copyright (C) 1999
20 * the Initial Developer. All Rights Reserved.
22 * Contributor(s):
23 * Travis Bogard <travis@netscape.com>
24 * Darin Fisher <darin@meer.net>
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"
42 interface nsIDOMDocument;
43 interface nsIInputStream;
44 interface nsISHistory;
45 interface nsIURI;
47 /**
48 * The nsIWebNavigation interface defines an interface for navigating the web.
49 * It provides methods and attributes to direct an object to navigate to a new
50 * location, stop or restart an in process load, or determine where the object
51 * has previously gone.
53 [scriptable, uuid(F5D9E7B0-D930-11d3-B057-00A024FFC08C)]
54 interface nsIWebNavigation : nsISupports
56 /**
57 * Indicates if the object can go back. If true this indicates that
58 * there is back session history available for navigation.
60 readonly attribute boolean canGoBack;
62 /**
63 * Indicates if the object can go forward. If true this indicates that
64 * there is forward session history available for navigation
66 readonly attribute boolean canGoForward;
68 /**
69 * Tells the object to navigate to the previous session history item. When a
70 * page is loaded from session history, all content is loaded from the cache
71 * (if available) and page state (such as form values and scroll position) is
72 * restored.
74 * @throw NS_ERROR_UNEXPECTED
75 * Indicates that the call was unexpected at this time, which implies
76 * that canGoBack is false.
78 void goBack();
80 /**
81 * Tells the object to navigate to the next session history item. When a
82 * page is loaded from session history, all content is loaded from the cache
83 * (if available) and page state (such as form values and scroll position) is
84 * restored.
86 * @throw NS_ERROR_UNEXPECTED
87 * Indicates that the call was unexpected at this time, which implies
88 * that canGoForward is false.
90 void goForward();
92 /**
93 * Tells the object to navigate to the session history item at a given index.
95 * @throw NS_ERROR_UNEXPECTED
96 * Indicates that the call was unexpected at this time, which implies
97 * that session history entry at the given index does not exist.
99 void gotoIndex(in long index);
101 /****************************************************************************
102 * The following flags may be bitwise combined to form the load flags
103 * parameter passed to either the loadURI or reload method. Some of these
104 * flags are only applicable to loadURI.
108 * This flags defines the range of bits that may be specified. Flags
109 * outside this range may be used, but may not be passed to Reload().
111 const unsigned long LOAD_FLAGS_MASK = 0xffff;
114 * This is the default value for the load flags parameter.
116 const unsigned long LOAD_FLAGS_NONE = 0x0000;
119 * Flags 0x1, 0x2, 0x4, 0x8 are reserved for internal use by
120 * nsIWebNavigation implementations for now.
124 * This flag specifies that the load should have the semantics of an HTML
125 * Meta-refresh tag (i.e., that the cache should be bypassed). This flag
126 * is only applicable to loadURI.
127 * XXX the meaning of this flag is poorly defined.
128 * XXX no one uses this, so we should probably deprecate and remove it.
130 const unsigned long LOAD_FLAGS_IS_REFRESH = 0x0010;
133 * This flag specifies that the load should have the semantics of a link
134 * click. This flag is only applicable to loadURI.
135 * XXX the meaning of this flag is poorly defined.
137 const unsigned long LOAD_FLAGS_IS_LINK = 0x0020;
140 * This flag specifies that history should not be updated. This flag is only
141 * applicable to loadURI.
143 const unsigned long LOAD_FLAGS_BYPASS_HISTORY = 0x0040;
146 * This flag specifies that any existing history entry should be replaced.
147 * This flag is only applicable to loadURI.
149 const unsigned long LOAD_FLAGS_REPLACE_HISTORY = 0x0080;
152 * This flag specifies that the local web cache should be bypassed, but an
153 * intermediate proxy cache could still be used to satisfy the load.
155 const unsigned long LOAD_FLAGS_BYPASS_CACHE = 0x0100;
158 * This flag specifies that any intermediate proxy caches should be bypassed
159 * (i.e., that the content should be loaded from the origin server).
161 const unsigned long LOAD_FLAGS_BYPASS_PROXY = 0x0200;
164 * This flag specifies that a reload was triggered as a result of detecting
165 * an incorrect character encoding while parsing a previously loaded
166 * document.
168 const unsigned long LOAD_FLAGS_CHARSET_CHANGE = 0x0400;
171 * If this flag is set, Stop() will be called before the load starts
172 * and will stop both content and network activity (the default is to
173 * only stop network activity). Effectively, this passes the
174 * STOP_CONTENT flag to Stop(), in addition to the STOP_NETWORK flag.
176 const unsigned long LOAD_FLAGS_STOP_CONTENT = 0x0800;
179 * A hint this load was prompted by an external program: take care!
181 const unsigned long LOAD_FLAGS_FROM_EXTERNAL = 0x1000;
184 * This flag specifies that the URI may be submitted to a third-party
185 * server for correction. This should only be applied to non-sensitive
186 * URIs entered by users. This flag must not be passed to Reload.
188 const unsigned long LOAD_FLAGS_ALLOW_THIRD_PARTY_FIXUP = 0x2000;
191 * This flag specifies that this is the first load in this object.
192 * Set with care, since setting incorrectly can cause us to assume that
193 * nothing was actually loaded in this object if the load ends up being
194 * handled by an external application. This flag must not be passed to
195 * Reload.
197 const unsigned long LOAD_FLAGS_FIRST_LOAD = 0x4000;
200 * This flag specifies that the load should not be subject to popup
201 * blocking checks. This flag must not be passed to Reload.
203 const unsigned long LOAD_FLAGS_ALLOW_POPUPS = 0x8000;
206 * This flag specifies that the URI classifier should not be checked for
207 * this load. This flag must not be passed to Reload.
209 const unsigned long LOAD_FLAGS_BYPASS_CLASSIFIER = 0x10000;
212 * Force relevant cookies to be sent with this load even if normally they
213 * wouldn't be.
215 const unsigned long LOAD_FLAGS_FORCE_ALLOW_COOKIES = 0x20000;
218 * Loads a given URI. This will give priority to loading the requested URI
219 * in the object implementing this interface. If it can't be loaded here
220 * however, the URI dispatcher will go through its normal process of content
221 * loading.
223 * @param aURI
224 * The URI string to load. For HTTP and FTP URLs and possibly others,
225 * characters above U+007F will be converted to UTF-8 and then URL-
226 * escaped per the rules of RFC 2396.
227 * @param aLoadFlags
228 * Flags modifying load behaviour. This parameter is a bitwise
229 * combination of the load flags defined above. (Undefined bits are
230 * reserved for future use.) Generally you will pass LOAD_FLAGS_NONE
231 * for this parameter.
232 * @param aReferrer
233 * The referring URI. If this argument is null, then the referring
234 * URI will be inferred internally.
235 * @param aPostData
236 * If the URI corresponds to a HTTP request, then this stream is
237 * appended directly to the HTTP request headers. It may be prefixed
238 * with additional HTTP headers. This stream must contain a "\r\n"
239 * sequence separating any HTTP headers from the HTTP request body.
240 * This parameter is optional and may be null.
241 * @param aHeaders
242 * If the URI corresponds to a HTTP request, then any HTTP headers
243 * contained in this stream are set on the HTTP request. The HTTP
244 * header stream is formatted as:
245 * ( HEADER "\r\n" )*
246 * This parameter is optional and may be null.
248 void loadURI(in wstring aURI,
249 in unsigned long aLoadFlags,
250 in nsIURI aReferrer,
251 in nsIInputStream aPostData,
252 in nsIInputStream aHeaders);
255 * Tells the Object to reload the current page. There may be cases where the
256 * user will be asked to confirm the reload (for example, when it is
257 * determined that the request is non-idempotent).
259 * @param aReloadFlags
260 * Flags modifying load behaviour. This parameter is a bitwise
261 * combination of the Load Flags defined above. (Undefined bits are
262 * reserved for future use.) Generally you will pass LOAD_FLAGS_NONE
263 * for this parameter.
265 * @throw NS_BINDING_ABORTED
266 * Indicating that the user canceled the reload.
268 void reload(in unsigned long aReloadFlags);
270 /****************************************************************************
271 * The following flags may be passed as the stop flags parameter to the stop
272 * method defined on this interface.
276 * This flag specifies that all network activity should be stopped. This
277 * includes both active network loads and pending META-refreshes.
279 const unsigned long STOP_NETWORK = 0x01;
282 * This flag specifies that all content activity should be stopped. This
283 * includes animated images, plugins and pending Javascript timeouts.
285 const unsigned long STOP_CONTENT = 0x02;
288 * This flag specifies that all activity should be stopped.
290 const unsigned long STOP_ALL = 0x03;
293 * Stops a load of a URI.
295 * @param aStopFlags
296 * This parameter is one of the stop flags defined above.
298 void stop(in unsigned long aStopFlags);
301 * Retrieves the current DOM document for the frame, or lazily creates a
302 * blank document if there is none. This attribute never returns null except
303 * for unexpected error situations.
305 readonly attribute nsIDOMDocument document;
308 * The currently loaded URI or null.
310 readonly attribute nsIURI currentURI;
313 * The referring URI for the currently loaded URI or null.
315 readonly attribute nsIURI referringURI;
318 * The session history object used by this web navigation instance.
320 attribute nsISHistory sessionHistory;