nsIScriptableInputStream.h 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. /*
  2. * DO NOT EDIT. THIS FILE IS GENERATED FROM c:/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 the nsIInputStream.
  21. *
  22. * @status FROZEN
  23. */
  24. class NS_NO_VTABLE nsIScriptableInputStream : public nsISupports {
  25. public:
  26. NS_DEFINE_STATIC_IID_ACCESSOR(NS_ISCRIPTABLEINPUTSTREAM_IID)
  27. /**
  28. * Closes the stream.
  29. */
  30. /* void close (); */
  31. NS_IMETHOD Close(void) = 0;
  32. /** Wrap the given nsIInputStream with this nsIScriptableInputStream.
  33. * @param aInputStream [in] parameter providing the stream to wrap
  34. */
  35. /* void init (in nsIInputStream aInputStream); */
  36. NS_IMETHOD Init(nsIInputStream *aInputStream) = 0;
  37. /** Return the number of bytes currently available in the stream
  38. * @param _retval [out] parameter to hold the number of bytes
  39. * if an error occurs, the parameter will be undefined
  40. * @return error status
  41. */
  42. /* unsigned long available (); */
  43. NS_IMETHOD Available(PRUint32 *_retval) = 0;
  44. /** Read data from the stream.
  45. * @param aCount [in] the maximum number of bytes to read
  46. * @param _retval [out] the data
  47. */
  48. /* string read (in unsigned long aCount); */
  49. NS_IMETHOD Read(PRUint32 aCount, char **_retval) = 0;
  50. };
  51. /* Use this macro when declaring classes that implement this interface. */
  52. #define NS_DECL_NSISCRIPTABLEINPUTSTREAM \
  53. NS_IMETHOD Close(void); \
  54. NS_IMETHOD Init(nsIInputStream *aInputStream); \
  55. NS_IMETHOD Available(PRUint32 *_retval); \
  56. NS_IMETHOD Read(PRUint32 aCount, char **_retval);
  57. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  58. #define NS_FORWARD_NSISCRIPTABLEINPUTSTREAM(_to) \
  59. NS_IMETHOD Close(void) { return _to Close(); } \
  60. NS_IMETHOD Init(nsIInputStream *aInputStream) { return _to Init(aInputStream); } \
  61. NS_IMETHOD Available(PRUint32 *_retval) { return _to Available(_retval); } \
  62. NS_IMETHOD Read(PRUint32 aCount, char **_retval) { return _to Read(aCount, _retval); }
  63. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  64. #define NS_FORWARD_SAFE_NSISCRIPTABLEINPUTSTREAM(_to) \
  65. NS_IMETHOD Close(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->Close(); } \
  66. NS_IMETHOD Init(nsIInputStream *aInputStream) { return !_to ? NS_ERROR_NULL_POINTER : _to->Init(aInputStream); } \
  67. NS_IMETHOD Available(PRUint32 *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->Available(_retval); } \
  68. NS_IMETHOD Read(PRUint32 aCount, char **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->Read(aCount, _retval); }
  69. #if 0
  70. /* Use the code below as a template for the implementation class for this interface. */
  71. /* Header file */
  72. class nsScriptableInputStream : public nsIScriptableInputStream
  73. {
  74. public:
  75. NS_DECL_ISUPPORTS
  76. NS_DECL_NSISCRIPTABLEINPUTSTREAM
  77. nsScriptableInputStream();
  78. private:
  79. ~nsScriptableInputStream();
  80. protected:
  81. /* additional members */
  82. };
  83. /* Implementation file */
  84. NS_IMPL_ISUPPORTS1(nsScriptableInputStream, nsIScriptableInputStream)
  85. nsScriptableInputStream::nsScriptableInputStream()
  86. {
  87. /* member initializers and constructor code */
  88. }
  89. nsScriptableInputStream::~nsScriptableInputStream()
  90. {
  91. /* destructor code */
  92. }
  93. /* void close (); */
  94. NS_IMETHODIMP nsScriptableInputStream::Close()
  95. {
  96. return NS_ERROR_NOT_IMPLEMENTED;
  97. }
  98. /* void init (in nsIInputStream aInputStream); */
  99. NS_IMETHODIMP nsScriptableInputStream::Init(nsIInputStream *aInputStream)
  100. {
  101. return NS_ERROR_NOT_IMPLEMENTED;
  102. }
  103. /* unsigned long available (); */
  104. NS_IMETHODIMP nsScriptableInputStream::Available(PRUint32 *_retval)
  105. {
  106. return NS_ERROR_NOT_IMPLEMENTED;
  107. }
  108. /* string read (in unsigned long aCount); */
  109. NS_IMETHODIMP nsScriptableInputStream::Read(PRUint32 aCount, char **_retval)
  110. {
  111. return NS_ERROR_NOT_IMPLEMENTED;
  112. }
  113. /* End of implementation class template. */
  114. #endif
  115. #endif /* __gen_nsIScriptableInputStream_h__ */