Line data Source code
1 : /*
2 : * DO NOT EDIT. THIS FILE IS GENERATED FROM ../../../dist/idl/nsIServerSocket.idl
3 : */
4 :
5 : #ifndef __gen_nsIServerSocket_h__
6 : #define __gen_nsIServerSocket_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 nsIFile; /* forward declaration */
18 :
19 : class nsIServerSocketListener; /* forward declaration */
20 :
21 : class nsISocketTransport; /* forward declaration */
22 :
23 : typedef uint32_t nsServerSocketFlag;
24 :
25 :
26 : /* starting interface: nsIServerSocket */
27 : #define NS_ISERVERSOCKET_IID_STR "7a9c39cb-a13f-4eef-9bdf-a74301628742"
28 :
29 : #define NS_ISERVERSOCKET_IID \
30 : {0x7a9c39cb, 0xa13f, 0x4eef, \
31 : { 0x9b, 0xdf, 0xa7, 0x43, 0x01, 0x62, 0x87, 0x42 }}
32 :
33 0 : class NS_NO_VTABLE nsIServerSocket : public nsISupports {
34 : public:
35 :
36 : NS_DECLARE_STATIC_IID_ACCESSOR(NS_ISERVERSOCKET_IID)
37 :
38 : enum {
39 : LoopbackOnly = 1U,
40 : KeepWhenOffline = 2U
41 : };
42 :
43 : /* void init (in long aPort, in boolean aLoopbackOnly, in long aBackLog); */
44 : NS_IMETHOD Init(int32_t aPort, bool aLoopbackOnly, int32_t aBackLog) = 0;
45 :
46 : /* void initSpecialConnection (in long aPort, in nsServerSocketFlag aFlags, in long aBackLog); */
47 : NS_IMETHOD InitSpecialConnection(int32_t aPort, nsServerSocketFlag aFlags, int32_t aBackLog) = 0;
48 :
49 : /* [noscript] void initWithAddress ([const] in PRNetAddrPtr aAddr, in long aBackLog); */
50 : NS_IMETHOD InitWithAddress(const union PRNetAddr *aAddr, int32_t aBackLog) = 0;
51 :
52 : /* void initWithFilename (in nsIFile aPath, in unsigned long aPermissions, in long aBacklog); */
53 : NS_IMETHOD InitWithFilename(nsIFile *aPath, uint32_t aPermissions, int32_t aBacklog) = 0;
54 :
55 : /* void close (); */
56 : NS_IMETHOD Close(void) = 0;
57 :
58 : /* void asyncListen (in nsIServerSocketListener aListener); */
59 : NS_IMETHOD AsyncListen(nsIServerSocketListener *aListener) = 0;
60 :
61 : /* readonly attribute long port; */
62 : NS_IMETHOD GetPort(int32_t *aPort) = 0;
63 :
64 : /* [noscript] PRNetAddr getAddress (); */
65 : NS_IMETHOD GetAddress(union PRNetAddr *_retval) = 0;
66 :
67 : };
68 :
69 : NS_DEFINE_STATIC_IID_ACCESSOR(nsIServerSocket, NS_ISERVERSOCKET_IID)
70 :
71 : /* Use this macro when declaring classes that implement this interface. */
72 : #define NS_DECL_NSISERVERSOCKET \
73 : NS_IMETHOD Init(int32_t aPort, bool aLoopbackOnly, int32_t aBackLog) override; \
74 : NS_IMETHOD InitSpecialConnection(int32_t aPort, nsServerSocketFlag aFlags, int32_t aBackLog) override; \
75 : NS_IMETHOD InitWithAddress(const union PRNetAddr *aAddr, int32_t aBackLog) override; \
76 : NS_IMETHOD InitWithFilename(nsIFile *aPath, uint32_t aPermissions, int32_t aBacklog) override; \
77 : NS_IMETHOD Close(void) override; \
78 : NS_IMETHOD AsyncListen(nsIServerSocketListener *aListener) override; \
79 : NS_IMETHOD GetPort(int32_t *aPort) override; \
80 : NS_IMETHOD GetAddress(union PRNetAddr *_retval) override;
81 :
82 : /* Use this macro when declaring the members of this interface when the
83 : class doesn't implement the interface. This is useful for forwarding. */
84 : #define NS_DECL_NON_VIRTUAL_NSISERVERSOCKET \
85 : nsresult Init(int32_t aPort, bool aLoopbackOnly, int32_t aBackLog); \
86 : nsresult InitSpecialConnection(int32_t aPort, nsServerSocketFlag aFlags, int32_t aBackLog); \
87 : nsresult InitWithAddress(const union PRNetAddr *aAddr, int32_t aBackLog); \
88 : nsresult InitWithFilename(nsIFile *aPath, uint32_t aPermissions, int32_t aBacklog); \
89 : nsresult Close(void); \
90 : nsresult AsyncListen(nsIServerSocketListener *aListener); \
91 : nsresult GetPort(int32_t *aPort); \
92 : nsresult GetAddress(union PRNetAddr *_retval);
93 :
94 : /* Use this macro to declare functions that forward the behavior of this interface to another object. */
95 : #define NS_FORWARD_NSISERVERSOCKET(_to) \
96 : NS_IMETHOD Init(int32_t aPort, bool aLoopbackOnly, int32_t aBackLog) override { return _to Init(aPort, aLoopbackOnly, aBackLog); } \
97 : NS_IMETHOD InitSpecialConnection(int32_t aPort, nsServerSocketFlag aFlags, int32_t aBackLog) override { return _to InitSpecialConnection(aPort, aFlags, aBackLog); } \
98 : NS_IMETHOD InitWithAddress(const union PRNetAddr *aAddr, int32_t aBackLog) override { return _to InitWithAddress(aAddr, aBackLog); } \
99 : NS_IMETHOD InitWithFilename(nsIFile *aPath, uint32_t aPermissions, int32_t aBacklog) override { return _to InitWithFilename(aPath, aPermissions, aBacklog); } \
100 : NS_IMETHOD Close(void) override { return _to Close(); } \
101 : NS_IMETHOD AsyncListen(nsIServerSocketListener *aListener) override { return _to AsyncListen(aListener); } \
102 : NS_IMETHOD GetPort(int32_t *aPort) override { return _to GetPort(aPort); } \
103 : NS_IMETHOD GetAddress(union PRNetAddr *_retval) override { return _to GetAddress(_retval); }
104 :
105 : /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
106 : #define NS_FORWARD_SAFE_NSISERVERSOCKET(_to) \
107 : NS_IMETHOD Init(int32_t aPort, bool aLoopbackOnly, int32_t aBackLog) override { return !_to ? NS_ERROR_NULL_POINTER : _to->Init(aPort, aLoopbackOnly, aBackLog); } \
108 : NS_IMETHOD InitSpecialConnection(int32_t aPort, nsServerSocketFlag aFlags, int32_t aBackLog) override { return !_to ? NS_ERROR_NULL_POINTER : _to->InitSpecialConnection(aPort, aFlags, aBackLog); } \
109 : NS_IMETHOD InitWithAddress(const union PRNetAddr *aAddr, int32_t aBackLog) override { return !_to ? NS_ERROR_NULL_POINTER : _to->InitWithAddress(aAddr, aBackLog); } \
110 : NS_IMETHOD InitWithFilename(nsIFile *aPath, uint32_t aPermissions, int32_t aBacklog) override { return !_to ? NS_ERROR_NULL_POINTER : _to->InitWithFilename(aPath, aPermissions, aBacklog); } \
111 : NS_IMETHOD Close(void) override { return !_to ? NS_ERROR_NULL_POINTER : _to->Close(); } \
112 : NS_IMETHOD AsyncListen(nsIServerSocketListener *aListener) override { return !_to ? NS_ERROR_NULL_POINTER : _to->AsyncListen(aListener); } \
113 : NS_IMETHOD GetPort(int32_t *aPort) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetPort(aPort); } \
114 : NS_IMETHOD GetAddress(union PRNetAddr *_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetAddress(_retval); }
115 :
116 : #if 0
117 : /* Use the code below as a template for the implementation class for this interface. */
118 :
119 : /* Header file */
120 : class nsServerSocket : public nsIServerSocket
121 : {
122 : public:
123 : NS_DECL_ISUPPORTS
124 : NS_DECL_NSISERVERSOCKET
125 :
126 : nsServerSocket();
127 :
128 : private:
129 : ~nsServerSocket();
130 :
131 : protected:
132 : /* additional members */
133 : };
134 :
135 : /* Implementation file */
136 : NS_IMPL_ISUPPORTS(nsServerSocket, nsIServerSocket)
137 :
138 : nsServerSocket::nsServerSocket()
139 : {
140 : /* member initializers and constructor code */
141 : }
142 :
143 : nsServerSocket::~nsServerSocket()
144 : {
145 : /* destructor code */
146 : }
147 :
148 : /* void init (in long aPort, in boolean aLoopbackOnly, in long aBackLog); */
149 : NS_IMETHODIMP nsServerSocket::Init(int32_t aPort, bool aLoopbackOnly, int32_t aBackLog)
150 : {
151 : return NS_ERROR_NOT_IMPLEMENTED;
152 : }
153 :
154 : /* void initSpecialConnection (in long aPort, in nsServerSocketFlag aFlags, in long aBackLog); */
155 : NS_IMETHODIMP nsServerSocket::InitSpecialConnection(int32_t aPort, nsServerSocketFlag aFlags, int32_t aBackLog)
156 : {
157 : return NS_ERROR_NOT_IMPLEMENTED;
158 : }
159 :
160 : /* [noscript] void initWithAddress ([const] in PRNetAddrPtr aAddr, in long aBackLog); */
161 : NS_IMETHODIMP nsServerSocket::InitWithAddress(const union PRNetAddr *aAddr, int32_t aBackLog)
162 : {
163 : return NS_ERROR_NOT_IMPLEMENTED;
164 : }
165 :
166 : /* void initWithFilename (in nsIFile aPath, in unsigned long aPermissions, in long aBacklog); */
167 : NS_IMETHODIMP nsServerSocket::InitWithFilename(nsIFile *aPath, uint32_t aPermissions, int32_t aBacklog)
168 : {
169 : return NS_ERROR_NOT_IMPLEMENTED;
170 : }
171 :
172 : /* void close (); */
173 : NS_IMETHODIMP nsServerSocket::Close()
174 : {
175 : return NS_ERROR_NOT_IMPLEMENTED;
176 : }
177 :
178 : /* void asyncListen (in nsIServerSocketListener aListener); */
179 : NS_IMETHODIMP nsServerSocket::AsyncListen(nsIServerSocketListener *aListener)
180 : {
181 : return NS_ERROR_NOT_IMPLEMENTED;
182 : }
183 :
184 : /* readonly attribute long port; */
185 : NS_IMETHODIMP nsServerSocket::GetPort(int32_t *aPort)
186 : {
187 : return NS_ERROR_NOT_IMPLEMENTED;
188 : }
189 :
190 : /* [noscript] PRNetAddr getAddress (); */
191 : NS_IMETHODIMP nsServerSocket::GetAddress(union PRNetAddr *_retval)
192 : {
193 : return NS_ERROR_NOT_IMPLEMENTED;
194 : }
195 :
196 : /* End of implementation class template. */
197 : #endif
198 :
199 :
200 : /* starting interface: nsIServerSocketListener */
201 : #define NS_ISERVERSOCKETLISTENER_IID_STR "836d98ec-fee2-4bde-b609-abd5e966eabd"
202 :
203 : #define NS_ISERVERSOCKETLISTENER_IID \
204 : {0x836d98ec, 0xfee2, 0x4bde, \
205 : { 0xb6, 0x09, 0xab, 0xd5, 0xe9, 0x66, 0xea, 0xbd }}
206 :
207 0 : class NS_NO_VTABLE nsIServerSocketListener : public nsISupports {
208 : public:
209 :
210 : NS_DECLARE_STATIC_IID_ACCESSOR(NS_ISERVERSOCKETLISTENER_IID)
211 :
212 : /* void onSocketAccepted (in nsIServerSocket aServ, in nsISocketTransport aTransport); */
213 : NS_IMETHOD OnSocketAccepted(nsIServerSocket *aServ, nsISocketTransport *aTransport) = 0;
214 :
215 : /* void onStopListening (in nsIServerSocket aServ, in nsresult aStatus); */
216 : NS_IMETHOD OnStopListening(nsIServerSocket *aServ, nsresult aStatus) = 0;
217 :
218 : };
219 :
220 : NS_DEFINE_STATIC_IID_ACCESSOR(nsIServerSocketListener, NS_ISERVERSOCKETLISTENER_IID)
221 :
222 : /* Use this macro when declaring classes that implement this interface. */
223 : #define NS_DECL_NSISERVERSOCKETLISTENER \
224 : NS_IMETHOD OnSocketAccepted(nsIServerSocket *aServ, nsISocketTransport *aTransport) override; \
225 : NS_IMETHOD OnStopListening(nsIServerSocket *aServ, nsresult aStatus) override;
226 :
227 : /* Use this macro when declaring the members of this interface when the
228 : class doesn't implement the interface. This is useful for forwarding. */
229 : #define NS_DECL_NON_VIRTUAL_NSISERVERSOCKETLISTENER \
230 : nsresult OnSocketAccepted(nsIServerSocket *aServ, nsISocketTransport *aTransport); \
231 : nsresult OnStopListening(nsIServerSocket *aServ, nsresult aStatus);
232 :
233 : /* Use this macro to declare functions that forward the behavior of this interface to another object. */
234 : #define NS_FORWARD_NSISERVERSOCKETLISTENER(_to) \
235 : NS_IMETHOD OnSocketAccepted(nsIServerSocket *aServ, nsISocketTransport *aTransport) override { return _to OnSocketAccepted(aServ, aTransport); } \
236 : NS_IMETHOD OnStopListening(nsIServerSocket *aServ, nsresult aStatus) override { return _to OnStopListening(aServ, aStatus); }
237 :
238 : /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
239 : #define NS_FORWARD_SAFE_NSISERVERSOCKETLISTENER(_to) \
240 : NS_IMETHOD OnSocketAccepted(nsIServerSocket *aServ, nsISocketTransport *aTransport) override { return !_to ? NS_ERROR_NULL_POINTER : _to->OnSocketAccepted(aServ, aTransport); } \
241 : NS_IMETHOD OnStopListening(nsIServerSocket *aServ, nsresult aStatus) override { return !_to ? NS_ERROR_NULL_POINTER : _to->OnStopListening(aServ, aStatus); }
242 :
243 : #if 0
244 : /* Use the code below as a template for the implementation class for this interface. */
245 :
246 : /* Header file */
247 : class nsServerSocketListener : public nsIServerSocketListener
248 : {
249 : public:
250 : NS_DECL_ISUPPORTS
251 : NS_DECL_NSISERVERSOCKETLISTENER
252 :
253 : nsServerSocketListener();
254 :
255 : private:
256 : ~nsServerSocketListener();
257 :
258 : protected:
259 : /* additional members */
260 : };
261 :
262 : /* Implementation file */
263 : NS_IMPL_ISUPPORTS(nsServerSocketListener, nsIServerSocketListener)
264 :
265 : nsServerSocketListener::nsServerSocketListener()
266 : {
267 : /* member initializers and constructor code */
268 : }
269 :
270 : nsServerSocketListener::~nsServerSocketListener()
271 : {
272 : /* destructor code */
273 : }
274 :
275 : /* void onSocketAccepted (in nsIServerSocket aServ, in nsISocketTransport aTransport); */
276 : NS_IMETHODIMP nsServerSocketListener::OnSocketAccepted(nsIServerSocket *aServ, nsISocketTransport *aTransport)
277 : {
278 : return NS_ERROR_NOT_IMPLEMENTED;
279 : }
280 :
281 : /* void onStopListening (in nsIServerSocket aServ, in nsresult aStatus); */
282 : NS_IMETHODIMP nsServerSocketListener::OnStopListening(nsIServerSocket *aServ, nsresult aStatus)
283 : {
284 : return NS_ERROR_NOT_IMPLEMENTED;
285 : }
286 :
287 : /* End of implementation class template. */
288 : #endif
289 :
290 :
291 : #endif /* __gen_nsIServerSocket_h__ */
|