Line data Source code
1 : /*
2 : * DO NOT EDIT. THIS FILE IS GENERATED FROM ../../../dist/idl/nsIPipe.idl
3 : */
4 :
5 : #ifndef __gen_nsIPipe_h__
6 : #define __gen_nsIPipe_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 nsIAsyncInputStream; /* forward declaration */
18 :
19 : class nsIAsyncOutputStream; /* forward declaration */
20 :
21 :
22 : /* starting interface: nsIPipe */
23 : #define NS_IPIPE_IID_STR "25d0de93-685e-4ea4-95d3-d884e31df63c"
24 :
25 : #define NS_IPIPE_IID \
26 : {0x25d0de93, 0x685e, 0x4ea4, \
27 : { 0x95, 0xd3, 0xd8, 0x84, 0xe3, 0x1d, 0xf6, 0x3c }}
28 :
29 76 : class NS_NO_VTABLE nsIPipe : public nsISupports {
30 : public:
31 :
32 : NS_DECLARE_STATIC_IID_ACCESSOR(NS_IPIPE_IID)
33 :
34 : /* [must_use] void init (in boolean nonBlockingInput, in boolean nonBlockingOutput, in unsigned long segmentSize, in unsigned long segmentCount); */
35 : MOZ_MUST_USE NS_IMETHOD Init(bool nonBlockingInput, bool nonBlockingOutput, uint32_t segmentSize, uint32_t segmentCount) = 0;
36 :
37 : /* [must_use] readonly attribute nsIAsyncInputStream inputStream; */
38 : MOZ_MUST_USE NS_IMETHOD GetInputStream(nsIAsyncInputStream * *aInputStream) = 0;
39 :
40 : /* [must_use] readonly attribute nsIAsyncOutputStream outputStream; */
41 : MOZ_MUST_USE NS_IMETHOD GetOutputStream(nsIAsyncOutputStream * *aOutputStream) = 0;
42 :
43 : };
44 :
45 : NS_DEFINE_STATIC_IID_ACCESSOR(nsIPipe, NS_IPIPE_IID)
46 :
47 : /* Use this macro when declaring classes that implement this interface. */
48 : #define NS_DECL_NSIPIPE \
49 : MOZ_MUST_USE NS_IMETHOD Init(bool nonBlockingInput, bool nonBlockingOutput, uint32_t segmentSize, uint32_t segmentCount) override; \
50 : MOZ_MUST_USE NS_IMETHOD GetInputStream(nsIAsyncInputStream * *aInputStream) override; \
51 : MOZ_MUST_USE NS_IMETHOD GetOutputStream(nsIAsyncOutputStream * *aOutputStream) override;
52 :
53 : /* Use this macro when declaring the members of this interface when the
54 : class doesn't implement the interface. This is useful for forwarding. */
55 : #define NS_DECL_NON_VIRTUAL_NSIPIPE \
56 : MOZ_MUST_USE nsresult Init(bool nonBlockingInput, bool nonBlockingOutput, uint32_t segmentSize, uint32_t segmentCount); \
57 : MOZ_MUST_USE nsresult GetInputStream(nsIAsyncInputStream * *aInputStream); \
58 : MOZ_MUST_USE nsresult GetOutputStream(nsIAsyncOutputStream * *aOutputStream);
59 :
60 : /* Use this macro to declare functions that forward the behavior of this interface to another object. */
61 : #define NS_FORWARD_NSIPIPE(_to) \
62 : MOZ_MUST_USE NS_IMETHOD Init(bool nonBlockingInput, bool nonBlockingOutput, uint32_t segmentSize, uint32_t segmentCount) override { return _to Init(nonBlockingInput, nonBlockingOutput, segmentSize, segmentCount); } \
63 : MOZ_MUST_USE NS_IMETHOD GetInputStream(nsIAsyncInputStream * *aInputStream) override { return _to GetInputStream(aInputStream); } \
64 : MOZ_MUST_USE NS_IMETHOD GetOutputStream(nsIAsyncOutputStream * *aOutputStream) override { return _to GetOutputStream(aOutputStream); }
65 :
66 : /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
67 : #define NS_FORWARD_SAFE_NSIPIPE(_to) \
68 : MOZ_MUST_USE NS_IMETHOD Init(bool nonBlockingInput, bool nonBlockingOutput, uint32_t segmentSize, uint32_t segmentCount) override { return !_to ? NS_ERROR_NULL_POINTER : _to->Init(nonBlockingInput, nonBlockingOutput, segmentSize, segmentCount); } \
69 : MOZ_MUST_USE NS_IMETHOD GetInputStream(nsIAsyncInputStream * *aInputStream) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetInputStream(aInputStream); } \
70 : MOZ_MUST_USE NS_IMETHOD GetOutputStream(nsIAsyncOutputStream * *aOutputStream) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetOutputStream(aOutputStream); }
71 :
72 : #if 0
73 : /* Use the code below as a template for the implementation class for this interface. */
74 :
75 : /* Header file */
76 : class nsPipe : public nsIPipe
77 : {
78 : public:
79 : NS_DECL_ISUPPORTS
80 : NS_DECL_NSIPIPE
81 :
82 : nsPipe();
83 :
84 : private:
85 : ~nsPipe();
86 :
87 : protected:
88 : /* additional members */
89 : };
90 :
91 : /* Implementation file */
92 : NS_IMPL_ISUPPORTS(nsPipe, nsIPipe)
93 :
94 : nsPipe::nsPipe()
95 : {
96 : /* member initializers and constructor code */
97 : }
98 :
99 : nsPipe::~nsPipe()
100 : {
101 : /* destructor code */
102 : }
103 :
104 : /* [must_use] void init (in boolean nonBlockingInput, in boolean nonBlockingOutput, in unsigned long segmentSize, in unsigned long segmentCount); */
105 : MOZ_MUST_USE NS_IMETHODIMP nsPipe::Init(bool nonBlockingInput, bool nonBlockingOutput, uint32_t segmentSize, uint32_t segmentCount)
106 : {
107 : return NS_ERROR_NOT_IMPLEMENTED;
108 : }
109 :
110 : /* [must_use] readonly attribute nsIAsyncInputStream inputStream; */
111 : MOZ_MUST_USE NS_IMETHODIMP nsPipe::GetInputStream(nsIAsyncInputStream * *aInputStream)
112 : {
113 : return NS_ERROR_NOT_IMPLEMENTED;
114 : }
115 :
116 : /* [must_use] readonly attribute nsIAsyncOutputStream outputStream; */
117 : MOZ_MUST_USE NS_IMETHODIMP nsPipe::GetOutputStream(nsIAsyncOutputStream * *aOutputStream)
118 : {
119 : return NS_ERROR_NOT_IMPLEMENTED;
120 : }
121 :
122 : /* End of implementation class template. */
123 : #endif
124 :
125 :
126 : /* starting interface: nsISearchableInputStream */
127 : #define NS_ISEARCHABLEINPUTSTREAM_IID_STR "8c39ef62-f7c9-11d4-98f5-001083010e9b"
128 :
129 : #define NS_ISEARCHABLEINPUTSTREAM_IID \
130 : {0x8c39ef62, 0xf7c9, 0x11d4, \
131 : { 0x98, 0xf5, 0x00, 0x10, 0x83, 0x01, 0x0e, 0x9b }}
132 :
133 76 : class NS_NO_VTABLE nsISearchableInputStream : public nsISupports {
134 : public:
135 :
136 : NS_DECLARE_STATIC_IID_ACCESSOR(NS_ISEARCHABLEINPUTSTREAM_IID)
137 :
138 : /* void search (in string forString, in boolean ignoreCase, out boolean found, out unsigned long offsetSearchedTo); */
139 : NS_IMETHOD Search(const char * forString, bool ignoreCase, bool *found, uint32_t *offsetSearchedTo) = 0;
140 :
141 : };
142 :
143 : NS_DEFINE_STATIC_IID_ACCESSOR(nsISearchableInputStream, NS_ISEARCHABLEINPUTSTREAM_IID)
144 :
145 : /* Use this macro when declaring classes that implement this interface. */
146 : #define NS_DECL_NSISEARCHABLEINPUTSTREAM \
147 : NS_IMETHOD Search(const char * forString, bool ignoreCase, bool *found, uint32_t *offsetSearchedTo) override;
148 :
149 : /* Use this macro when declaring the members of this interface when the
150 : class doesn't implement the interface. This is useful for forwarding. */
151 : #define NS_DECL_NON_VIRTUAL_NSISEARCHABLEINPUTSTREAM \
152 : nsresult Search(const char * forString, bool ignoreCase, bool *found, uint32_t *offsetSearchedTo);
153 :
154 : /* Use this macro to declare functions that forward the behavior of this interface to another object. */
155 : #define NS_FORWARD_NSISEARCHABLEINPUTSTREAM(_to) \
156 : NS_IMETHOD Search(const char * forString, bool ignoreCase, bool *found, uint32_t *offsetSearchedTo) override { return _to Search(forString, ignoreCase, found, offsetSearchedTo); }
157 :
158 : /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
159 : #define NS_FORWARD_SAFE_NSISEARCHABLEINPUTSTREAM(_to) \
160 : NS_IMETHOD Search(const char * forString, bool ignoreCase, bool *found, uint32_t *offsetSearchedTo) override { return !_to ? NS_ERROR_NULL_POINTER : _to->Search(forString, ignoreCase, found, offsetSearchedTo); }
161 :
162 : #if 0
163 : /* Use the code below as a template for the implementation class for this interface. */
164 :
165 : /* Header file */
166 : class nsSearchableInputStream : public nsISearchableInputStream
167 : {
168 : public:
169 : NS_DECL_ISUPPORTS
170 : NS_DECL_NSISEARCHABLEINPUTSTREAM
171 :
172 : nsSearchableInputStream();
173 :
174 : private:
175 : ~nsSearchableInputStream();
176 :
177 : protected:
178 : /* additional members */
179 : };
180 :
181 : /* Implementation file */
182 : NS_IMPL_ISUPPORTS(nsSearchableInputStream, nsISearchableInputStream)
183 :
184 : nsSearchableInputStream::nsSearchableInputStream()
185 : {
186 : /* member initializers and constructor code */
187 : }
188 :
189 : nsSearchableInputStream::~nsSearchableInputStream()
190 : {
191 : /* destructor code */
192 : }
193 :
194 : /* void search (in string forString, in boolean ignoreCase, out boolean found, out unsigned long offsetSearchedTo); */
195 : NS_IMETHODIMP nsSearchableInputStream::Search(const char * forString, bool ignoreCase, bool *found, uint32_t *offsetSearchedTo)
196 : {
197 : return NS_ERROR_NOT_IMPLEMENTED;
198 : }
199 :
200 : /* End of implementation class template. */
201 : #endif
202 :
203 :
204 : class nsIInputStream;
205 : class nsIOutputStream;
206 : /**
207 : * NS_NewPipe2
208 : *
209 : * This function supersedes NS_NewPipe. It differs from NS_NewPipe in two
210 : * major ways:
211 : * (1) returns nsIAsyncInputStream and nsIAsyncOutputStream, so it is
212 : * not necessary to QI in order to access these interfaces.
213 : * (2) the size of the pipe is determined by the number of segments
214 : * times the size of each segment.
215 : *
216 : * @param pipeIn
217 : * resulting input end of the pipe
218 : * @param pipeOut
219 : * resulting output end of the pipe
220 : * @param nonBlockingInput
221 : * true specifies non-blocking input stream behavior
222 : * @param nonBlockingOutput
223 : * true specifies non-blocking output stream behavior
224 : * @param segmentSize
225 : * specifies the segment size in bytes (pass 0 to use default value)
226 : * @param segmentCount
227 : * specifies the max number of segments (pass 0 to use default value)
228 : * passing UINT32_MAX here causes the pipe to have "infinite" space.
229 : * this mode can be useful in some cases, but should always be used with
230 : * caution. the default value for this parameter is a finite value.
231 : */
232 : extern MOZ_MUST_USE nsresult
233 : NS_NewPipe2(nsIAsyncInputStream **pipeIn,
234 : nsIAsyncOutputStream **pipeOut,
235 : bool nonBlockingInput = false,
236 : bool nonBlockingOutput = false,
237 : uint32_t segmentSize = 0,
238 : uint32_t segmentCount = 0);
239 : /**
240 : * NS_NewPipe
241 : *
242 : * Preserved for backwards compatibility. Plus, this interface is more
243 : * amiable in certain contexts (e.g., when you don't need the pipe's async
244 : * capabilities).
245 : *
246 : * @param pipeIn
247 : * resulting input end of the pipe
248 : * @param pipeOut
249 : * resulting output end of the pipe
250 : * @param segmentSize
251 : * specifies the segment size in bytes (pass 0 to use default value)
252 : * @param maxSize
253 : * specifies the max size of the pipe (pass 0 to use default value)
254 : * number of segments is maxSize / segmentSize, and maxSize must be a
255 : * multiple of segmentSize. passing UINT32_MAX here causes the
256 : * pipe to have "infinite" space. this mode can be useful in some
257 : * cases, but should always be used with caution. the default value
258 : * for this parameter is a finite value.
259 : * @param nonBlockingInput
260 : * true specifies non-blocking input stream behavior
261 : * @param nonBlockingOutput
262 : * true specifies non-blocking output stream behavior
263 : */
264 : extern MOZ_MUST_USE nsresult
265 : NS_NewPipe(nsIInputStream **pipeIn,
266 : nsIOutputStream **pipeOut,
267 : uint32_t segmentSize = 0,
268 : uint32_t maxSize = 0,
269 : bool nonBlockingInput = false,
270 : bool nonBlockingOutput = false);
271 :
272 : #endif /* __gen_nsIPipe_h__ */
|