PageRenderTime 42ms CodeModel.GetById 20ms RepoModel.GetById 1ms app.codeStats 0ms

/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. #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 NS_SCRIPTABLE nsISimpleEnumerator : public nsISupports {
  28. public:
  29. NS_DECLARE_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_SCRIPTABLE 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_SCRIPTABLE NS_IMETHOD GetNext(nsISupports **_retval) = 0;
  60. };
  61. NS_DEFINE_STATIC_IID_ACCESSOR(nsISimpleEnumerator, NS_ISIMPLEENUMERATOR_IID)
  62. /* Use this macro when declaring classes that implement this interface. */
  63. #define NS_DECL_NSISIMPLEENUMERATOR \
  64. NS_SCRIPTABLE NS_IMETHOD HasMoreElements(PRBool *_retval); \
  65. NS_SCRIPTABLE NS_IMETHOD GetNext(nsISupports **_retval);
  66. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  67. #define NS_FORWARD_NSISIMPLEENUMERATOR(_to) \
  68. NS_SCRIPTABLE NS_IMETHOD HasMoreElements(PRBool *_retval) { return _to HasMoreElements(_retval); } \
  69. NS_SCRIPTABLE NS_IMETHOD GetNext(nsISupports **_retval) { return _to GetNext(_retval); }
  70. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  71. #define NS_FORWARD_SAFE_NSISIMPLEENUMERATOR(_to) \
  72. NS_SCRIPTABLE NS_IMETHOD HasMoreElements(PRBool *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->HasMoreElements(_retval); } \
  73. NS_SCRIPTABLE NS_IMETHOD GetNext(nsISupports **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetNext(_retval); }
  74. #if 0
  75. /* Use the code below as a template for the implementation class for this interface. */
  76. /* Header file */
  77. class nsSimpleEnumerator : public nsISimpleEnumerator
  78. {
  79. public:
  80. NS_DECL_ISUPPORTS
  81. NS_DECL_NSISIMPLEENUMERATOR
  82. nsSimpleEnumerator();
  83. private:
  84. ~nsSimpleEnumerator();
  85. protected:
  86. /* additional members */
  87. };
  88. /* Implementation file */
  89. NS_IMPL_ISUPPORTS1(nsSimpleEnumerator, nsISimpleEnumerator)
  90. nsSimpleEnumerator::nsSimpleEnumerator()
  91. {
  92. /* member initializers and constructor code */
  93. }
  94. nsSimpleEnumerator::~nsSimpleEnumerator()
  95. {
  96. /* destructor code */
  97. }
  98. /* boolean hasMoreElements (); */
  99. NS_IMETHODIMP nsSimpleEnumerator::HasMoreElements(PRBool *_retval)
  100. {
  101. return NS_ERROR_NOT_IMPLEMENTED;
  102. }
  103. /* nsISupports getNext (); */
  104. NS_IMETHODIMP nsSimpleEnumerator::GetNext(nsISupports **_retval)
  105. {
  106. return NS_ERROR_NOT_IMPLEMENTED;
  107. }
  108. /* End of implementation class template. */
  109. #endif
  110. #endif /* __gen_nsISimpleEnumerator_h__ */