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