PageRenderTime 124ms CodeModel.GetById 60ms app.highlight 5ms RepoModel.GetById 55ms app.codeStats 0ms

/gecko_api/include/nsISHistoryListener.h

http://firefox-mac-pdf.googlecode.com/
C++ Header | 220 lines | 89 code | 37 blank | 94 comment | 0 complexity | 049f920271bdaaced459f7cf8f8edb58 MD5 | raw file
  1/*
  2 * DO NOT EDIT.  THIS FILE IS GENERATED FROM /builds/tinderbox/XR-Trunk/Darwin_8.8.4_Depend/mozilla/docshell/shistory/public/nsISHistoryListener.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
 17class nsIURI; /* forward declaration */
 18
 19
 20/* starting interface:    nsISHistoryListener */
 21#define NS_ISHISTORYLISTENER_IID_STR "3b07f591-e8e1-11d4-9882-00c04fa02f40"
 22
 23#define NS_ISHISTORYLISTENER_IID \
 24  {0x3b07f591, 0xe8e1, 0x11d4, \
 25    { 0x98, 0x82, 0x00, 0xc0, 0x4f, 0xa0, 0x2f, 0x40 }}
 26
 27/**
 28 * nsISHistoryListener defines the interface one can implement to receive
 29 * notifications about activities in session history and to be able to
 30 * cancel them.
 31 *
 32 * A session history listener will be notified when pages are added, removed
 33 * and loaded from session history. It can prevent any action (except adding
 34 * a new session history entry) from happening by returning false from the
 35 * corresponding callback method.
 36 *
 37 * A session history listener can be registered on a particular nsISHistory
 38 * instance via the nsISHistory::addSHistoryListener() method.
 39 *
 40 * @status FROZEN
 41 */
 42class NS_NO_VTABLE NS_SCRIPTABLE nsISHistoryListener : public nsISupports {
 43 public: 
 44
 45  NS_DECLARE_STATIC_IID_ACCESSOR(NS_ISHISTORYLISTENER_IID)
 46
 47  /**
 48   * Called when a new document is added to session history. New documents are
 49   * added to session history by docshell when new pages are loaded in a frame
 50   * or content area, for example via nsIWebNavigation::loadURI()
 51   *
 52   * @param aNewURI     The URI of the document to be added to session history.
 53   */
 54  /* void OnHistoryNewEntry (in nsIURI aNewURI); */
 55  NS_SCRIPTABLE NS_IMETHOD OnHistoryNewEntry(nsIURI *aNewURI) = 0;
 56
 57  /**
 58   * Called when navigating to a previous session history entry, for example
 59   * due to a nsIWebNavigation::goBack() call.
 60   *
 61   * @param aBackURI    The URI of the session history entry being navigated to.
 62   * @return            Whether the operation can proceed.
 63   */
 64  /* boolean OnHistoryGoBack (in nsIURI aBackURI); */
 65  NS_SCRIPTABLE NS_IMETHOD OnHistoryGoBack(nsIURI *aBackURI, PRBool *_retval) = 0;
 66
 67  /**
 68   * Called when navigating to a next session history entry, for example
 69   * due to a nsIWebNavigation::goForward() call.
 70   *
 71   * @param aForwardURI   The URI of the session history entry being navigated to.
 72   * @return              Whether the operation can proceed.
 73   */
 74  /* boolean OnHistoryGoForward (in nsIURI aForwardURI); */
 75  NS_SCRIPTABLE NS_IMETHOD OnHistoryGoForward(nsIURI *aForwardURI, PRBool *_retval) = 0;
 76
 77  /** 
 78   * Called when the current document is reloaded, for example due to a
 79   * nsIWebNavigation::reload() call.
 80   *
 81   * @param aReloadURI    The URI of the document to be reloaded.
 82   * @param aReloadFlags  Flags that indicate how the document is to be 
 83   *                      refreshed. See constants on the nsIWebNavigation
 84   *                      interface.
 85   * @return              Whether the operation can proceed.
 86   *
 87   * @see  nsIWebNavigation
 88   */
 89  /* boolean OnHistoryReload (in nsIURI aReloadURI, in unsigned long aReloadFlags); */
 90  NS_SCRIPTABLE NS_IMETHOD OnHistoryReload(nsIURI *aReloadURI, PRUint32 aReloadFlags, PRBool *_retval) = 0;
 91
 92  /**
 93   * Called when navigating to a session history entry by index, for example,
 94   * when nsIWebNavigation::gotoIndex() is called.
 95   *
 96   * @param aIndex        The index in session history of the entry to be loaded.
 97   * @param aGotoURI      The URI of the session history entry to be loaded.
 98   * @return              Whether the operation can proceed.
 99   */
100  /* boolean OnHistoryGotoIndex (in long aIndex, in nsIURI aGotoURI); */
101  NS_SCRIPTABLE NS_IMETHOD OnHistoryGotoIndex(PRInt32 aIndex, nsIURI *aGotoURI, PRBool *_retval) = 0;
102
103  /**
104   * Called when entries are removed from session history. Entries can be
105   * removed from session history for various reasons, for example to control
106   * the memory usage of the browser, to prevent users from loading documents
107   * from history, to erase evidence of prior page loads, etc.
108   *
109   * To purge documents from session history call nsISHistory::PurgeHistory()
110   *
111   * @param aNumEntries   The number of entries to be removed from session history.
112   * @return              Whether the operation can proceed.
113   */
114  /* boolean OnHistoryPurge (in long aNumEntries); */
115  NS_SCRIPTABLE NS_IMETHOD OnHistoryPurge(PRInt32 aNumEntries, PRBool *_retval) = 0;
116
117};
118
119  NS_DEFINE_STATIC_IID_ACCESSOR(nsISHistoryListener, NS_ISHISTORYLISTENER_IID)
120
121/* Use this macro when declaring classes that implement this interface. */
122#define NS_DECL_NSISHISTORYLISTENER \
123  NS_SCRIPTABLE NS_IMETHOD OnHistoryNewEntry(nsIURI *aNewURI); \
124  NS_SCRIPTABLE NS_IMETHOD OnHistoryGoBack(nsIURI *aBackURI, PRBool *_retval); \
125  NS_SCRIPTABLE NS_IMETHOD OnHistoryGoForward(nsIURI *aForwardURI, PRBool *_retval); \
126  NS_SCRIPTABLE NS_IMETHOD OnHistoryReload(nsIURI *aReloadURI, PRUint32 aReloadFlags, PRBool *_retval); \
127  NS_SCRIPTABLE NS_IMETHOD OnHistoryGotoIndex(PRInt32 aIndex, nsIURI *aGotoURI, PRBool *_retval); \
128  NS_SCRIPTABLE NS_IMETHOD OnHistoryPurge(PRInt32 aNumEntries, PRBool *_retval); 
129
130/* Use this macro to declare functions that forward the behavior of this interface to another object. */
131#define NS_FORWARD_NSISHISTORYLISTENER(_to) \
132  NS_SCRIPTABLE NS_IMETHOD OnHistoryNewEntry(nsIURI *aNewURI) { return _to OnHistoryNewEntry(aNewURI); } \
133  NS_SCRIPTABLE NS_IMETHOD OnHistoryGoBack(nsIURI *aBackURI, PRBool *_retval) { return _to OnHistoryGoBack(aBackURI, _retval); } \
134  NS_SCRIPTABLE NS_IMETHOD OnHistoryGoForward(nsIURI *aForwardURI, PRBool *_retval) { return _to OnHistoryGoForward(aForwardURI, _retval); } \
135  NS_SCRIPTABLE NS_IMETHOD OnHistoryReload(nsIURI *aReloadURI, PRUint32 aReloadFlags, PRBool *_retval) { return _to OnHistoryReload(aReloadURI, aReloadFlags, _retval); } \
136  NS_SCRIPTABLE NS_IMETHOD OnHistoryGotoIndex(PRInt32 aIndex, nsIURI *aGotoURI, PRBool *_retval) { return _to OnHistoryGotoIndex(aIndex, aGotoURI, _retval); } \
137  NS_SCRIPTABLE NS_IMETHOD OnHistoryPurge(PRInt32 aNumEntries, PRBool *_retval) { return _to OnHistoryPurge(aNumEntries, _retval); } 
138
139/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
140#define NS_FORWARD_SAFE_NSISHISTORYLISTENER(_to) \
141  NS_SCRIPTABLE NS_IMETHOD OnHistoryNewEntry(nsIURI *aNewURI) { return !_to ? NS_ERROR_NULL_POINTER : _to->OnHistoryNewEntry(aNewURI); } \
142  NS_SCRIPTABLE NS_IMETHOD OnHistoryGoBack(nsIURI *aBackURI, PRBool *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->OnHistoryGoBack(aBackURI, _retval); } \
143  NS_SCRIPTABLE NS_IMETHOD OnHistoryGoForward(nsIURI *aForwardURI, PRBool *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->OnHistoryGoForward(aForwardURI, _retval); } \
144  NS_SCRIPTABLE NS_IMETHOD OnHistoryReload(nsIURI *aReloadURI, PRUint32 aReloadFlags, PRBool *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->OnHistoryReload(aReloadURI, aReloadFlags, _retval); } \
145  NS_SCRIPTABLE NS_IMETHOD OnHistoryGotoIndex(PRInt32 aIndex, nsIURI *aGotoURI, PRBool *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->OnHistoryGotoIndex(aIndex, aGotoURI, _retval); } \
146  NS_SCRIPTABLE NS_IMETHOD OnHistoryPurge(PRInt32 aNumEntries, PRBool *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->OnHistoryPurge(aNumEntries, _retval); } 
147
148#if 0
149/* Use the code below as a template for the implementation class for this interface. */
150
151/* Header file */
152class nsSHistoryListener : public nsISHistoryListener
153{
154public:
155  NS_DECL_ISUPPORTS
156  NS_DECL_NSISHISTORYLISTENER
157
158  nsSHistoryListener();
159
160private:
161  ~nsSHistoryListener();
162
163protected:
164  /* additional members */
165};
166
167/* Implementation file */
168NS_IMPL_ISUPPORTS1(nsSHistoryListener, nsISHistoryListener)
169
170nsSHistoryListener::nsSHistoryListener()
171{
172  /* member initializers and constructor code */
173}
174
175nsSHistoryListener::~nsSHistoryListener()
176{
177  /* destructor code */
178}
179
180/* void OnHistoryNewEntry (in nsIURI aNewURI); */
181NS_IMETHODIMP nsSHistoryListener::OnHistoryNewEntry(nsIURI *aNewURI)
182{
183    return NS_ERROR_NOT_IMPLEMENTED;
184}
185
186/* boolean OnHistoryGoBack (in nsIURI aBackURI); */
187NS_IMETHODIMP nsSHistoryListener::OnHistoryGoBack(nsIURI *aBackURI, PRBool *_retval)
188{
189    return NS_ERROR_NOT_IMPLEMENTED;
190}
191
192/* boolean OnHistoryGoForward (in nsIURI aForwardURI); */
193NS_IMETHODIMP nsSHistoryListener::OnHistoryGoForward(nsIURI *aForwardURI, PRBool *_retval)
194{
195    return NS_ERROR_NOT_IMPLEMENTED;
196}
197
198/* boolean OnHistoryReload (in nsIURI aReloadURI, in unsigned long aReloadFlags); */
199NS_IMETHODIMP nsSHistoryListener::OnHistoryReload(nsIURI *aReloadURI, PRUint32 aReloadFlags, PRBool *_retval)
200{
201    return NS_ERROR_NOT_IMPLEMENTED;
202}
203
204/* boolean OnHistoryGotoIndex (in long aIndex, in nsIURI aGotoURI); */
205NS_IMETHODIMP nsSHistoryListener::OnHistoryGotoIndex(PRInt32 aIndex, nsIURI *aGotoURI, PRBool *_retval)
206{
207    return NS_ERROR_NOT_IMPLEMENTED;
208}
209
210/* boolean OnHistoryPurge (in long aNumEntries); */
211NS_IMETHODIMP nsSHistoryListener::OnHistoryPurge(PRInt32 aNumEntries, PRBool *_retval)
212{
213    return NS_ERROR_NOT_IMPLEMENTED;
214}
215
216/* End of implementation class template. */
217#endif
218
219
220#endif /* __gen_nsISHistoryListener_h__ */