2000-02-02 08:51:30 +03:00
|
|
|
/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
2004-04-18 01:52:36 +04:00
|
|
|
* ***** 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.
|
|
|
|
*
|
2000-02-02 08:51:30 +03:00
|
|
|
* The Original Code is the Mozilla browser.
|
2004-04-18 01:52:36 +04:00
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*
|
2000-02-02 08:51:30 +03:00
|
|
|
* Contributor(s):
|
|
|
|
* Travis Bogard <travis@netscape.com>
|
2005-02-19 12:12:26 +03:00
|
|
|
* Darin Fisher <darin@meer.net>
|
2004-04-18 01:52:36 +04:00
|
|
|
*
|
|
|
|
* 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 ***** */
|
2005-02-19 12:12:26 +03:00
|
|
|
|
2000-02-02 08:51:30 +03:00
|
|
|
#include "nsISupports.idl"
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 20:46:42 +04:00
|
|
|
|
2005-02-19 12:12:26 +03:00
|
|
|
interface nsIDOMDocument;
|
|
|
|
interface nsIInputStream;
|
|
|
|
interface nsISHistory;
|
|
|
|
interface nsIURI;
|
2000-02-02 08:51:30 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The nsIWebNavigation interface defines an interface for navigating the web.
|
|
|
|
* It provides methods and attributes to direct an object to navigate to a new
|
2005-02-19 12:12:26 +03:00
|
|
|
* location, stop or restart an in process load, or determine where the object
|
|
|
|
* has previously gone.
|
2001-03-24 03:22:18 +03:00
|
|
|
*
|
|
|
|
* @status UNDER_REVIEW
|
2000-02-02 08:51:30 +03:00
|
|
|
*/
|
|
|
|
[scriptable, uuid(F5D9E7B0-D930-11d3-B057-00A024FFC08C)]
|
|
|
|
interface nsIWebNavigation : nsISupports
|
|
|
|
{
|
2005-02-19 12:12:26 +03:00
|
|
|
/**
|
|
|
|
* Indicates if the object can go back. If true this indicates that
|
|
|
|
* there is back session history available for navigation.
|
|
|
|
*/
|
2001-08-14 08:46:20 +04:00
|
|
|
readonly attribute boolean canGoBack;
|
|
|
|
|
2005-02-19 12:12:26 +03:00
|
|
|
/**
|
|
|
|
* Indicates if the object can go forward. If true this indicates that
|
|
|
|
* there is forward session history available for navigation
|
|
|
|
*/
|
2001-08-14 08:46:20 +04:00
|
|
|
readonly attribute boolean canGoForward;
|
|
|
|
|
2005-02-19 12:12:26 +03:00
|
|
|
/**
|
|
|
|
* Tells the object to navigate to the previous session history item. When a
|
|
|
|
* page is loaded from session history, all content is loaded from the cache
|
|
|
|
* (if available) and page state (such as form values and scroll position) is
|
|
|
|
* restored.
|
|
|
|
*
|
|
|
|
* @throw NS_ERROR_UNEXPECTED
|
|
|
|
* Indicates that the call was unexpected at this time, which implies
|
|
|
|
* that canGoBack is false.
|
|
|
|
*/
|
2001-08-14 08:46:20 +04:00
|
|
|
void goBack();
|
|
|
|
|
2005-02-19 12:12:26 +03:00
|
|
|
/**
|
|
|
|
* Tells the object to navigate to the next session history item. When a
|
|
|
|
* page is loaded from session history, all content is loaded from the cache
|
|
|
|
* (if available) and page state (such as form values and scroll position) is
|
|
|
|
* restored.
|
|
|
|
*
|
|
|
|
* @throw NS_ERROR_UNEXPECTED
|
|
|
|
* Indicates that the call was unexpected at this time, which implies
|
|
|
|
* that canGoForward is false.
|
|
|
|
*/
|
2001-08-14 08:46:20 +04:00
|
|
|
void goForward();
|
|
|
|
|
2005-02-19 12:12:26 +03:00
|
|
|
/**
|
|
|
|
* Tells the object to navigate to the session history item at a given index.
|
|
|
|
*
|
|
|
|
* @throw NS_ERROR_UNEXPECTED
|
|
|
|
* Indicates that the call was unexpected at this time, which implies
|
|
|
|
* that session history entry at the given index does not exist.
|
|
|
|
*/
|
2001-08-14 08:46:20 +04:00
|
|
|
void gotoIndex(in long index);
|
|
|
|
|
2005-02-19 12:12:26 +03:00
|
|
|
/****************************************************************************
|
|
|
|
* The following flags may be bitwise combined to form the load flags
|
|
|
|
* parameter passed to either the loadURI or reload method. Some of these
|
|
|
|
* flags are only applicable to loadURI.
|
|
|
|
*/
|
2001-08-14 08:46:20 +04:00
|
|
|
|
2005-02-19 12:12:26 +03:00
|
|
|
/**
|
|
|
|
* This flags defines the range of bits that may be specified.
|
|
|
|
*/
|
|
|
|
const unsigned long LOAD_FLAGS_MASK = 0xffff;
|
2001-08-14 08:46:20 +04:00
|
|
|
|
2005-02-19 12:12:26 +03:00
|
|
|
/**
|
|
|
|
* This is the default value for the load flags parameter.
|
|
|
|
*/
|
2001-08-14 08:46:20 +04:00
|
|
|
const unsigned long LOAD_FLAGS_NONE = 0x0000;
|
|
|
|
|
2005-02-19 12:12:26 +03:00
|
|
|
/**
|
|
|
|
* This flag specifies that the load should have the semantics of an HTML
|
|
|
|
* Meta-refresh tag (i.e., that the cache should be bypassed). This flag
|
|
|
|
* is only applicable to loadURI.
|
|
|
|
* XXX the meaning of this flag is poorly defined.
|
|
|
|
* XXX no one uses this, so we should probably deprecate and remove it.
|
|
|
|
*/
|
2001-08-14 08:46:20 +04:00
|
|
|
const unsigned long LOAD_FLAGS_IS_REFRESH = 0x0010;
|
|
|
|
|
2005-02-19 12:12:26 +03:00
|
|
|
/**
|
|
|
|
* This flag specifies that the load should have the semantics of a link
|
|
|
|
* click. This flag is only applicable to loadURI.
|
|
|
|
* XXX the meaning of this flag is poorly defined.
|
|
|
|
*/
|
2001-08-14 08:46:20 +04:00
|
|
|
const unsigned long LOAD_FLAGS_IS_LINK = 0x0020;
|
|
|
|
|
2005-02-19 12:12:26 +03:00
|
|
|
/**
|
|
|
|
* This flag specifies that history should not be updated. This flag is only
|
|
|
|
* applicable to loadURI.
|
|
|
|
*/
|
2001-08-14 08:46:20 +04:00
|
|
|
const unsigned long LOAD_FLAGS_BYPASS_HISTORY = 0x0040;
|
|
|
|
|
2005-02-19 12:12:26 +03:00
|
|
|
/**
|
|
|
|
* This flag specifies that any existing history entry should be replaced.
|
|
|
|
* This flag is only applicable to loadURI.
|
|
|
|
*/
|
2001-08-14 08:46:20 +04:00
|
|
|
const unsigned long LOAD_FLAGS_REPLACE_HISTORY = 0x0080;
|
|
|
|
|
2005-02-19 12:12:26 +03:00
|
|
|
/**
|
|
|
|
* This flag specifies that the local web cache should be bypassed, but an
|
|
|
|
* intermediate proxy cache could still be used to satisfy the load.
|
|
|
|
*/
|
|
|
|
const unsigned long LOAD_FLAGS_BYPASS_CACHE = 0x0100;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This flag specifies that any intermediate proxy caches should be bypassed
|
|
|
|
* (i.e., that the content should be loaded from the origin server).
|
|
|
|
*/
|
|
|
|
const unsigned long LOAD_FLAGS_BYPASS_PROXY = 0x0200;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This flag specifies that a reload was triggered as a result of detecting
|
|
|
|
* an incorrect character encoding while parsing a previously loaded
|
|
|
|
* document.
|
|
|
|
*/
|
|
|
|
const unsigned long LOAD_FLAGS_CHARSET_CHANGE = 0x0400;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* If this flag is set, Stop() will be called before the load starts
|
|
|
|
* and will stop both content and network activity (the default is to
|
|
|
|
* only stop network activity). Effectively, this passes the
|
|
|
|
* STOP_CONTENT flag to Stop(), in addition to the STOP_NETWORK flag.
|
|
|
|
*/
|
2005-01-20 19:57:04 +03:00
|
|
|
const unsigned long LOAD_FLAGS_STOP_CONTENT = 0x0800;
|
2005-02-19 12:12:26 +03:00
|
|
|
|
2005-07-07 13:45:47 +04:00
|
|
|
/**
|
|
|
|
* A hint this load was prompted by an external program: take care!
|
|
|
|
*/
|
|
|
|
const unsigned long LOAD_FLAGS_FROM_EXTERNAL = 0x1000;
|
2006-04-04 03:17:51 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* This flag specifies that the URI may be submitted to a third-party
|
|
|
|
* server for correction. This should only be applied to non-sensitive
|
|
|
|
* URIs entered by users.
|
|
|
|
*/
|
|
|
|
const unsigned long LOAD_FLAGS_ALLOW_THIRD_PARTY_FIXUP = 0x2000;
|
2005-07-07 13:45:47 +04:00
|
|
|
|
2006-07-05 00:48:33 +04:00
|
|
|
/**
|
2006-08-06 22:17:29 +04:00
|
|
|
* This flag specifies that this is the first load in this object.
|
|
|
|
* Set with care, since setting incorrectly can cause us to assume that
|
|
|
|
* nothing was actually loaded in this object if the load ends up being
|
|
|
|
* handled by an external application.
|
2006-07-05 00:48:33 +04:00
|
|
|
*/
|
2006-08-06 22:17:29 +04:00
|
|
|
const unsigned long LOAD_FLAGS_FIRST_LOAD = 0x4000;
|
2006-07-05 00:48:33 +04:00
|
|
|
|
2007-09-14 23:21:45 +04:00
|
|
|
/**
|
|
|
|
* This flag specifies that the load should not be subject to popup
|
|
|
|
* blocking checks.
|
|
|
|
*/
|
|
|
|
const unsigned long LOAD_FLAGS_ALLOW_POPUPS = 0x8000;
|
|
|
|
|
2005-02-19 12:12:26 +03:00
|
|
|
/**
|
|
|
|
* Loads a given URI. This will give priority to loading the requested URI
|
|
|
|
* in the object implementing this interface. If it can't be loaded here
|
|
|
|
* however, the URI dispatcher will go through its normal process of content
|
|
|
|
* loading.
|
|
|
|
*
|
|
|
|
* @param aURI
|
|
|
|
* The URI string to load. For HTTP and FTP URLs and possibly others,
|
|
|
|
* characters above U+007F will be converted to UTF-8 and then URL-
|
|
|
|
* escaped per the rules of RFC 2396.
|
|
|
|
* @param aLoadFlags
|
|
|
|
* Flags modifying load behaviour. This parameter is a bitwise
|
|
|
|
* combination of the load flags defined above. (Undefined bits are
|
|
|
|
* reserved for future use.) Generally you will pass LOAD_FLAGS_NONE
|
|
|
|
* for this parameter.
|
|
|
|
* @param aReferrer
|
|
|
|
* The referring URI. If this argument is null, then the referring
|
|
|
|
* URI will be inferred internally.
|
|
|
|
* @param aPostData
|
|
|
|
* If the URI corresponds to a HTTP request, then this stream is
|
|
|
|
* appended directly to the HTTP request headers. It may be prefixed
|
|
|
|
* with additional HTTP headers. This stream must contain a "\r\n"
|
|
|
|
* sequence separating any HTTP headers from the HTTP request body.
|
|
|
|
* This parameter is optional and may be null.
|
|
|
|
* @param aHeaders
|
|
|
|
* If the URI corresponds to a HTTP request, then any HTTP headers
|
|
|
|
* contained in this stream are set on the HTTP request. The HTTP
|
|
|
|
* header stream is formatted as:
|
|
|
|
* ( HEADER "\r\n" )*
|
|
|
|
* This parameter is optional and may be null.
|
|
|
|
*/
|
|
|
|
void loadURI(in wstring aURI,
|
|
|
|
in unsigned long aLoadFlags,
|
|
|
|
in nsIURI aReferrer,
|
|
|
|
in nsIInputStream aPostData,
|
|
|
|
in nsIInputStream aHeaders);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Tells the Object to reload the current page. There may be cases where the
|
|
|
|
* user will be asked to confirm the reload (for example, when it is
|
|
|
|
* determined that the request is non-idempotent).
|
|
|
|
*
|
|
|
|
* @param aReloadFlags
|
|
|
|
* Flags modifying load behaviour. This parameter is a bitwise
|
|
|
|
* combination of the Load Flags defined above. (Undefined bits are
|
|
|
|
* reserved for future use.) Generally you will pass LOAD_FLAGS_NONE
|
|
|
|
* for this parameter.
|
|
|
|
*
|
|
|
|
* @throw NS_BINDING_ABORTED
|
|
|
|
* Indicating that the user canceled the reload.
|
|
|
|
*/
|
|
|
|
void reload(in unsigned long aReloadFlags);
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* The following flags may be passed as the stop flags parameter to the stop
|
|
|
|
* method defined on this interface.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This flag specifies that all network activity should be stopped. This
|
|
|
|
* includes both active network loads and pending META-refreshes.
|
|
|
|
*/
|
2001-08-14 08:46:20 +04:00
|
|
|
const unsigned long STOP_NETWORK = 0x01;
|
|
|
|
|
2005-02-19 12:12:26 +03:00
|
|
|
/**
|
|
|
|
* This flag specifies that all content activity should be stopped. This
|
|
|
|
* includes animated images, plugins and pending Javascript timeouts.
|
|
|
|
*/
|
2001-08-14 08:46:20 +04:00
|
|
|
const unsigned long STOP_CONTENT = 0x02;
|
|
|
|
|
2005-02-19 12:12:26 +03:00
|
|
|
/**
|
|
|
|
* This flag specifies that all activity should be stopped.
|
|
|
|
*/
|
|
|
|
const unsigned long STOP_ALL = 0x03;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Stops a load of a URI.
|
|
|
|
*
|
|
|
|
* @param aStopFlags
|
|
|
|
* This parameter is one of the stop flags defined above.
|
|
|
|
*/
|
|
|
|
void stop(in unsigned long aStopFlags);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Retrieves the current DOM document for the frame, or lazily creates a
|
|
|
|
* blank document if there is none. This attribute never returns null except
|
|
|
|
* for unexpected error situations.
|
|
|
|
*/
|
2001-08-14 08:46:20 +04:00
|
|
|
readonly attribute nsIDOMDocument document;
|
|
|
|
|
2005-02-19 12:12:26 +03:00
|
|
|
/**
|
|
|
|
* The currently loaded URI or null.
|
|
|
|
*/
|
2001-08-14 08:46:20 +04:00
|
|
|
readonly attribute nsIURI currentURI;
|
2005-02-19 12:12:26 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The referring URI for the currently loaded URI or null.
|
|
|
|
*/
|
2003-02-13 02:50:14 +03:00
|
|
|
readonly attribute nsIURI referringURI;
|
2001-12-01 01:35:33 +03:00
|
|
|
|
2005-02-19 12:12:26 +03:00
|
|
|
/**
|
|
|
|
* The session history object used by this web navigation instance.
|
|
|
|
*/
|
2001-08-14 08:46:20 +04:00
|
|
|
attribute nsISHistory sessionHistory;
|
2000-09-20 16:23:53 +04:00
|
|
|
};
|