PageRenderTime 48ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/gecko_api/include/nsISHistory.h

http://firefox-mac-pdf.googlecode.com/
C Header | 312 lines | 126 code | 45 blank | 141 comment | 0 complexity | 1baa9bfd64b1432dc36a9a601756ae1b 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/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 "9883609f-cdd8-4d83-9b55-868ff08ad433"
  21. #define NS_ISHISTORY_IID \
  22. {0x9883609f, 0xcdd8, 0x4d83, \
  23. { 0x9b, 0x55, 0x86, 0x8f, 0xf0, 0x8a, 0xd4, 0x33 }}
  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 NS_SCRIPTABLE nsISHistory : public nsISupports {
  37. public:
  38. NS_DECLARE_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_SCRIPTABLE 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_SCRIPTABLE NS_IMETHOD GetIndex(PRInt32 *aIndex) = 0;
  52. /**
  53. * A readonly property of the interface that returns
  54. * the index of the last document that started to load and
  55. * didn't finished yet. When document finishes the loading
  56. * value -1 is returned.
  57. */
  58. /* readonly attribute long requestedIndex; */
  59. NS_SCRIPTABLE NS_IMETHOD GetRequestedIndex(PRInt32 *aRequestedIndex) = 0;
  60. /**
  61. * A read/write property of the interface, used to Get/Set
  62. * the maximum number of toplevel documents, session history
  63. * can hold for each instance.
  64. */
  65. /* attribute long maxLength; */
  66. NS_SCRIPTABLE NS_IMETHOD GetMaxLength(PRInt32 *aMaxLength) = 0;
  67. NS_SCRIPTABLE NS_IMETHOD SetMaxLength(PRInt32 aMaxLength) = 0;
  68. /**
  69. * Called to obtain handle to the history entry at a
  70. * given index.
  71. *
  72. * @param index The index value whose entry is requested.
  73. * @param modifyIndex A boolean flag that indicates if the current
  74. * index of session history should be modified
  75. * to the parameter index.
  76. *
  77. * @return <code>NS_OK</code> history entry for
  78. * the index is obtained successfully.
  79. * <code>NS_ERROR_FAILURE</code> Error in obtaining
  80. * history entry for the given index.
  81. */
  82. /* nsIHistoryEntry getEntryAtIndex (in long index, in boolean modifyIndex); */
  83. NS_SCRIPTABLE NS_IMETHOD GetEntryAtIndex(PRInt32 index, PRBool modifyIndex, nsIHistoryEntry **_retval) = 0;
  84. /**
  85. * Called to purge older documents from history.
  86. * Documents can be removed from session history for various
  87. * reasons. For example to control memory usage of the browser, to
  88. * prevent users from loading documents from history, to erase evidence of
  89. * prior page loads etc...
  90. *
  91. * @param numEntries The number of toplevel documents to be
  92. * purged from history. During purge operation,
  93. * the latest documents are maintained and older
  94. * 'numEntries' documents are removed from history.
  95. * @throws <code>NS_SUCCESS_LOSS_OF_INSIGNIFICANT_DATA</code> Purge was vetod.
  96. * @throws <code>NS_ERROR_FAILURE</code> numEntries is
  97. * invalid or out of bounds with the size of history.
  98. *
  99. */
  100. /* void PurgeHistory (in long numEntries); */
  101. NS_SCRIPTABLE NS_IMETHOD PurgeHistory(PRInt32 numEntries) = 0;
  102. /**
  103. * Called to register a listener for the session history component.
  104. * Listeners are notified when pages are loaded or purged from history.
  105. *
  106. * @param aListener Listener object to be notified for all
  107. * page loads that initiate in session history.
  108. *
  109. * @note A listener object must implement
  110. * nsISHistoryListener and nsSupportsWeakReference
  111. *
  112. * @see nsISHistoryListener
  113. * @see nsSupportsWeakReference
  114. */
  115. /* void addSHistoryListener (in nsISHistoryListener aListener); */
  116. NS_SCRIPTABLE NS_IMETHOD AddSHistoryListener(nsISHistoryListener *aListener) = 0;
  117. /**
  118. * Called to remove a listener for the session history component.
  119. * Listeners are notified when pages are loaded from history.
  120. *
  121. * @param aListener Listener object to be removed from
  122. * session history.
  123. *
  124. * @note A listener object must implement
  125. * nsISHistoryListener and nsSupportsWeakReference
  126. * @see nsISHistoryListener
  127. * @see nsSupportsWeakReference
  128. */
  129. /* void removeSHistoryListener (in nsISHistoryListener aListener); */
  130. NS_SCRIPTABLE NS_IMETHOD RemoveSHistoryListener(nsISHistoryListener *aListener) = 0;
  131. /**
  132. * Called to obtain a enumerator for all the documents stored in
  133. * session history. The enumerator object thus returned by this method
  134. * can be traversed using nsISimpleEnumerator.
  135. *
  136. * @note To access individual history entries of the enumerator, perform the
  137. * following steps:
  138. * 1) Call nsISHistory->GetSHistoryEnumerator() to obtain handle
  139. * the nsISimpleEnumerator object.
  140. * 2) Use nsISimpleEnumerator->GetNext() on the object returned
  141. * by step #1 to obtain handle to the next object in the list.
  142. * The object returned by this step is of type nsISupports.
  143. * 3) Perform a QueryInterface on the object returned by step #2
  144. * to nsIHistoryEntry.
  145. * 4) Use nsIHistoryEntry to access properties of each history entry.
  146. *
  147. * @see nsISimpleEnumerator
  148. * @see nsIHistoryEntry
  149. * @see QueryInterface()
  150. * @see do_QueryInterface()
  151. */
  152. /* readonly attribute nsISimpleEnumerator SHistoryEnumerator; */
  153. NS_SCRIPTABLE NS_IMETHOD GetSHistoryEnumerator(nsISimpleEnumerator * *aSHistoryEnumerator) = 0;
  154. };
  155. NS_DEFINE_STATIC_IID_ACCESSOR(nsISHistory, NS_ISHISTORY_IID)
  156. /* Use this macro when declaring classes that implement this interface. */
  157. #define NS_DECL_NSISHISTORY \
  158. NS_SCRIPTABLE NS_IMETHOD GetCount(PRInt32 *aCount); \
  159. NS_SCRIPTABLE NS_IMETHOD GetIndex(PRInt32 *aIndex); \
  160. NS_SCRIPTABLE NS_IMETHOD GetRequestedIndex(PRInt32 *aRequestedIndex); \
  161. NS_SCRIPTABLE NS_IMETHOD GetMaxLength(PRInt32 *aMaxLength); \
  162. NS_SCRIPTABLE NS_IMETHOD SetMaxLength(PRInt32 aMaxLength); \
  163. NS_SCRIPTABLE NS_IMETHOD GetEntryAtIndex(PRInt32 index, PRBool modifyIndex, nsIHistoryEntry **_retval); \
  164. NS_SCRIPTABLE NS_IMETHOD PurgeHistory(PRInt32 numEntries); \
  165. NS_SCRIPTABLE NS_IMETHOD AddSHistoryListener(nsISHistoryListener *aListener); \
  166. NS_SCRIPTABLE NS_IMETHOD RemoveSHistoryListener(nsISHistoryListener *aListener); \
  167. NS_SCRIPTABLE NS_IMETHOD GetSHistoryEnumerator(nsISimpleEnumerator * *aSHistoryEnumerator);
  168. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  169. #define NS_FORWARD_NSISHISTORY(_to) \
  170. NS_SCRIPTABLE NS_IMETHOD GetCount(PRInt32 *aCount) { return _to GetCount(aCount); } \
  171. NS_SCRIPTABLE NS_IMETHOD GetIndex(PRInt32 *aIndex) { return _to GetIndex(aIndex); } \
  172. NS_SCRIPTABLE NS_IMETHOD GetRequestedIndex(PRInt32 *aRequestedIndex) { return _to GetRequestedIndex(aRequestedIndex); } \
  173. NS_SCRIPTABLE NS_IMETHOD GetMaxLength(PRInt32 *aMaxLength) { return _to GetMaxLength(aMaxLength); } \
  174. NS_SCRIPTABLE NS_IMETHOD SetMaxLength(PRInt32 aMaxLength) { return _to SetMaxLength(aMaxLength); } \
  175. NS_SCRIPTABLE NS_IMETHOD GetEntryAtIndex(PRInt32 index, PRBool modifyIndex, nsIHistoryEntry **_retval) { return _to GetEntryAtIndex(index, modifyIndex, _retval); } \
  176. NS_SCRIPTABLE NS_IMETHOD PurgeHistory(PRInt32 numEntries) { return _to PurgeHistory(numEntries); } \
  177. NS_SCRIPTABLE NS_IMETHOD AddSHistoryListener(nsISHistoryListener *aListener) { return _to AddSHistoryListener(aListener); } \
  178. NS_SCRIPTABLE NS_IMETHOD RemoveSHistoryListener(nsISHistoryListener *aListener) { return _to RemoveSHistoryListener(aListener); } \
  179. NS_SCRIPTABLE NS_IMETHOD GetSHistoryEnumerator(nsISimpleEnumerator * *aSHistoryEnumerator) { return _to GetSHistoryEnumerator(aSHistoryEnumerator); }
  180. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  181. #define NS_FORWARD_SAFE_NSISHISTORY(_to) \
  182. NS_SCRIPTABLE NS_IMETHOD GetCount(PRInt32 *aCount) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetCount(aCount); } \
  183. NS_SCRIPTABLE NS_IMETHOD GetIndex(PRInt32 *aIndex) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetIndex(aIndex); } \
  184. NS_SCRIPTABLE NS_IMETHOD GetRequestedIndex(PRInt32 *aRequestedIndex) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetRequestedIndex(aRequestedIndex); } \
  185. NS_SCRIPTABLE NS_IMETHOD GetMaxLength(PRInt32 *aMaxLength) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetMaxLength(aMaxLength); } \
  186. NS_SCRIPTABLE NS_IMETHOD SetMaxLength(PRInt32 aMaxLength) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetMaxLength(aMaxLength); } \
  187. NS_SCRIPTABLE NS_IMETHOD GetEntryAtIndex(PRInt32 index, PRBool modifyIndex, nsIHistoryEntry **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetEntryAtIndex(index, modifyIndex, _retval); } \
  188. NS_SCRIPTABLE NS_IMETHOD PurgeHistory(PRInt32 numEntries) { return !_to ? NS_ERROR_NULL_POINTER : _to->PurgeHistory(numEntries); } \
  189. NS_SCRIPTABLE NS_IMETHOD AddSHistoryListener(nsISHistoryListener *aListener) { return !_to ? NS_ERROR_NULL_POINTER : _to->AddSHistoryListener(aListener); } \
  190. NS_SCRIPTABLE NS_IMETHOD RemoveSHistoryListener(nsISHistoryListener *aListener) { return !_to ? NS_ERROR_NULL_POINTER : _to->RemoveSHistoryListener(aListener); } \
  191. NS_SCRIPTABLE NS_IMETHOD GetSHistoryEnumerator(nsISimpleEnumerator * *aSHistoryEnumerator) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetSHistoryEnumerator(aSHistoryEnumerator); }
  192. #if 0
  193. /* Use the code below as a template for the implementation class for this interface. */
  194. /* Header file */
  195. class nsSHistory : public nsISHistory
  196. {
  197. public:
  198. NS_DECL_ISUPPORTS
  199. NS_DECL_NSISHISTORY
  200. nsSHistory();
  201. private:
  202. ~nsSHistory();
  203. protected:
  204. /* additional members */
  205. };
  206. /* Implementation file */
  207. NS_IMPL_ISUPPORTS1(nsSHistory, nsISHistory)
  208. nsSHistory::nsSHistory()
  209. {
  210. /* member initializers and constructor code */
  211. }
  212. nsSHistory::~nsSHistory()
  213. {
  214. /* destructor code */
  215. }
  216. /* readonly attribute long count; */
  217. NS_IMETHODIMP nsSHistory::GetCount(PRInt32 *aCount)
  218. {
  219. return NS_ERROR_NOT_IMPLEMENTED;
  220. }
  221. /* readonly attribute long index; */
  222. NS_IMETHODIMP nsSHistory::GetIndex(PRInt32 *aIndex)
  223. {
  224. return NS_ERROR_NOT_IMPLEMENTED;
  225. }
  226. /* readonly attribute long requestedIndex; */
  227. NS_IMETHODIMP nsSHistory::GetRequestedIndex(PRInt32 *aRequestedIndex)
  228. {
  229. return NS_ERROR_NOT_IMPLEMENTED;
  230. }
  231. /* attribute long maxLength; */
  232. NS_IMETHODIMP nsSHistory::GetMaxLength(PRInt32 *aMaxLength)
  233. {
  234. return NS_ERROR_NOT_IMPLEMENTED;
  235. }
  236. NS_IMETHODIMP nsSHistory::SetMaxLength(PRInt32 aMaxLength)
  237. {
  238. return NS_ERROR_NOT_IMPLEMENTED;
  239. }
  240. /* nsIHistoryEntry getEntryAtIndex (in long index, in boolean modifyIndex); */
  241. NS_IMETHODIMP nsSHistory::GetEntryAtIndex(PRInt32 index, PRBool modifyIndex, nsIHistoryEntry **_retval)
  242. {
  243. return NS_ERROR_NOT_IMPLEMENTED;
  244. }
  245. /* void PurgeHistory (in long numEntries); */
  246. NS_IMETHODIMP nsSHistory::PurgeHistory(PRInt32 numEntries)
  247. {
  248. return NS_ERROR_NOT_IMPLEMENTED;
  249. }
  250. /* void addSHistoryListener (in nsISHistoryListener aListener); */
  251. NS_IMETHODIMP nsSHistory::AddSHistoryListener(nsISHistoryListener *aListener)
  252. {
  253. return NS_ERROR_NOT_IMPLEMENTED;
  254. }
  255. /* void removeSHistoryListener (in nsISHistoryListener aListener); */
  256. NS_IMETHODIMP nsSHistory::RemoveSHistoryListener(nsISHistoryListener *aListener)
  257. {
  258. return NS_ERROR_NOT_IMPLEMENTED;
  259. }
  260. /* readonly attribute nsISimpleEnumerator SHistoryEnumerator; */
  261. NS_IMETHODIMP nsSHistory::GetSHistoryEnumerator(nsISimpleEnumerator * *aSHistoryEnumerator)
  262. {
  263. return NS_ERROR_NOT_IMPLEMENTED;
  264. }
  265. /* End of implementation class template. */
  266. #endif
  267. #endif /* __gen_nsISHistory_h__ */