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