pjs/docshell/base/nsIWebNavigation.idl

147 строки
4.6 KiB
Plaintext

/* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* 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 Netscape are
* Copyright (C) 1999, Mozilla. All Rights Reserved.
*
* Contributor(s):
* Travis Bogard <travis@netscape.com>
*/
#include "nsISupports.idl"
#include "domstubs.idl"
/**
* The nsIWebNavigation interface defines an interface for navigating the web.
* It provides methods and attributes to direct an object to navigate to a new
* location, stop or restart an in process load or determine where the object,
* has previously gone.
*/
interface nsISHistory;
interface nsISHEntry;
[scriptable, uuid(F5D9E7B0-D930-11d3-B057-00A024FFC08C)]
interface nsIWebNavigation : nsISupports
{
/*
Indicates if the object can go back. If true this indicates that
there is back session history available to navigate to.
*/
readonly attribute boolean canGoBack;
/*
Indicates if the object can go forward. If true this indicates that
there is forward session history available to navigate to.
*/
readonly attribute boolean canGoForward;
/*
Tells the object to navigate to the next Back session history item.
@return NS_OK - Back was successfull
NS_ERROR_UNEXPECTED - This call was unexpected at this time. Most
likely you can't go back right now.
*/
void goBack();
/*
Tells the object to navigate to the next Forward session history item.
@return NS_OK - Forward was successfull
NS_ERROR_UNEXPECTED - This call was unexpected at this time. Most
likely you can't go forward right now.
*/
void goForward();
/*
Tells the object to navigate to the session history item at index.
@return NS_OK - Gotoindex was successfull
NS_ERROR_UNEXPECTED - This call was unexpected at this time. Most
likely you can't goto that index
*/
void gotoIndex(in long index);
/*
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 URL dispatcher will go through its normal process of content
loading.
@param uri - The URI to load.
*/
void loadURI(in wstring uri);
/*
Definitions for the reload types.
*/
/* these are load type enums... */
const long loadNormal = 0; // Normal Load
const long loadNormalReplace = 1; // Normal Load but replaces current history slot
const long loadHistory = 2; // Load from history
const long loadReloadNormal = 3; // normal Reload
const long loadReloadBypassCache = 4; // Reloads bypassing the cache
const long loadReloadBypassProxy = 5; // Reloads bypassing the proxy
const long loadReloadBypassProxyAndCache = 6;// Reloads bypassing proxy and cache
const long loadLink = 7;
const long loadRefresh = 8;
/*
Tells the Object to reload the current location.
*/
void reload(in long reloadType);
/*
Stops a load of a URI.
*/
void stop();
/*
Set the document for the current webBrowser. This will simulate the normal
load process of a document being loaded.
@param document - The document to be set.
@param contentType - This is the content type to try and render the document
as. This may be null. If this is null, the method will try to query
the document to identify the content type of the document. If the query
fails, content type "HTML" will be assumed.
*/
void setDocument(in nsIDOMDocument document, in wstring contentType);
/*
Retrieves or sets the current Document for the WebBrowser. When setting
this will simulate the normal load process.
*/
readonly attribute nsIDOMDocument document;
/*
Retrieves the current URI that is loaded.
*/
readonly attribute wstring currentURI;
/*
The session history object used to store the session history for the session.
*/
attribute nsISHistory sessionHistory;
/*
Get the SHEntry associated with a child docshell
*/
nsISHEntry GetSHEForChild(in long childOffset);
/*
Add a Child SHEntry for a frameset page
*/
void AddChildSHEntry(in nsISHEntry cloneReference, in nsISHEntry newEntry, in long childOffset);
};