PageRenderTime 9ms CodeModel.GetById 0ms RepoModel.GetById 0ms app.codeStats 1ms

/gecko_api/include/nsIScriptableInputStream.h

http://firefox-mac-pdf.googlecode.com/
C Header | 163 lines | 73 code | 33 blank | 57 comment | 0 complexity | ee2e2e688dbbc9c7aa4a7cfccb055650 MD5 | raw file
  1. /*
  2. * DO NOT EDIT. THIS FILE IS GENERATED FROM /builds/tinderbox/XR-Trunk/Darwin_8.8.4_Depend/mozilla/xpcom/io/nsIScriptableInputStream.idl
  3. */
  4. #ifndef __gen_nsIScriptableInputStream_h__
  5. #define __gen_nsIScriptableInputStream_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 nsIInputStream; /* forward declaration */
  14. /* starting interface: nsIScriptableInputStream */
  15. #define NS_ISCRIPTABLEINPUTSTREAM_IID_STR "a2a32f90-9b90-11d3-a189-0050041caf44"
  16. #define NS_ISCRIPTABLEINPUTSTREAM_IID \
  17. {0xa2a32f90, 0x9b90, 0x11d3, \
  18. { 0xa1, 0x89, 0x00, 0x50, 0x04, 0x1c, 0xaf, 0x44 }}
  19. /**
  20. * nsIScriptableInputStream provides scriptable access to an nsIInputStream
  21. * instance.
  22. *
  23. * @status FROZEN
  24. */
  25. class NS_NO_VTABLE NS_SCRIPTABLE nsIScriptableInputStream : public nsISupports {
  26. public:
  27. NS_DECLARE_STATIC_IID_ACCESSOR(NS_ISCRIPTABLEINPUTSTREAM_IID)
  28. /**
  29. * Closes the stream.
  30. */
  31. /* void close (); */
  32. NS_SCRIPTABLE NS_IMETHOD Close(void) = 0;
  33. /**
  34. * Wrap the given nsIInputStream with this nsIScriptableInputStream.
  35. *
  36. * @param aInputStream parameter providing the stream to wrap
  37. */
  38. /* void init (in nsIInputStream aInputStream); */
  39. NS_SCRIPTABLE NS_IMETHOD Init(nsIInputStream *aInputStream) = 0;
  40. /**
  41. * Return the number of bytes currently available in the stream
  42. *
  43. * @return the number of bytes
  44. *
  45. * @throws NS_BASE_STREAM_CLOSED if called after the stream has been closed
  46. */
  47. /* unsigned long available (); */
  48. NS_SCRIPTABLE NS_IMETHOD Available(PRUint32 *_retval) = 0;
  49. /**
  50. * Read data from the stream.
  51. *
  52. * WARNING: If the data contains a null byte, then this method will return
  53. * a truncated string.
  54. *
  55. * @param aCount the maximum number of bytes to read
  56. *
  57. * @return the data, which will be an empty string if the stream is at EOF.
  58. *
  59. * @throws NS_BASE_STREAM_CLOSED if called after the stream has been closed
  60. * @throws NS_ERROR_NOT_INITIALIZED if init was not called
  61. */
  62. /* string read (in unsigned long aCount); */
  63. NS_SCRIPTABLE NS_IMETHOD Read(PRUint32 aCount, char **_retval) = 0;
  64. };
  65. NS_DEFINE_STATIC_IID_ACCESSOR(nsIScriptableInputStream, NS_ISCRIPTABLEINPUTSTREAM_IID)
  66. /* Use this macro when declaring classes that implement this interface. */
  67. #define NS_DECL_NSISCRIPTABLEINPUTSTREAM \
  68. NS_SCRIPTABLE NS_IMETHOD Close(void); \
  69. NS_SCRIPTABLE NS_IMETHOD Init(nsIInputStream *aInputStream); \
  70. NS_SCRIPTABLE NS_IMETHOD Available(PRUint32 *_retval); \
  71. NS_SCRIPTABLE NS_IMETHOD Read(PRUint32 aCount, char **_retval);
  72. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  73. #define NS_FORWARD_NSISCRIPTABLEINPUTSTREAM(_to) \
  74. NS_SCRIPTABLE NS_IMETHOD Close(void) { return _to Close(); } \
  75. NS_SCRIPTABLE NS_IMETHOD Init(nsIInputStream *aInputStream) { return _to Init(aInputStream); } \
  76. NS_SCRIPTABLE NS_IMETHOD Available(PRUint32 *_retval) { return _to Available(_retval); } \
  77. NS_SCRIPTABLE NS_IMETHOD Read(PRUint32 aCount, char **_retval) { return _to Read(aCount, _retval); }
  78. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  79. #define NS_FORWARD_SAFE_NSISCRIPTABLEINPUTSTREAM(_to) \
  80. NS_SCRIPTABLE NS_IMETHOD Close(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->Close(); } \
  81. NS_SCRIPTABLE NS_IMETHOD Init(nsIInputStream *aInputStream) { return !_to ? NS_ERROR_NULL_POINTER : _to->Init(aInputStream); } \
  82. NS_SCRIPTABLE NS_IMETHOD Available(PRUint32 *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->Available(_retval); } \
  83. NS_SCRIPTABLE NS_IMETHOD Read(PRUint32 aCount, char **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->Read(aCount, _retval); }
  84. #if 0
  85. /* Use the code below as a template for the implementation class for this interface. */
  86. /* Header file */
  87. class nsScriptableInputStream : public nsIScriptableInputStream
  88. {
  89. public:
  90. NS_DECL_ISUPPORTS
  91. NS_DECL_NSISCRIPTABLEINPUTSTREAM
  92. nsScriptableInputStream();
  93. private:
  94. ~nsScriptableInputStream();
  95. protected:
  96. /* additional members */
  97. };
  98. /* Implementation file */
  99. NS_IMPL_ISUPPORTS1(nsScriptableInputStream, nsIScriptableInputStream)
  100. nsScriptableInputStream::nsScriptableInputStream()
  101. {
  102. /* member initializers and constructor code */
  103. }
  104. nsScriptableInputStream::~nsScriptableInputStream()
  105. {
  106. /* destructor code */
  107. }
  108. /* void close (); */
  109. NS_IMETHODIMP nsScriptableInputStream::Close()
  110. {
  111. return NS_ERROR_NOT_IMPLEMENTED;
  112. }
  113. /* void init (in nsIInputStream aInputStream); */
  114. NS_IMETHODIMP nsScriptableInputStream::Init(nsIInputStream *aInputStream)
  115. {
  116. return NS_ERROR_NOT_IMPLEMENTED;
  117. }
  118. /* unsigned long available (); */
  119. NS_IMETHODIMP nsScriptableInputStream::Available(PRUint32 *_retval)
  120. {
  121. return NS_ERROR_NOT_IMPLEMENTED;
  122. }
  123. /* string read (in unsigned long aCount); */
  124. NS_IMETHODIMP nsScriptableInputStream::Read(PRUint32 aCount, char **_retval)
  125. {
  126. return NS_ERROR_NOT_IMPLEMENTED;
  127. }
  128. /* End of implementation class template. */
  129. #endif
  130. #endif /* __gen_nsIScriptableInputStream_h__ */