CLOSED TREE: TraceMonkey merge head. (a=blockers)
[mozilla-central.git] / docshell / shistory / public / nsISHistoryInternal.idl
blob338acec23468514dc873732b3e5c4b2650311766
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* ***** BEGIN LICENSE BLOCK *****
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
5 * The contents of this file are subject to the Mozilla Public License Version
6 * 1.1 (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 * http://www.mozilla.org/MPL/
10 * Software distributed under the License is distributed on an "AS IS" basis,
11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 * for the specific language governing rights and limitations under the
13 * License.
15 * The Original Code is mozilla.org code.
17 * The Initial Developer of the Original Code is
18 * Netscape Communications Corporation.
19 * Portions created by the Initial Developer are Copyright (C) 1999
20 * the Initial Developer. All Rights Reserved.
22 * Contributor(s):
23 * Radha Kulkarni (radha@netscape.com)
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.
37 * ***** END LICENSE BLOCK ***** */
39 #include "nsISupports.idl"
40 #include "nsIFactory.idl"
41 #include "nsISHEntry.idl"
42 #include "nsISHTransaction.idl"
44 interface nsISHistoryListener;
45 interface nsIDocShell;
47 %{C++
48 #define NS_SHISTORY_INTERNAL_CID \
49 { 0x9c47c121, 0x1c6e, 0x4d8f, \
50 { 0xb9, 0x04, 0x3a, 0xc9, 0x68, 0x11, 0x6e, 0x88 } }
52 #define NS_SHISTORY_INTERNAL_CONTRACTID "@mozilla.org/browser/shistory-internal;1"
54 template<class E, class A> class nsTArray;
55 struct nsTArrayDefaultAllocator;
58 [ref] native nsDocshellIDArray(nsTArray<PRUint64, nsTArrayDefaultAllocator>);
60 [scriptable, uuid(2dede933-25e1-47a3-8f61-0127c785ea01)]
61 interface nsISHistoryInternal: nsISupports
63 /**
64 * Add a new Entry to the History List
65 * @param aEntry - The entry to add
66 * @param aPersist - If true this specifies that the entry should persist
67 * in the list. If false, this means that when new entries are added
68 * this element will not appear in the session history list.
70 void addEntry(in nsISHEntry aEntry, in boolean aPersist);
72 /**
73 * Get the root transaction
75 readonly attribute nsISHTransaction rootTransaction;
77 /**
78 * The toplevel docshell object to which this SHistory object belongs to.
80 attribute nsIDocShell rootDocShell;
82 /**
83 * Update the index maintained by sessionHistory
85 void updateIndex();
87 /**
88 * Replace the nsISHEntry at a particular index
89 * @param aIndex - The index at which the entry should be replaced
90 * @param aReplaceEntry - The replacement entry for the index.
92 void replaceEntry(in long aIndex, in nsISHEntry aReplaceEntry);
94 /**
95 * Get handle to the history listener
97 readonly attribute nsISHistoryListener listener;
99 /**
100 * Evict content viewers until the number of content viewers per tab
101 * is no more than gHistoryMaxViewers. Also, count
102 * total number of content viewers globally and evict one if we are over
103 * our total max. This is always called in Show(), after we destroy
104 * the previous viewer.
106 void evictContentViewers(in long previousIndex, in long index);
109 * Evict the content viewer associated with a session history entry
110 * that has timed out.
112 void evictExpiredContentViewerForEntry(in nsISHEntry aEntry);
115 * Evict all the content viewers in this session history
117 void evictAllContentViewers();
120 * Removes entries from the history if their docshellID is in
121 * aIDs array.
123 [noscript, notxpcom] void RemoveEntries(in nsDocshellIDArray aIDs,
124 in long aStartIndex);