/* -*- Mode: IDL; tab-width: 2; 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):
 *   Radha Kulkarni <radha@netscape.com> */

#include "nsISupports.idl"

interface nsIURI;


/**
 * nsISHistoryListener defines an interface for an object to receive  
 * notifications about activities in History. A History listener will be 
 * notified about page additions,back,forward,goto traversals thro' 
 * Session history
 */
%{C++
#define NS_SHISTORYLISTENER_CONTRACTID "@mozilla.org/browser/shistorylistener;1"
%}

// interface nsISHistoryListener

[scriptable, uuid(3b07f591-e8e1-11d4-9882-00c04fa02f40)]
interface nsISHistoryListener : nsISupports 
{

  /**
   * Notify when a new page is added to History
   */
   void OnHistoryNewEntry(in nsIURI aNewURI);

  /**
   * Notification for going back with an option to cancel the operation
   */
   boolean OnHistoryGoBack(in nsIURI aBackURI);

  /**
   * Notification for going forward with an option to cancel the operation
   */
   boolean OnHistoryGoForward(in nsIURI aForwardURI);

  /** 
   * Notification for Reload with an option to cancel
   */
   boolean OnHistoryReload(in nsIURI aReloadURI, in unsigned long aReloadFlags);

  /**
   * Notify while going to an particular index with an option to cancel
   */
   boolean OnHistoryGotoIndex(in long aIndex, in nsIURI aGotoURI);

  /**
   * Notify when History is about to be trimmed with an option to cancel
   */
   boolean OnHistoryPurge(in long aNumEntries);
};