2007-03-22 10:30:00 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-05-21 04:12:37 -07:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
#include "nsISupports.idl"
|
|
|
|
|
2013-09-22 16:25:21 -07:00
|
|
|
interface nsIBFCacheEntry;
|
|
|
|
interface nsISHEntry;
|
2007-03-22 10:30:00 -07:00
|
|
|
interface nsISHistoryListener;
|
2013-09-22 16:25:21 -07:00
|
|
|
interface nsISHTransaction;
|
2007-03-22 10:30:00 -07:00
|
|
|
interface nsIDocShell;
|
2013-09-22 16:25:21 -07:00
|
|
|
interface nsIURI;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
%{C++
|
|
|
|
#define NS_SHISTORY_INTERNAL_CID \
|
2007-09-21 02:19:59 -07:00
|
|
|
{ 0x9c47c121, 0x1c6e, 0x4d8f, \
|
|
|
|
{ 0xb9, 0x04, 0x3a, 0xc9, 0x68, 0x11, 0x6e, 0x88 } }
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
#define NS_SHISTORY_INTERNAL_CONTRACTID "@mozilla.org/browser/shistory-internal;1"
|
2010-08-17 07:13:55 -07:00
|
|
|
|
2012-12-18 17:16:06 -08:00
|
|
|
#include "nsTArrayForwardDeclare.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
%}
|
|
|
|
|
2012-12-18 17:16:06 -08:00
|
|
|
[ref] native nsDocshellIDArray(nsTArray<uint64_t>);
|
2010-08-17 07:13:55 -07:00
|
|
|
|
2012-09-20 07:41:18 -07:00
|
|
|
[scriptable, uuid(f9348014-0239-11e2-b029-3d38e719eb2d)]
|
2007-03-22 10:30:00 -07:00
|
|
|
interface nsISHistoryInternal: nsISupports
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Add a new Entry to the History List
|
|
|
|
* @param aEntry - The entry to add
|
|
|
|
* @param aPersist - If true this specifies that the entry should persist
|
|
|
|
* in the list. If false, this means that when new entries are added
|
|
|
|
* this element will not appear in the session history list.
|
|
|
|
*/
|
|
|
|
void addEntry(in nsISHEntry aEntry, in boolean aPersist);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the root transaction
|
|
|
|
*/
|
|
|
|
readonly attribute nsISHTransaction rootTransaction;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The toplevel docshell object to which this SHistory object belongs to.
|
|
|
|
*/
|
|
|
|
attribute nsIDocShell rootDocShell;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Update the index maintained by sessionHistory
|
|
|
|
*/
|
|
|
|
void updateIndex();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Replace the nsISHEntry at a particular index
|
2010-07-07 06:33:52 -07:00
|
|
|
* @param aIndex - The index at which the entry should be replaced
|
2007-03-22 10:30:00 -07:00
|
|
|
* @param aReplaceEntry - The replacement entry for the index.
|
|
|
|
*/
|
|
|
|
void replaceEntry(in long aIndex, in nsISHEntry aReplaceEntry);
|
|
|
|
|
2012-09-20 07:41:18 -07:00
|
|
|
/**
|
|
|
|
* Notifies all registered session history listeners about an impending
|
|
|
|
* reload.
|
|
|
|
*
|
|
|
|
* @param aReloadURI The URI of the document to be reloaded.
|
|
|
|
* @param aReloadFlags Flags that indicate how the document is to be
|
|
|
|
* refreshed. See constants on the nsIWebNavigation
|
|
|
|
* interface.
|
|
|
|
* @return Whether the operation can proceed.
|
2007-03-22 10:30:00 -07:00
|
|
|
*/
|
2012-09-20 07:41:18 -07:00
|
|
|
boolean notifyOnHistoryReload(in nsIURI aReloadURI, in unsigned long aReloadFlags);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2011-10-21 08:26:34 -07:00
|
|
|
/**
|
|
|
|
* Evict content viewers which don't lie in the "safe" range around aIndex.
|
|
|
|
* In practice, this should leave us with no more than gHistoryMaxViewers
|
|
|
|
* viewers associated with this SHistory object.
|
|
|
|
*
|
|
|
|
* Also make sure that the total number of content viewers in all windows is
|
|
|
|
* not greater than our global max; if it is, evict viewers as appropriate.
|
|
|
|
*
|
|
|
|
* @param aIndex - The index around which the "safe" range is centered. In
|
|
|
|
* general, if you just navigated the history, aIndex should be the index
|
|
|
|
* history was navigated to.
|
|
|
|
*/
|
|
|
|
void evictOutOfRangeContentViewers(in long aIndex);
|
2007-09-21 02:19:59 -07:00
|
|
|
|
|
|
|
/**
|
2011-10-21 08:26:34 -07:00
|
|
|
* Evict the content viewer associated with a bfcache entry
|
2007-09-21 02:19:59 -07:00
|
|
|
* that has timed out.
|
|
|
|
*/
|
2011-10-21 08:26:34 -07:00
|
|
|
void evictExpiredContentViewerForEntry(in nsIBFCacheEntry aEntry);
|
2009-01-13 11:32:30 -08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Evict all the content viewers in this session history
|
|
|
|
*/
|
|
|
|
void evictAllContentViewers();
|
2010-08-17 07:13:55 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Removes entries from the history if their docshellID is in
|
|
|
|
* aIDs array.
|
|
|
|
*/
|
|
|
|
[noscript, notxpcom] void RemoveEntries(in nsDocshellIDArray aIDs,
|
|
|
|
in long aStartIndex);
|
2007-03-22 10:30:00 -07:00
|
|
|
};
|