OLD | NEW |
(Empty) | |
| 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 |
| 41 interface nsIURI; |
| 42 |
| 43 |
| 44 /** |
| 45 * nsISHistoryListener defines the interface for an object that wishes |
| 46 * to receive notifications about activities in History. A history |
| 47 * listener will be notified when pages are added, removed and loaded |
| 48 * from session history. A listener to session history can be registered |
| 49 * using the interface nsISHistory. |
| 50 * |
| 51 * @status FROZEN |
| 52 */ |
| 53 %{C++ |
| 54 #define NS_SHISTORYLISTENER_CONTRACTID "@mozilla.org/browser/shistorylistener;1" |
| 55 %} |
| 56 |
| 57 // interface nsISHistoryListener |
| 58 |
| 59 [scriptable, uuid(3b07f591-e8e1-11d4-9882-00c04fa02f40)] |
| 60 interface nsISHistoryListener : nsISupports |
| 61 { |
| 62 |
| 63 /** |
| 64 * called to notify a listener when a new document is |
| 65 * added to session history. New documents are added to |
| 66 * session history by docshell when new pages are loaded |
| 67 * in a frame or content area. |
| 68 * |
| 69 * @param aNewURI The uri of the document to be added to session history |
| 70 * |
| 71 * @return <CODE>NS_OK</CODE> notification sent out successfully |
| 72 */ |
| 73 void OnHistoryNewEntry(in nsIURI aNewURI); |
| 74 |
| 75 /** |
| 76 * called to notify a listener when the user presses the 'back' button |
| 77 * of the browser OR when the user attempts to go back one page |
| 78 * in history thro' other means, from javascript or using nsIWebNavigation |
| 79 * |
| 80 * @param aBackURI The uri of the previous page which is to be |
| 81 * loaded. |
| 82 * |
| 83 * @return aReturn A boolean flag returned by the listener to |
| 84 * indicate if the back operation is to be aborted |
| 85 * or continued. If the listener returns 'true', it in
dicates |
| 86 * that the back operation can be continued. If the lis
tener |
| 87 * returns 'false', then the back operation will be abo
rted. |
| 88 * This is a mechanism for the listener to control user
's |
| 89 * operations with history. |
| 90 * |
| 91 */ |
| 92 boolean OnHistoryGoBack(in nsIURI aBackURI); |
| 93 |
| 94 /** |
| 95 * called to notify a listener when the user presses the 'forward' button |
| 96 * of the browser OR when the user attempts to go forward one page |
| 97 * in history thro' other means, from javascript or using nsIWebNavigation |
| 98 * |
| 99 * @param aForwardURI The uri of the next page which is to be |
| 100 * loaded. |
| 101 * |
| 102 * @return aReturn A boolean flag returned by the listener to |
| 103 * indicate if the forward operation is to be aborted |
| 104 * or continued. If the listener returns 'true', it in
dicates |
| 105 * that the forward operation can be continued. If the
listener |
| 106 * returns 'false', then the forward operation will be
aborted. |
| 107 * This is a mechanism for the listener to control user
's |
| 108 * operations with history. |
| 109 * |
| 110 */ |
| 111 boolean OnHistoryGoForward(in nsIURI aForwardURI); |
| 112 |
| 113 /** |
| 114 * called to notify a listener when the user presses the 'reload' button |
| 115 * of the browser OR when the user attempts to reload the current document |
| 116 * through other means, like from javascript or using nsIWebNavigation |
| 117 * |
| 118 * @param aReloadURI The uri of the current document to be reloaded. |
| 119 * @param aReloadFlags Flags that indicate how the document is to be |
| 120 * refreshed. For example, from cache or bypassing |
| 121 * cache and/or Proxy server. |
| 122 * @return aReturn A boolean flag returned by the listener to indicate |
| 123 * if the reload operation is to be aborted or continued. |
| 124 * If the listener returns 'true', it indicates that the |
| 125 * reload operation can be continued. If the listener |
| 126 * returns 'false', then the reload operation will be abo
rted. |
| 127 * This is a mechanism for the listener to control user's
|
| 128 * operations with history. |
| 129 * @see nsIWebNavigation |
| 130 * |
| 131 */ |
| 132 boolean OnHistoryReload(in nsIURI aReloadURI, in unsigned long aReloadFlags); |
| 133 |
| 134 /** |
| 135 * called to notify a listener when the user visits a page using the 'Go' menu |
| 136 * of the browser OR when the user attempts to go to a page at a particular in
dex |
| 137 * through other means, like from javascript or using nsIWebNavigation |
| 138 * |
| 139 * @param aIndex The index in history of the document to be loaded. |
| 140 * @param aGotoURI The uri of the document to be loaded. |
| 141 * |
| 142 * @return aReturn A boolean flag returned by the listener to |
| 143 * indicate if the GotoIndex operation is to be aborted |
| 144 * or continued. If the listener returns 'true', it indi
cates |
| 145 * that the GotoIndex operation can be continued. If the
listener |
| 146 * returns 'false', then the GotoIndex operation will be
aborted. |
| 147 * This is a mechanism for the listener to control user's
|
| 148 * operations with history. |
| 149 * |
| 150 */ |
| 151 boolean OnHistoryGotoIndex(in long aIndex, in nsIURI aGotoURI); |
| 152 |
| 153 /** |
| 154 * called to notify a listener when documents are removed from session |
| 155 * history. Documents can be removed from session history for various |
| 156 * reasons. For example to control the memory usage of the browser, to |
| 157 * prevent users from loading documents from history, to erase evidence of |
| 158 * prior page loads etc... To purge documents from session history call |
| 159 * nsISHistory::PurgeHistory() |
| 160 * |
| 161 * @param aNumEntries The number of documents to be removed from session his
tory. |
| 162 * |
| 163 * @return aReturn A boolean flag returned by the listener to |
| 164 * indicate if the purge operation is to be aborted |
| 165 * or continued. If the listener returns 'true', it indi
cates |
| 166 * that the purge operation can be continued. If the list
ener |
| 167 * returns 'false', then the purge operation will be abor
ted. |
| 168 * This is a mechanism for the listener to control user's
|
| 169 * operations with history. |
| 170 * |
| 171 * @note While purging history, the older documents are removed |
| 172 * and newly loaded documents are kept. For example if t
here |
| 173 * are 5 documents in history, and nsISHistory::PurgeHist
ory(3) |
| 174 * is called, then, document 1, 2 and 3 are removed from
history |
| 175 * and most recently loaded document 4 and 5 are kept. |
| 176 * |
| 177 */ |
| 178 boolean OnHistoryPurge(in long aNumEntries); |
| 179 }; |
OLD | NEW |