OLD | NEW |
(Empty) | |
| 1 /* |
| 2 * DO NOT EDIT. THIS FILE IS GENERATED FROM c:/builds/tinderbox/XR-Mozilla1.8.0
-Release/WINNT_5.2_Depend/mozilla/xpfe/components/shistory/public/nsISHistoryLis
tener.idl |
| 3 */ |
| 4 |
| 5 #ifndef __gen_nsISHistoryListener_h__ |
| 6 #define __gen_nsISHistoryListener_h__ |
| 7 |
| 8 |
| 9 #ifndef __gen_nsISupports_h__ |
| 10 #include "nsISupports.h" |
| 11 #endif |
| 12 |
| 13 /* For IDL files that don't want to include root IDL files. */ |
| 14 #ifndef NS_NO_VTABLE |
| 15 #define NS_NO_VTABLE |
| 16 #endif |
| 17 class nsIURI; /* forward declaration */ |
| 18 |
| 19 #define NS_SHISTORYLISTENER_CONTRACTID "@mozilla.org/browser/shistorylistener;1" |
| 20 |
| 21 /* starting interface: nsISHistoryListener */ |
| 22 #define NS_ISHISTORYLISTENER_IID_STR "3b07f591-e8e1-11d4-9882-00c04fa02f40" |
| 23 |
| 24 #define NS_ISHISTORYLISTENER_IID \ |
| 25 {0x3b07f591, 0xe8e1, 0x11d4, \ |
| 26 { 0x98, 0x82, 0x00, 0xc0, 0x4f, 0xa0, 0x2f, 0x40 }} |
| 27 |
| 28 /** |
| 29 * nsISHistoryListener defines the interface for an object that wishes |
| 30 * to receive notifications about activities in History. A history |
| 31 * listener will be notified when pages are added, removed and loaded |
| 32 * from session history. A listener to session history can be registered |
| 33 * using the interface nsISHistory. |
| 34 * |
| 35 * @status FROZEN |
| 36 */ |
| 37 class NS_NO_VTABLE nsISHistoryListener : public nsISupports { |
| 38 public: |
| 39 |
| 40 NS_DEFINE_STATIC_IID_ACCESSOR(NS_ISHISTORYLISTENER_IID) |
| 41 |
| 42 /** |
| 43 * called to notify a listener when a new document is |
| 44 * added to session history. New documents are added to |
| 45 * session history by docshell when new pages are loaded |
| 46 * in a frame or content area. |
| 47 * |
| 48 * @param aNewURI The uri of the document to be added to session history |
| 49 * |
| 50 * @return <CODE>NS_OK</CODE> notification sent out successfully |
| 51 */ |
| 52 /* void OnHistoryNewEntry (in nsIURI aNewURI); */ |
| 53 NS_IMETHOD OnHistoryNewEntry(nsIURI *aNewURI) = 0; |
| 54 |
| 55 /** |
| 56 * called to notify a listener when the user presses the 'back' button |
| 57 * of the browser OR when the user attempts to go back one page |
| 58 * in history thro' other means, from javascript or using nsIWebNavigation |
| 59 * |
| 60 * @param aBackURI The uri of the previous page which is to be |
| 61 * loaded. |
| 62 * |
| 63 * @return aReturn A boolean flag returned by the listener to |
| 64 * indicate if the back operation is to be aborted |
| 65 * or continued. If the listener returns 'true', it in
dicates |
| 66 * that the back operation can be continued. If the lis
tener |
| 67 * returns 'false', then the back operation will be abo
rted. |
| 68 * This is a mechanism for the listener to control user
's |
| 69 * operations with history. |
| 70 * |
| 71 */ |
| 72 /* boolean OnHistoryGoBack (in nsIURI aBackURI); */ |
| 73 NS_IMETHOD OnHistoryGoBack(nsIURI *aBackURI, PRBool *_retval) = 0; |
| 74 |
| 75 /** |
| 76 * called to notify a listener when the user presses the 'forward' button |
| 77 * of the browser OR when the user attempts to go forward one page |
| 78 * in history thro' other means, from javascript or using nsIWebNavigation |
| 79 * |
| 80 * @param aForwardURI The uri of the next page which is to be |
| 81 * loaded. |
| 82 * |
| 83 * @return aReturn A boolean flag returned by the listener to |
| 84 * indicate if the forward operation is to be aborted |
| 85 * or continued. If the listener returns 'true', it in
dicates |
| 86 * that the forward operation can be continued. If the
listener |
| 87 * returns 'false', then the forward operation will be
aborted. |
| 88 * This is a mechanism for the listener to control user
's |
| 89 * operations with history. |
| 90 * |
| 91 */ |
| 92 /* boolean OnHistoryGoForward (in nsIURI aForwardURI); */ |
| 93 NS_IMETHOD OnHistoryGoForward(nsIURI *aForwardURI, PRBool *_retval) = 0; |
| 94 |
| 95 /** |
| 96 * called to notify a listener when the user presses the 'reload' button |
| 97 * of the browser OR when the user attempts to reload the current document |
| 98 * through other means, like from javascript or using nsIWebNavigation |
| 99 * |
| 100 * @param aReloadURI The uri of the current document to be reloaded. |
| 101 * @param aReloadFlags Flags that indicate how the document is to be |
| 102 * refreshed. For example, from cache or bypassing |
| 103 * cache and/or Proxy server. |
| 104 * @return aReturn A boolean flag returned by the listener to indicate |
| 105 * if the reload operation is to be aborted or continued. |
| 106 * If the listener returns 'true', it indicates that the |
| 107 * reload operation can be continued. If the listener |
| 108 * returns 'false', then the reload operation will be abo
rted. |
| 109 * This is a mechanism for the listener to control user's
|
| 110 * operations with history. |
| 111 * @see nsIWebNavigation |
| 112 * |
| 113 */ |
| 114 /* boolean OnHistoryReload (in nsIURI aReloadURI, in unsigned long aReloadFlag
s); */ |
| 115 NS_IMETHOD OnHistoryReload(nsIURI *aReloadURI, PRUint32 aReloadFlags, PRBool *
_retval) = 0; |
| 116 |
| 117 /** |
| 118 * called to notify a listener when the user visits a page using the 'Go' menu |
| 119 * of the browser OR when the user attempts to go to a page at a particular in
dex |
| 120 * through other means, like from javascript or using nsIWebNavigation |
| 121 * |
| 122 * @param aIndex The index in history of the document to be loaded. |
| 123 * @param aGotoURI The uri of the document to be loaded. |
| 124 * |
| 125 * @return aReturn A boolean flag returned by the listener to |
| 126 * indicate if the GotoIndex operation is to be aborted |
| 127 * or continued. If the listener returns 'true', it indi
cates |
| 128 * that the GotoIndex operation can be continued. If the
listener |
| 129 * returns 'false', then the GotoIndex operation will be
aborted. |
| 130 * This is a mechanism for the listener to control user's
|
| 131 * operations with history. |
| 132 * |
| 133 */ |
| 134 /* boolean OnHistoryGotoIndex (in long aIndex, in nsIURI aGotoURI); */ |
| 135 NS_IMETHOD OnHistoryGotoIndex(PRInt32 aIndex, nsIURI *aGotoURI, PRBool *_retva
l) = 0; |
| 136 |
| 137 /** |
| 138 * called to notify a listener when documents are removed from session |
| 139 * history. Documents can be removed from session history for various |
| 140 * reasons. For example to control the memory usage of the browser, to |
| 141 * prevent users from loading documents from history, to erase evidence of |
| 142 * prior page loads etc... To purge documents from session history call |
| 143 * nsISHistory::PurgeHistory() |
| 144 * |
| 145 * @param aNumEntries The number of documents to be removed from session his
tory. |
| 146 * |
| 147 * @return aReturn A boolean flag returned by the listener to |
| 148 * indicate if the purge operation is to be aborted |
| 149 * or continued. If the listener returns 'true', it indi
cates |
| 150 * that the purge operation can be continued. If the list
ener |
| 151 * returns 'false', then the purge operation will be abor
ted. |
| 152 * This is a mechanism for the listener to control user's
|
| 153 * operations with history. |
| 154 * |
| 155 * @note While purging history, the older documents are removed |
| 156 * and newly loaded documents are kept. For example if t
here |
| 157 * are 5 documents in history, and nsISHistory::PurgeHist
ory(3) |
| 158 * is called, then, document 1, 2 and 3 are removed from
history |
| 159 * and most recently loaded document 4 and 5 are kept. |
| 160 * |
| 161 */ |
| 162 /* boolean OnHistoryPurge (in long aNumEntries); */ |
| 163 NS_IMETHOD OnHistoryPurge(PRInt32 aNumEntries, PRBool *_retval) = 0; |
| 164 |
| 165 }; |
| 166 |
| 167 /* Use this macro when declaring classes that implement this interface. */ |
| 168 #define NS_DECL_NSISHISTORYLISTENER \ |
| 169 NS_IMETHOD OnHistoryNewEntry(nsIURI *aNewURI); \ |
| 170 NS_IMETHOD OnHistoryGoBack(nsIURI *aBackURI, PRBool *_retval); \ |
| 171 NS_IMETHOD OnHistoryGoForward(nsIURI *aForwardURI, PRBool *_retval); \ |
| 172 NS_IMETHOD OnHistoryReload(nsIURI *aReloadURI, PRUint32 aReloadFlags, PRBool *
_retval); \ |
| 173 NS_IMETHOD OnHistoryGotoIndex(PRInt32 aIndex, nsIURI *aGotoURI, PRBool *_retva
l); \ |
| 174 NS_IMETHOD OnHistoryPurge(PRInt32 aNumEntries, PRBool *_retval); |
| 175 |
| 176 /* Use this macro to declare functions that forward the behavior of this interfa
ce to another object. */ |
| 177 #define NS_FORWARD_NSISHISTORYLISTENER(_to) \ |
| 178 NS_IMETHOD OnHistoryNewEntry(nsIURI *aNewURI) { return _to OnHistoryNewEntry(a
NewURI); } \ |
| 179 NS_IMETHOD OnHistoryGoBack(nsIURI *aBackURI, PRBool *_retval) { return _to OnH
istoryGoBack(aBackURI, _retval); } \ |
| 180 NS_IMETHOD OnHistoryGoForward(nsIURI *aForwardURI, PRBool *_retval) { return _
to OnHistoryGoForward(aForwardURI, _retval); } \ |
| 181 NS_IMETHOD OnHistoryReload(nsIURI *aReloadURI, PRUint32 aReloadFlags, PRBool *
_retval) { return _to OnHistoryReload(aReloadURI, aReloadFlags, _retval); } \ |
| 182 NS_IMETHOD OnHistoryGotoIndex(PRInt32 aIndex, nsIURI *aGotoURI, PRBool *_retva
l) { return _to OnHistoryGotoIndex(aIndex, aGotoURI, _retval); } \ |
| 183 NS_IMETHOD OnHistoryPurge(PRInt32 aNumEntries, PRBool *_retval) { return _to O
nHistoryPurge(aNumEntries, _retval); } |
| 184 |
| 185 /* Use this macro to declare functions that forward the behavior of this interfa
ce to another object in a safe way. */ |
| 186 #define NS_FORWARD_SAFE_NSISHISTORYLISTENER(_to) \ |
| 187 NS_IMETHOD OnHistoryNewEntry(nsIURI *aNewURI) { return !_to ? NS_ERROR_NULL_PO
INTER : _to->OnHistoryNewEntry(aNewURI); } \ |
| 188 NS_IMETHOD OnHistoryGoBack(nsIURI *aBackURI, PRBool *_retval) { return !_to ?
NS_ERROR_NULL_POINTER : _to->OnHistoryGoBack(aBackURI, _retval); } \ |
| 189 NS_IMETHOD OnHistoryGoForward(nsIURI *aForwardURI, PRBool *_retval) { return !
_to ? NS_ERROR_NULL_POINTER : _to->OnHistoryGoForward(aForwardURI, _retval); } \ |
| 190 NS_IMETHOD OnHistoryReload(nsIURI *aReloadURI, PRUint32 aReloadFlags, PRBool *
_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->OnHistoryReload(aReloadURI
, aReloadFlags, _retval); } \ |
| 191 NS_IMETHOD OnHistoryGotoIndex(PRInt32 aIndex, nsIURI *aGotoURI, PRBool *_retva
l) { return !_to ? NS_ERROR_NULL_POINTER : _to->OnHistoryGotoIndex(aIndex, aGoto
URI, _retval); } \ |
| 192 NS_IMETHOD OnHistoryPurge(PRInt32 aNumEntries, PRBool *_retval) { return !_to
? NS_ERROR_NULL_POINTER : _to->OnHistoryPurge(aNumEntries, _retval); } |
| 193 |
| 194 #if 0 |
| 195 /* Use the code below as a template for the implementation class for this interf
ace. */ |
| 196 |
| 197 /* Header file */ |
| 198 class nsSHistoryListener : public nsISHistoryListener |
| 199 { |
| 200 public: |
| 201 NS_DECL_ISUPPORTS |
| 202 NS_DECL_NSISHISTORYLISTENER |
| 203 |
| 204 nsSHistoryListener(); |
| 205 |
| 206 private: |
| 207 ~nsSHistoryListener(); |
| 208 |
| 209 protected: |
| 210 /* additional members */ |
| 211 }; |
| 212 |
| 213 /* Implementation file */ |
| 214 NS_IMPL_ISUPPORTS1(nsSHistoryListener, nsISHistoryListener) |
| 215 |
| 216 nsSHistoryListener::nsSHistoryListener() |
| 217 { |
| 218 /* member initializers and constructor code */ |
| 219 } |
| 220 |
| 221 nsSHistoryListener::~nsSHistoryListener() |
| 222 { |
| 223 /* destructor code */ |
| 224 } |
| 225 |
| 226 /* void OnHistoryNewEntry (in nsIURI aNewURI); */ |
| 227 NS_IMETHODIMP nsSHistoryListener::OnHistoryNewEntry(nsIURI *aNewURI) |
| 228 { |
| 229 return NS_ERROR_NOT_IMPLEMENTED; |
| 230 } |
| 231 |
| 232 /* boolean OnHistoryGoBack (in nsIURI aBackURI); */ |
| 233 NS_IMETHODIMP nsSHistoryListener::OnHistoryGoBack(nsIURI *aBackURI, PRBool *_ret
val) |
| 234 { |
| 235 return NS_ERROR_NOT_IMPLEMENTED; |
| 236 } |
| 237 |
| 238 /* boolean OnHistoryGoForward (in nsIURI aForwardURI); */ |
| 239 NS_IMETHODIMP nsSHistoryListener::OnHistoryGoForward(nsIURI *aForwardURI, PRBool
*_retval) |
| 240 { |
| 241 return NS_ERROR_NOT_IMPLEMENTED; |
| 242 } |
| 243 |
| 244 /* boolean OnHistoryReload (in nsIURI aReloadURI, in unsigned long aReloadFlags)
; */ |
| 245 NS_IMETHODIMP nsSHistoryListener::OnHistoryReload(nsIURI *aReloadURI, PRUint32 a
ReloadFlags, PRBool *_retval) |
| 246 { |
| 247 return NS_ERROR_NOT_IMPLEMENTED; |
| 248 } |
| 249 |
| 250 /* boolean OnHistoryGotoIndex (in long aIndex, in nsIURI aGotoURI); */ |
| 251 NS_IMETHODIMP nsSHistoryListener::OnHistoryGotoIndex(PRInt32 aIndex, nsIURI *aGo
toURI, PRBool *_retval) |
| 252 { |
| 253 return NS_ERROR_NOT_IMPLEMENTED; |
| 254 } |
| 255 |
| 256 /* boolean OnHistoryPurge (in long aNumEntries); */ |
| 257 NS_IMETHODIMP nsSHistoryListener::OnHistoryPurge(PRInt32 aNumEntries, PRBool *_r
etval) |
| 258 { |
| 259 return NS_ERROR_NOT_IMPLEMENTED; |
| 260 } |
| 261 |
| 262 /* End of implementation class template. */ |
| 263 #endif |
| 264 |
| 265 |
| 266 #endif /* __gen_nsISHistoryListener_h__ */ |
OLD | NEW |