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