nsISimpleEnumerator.h 4.2 KB

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