1 : /*
2 : * DO NOT EDIT. THIS FILE IS GENERATED FROM /builds/slave/m-beta-lnx-codecoverage/build/xpcom/io/nsIInputStream.idl
3 : */
4 :
5 : #ifndef __gen_nsIInputStream_h__
6 : #define __gen_nsIInputStream_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 : class nsIInputStream; /* forward declaration */
18 :
19 : /**
20 : * The signature of the writer function passed to ReadSegments. This
21 : * is the "consumer" of data that gets read from the stream's buffer.
22 : *
23 : * @param aInStream stream being read
24 : * @param aClosure opaque parameter passed to ReadSegments
25 : * @param aFromSegment pointer to memory owned by the input stream. This is
26 : * where the writer function should start consuming data.
27 : * @param aToOffset amount of data already consumed by this writer during this
28 : * ReadSegments call. This is also the sum of the aWriteCount
29 : * returns from this writer over the previous invocations of
30 : * the writer by this ReadSegments call.
31 : * @param aCount Number of bytes available to be read starting at aFromSegment
32 : * @param [out] aWriteCount number of bytes read by this writer function call
33 : *
34 : * Implementers should return the following:
35 : *
36 : * @return NS_OK and (*aWriteCount > 0) if consumed some data
37 : * @return <any-error> if not interested in consuming any data
38 : *
39 : * Errors are never passed to the caller of ReadSegments.
40 : *
41 : * NOTE: returning NS_OK and (*aWriteCount = 0) has undefined behavior.
42 : */
43 : typedef NS_CALLBACK(nsWriteSegmentFun)(nsIInputStream *aInStream,
44 : void *aClosure,
45 : const char *aFromSegment,
46 : PRUint32 aToOffset,
47 : PRUint32 aCount,
48 : PRUint32 *aWriteCount);
49 :
50 : /* starting interface: nsIInputStream */
51 : #define NS_IINPUTSTREAM_IID_STR "fa9c7f6c-61b3-11d4-9877-00c04fa0cf4a"
52 :
53 : #define NS_IINPUTSTREAM_IID \
54 : {0xfa9c7f6c, 0x61b3, 0x11d4, \
55 : { 0x98, 0x77, 0x00, 0xc0, 0x4f, 0xa0, 0xcf, 0x4a }}
56 :
57 273918 : class NS_NO_VTABLE NS_SCRIPTABLE nsIInputStream : public nsISupports {
58 : public:
59 :
60 : NS_DECLARE_STATIC_IID_ACCESSOR(NS_IINPUTSTREAM_IID)
61 :
62 : /* void close (); */
63 : NS_SCRIPTABLE NS_IMETHOD Close(void) = 0;
64 :
65 : /* unsigned long available (); */
66 : NS_SCRIPTABLE NS_IMETHOD Available(PRUint32 *_retval NS_OUTPARAM) = 0;
67 :
68 : /* [noscript] unsigned long read (in charPtr aBuf, in unsigned long aCount); */
69 : NS_IMETHOD Read(char *aBuf, PRUint32 aCount, PRUint32 *_retval NS_OUTPARAM) = 0;
70 :
71 : /* [noscript] unsigned long readSegments (in nsWriteSegmentFun aWriter, in voidPtr aClosure, in unsigned long aCount); */
72 : NS_IMETHOD ReadSegments(nsWriteSegmentFun aWriter, void *aClosure, PRUint32 aCount, PRUint32 *_retval NS_OUTPARAM) = 0;
73 :
74 : /* boolean isNonBlocking (); */
75 : NS_SCRIPTABLE NS_IMETHOD IsNonBlocking(bool *_retval NS_OUTPARAM) = 0;
76 :
77 : };
78 :
79 : NS_DEFINE_STATIC_IID_ACCESSOR(nsIInputStream, NS_IINPUTSTREAM_IID)
80 :
81 : /* Use this macro when declaring classes that implement this interface. */
82 : #define NS_DECL_NSIINPUTSTREAM \
83 : NS_SCRIPTABLE NS_IMETHOD Close(void); \
84 : NS_SCRIPTABLE NS_IMETHOD Available(PRUint32 *_retval NS_OUTPARAM); \
85 : NS_IMETHOD Read(char *aBuf, PRUint32 aCount, PRUint32 *_retval NS_OUTPARAM); \
86 : NS_IMETHOD ReadSegments(nsWriteSegmentFun aWriter, void *aClosure, PRUint32 aCount, PRUint32 *_retval NS_OUTPARAM); \
87 : NS_SCRIPTABLE NS_IMETHOD IsNonBlocking(bool *_retval NS_OUTPARAM);
88 :
89 : /* Use this macro to declare functions that forward the behavior of this interface to another object. */
90 : #define NS_FORWARD_NSIINPUTSTREAM(_to) \
91 : NS_SCRIPTABLE NS_IMETHOD Close(void) { return _to Close(); } \
92 : NS_SCRIPTABLE NS_IMETHOD Available(PRUint32 *_retval NS_OUTPARAM) { return _to Available(_retval); } \
93 : NS_IMETHOD Read(char *aBuf, PRUint32 aCount, PRUint32 *_retval NS_OUTPARAM) { return _to Read(aBuf, aCount, _retval); } \
94 : NS_IMETHOD ReadSegments(nsWriteSegmentFun aWriter, void *aClosure, PRUint32 aCount, PRUint32 *_retval NS_OUTPARAM) { return _to ReadSegments(aWriter, aClosure, aCount, _retval); } \
95 : NS_SCRIPTABLE NS_IMETHOD IsNonBlocking(bool *_retval NS_OUTPARAM) { return _to IsNonBlocking(_retval); }
96 :
97 : /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
98 : #define NS_FORWARD_SAFE_NSIINPUTSTREAM(_to) \
99 : NS_SCRIPTABLE NS_IMETHOD Close(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->Close(); } \
100 : NS_SCRIPTABLE NS_IMETHOD Available(PRUint32 *_retval NS_OUTPARAM) { return !_to ? NS_ERROR_NULL_POINTER : _to->Available(_retval); } \
101 : NS_IMETHOD Read(char *aBuf, PRUint32 aCount, PRUint32 *_retval NS_OUTPARAM) { return !_to ? NS_ERROR_NULL_POINTER : _to->Read(aBuf, aCount, _retval); } \
102 : NS_IMETHOD ReadSegments(nsWriteSegmentFun aWriter, void *aClosure, PRUint32 aCount, PRUint32 *_retval NS_OUTPARAM) { return !_to ? NS_ERROR_NULL_POINTER : _to->ReadSegments(aWriter, aClosure, aCount, _retval); } \
103 : NS_SCRIPTABLE NS_IMETHOD IsNonBlocking(bool *_retval NS_OUTPARAM) { return !_to ? NS_ERROR_NULL_POINTER : _to->IsNonBlocking(_retval); }
104 :
105 : #if 0
106 : /* Use the code below as a template for the implementation class for this interface. */
107 :
108 : /* Header file */
109 : class nsInputStream : public nsIInputStream
110 : {
111 : public:
112 : NS_DECL_ISUPPORTS
113 : NS_DECL_NSIINPUTSTREAM
114 :
115 : nsInputStream();
116 :
117 : private:
118 : ~nsInputStream();
119 :
120 : protected:
121 : /* additional members */
122 : };
123 :
124 : /* Implementation file */
125 : NS_IMPL_ISUPPORTS1(nsInputStream, nsIInputStream)
126 :
127 : nsInputStream::nsInputStream()
128 : {
129 : /* member initializers and constructor code */
130 : }
131 :
132 : nsInputStream::~nsInputStream()
133 : {
134 : /* destructor code */
135 : }
136 :
137 : /* void close (); */
138 : NS_IMETHODIMP nsInputStream::Close()
139 : {
140 : return NS_ERROR_NOT_IMPLEMENTED;
141 : }
142 :
143 : /* unsigned long available (); */
144 : NS_IMETHODIMP nsInputStream::Available(PRUint32 *_retval NS_OUTPARAM)
145 : {
146 : return NS_ERROR_NOT_IMPLEMENTED;
147 : }
148 :
149 : /* [noscript] unsigned long read (in charPtr aBuf, in unsigned long aCount); */
150 : NS_IMETHODIMP nsInputStream::Read(char *aBuf, PRUint32 aCount, PRUint32 *_retval NS_OUTPARAM)
151 : {
152 : return NS_ERROR_NOT_IMPLEMENTED;
153 : }
154 :
155 : /* [noscript] unsigned long readSegments (in nsWriteSegmentFun aWriter, in voidPtr aClosure, in unsigned long aCount); */
156 : NS_IMETHODIMP nsInputStream::ReadSegments(nsWriteSegmentFun aWriter, void *aClosure, PRUint32 aCount, PRUint32 *_retval NS_OUTPARAM)
157 : {
158 : return NS_ERROR_NOT_IMPLEMENTED;
159 : }
160 :
161 : /* boolean isNonBlocking (); */
162 : NS_IMETHODIMP nsInputStream::IsNonBlocking(bool *_retval NS_OUTPARAM)
163 : {
164 : return NS_ERROR_NOT_IMPLEMENTED;
165 : }
166 :
167 : /* End of implementation class template. */
168 : #endif
169 :
170 :
171 : #endif /* __gen_nsIInputStream_h__ */
|