PageRenderTime 59ms CodeModel.GetById 55ms app.highlight 1ms RepoModel.GetById 2ms app.codeStats 0ms

/gecko_sdk/idl/nsISHistoryListener.idl

http://firefox-mac-pdf.googlecode.com/
IDL | 124 lines | 12 code | 8 blank | 104 comment | 0 complexity | c1c2078dd87e7ee4a5414f8ff11cb260 MD5 | raw file
  1/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  2 *
  3 * ***** BEGIN LICENSE BLOCK *****
  4 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  5 *
  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/
 10 *
 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
 14 * License.
 15 *
 16 * The Original Code is the Mozilla browser.
 17 *
 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.
 22 *
 23 * Contributor(s):
 24 *
 25 * Alternatively, the contents of this file may be used under the terms of
 26 * either of the GNU General Public License Version 2 or later (the "GPL"),
 27 * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
 28 * in which case the provisions of the GPL or the LGPL are applicable instead
 29 * of those above. If you wish to allow use of your version of this file only
 30 * under the terms of either the GPL or the LGPL, and not to allow others to
 31 * use your version of this file under the terms of the MPL, indicate your
 32 * decision by deleting the provisions above and replace them with the notice
 33 * and other provisions required by the GPL or the LGPL. If you do not delete
 34 * the provisions above, a recipient may use your version of this file under
 35 * the terms of any one of the MPL, the GPL or the LGPL.
 36 *
 37 * ***** END LICENSE BLOCK ***** */
 38
 39#include "nsISupports.idl"
 40
 41interface nsIURI;
 42
 43/**
 44 * nsISHistoryListener defines the interface one can implement to receive
 45 * notifications about activities in session history and to be able to
 46 * cancel them.
 47 *
 48 * A session history listener will be notified when pages are added, removed
 49 * and loaded from session history. It can prevent any action (except adding
 50 * a new session history entry) from happening by returning false from the
 51 * corresponding callback method.
 52 *
 53 * A session history listener can be registered on a particular nsISHistory
 54 * instance via the nsISHistory::addSHistoryListener() method.
 55 *
 56 * @status FROZEN
 57 */
 58[scriptable, uuid(3b07f591-e8e1-11d4-9882-00c04fa02f40)]
 59interface nsISHistoryListener : nsISupports 
 60{
 61  /**
 62   * Called when a new document is added to session history. New documents are
 63   * added to session history by docshell when new pages are loaded in a frame
 64   * or content area, for example via nsIWebNavigation::loadURI()
 65   *
 66   * @param aNewURI     The URI of the document to be added to session history.
 67   */
 68   void OnHistoryNewEntry(in nsIURI aNewURI);
 69
 70  /**
 71   * Called when navigating to a previous session history entry, for example
 72   * due to a nsIWebNavigation::goBack() call.
 73   *
 74   * @param aBackURI    The URI of the session history entry being navigated to.
 75   * @return            Whether the operation can proceed.
 76   */
 77   boolean OnHistoryGoBack(in nsIURI aBackURI);
 78
 79  /**
 80   * Called when navigating to a next session history entry, for example
 81   * due to a nsIWebNavigation::goForward() call.
 82   *
 83   * @param aForwardURI   The URI of the session history entry being navigated to.
 84   * @return              Whether the operation can proceed.
 85   */
 86   boolean OnHistoryGoForward(in nsIURI aForwardURI);
 87
 88  /** 
 89   * Called when the current document is reloaded, for example due to a
 90   * nsIWebNavigation::reload() call.
 91   *
 92   * @param aReloadURI    The URI of the document to be reloaded.
 93   * @param aReloadFlags  Flags that indicate how the document is to be 
 94   *                      refreshed. See constants on the nsIWebNavigation
 95   *                      interface.
 96   * @return              Whether the operation can proceed.
 97   *
 98   * @see  nsIWebNavigation
 99   */
100   boolean OnHistoryReload(in nsIURI aReloadURI, in unsigned long aReloadFlags);
101
102  /**
103   * Called when navigating to a session history entry by index, for example,
104   * when nsIWebNavigation::gotoIndex() is called.
105   *
106   * @param aIndex        The index in session history of the entry to be loaded.
107   * @param aGotoURI      The URI of the session history entry to be loaded.
108   * @return              Whether the operation can proceed.
109   */
110   boolean OnHistoryGotoIndex(in long aIndex, in nsIURI aGotoURI);
111
112  /**
113   * Called when entries are removed from session history. Entries can be
114   * removed from session history for various reasons, for example to control
115   * the memory usage of the browser, to prevent users from loading documents
116   * from history, to erase evidence of prior page loads, etc.
117   *
118   * To purge documents from session history call nsISHistory::PurgeHistory()
119   *
120   * @param aNumEntries   The number of entries to be removed from session history.
121   * @return              Whether the operation can proceed.
122   */
123   boolean OnHistoryPurge(in long aNumEntries);
124};