PageRenderTime 86ms CodeModel.GetById 40ms app.highlight 3ms RepoModel.GetById 37ms app.codeStats 4ms

/gecko_api/include/nsISimpleEnumerator.h

http://firefox-mac-pdf.googlecode.com/
C++ Header | 138 lines | 56 code | 28 blank | 54 comment | 0 complexity | 2729adb0c32a0a87c3226c5f5b723c00 MD5 | raw file
  1/*
  2 * DO NOT EDIT.  THIS FILE IS GENERATED FROM /builds/tinderbox/XR-Trunk/Darwin_8.8.4_Depend/mozilla/xpcom/ds/nsISimpleEnumerator.idl
  3 */
  4
  5#ifndef __gen_nsISimpleEnumerator_h__
  6#define __gen_nsISimpleEnumerator_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
 17
 18/* starting interface:    nsISimpleEnumerator */
 19#define NS_ISIMPLEENUMERATOR_IID_STR "d1899240-f9d2-11d2-bdd6-000064657374"
 20
 21#define NS_ISIMPLEENUMERATOR_IID \
 22  {0xd1899240, 0xf9d2, 0x11d2, \
 23    { 0xbd, 0xd6, 0x00, 0x00, 0x64, 0x65, 0x73, 0x74 }}
 24
 25/**
 26 * Used to enumerate over elements defined by its implementor.
 27 * Although hasMoreElements() can be called independently of getNext(),
 28 * getNext() must be pre-ceeded by a call to hasMoreElements(). There is
 29 * no way to "reset" an enumerator, once you obtain one.
 30 *
 31 * @status FROZEN
 32 * @version 1.0
 33 */
 34class NS_NO_VTABLE NS_SCRIPTABLE nsISimpleEnumerator : public nsISupports {
 35 public: 
 36
 37  NS_DECLARE_STATIC_IID_ACCESSOR(NS_ISIMPLEENUMERATOR_IID)
 38
 39  /**
 40   * Called to determine whether or not the enumerator has
 41   * any elements that can be returned via getNext(). This method
 42   * is generally used to determine whether or not to initiate or
 43   * continue iteration over the enumerator, though it can be
 44   * called without subsequent getNext() calls. Does not affect
 45   * internal state of enumerator.
 46   *
 47   * @see getNext()
 48   * @return PR_TRUE if there are remaining elements in the enumerator.
 49   *         PR_FALSE if there are no more elements in the enumerator.
 50   */
 51  /* boolean hasMoreElements (); */
 52  NS_SCRIPTABLE NS_IMETHOD HasMoreElements(PRBool *_retval) = 0;
 53
 54  /**
 55   * Called to retrieve the next element in the enumerator. The "next"
 56   * element is the first element upon the first call. Must be
 57   * pre-ceeded by a call to hasMoreElements() which returns PR_TRUE.
 58   * This method is generally called within a loop to iterate over
 59   * the elements in the enumerator.
 60   *
 61   * @see hasMoreElements()
 62   * @return NS_OK if the call succeeded in returning a non-null
 63   *               value through the out parameter.
 64   *         NS_ERROR_FAILURE if there are no more elements
 65   *                          to enumerate.
 66   * @return the next element in the enumeration.
 67   */
 68  /* nsISupports getNext (); */
 69  NS_SCRIPTABLE NS_IMETHOD GetNext(nsISupports **_retval) = 0;
 70
 71};
 72
 73  NS_DEFINE_STATIC_IID_ACCESSOR(nsISimpleEnumerator, NS_ISIMPLEENUMERATOR_IID)
 74
 75/* Use this macro when declaring classes that implement this interface. */
 76#define NS_DECL_NSISIMPLEENUMERATOR \
 77  NS_SCRIPTABLE NS_IMETHOD HasMoreElements(PRBool *_retval); \
 78  NS_SCRIPTABLE NS_IMETHOD GetNext(nsISupports **_retval); 
 79
 80/* Use this macro to declare functions that forward the behavior of this interface to another object. */
 81#define NS_FORWARD_NSISIMPLEENUMERATOR(_to) \
 82  NS_SCRIPTABLE NS_IMETHOD HasMoreElements(PRBool *_retval) { return _to HasMoreElements(_retval); } \
 83  NS_SCRIPTABLE NS_IMETHOD GetNext(nsISupports **_retval) { return _to GetNext(_retval); } 
 84
 85/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
 86#define NS_FORWARD_SAFE_NSISIMPLEENUMERATOR(_to) \
 87  NS_SCRIPTABLE NS_IMETHOD HasMoreElements(PRBool *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->HasMoreElements(_retval); } \
 88  NS_SCRIPTABLE NS_IMETHOD GetNext(nsISupports **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetNext(_retval); } 
 89
 90#if 0
 91/* Use the code below as a template for the implementation class for this interface. */
 92
 93/* Header file */
 94class nsSimpleEnumerator : public nsISimpleEnumerator
 95{
 96public:
 97  NS_DECL_ISUPPORTS
 98  NS_DECL_NSISIMPLEENUMERATOR
 99
100  nsSimpleEnumerator();
101
102private:
103  ~nsSimpleEnumerator();
104
105protected:
106  /* additional members */
107};
108
109/* Implementation file */
110NS_IMPL_ISUPPORTS1(nsSimpleEnumerator, nsISimpleEnumerator)
111
112nsSimpleEnumerator::nsSimpleEnumerator()
113{
114  /* member initializers and constructor code */
115}
116
117nsSimpleEnumerator::~nsSimpleEnumerator()
118{
119  /* destructor code */
120}
121
122/* boolean hasMoreElements (); */
123NS_IMETHODIMP nsSimpleEnumerator::HasMoreElements(PRBool *_retval)
124{
125    return NS_ERROR_NOT_IMPLEMENTED;
126}
127
128/* nsISupports getNext (); */
129NS_IMETHODIMP nsSimpleEnumerator::GetNext(nsISupports **_retval)
130{
131    return NS_ERROR_NOT_IMPLEMENTED;
132}
133
134/* End of implementation class template. */
135#endif
136
137
138#endif /* __gen_nsISimpleEnumerator_h__ */