nsISHistory.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292
  1. /*
  2. * DO NOT EDIT. THIS FILE IS GENERATED FROM c:/mozilla/xpfe/components/shistory/public/nsISHistory.idl
  3. */
  4. #ifndef __gen_nsISHistory_h__
  5. #define __gen_nsISHistory_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 nsIHistoryEntry; /* forward declaration */
  14. class nsISHistoryListener; /* forward declaration */
  15. class nsISimpleEnumerator; /* forward declaration */
  16. #define NS_SHISTORY_CID \
  17. {0x7294fe9c, 0x14d8, 0x11d5, {0x98, 0x82, 0x00, 0xC0, 0x4f, 0xa0, 0x2f, 0x40}}
  18. #define NS_SHISTORY_CONTRACTID "@mozilla.org/browser/shistory;1"
  19. /* starting interface: nsISHistory */
  20. #define NS_ISHISTORY_IID_STR "7294fe9b-14d8-11d5-9882-00c04fa02f40"
  21. #define NS_ISHISTORY_IID \
  22. {0x7294fe9b, 0x14d8, 0x11d5, \
  23. { 0x98, 0x82, 0x00, 0xc0, 0x4f, 0xa0, 0x2f, 0x40 }}
  24. /**
  25. * An interface to the primary properties of the Session History
  26. * component. In an embedded browser environment, the nsIWebBrowser
  27. * object creates an instance of session history for each open window.
  28. * A handle to the session history object can be obtained from
  29. * nsIWebNavigation. In a non-embedded situation, the owner of the
  30. * session history component must create a instance of it and set
  31. * it in the nsIWebNavigation object.
  32. * This interface is accessible from javascript.
  33. *
  34. * @status FROZEN
  35. */
  36. class NS_NO_VTABLE nsISHistory : public nsISupports {
  37. public:
  38. NS_DEFINE_STATIC_IID_ACCESSOR(NS_ISHISTORY_IID)
  39. /**
  40. * A readonly property of the interface that returns
  41. * the number of toplevel documents currently available
  42. * in session history.
  43. */
  44. /* readonly attribute long count; */
  45. NS_IMETHOD GetCount(PRInt32 *aCount) = 0;
  46. /**
  47. * A readonly property of the interface that returns
  48. * the index of the current document in session history.
  49. */
  50. /* readonly attribute long index; */
  51. NS_IMETHOD GetIndex(PRInt32 *aIndex) = 0;
  52. /**
  53. * A read/write property of the interface, used to Get/Set
  54. * the maximum number of toplevel documents, session history
  55. * can hold for each instance.
  56. */
  57. /* attribute long maxLength; */
  58. NS_IMETHOD GetMaxLength(PRInt32 *aMaxLength) = 0;
  59. NS_IMETHOD SetMaxLength(PRInt32 aMaxLength) = 0;
  60. /**
  61. * Called to obtain handle to the history entry at a
  62. * given index.
  63. *
  64. * @param index The index value whose entry is requested.
  65. * @param modifyIndex A boolean flag that indicates if the current
  66. * index of session history should be modified
  67. * to the parameter index.
  68. *
  69. * @return <code>NS_OK</code> history entry for
  70. * the index is obtained successfully.
  71. * <code>NS_ERROR_FAILURE</code> Error in obtaining
  72. * history entry for the given index.
  73. */
  74. /* nsIHistoryEntry getEntryAtIndex (in long index, in boolean modifyIndex); */
  75. NS_IMETHOD GetEntryAtIndex(PRInt32 index, PRBool modifyIndex, nsIHistoryEntry **_retval) = 0;
  76. /**
  77. * Called to purge older documents from history.
  78. * Documents can be removed from session history for various
  79. * reasons. For example to control memory usage of the browser, to
  80. * prevent users from loading documents from history, to erase evidence of
  81. * prior page loads etc...
  82. *
  83. * @param numEntries The number of toplevel documents to be
  84. * purged from history. During purge operation,
  85. * the latest documents are maintained and older
  86. * 'numEntries' documents are removed from history.
  87. * @throws <code>NS_SUCCESS_LOSS_OF_INSIGNIFICANT_DATA</code> Purge was vetod.
  88. * @throws <code>NS_ERROR_FAILURE</code> numEntries is
  89. * invalid or out of bounds with the size of history.
  90. *
  91. */
  92. /* void PurgeHistory (in long numEntries); */
  93. NS_IMETHOD PurgeHistory(PRInt32 numEntries) = 0;
  94. /**
  95. * Called to register a listener for the session history component.
  96. * Listeners are notified when pages are loaded or purged from history.
  97. *
  98. * @param aListener Listener object to be notified for all
  99. * page loads that initiate in session history.
  100. *
  101. * @note A listener object must implement
  102. * nsISHistoryListener and nsSupportsWeakReference
  103. *
  104. * @see nsISHistoryListener
  105. * @see nsSupportsWeakReference
  106. */
  107. /* void addSHistoryListener (in nsISHistoryListener aListener); */
  108. NS_IMETHOD AddSHistoryListener(nsISHistoryListener *aListener) = 0;
  109. /**
  110. * Called to remove a listener for the session history component.
  111. * Listeners are notified when pages are loaded from history.
  112. *
  113. * @param aListener Listener object to be removed from
  114. * session history.
  115. *
  116. * @note A listener object must implement
  117. * nsISHistoryListener and nsSupportsWeakReference
  118. * @see nsISHistoryListener
  119. * @see nsSupportsWeakReference
  120. */
  121. /* void removeSHistoryListener (in nsISHistoryListener aListener); */
  122. NS_IMETHOD RemoveSHistoryListener(nsISHistoryListener *aListener) = 0;
  123. /**
  124. * Called to obtain a enumerator for all the documents stored in
  125. * session history. The enumerator object thus returned by this method
  126. * can be traversed using nsISimpleEnumerator.
  127. *
  128. * @note To access individual history entries of the enumerator, perform the
  129. * following steps:
  130. * 1) Call nsISHistory->GetSHistoryEnumerator() to obtain handle
  131. * the nsISimpleEnumerator object.
  132. * 2) Use nsISimpleEnumerator->GetNext() on the object returned
  133. * by step #1 to obtain handle to the next object in the list.
  134. * The object returned by this step is of type nsISupports.
  135. * 3) Perform a QueryInterface on the object returned by step #2
  136. * to nsIHistoryEntry.
  137. * 4) Use nsIHistoryEntry to access properties of each history entry.
  138. *
  139. * @see nsISimpleEnumerator
  140. * @see nsIHistoryEntry
  141. * @see QueryInterface()
  142. * @see do_QueryInterface()
  143. */
  144. /* readonly attribute nsISimpleEnumerator SHistoryEnumerator; */
  145. NS_IMETHOD GetSHistoryEnumerator(nsISimpleEnumerator * *aSHistoryEnumerator) = 0;
  146. };
  147. /* Use this macro when declaring classes that implement this interface. */
  148. #define NS_DECL_NSISHISTORY \
  149. NS_IMETHOD GetCount(PRInt32 *aCount); \
  150. NS_IMETHOD GetIndex(PRInt32 *aIndex); \
  151. NS_IMETHOD GetMaxLength(PRInt32 *aMaxLength); \
  152. NS_IMETHOD SetMaxLength(PRInt32 aMaxLength); \
  153. NS_IMETHOD GetEntryAtIndex(PRInt32 index, PRBool modifyIndex, nsIHistoryEntry **_retval); \
  154. NS_IMETHOD PurgeHistory(PRInt32 numEntries); \
  155. NS_IMETHOD AddSHistoryListener(nsISHistoryListener *aListener); \
  156. NS_IMETHOD RemoveSHistoryListener(nsISHistoryListener *aListener); \
  157. NS_IMETHOD GetSHistoryEnumerator(nsISimpleEnumerator * *aSHistoryEnumerator);
  158. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  159. #define NS_FORWARD_NSISHISTORY(_to) \
  160. NS_IMETHOD GetCount(PRInt32 *aCount) { return _to GetCount(aCount); } \
  161. NS_IMETHOD GetIndex(PRInt32 *aIndex) { return _to GetIndex(aIndex); } \
  162. NS_IMETHOD GetMaxLength(PRInt32 *aMaxLength) { return _to GetMaxLength(aMaxLength); } \
  163. NS_IMETHOD SetMaxLength(PRInt32 aMaxLength) { return _to SetMaxLength(aMaxLength); } \
  164. NS_IMETHOD GetEntryAtIndex(PRInt32 index, PRBool modifyIndex, nsIHistoryEntry **_retval) { return _to GetEntryAtIndex(index, modifyIndex, _retval); } \
  165. NS_IMETHOD PurgeHistory(PRInt32 numEntries) { return _to PurgeHistory(numEntries); } \
  166. NS_IMETHOD AddSHistoryListener(nsISHistoryListener *aListener) { return _to AddSHistoryListener(aListener); } \
  167. NS_IMETHOD RemoveSHistoryListener(nsISHistoryListener *aListener) { return _to RemoveSHistoryListener(aListener); } \
  168. NS_IMETHOD GetSHistoryEnumerator(nsISimpleEnumerator * *aSHistoryEnumerator) { return _to GetSHistoryEnumerator(aSHistoryEnumerator); }
  169. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  170. #define NS_FORWARD_SAFE_NSISHISTORY(_to) \
  171. NS_IMETHOD GetCount(PRInt32 *aCount) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetCount(aCount); } \
  172. NS_IMETHOD GetIndex(PRInt32 *aIndex) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetIndex(aIndex); } \
  173. NS_IMETHOD GetMaxLength(PRInt32 *aMaxLength) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetMaxLength(aMaxLength); } \
  174. NS_IMETHOD SetMaxLength(PRInt32 aMaxLength) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetMaxLength(aMaxLength); } \
  175. NS_IMETHOD GetEntryAtIndex(PRInt32 index, PRBool modifyIndex, nsIHistoryEntry **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetEntryAtIndex(index, modifyIndex, _retval); } \
  176. NS_IMETHOD PurgeHistory(PRInt32 numEntries) { return !_to ? NS_ERROR_NULL_POINTER : _to->PurgeHistory(numEntries); } \
  177. NS_IMETHOD AddSHistoryListener(nsISHistoryListener *aListener) { return !_to ? NS_ERROR_NULL_POINTER : _to->AddSHistoryListener(aListener); } \
  178. NS_IMETHOD RemoveSHistoryListener(nsISHistoryListener *aListener) { return !_to ? NS_ERROR_NULL_POINTER : _to->RemoveSHistoryListener(aListener); } \
  179. NS_IMETHOD GetSHistoryEnumerator(nsISimpleEnumerator * *aSHistoryEnumerator) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetSHistoryEnumerator(aSHistoryEnumerator); }
  180. #if 0
  181. /* Use the code below as a template for the implementation class for this interface. */
  182. /* Header file */
  183. class nsSHistory : public nsISHistory
  184. {
  185. public:
  186. NS_DECL_ISUPPORTS
  187. NS_DECL_NSISHISTORY
  188. nsSHistory();
  189. private:
  190. ~nsSHistory();
  191. protected:
  192. /* additional members */
  193. };
  194. /* Implementation file */
  195. NS_IMPL_ISUPPORTS1(nsSHistory, nsISHistory)
  196. nsSHistory::nsSHistory()
  197. {
  198. /* member initializers and constructor code */
  199. }
  200. nsSHistory::~nsSHistory()
  201. {
  202. /* destructor code */
  203. }
  204. /* readonly attribute long count; */
  205. NS_IMETHODIMP nsSHistory::GetCount(PRInt32 *aCount)
  206. {
  207. return NS_ERROR_NOT_IMPLEMENTED;
  208. }
  209. /* readonly attribute long index; */
  210. NS_IMETHODIMP nsSHistory::GetIndex(PRInt32 *aIndex)
  211. {
  212. return NS_ERROR_NOT_IMPLEMENTED;
  213. }
  214. /* attribute long maxLength; */
  215. NS_IMETHODIMP nsSHistory::GetMaxLength(PRInt32 *aMaxLength)
  216. {
  217. return NS_ERROR_NOT_IMPLEMENTED;
  218. }
  219. NS_IMETHODIMP nsSHistory::SetMaxLength(PRInt32 aMaxLength)
  220. {
  221. return NS_ERROR_NOT_IMPLEMENTED;
  222. }
  223. /* nsIHistoryEntry getEntryAtIndex (in long index, in boolean modifyIndex); */
  224. NS_IMETHODIMP nsSHistory::GetEntryAtIndex(PRInt32 index, PRBool modifyIndex, nsIHistoryEntry **_retval)
  225. {
  226. return NS_ERROR_NOT_IMPLEMENTED;
  227. }
  228. /* void PurgeHistory (in long numEntries); */
  229. NS_IMETHODIMP nsSHistory::PurgeHistory(PRInt32 numEntries)
  230. {
  231. return NS_ERROR_NOT_IMPLEMENTED;
  232. }
  233. /* void addSHistoryListener (in nsISHistoryListener aListener); */
  234. NS_IMETHODIMP nsSHistory::AddSHistoryListener(nsISHistoryListener *aListener)
  235. {
  236. return NS_ERROR_NOT_IMPLEMENTED;
  237. }
  238. /* void removeSHistoryListener (in nsISHistoryListener aListener); */
  239. NS_IMETHODIMP nsSHistory::RemoveSHistoryListener(nsISHistoryListener *aListener)
  240. {
  241. return NS_ERROR_NOT_IMPLEMENTED;
  242. }
  243. /* readonly attribute nsISimpleEnumerator SHistoryEnumerator; */
  244. NS_IMETHODIMP nsSHistory::GetSHistoryEnumerator(nsISimpleEnumerator * *aSHistoryEnumerator)
  245. {
  246. return NS_ERROR_NOT_IMPLEMENTED;
  247. }
  248. /* End of implementation class template. */
  249. #endif
  250. #endif /* __gen_nsISHistory_h__ */