Line data Source code
1 : /*
2 : * DO NOT EDIT. THIS FILE IS GENERATED FROM ../../../dist/idl/nsIIOService.idl
3 : */
4 :
5 : #ifndef __gen_nsIIOService_h__
6 : #define __gen_nsIIOService_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 nsIProtocolHandler; /* forward declaration */
18 :
19 : class nsIChannel; /* forward declaration */
20 :
21 : class nsIURI; /* forward declaration */
22 :
23 : class nsIFile; /* forward declaration */
24 :
25 : class nsIDOMNode; /* forward declaration */
26 :
27 : class nsIPrincipal; /* forward declaration */
28 :
29 : class nsILoadInfo; /* forward declaration */
30 :
31 :
32 : /* starting interface: nsIIOService */
33 : #define NS_IIOSERVICE_IID_STR "4286de5a-b2ea-446f-8f70-e2a461f42694"
34 :
35 : #define NS_IIOSERVICE_IID \
36 : {0x4286de5a, 0xb2ea, 0x446f, \
37 : { 0x8f, 0x70, 0xe2, 0xa4, 0x61, 0xf4, 0x26, 0x94 }}
38 :
39 3 : class NS_NO_VTABLE nsIIOService : public nsISupports {
40 : public:
41 :
42 : NS_DECLARE_STATIC_IID_ACCESSOR(NS_IIOSERVICE_IID)
43 :
44 : /* nsIProtocolHandler getProtocolHandler (in string aScheme); */
45 : NS_IMETHOD GetProtocolHandler(const char * aScheme, nsIProtocolHandler * *_retval) = 0;
46 :
47 : /* unsigned long getProtocolFlags (in string aScheme); */
48 : NS_IMETHOD GetProtocolFlags(const char * aScheme, uint32_t *_retval) = 0;
49 :
50 : /* nsIURI newURI (in AUTF8String aSpec, [optional] in string aOriginCharset, [optional] in nsIURI aBaseURI); */
51 : NS_IMETHOD NewURI(const nsACString & aSpec, const char * aOriginCharset, nsIURI *aBaseURI, nsIURI * *_retval) = 0;
52 :
53 : /* nsIURI newFileURI (in nsIFile aFile); */
54 : NS_IMETHOD NewFileURI(nsIFile *aFile, nsIURI * *_retval) = 0;
55 :
56 : /* nsIChannel newChannelFromURI2 (in nsIURI aURI, in nsIDOMNode aLoadingNode, in nsIPrincipal aLoadingPrincipal, in nsIPrincipal aTriggeringPrincipal, in unsigned long aSecurityFlags, in unsigned long aContentPolicyType); */
57 : NS_IMETHOD NewChannelFromURI2(nsIURI *aURI, nsIDOMNode *aLoadingNode, nsIPrincipal *aLoadingPrincipal, nsIPrincipal *aTriggeringPrincipal, uint32_t aSecurityFlags, uint32_t aContentPolicyType, nsIChannel * *_retval) = 0;
58 :
59 : /* nsIChannel newChannelFromURIWithLoadInfo (in nsIURI aURI, in nsILoadInfo aLoadInfo); */
60 : NS_IMETHOD NewChannelFromURIWithLoadInfo(nsIURI *aURI, nsILoadInfo *aLoadInfo, nsIChannel * *_retval) = 0;
61 :
62 : /* nsIChannel newChannel2 (in AUTF8String aSpec, in string aOriginCharset, in nsIURI aBaseURI, in nsIDOMNode aLoadingNode, in nsIPrincipal aLoadingPrincipal, in nsIPrincipal aTriggeringPrincipal, in unsigned long aSecurityFlags, in unsigned long aContentPolicyType); */
63 : NS_IMETHOD NewChannel2(const nsACString & aSpec, const char * aOriginCharset, nsIURI *aBaseURI, nsIDOMNode *aLoadingNode, nsIPrincipal *aLoadingPrincipal, nsIPrincipal *aTriggeringPrincipal, uint32_t aSecurityFlags, uint32_t aContentPolicyType, nsIChannel * *_retval) = 0;
64 :
65 : /* nsIChannel newChannelFromURI (in nsIURI aURI); */
66 : NS_IMETHOD NewChannelFromURI(nsIURI *aURI, nsIChannel * *_retval) = 0;
67 :
68 : /* nsIChannel newChannel (in AUTF8String aSpec, in string aOriginCharset, in nsIURI aBaseURI); */
69 : NS_IMETHOD NewChannel(const nsACString & aSpec, const char * aOriginCharset, nsIURI *aBaseURI, nsIChannel * *_retval) = 0;
70 :
71 : /* attribute boolean offline; */
72 : NS_IMETHOD GetOffline(bool *aOffline) = 0;
73 : NS_IMETHOD SetOffline(bool aOffline) = 0;
74 :
75 : /* readonly attribute boolean connectivity; */
76 : NS_IMETHOD GetConnectivity(bool *aConnectivity) = 0;
77 :
78 : /* boolean allowPort (in long aPort, in string aScheme); */
79 : NS_IMETHOD AllowPort(int32_t aPort, const char * aScheme, bool *_retval) = 0;
80 :
81 : /* ACString extractScheme (in AUTF8String urlString); */
82 : NS_IMETHOD ExtractScheme(const nsACString & urlString, nsACString & _retval) = 0;
83 :
84 : /* boolean hostnameIsLocalIPAddress (in nsIURI aURI); */
85 : NS_IMETHOD HostnameIsLocalIPAddress(nsIURI *aURI, bool *_retval) = 0;
86 :
87 : };
88 :
89 : NS_DEFINE_STATIC_IID_ACCESSOR(nsIIOService, NS_IIOSERVICE_IID)
90 :
91 : /* Use this macro when declaring classes that implement this interface. */
92 : #define NS_DECL_NSIIOSERVICE \
93 : NS_IMETHOD GetProtocolHandler(const char * aScheme, nsIProtocolHandler * *_retval) override; \
94 : NS_IMETHOD GetProtocolFlags(const char * aScheme, uint32_t *_retval) override; \
95 : NS_IMETHOD NewURI(const nsACString & aSpec, const char * aOriginCharset, nsIURI *aBaseURI, nsIURI * *_retval) override; \
96 : NS_IMETHOD NewFileURI(nsIFile *aFile, nsIURI * *_retval) override; \
97 : NS_IMETHOD NewChannelFromURI2(nsIURI *aURI, nsIDOMNode *aLoadingNode, nsIPrincipal *aLoadingPrincipal, nsIPrincipal *aTriggeringPrincipal, uint32_t aSecurityFlags, uint32_t aContentPolicyType, nsIChannel * *_retval) override; \
98 : NS_IMETHOD NewChannelFromURIWithLoadInfo(nsIURI *aURI, nsILoadInfo *aLoadInfo, nsIChannel * *_retval) override; \
99 : NS_IMETHOD NewChannel2(const nsACString & aSpec, const char * aOriginCharset, nsIURI *aBaseURI, nsIDOMNode *aLoadingNode, nsIPrincipal *aLoadingPrincipal, nsIPrincipal *aTriggeringPrincipal, uint32_t aSecurityFlags, uint32_t aContentPolicyType, nsIChannel * *_retval) override; \
100 : NS_IMETHOD NewChannelFromURI(nsIURI *aURI, nsIChannel * *_retval) override; \
101 : NS_IMETHOD NewChannel(const nsACString & aSpec, const char * aOriginCharset, nsIURI *aBaseURI, nsIChannel * *_retval) override; \
102 : NS_IMETHOD GetOffline(bool *aOffline) override; \
103 : NS_IMETHOD SetOffline(bool aOffline) override; \
104 : NS_IMETHOD GetConnectivity(bool *aConnectivity) override; \
105 : NS_IMETHOD AllowPort(int32_t aPort, const char * aScheme, bool *_retval) override; \
106 : NS_IMETHOD ExtractScheme(const nsACString & urlString, nsACString & _retval) override; \
107 : NS_IMETHOD HostnameIsLocalIPAddress(nsIURI *aURI, bool *_retval) override;
108 :
109 : /* Use this macro when declaring the members of this interface when the
110 : class doesn't implement the interface. This is useful for forwarding. */
111 : #define NS_DECL_NON_VIRTUAL_NSIIOSERVICE \
112 : nsresult GetProtocolHandler(const char * aScheme, nsIProtocolHandler * *_retval); \
113 : nsresult GetProtocolFlags(const char * aScheme, uint32_t *_retval); \
114 : nsresult NewURI(const nsACString & aSpec, const char * aOriginCharset, nsIURI *aBaseURI, nsIURI * *_retval); \
115 : nsresult NewFileURI(nsIFile *aFile, nsIURI * *_retval); \
116 : nsresult NewChannelFromURI2(nsIURI *aURI, nsIDOMNode *aLoadingNode, nsIPrincipal *aLoadingPrincipal, nsIPrincipal *aTriggeringPrincipal, uint32_t aSecurityFlags, uint32_t aContentPolicyType, nsIChannel * *_retval); \
117 : nsresult NewChannelFromURIWithLoadInfo(nsIURI *aURI, nsILoadInfo *aLoadInfo, nsIChannel * *_retval); \
118 : nsresult NewChannel2(const nsACString & aSpec, const char * aOriginCharset, nsIURI *aBaseURI, nsIDOMNode *aLoadingNode, nsIPrincipal *aLoadingPrincipal, nsIPrincipal *aTriggeringPrincipal, uint32_t aSecurityFlags, uint32_t aContentPolicyType, nsIChannel * *_retval); \
119 : nsresult NewChannelFromURI(nsIURI *aURI, nsIChannel * *_retval); \
120 : nsresult NewChannel(const nsACString & aSpec, const char * aOriginCharset, nsIURI *aBaseURI, nsIChannel * *_retval); \
121 : nsresult GetOffline(bool *aOffline); \
122 : nsresult SetOffline(bool aOffline); \
123 : nsresult GetConnectivity(bool *aConnectivity); \
124 : nsresult AllowPort(int32_t aPort, const char * aScheme, bool *_retval); \
125 : nsresult ExtractScheme(const nsACString & urlString, nsACString & _retval); \
126 : nsresult HostnameIsLocalIPAddress(nsIURI *aURI, bool *_retval);
127 :
128 : /* Use this macro to declare functions that forward the behavior of this interface to another object. */
129 : #define NS_FORWARD_NSIIOSERVICE(_to) \
130 : NS_IMETHOD GetProtocolHandler(const char * aScheme, nsIProtocolHandler * *_retval) override { return _to GetProtocolHandler(aScheme, _retval); } \
131 : NS_IMETHOD GetProtocolFlags(const char * aScheme, uint32_t *_retval) override { return _to GetProtocolFlags(aScheme, _retval); } \
132 : NS_IMETHOD NewURI(const nsACString & aSpec, const char * aOriginCharset, nsIURI *aBaseURI, nsIURI * *_retval) override { return _to NewURI(aSpec, aOriginCharset, aBaseURI, _retval); } \
133 : NS_IMETHOD NewFileURI(nsIFile *aFile, nsIURI * *_retval) override { return _to NewFileURI(aFile, _retval); } \
134 : NS_IMETHOD NewChannelFromURI2(nsIURI *aURI, nsIDOMNode *aLoadingNode, nsIPrincipal *aLoadingPrincipal, nsIPrincipal *aTriggeringPrincipal, uint32_t aSecurityFlags, uint32_t aContentPolicyType, nsIChannel * *_retval) override { return _to NewChannelFromURI2(aURI, aLoadingNode, aLoadingPrincipal, aTriggeringPrincipal, aSecurityFlags, aContentPolicyType, _retval); } \
135 : NS_IMETHOD NewChannelFromURIWithLoadInfo(nsIURI *aURI, nsILoadInfo *aLoadInfo, nsIChannel * *_retval) override { return _to NewChannelFromURIWithLoadInfo(aURI, aLoadInfo, _retval); } \
136 : NS_IMETHOD NewChannel2(const nsACString & aSpec, const char * aOriginCharset, nsIURI *aBaseURI, nsIDOMNode *aLoadingNode, nsIPrincipal *aLoadingPrincipal, nsIPrincipal *aTriggeringPrincipal, uint32_t aSecurityFlags, uint32_t aContentPolicyType, nsIChannel * *_retval) override { return _to NewChannel2(aSpec, aOriginCharset, aBaseURI, aLoadingNode, aLoadingPrincipal, aTriggeringPrincipal, aSecurityFlags, aContentPolicyType, _retval); } \
137 : NS_IMETHOD NewChannelFromURI(nsIURI *aURI, nsIChannel * *_retval) override { return _to NewChannelFromURI(aURI, _retval); } \
138 : NS_IMETHOD NewChannel(const nsACString & aSpec, const char * aOriginCharset, nsIURI *aBaseURI, nsIChannel * *_retval) override { return _to NewChannel(aSpec, aOriginCharset, aBaseURI, _retval); } \
139 : NS_IMETHOD GetOffline(bool *aOffline) override { return _to GetOffline(aOffline); } \
140 : NS_IMETHOD SetOffline(bool aOffline) override { return _to SetOffline(aOffline); } \
141 : NS_IMETHOD GetConnectivity(bool *aConnectivity) override { return _to GetConnectivity(aConnectivity); } \
142 : NS_IMETHOD AllowPort(int32_t aPort, const char * aScheme, bool *_retval) override { return _to AllowPort(aPort, aScheme, _retval); } \
143 : NS_IMETHOD ExtractScheme(const nsACString & urlString, nsACString & _retval) override { return _to ExtractScheme(urlString, _retval); } \
144 : NS_IMETHOD HostnameIsLocalIPAddress(nsIURI *aURI, bool *_retval) override { return _to HostnameIsLocalIPAddress(aURI, _retval); }
145 :
146 : /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
147 : #define NS_FORWARD_SAFE_NSIIOSERVICE(_to) \
148 : NS_IMETHOD GetProtocolHandler(const char * aScheme, nsIProtocolHandler * *_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetProtocolHandler(aScheme, _retval); } \
149 : NS_IMETHOD GetProtocolFlags(const char * aScheme, uint32_t *_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetProtocolFlags(aScheme, _retval); } \
150 : NS_IMETHOD NewURI(const nsACString & aSpec, const char * aOriginCharset, nsIURI *aBaseURI, nsIURI * *_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->NewURI(aSpec, aOriginCharset, aBaseURI, _retval); } \
151 : NS_IMETHOD NewFileURI(nsIFile *aFile, nsIURI * *_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->NewFileURI(aFile, _retval); } \
152 : NS_IMETHOD NewChannelFromURI2(nsIURI *aURI, nsIDOMNode *aLoadingNode, nsIPrincipal *aLoadingPrincipal, nsIPrincipal *aTriggeringPrincipal, uint32_t aSecurityFlags, uint32_t aContentPolicyType, nsIChannel * *_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->NewChannelFromURI2(aURI, aLoadingNode, aLoadingPrincipal, aTriggeringPrincipal, aSecurityFlags, aContentPolicyType, _retval); } \
153 : NS_IMETHOD NewChannelFromURIWithLoadInfo(nsIURI *aURI, nsILoadInfo *aLoadInfo, nsIChannel * *_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->NewChannelFromURIWithLoadInfo(aURI, aLoadInfo, _retval); } \
154 : NS_IMETHOD NewChannel2(const nsACString & aSpec, const char * aOriginCharset, nsIURI *aBaseURI, nsIDOMNode *aLoadingNode, nsIPrincipal *aLoadingPrincipal, nsIPrincipal *aTriggeringPrincipal, uint32_t aSecurityFlags, uint32_t aContentPolicyType, nsIChannel * *_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->NewChannel2(aSpec, aOriginCharset, aBaseURI, aLoadingNode, aLoadingPrincipal, aTriggeringPrincipal, aSecurityFlags, aContentPolicyType, _retval); } \
155 : NS_IMETHOD NewChannelFromURI(nsIURI *aURI, nsIChannel * *_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->NewChannelFromURI(aURI, _retval); } \
156 : NS_IMETHOD NewChannel(const nsACString & aSpec, const char * aOriginCharset, nsIURI *aBaseURI, nsIChannel * *_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->NewChannel(aSpec, aOriginCharset, aBaseURI, _retval); } \
157 : NS_IMETHOD GetOffline(bool *aOffline) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetOffline(aOffline); } \
158 : NS_IMETHOD SetOffline(bool aOffline) override { return !_to ? NS_ERROR_NULL_POINTER : _to->SetOffline(aOffline); } \
159 : NS_IMETHOD GetConnectivity(bool *aConnectivity) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetConnectivity(aConnectivity); } \
160 : NS_IMETHOD AllowPort(int32_t aPort, const char * aScheme, bool *_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->AllowPort(aPort, aScheme, _retval); } \
161 : NS_IMETHOD ExtractScheme(const nsACString & urlString, nsACString & _retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->ExtractScheme(urlString, _retval); } \
162 : NS_IMETHOD HostnameIsLocalIPAddress(nsIURI *aURI, bool *_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->HostnameIsLocalIPAddress(aURI, _retval); }
163 :
164 : #if 0
165 : /* Use the code below as a template for the implementation class for this interface. */
166 :
167 : /* Header file */
168 : class nsIOService : public nsIIOService
169 : {
170 : public:
171 : NS_DECL_ISUPPORTS
172 : NS_DECL_NSIIOSERVICE
173 :
174 : nsIOService();
175 :
176 : private:
177 : ~nsIOService();
178 :
179 : protected:
180 : /* additional members */
181 : };
182 :
183 : /* Implementation file */
184 : NS_IMPL_ISUPPORTS(nsIOService, nsIIOService)
185 :
186 : nsIOService::nsIOService()
187 : {
188 : /* member initializers and constructor code */
189 : }
190 :
191 : nsIOService::~nsIOService()
192 : {
193 : /* destructor code */
194 : }
195 :
196 : /* nsIProtocolHandler getProtocolHandler (in string aScheme); */
197 : NS_IMETHODIMP nsIOService::GetProtocolHandler(const char * aScheme, nsIProtocolHandler * *_retval)
198 : {
199 : return NS_ERROR_NOT_IMPLEMENTED;
200 : }
201 :
202 : /* unsigned long getProtocolFlags (in string aScheme); */
203 : NS_IMETHODIMP nsIOService::GetProtocolFlags(const char * aScheme, uint32_t *_retval)
204 : {
205 : return NS_ERROR_NOT_IMPLEMENTED;
206 : }
207 :
208 : /* nsIURI newURI (in AUTF8String aSpec, [optional] in string aOriginCharset, [optional] in nsIURI aBaseURI); */
209 : NS_IMETHODIMP nsIOService::NewURI(const nsACString & aSpec, const char * aOriginCharset, nsIURI *aBaseURI, nsIURI * *_retval)
210 : {
211 : return NS_ERROR_NOT_IMPLEMENTED;
212 : }
213 :
214 : /* nsIURI newFileURI (in nsIFile aFile); */
215 : NS_IMETHODIMP nsIOService::NewFileURI(nsIFile *aFile, nsIURI * *_retval)
216 : {
217 : return NS_ERROR_NOT_IMPLEMENTED;
218 : }
219 :
220 : /* nsIChannel newChannelFromURI2 (in nsIURI aURI, in nsIDOMNode aLoadingNode, in nsIPrincipal aLoadingPrincipal, in nsIPrincipal aTriggeringPrincipal, in unsigned long aSecurityFlags, in unsigned long aContentPolicyType); */
221 : NS_IMETHODIMP nsIOService::NewChannelFromURI2(nsIURI *aURI, nsIDOMNode *aLoadingNode, nsIPrincipal *aLoadingPrincipal, nsIPrincipal *aTriggeringPrincipal, uint32_t aSecurityFlags, uint32_t aContentPolicyType, nsIChannel * *_retval)
222 : {
223 : return NS_ERROR_NOT_IMPLEMENTED;
224 : }
225 :
226 : /* nsIChannel newChannelFromURIWithLoadInfo (in nsIURI aURI, in nsILoadInfo aLoadInfo); */
227 : NS_IMETHODIMP nsIOService::NewChannelFromURIWithLoadInfo(nsIURI *aURI, nsILoadInfo *aLoadInfo, nsIChannel * *_retval)
228 : {
229 : return NS_ERROR_NOT_IMPLEMENTED;
230 : }
231 :
232 : /* nsIChannel newChannel2 (in AUTF8String aSpec, in string aOriginCharset, in nsIURI aBaseURI, in nsIDOMNode aLoadingNode, in nsIPrincipal aLoadingPrincipal, in nsIPrincipal aTriggeringPrincipal, in unsigned long aSecurityFlags, in unsigned long aContentPolicyType); */
233 : NS_IMETHODIMP nsIOService::NewChannel2(const nsACString & aSpec, const char * aOriginCharset, nsIURI *aBaseURI, nsIDOMNode *aLoadingNode, nsIPrincipal *aLoadingPrincipal, nsIPrincipal *aTriggeringPrincipal, uint32_t aSecurityFlags, uint32_t aContentPolicyType, nsIChannel * *_retval)
234 : {
235 : return NS_ERROR_NOT_IMPLEMENTED;
236 : }
237 :
238 : /* nsIChannel newChannelFromURI (in nsIURI aURI); */
239 : NS_IMETHODIMP nsIOService::NewChannelFromURI(nsIURI *aURI, nsIChannel * *_retval)
240 : {
241 : return NS_ERROR_NOT_IMPLEMENTED;
242 : }
243 :
244 : /* nsIChannel newChannel (in AUTF8String aSpec, in string aOriginCharset, in nsIURI aBaseURI); */
245 : NS_IMETHODIMP nsIOService::NewChannel(const nsACString & aSpec, const char * aOriginCharset, nsIURI *aBaseURI, nsIChannel * *_retval)
246 : {
247 : return NS_ERROR_NOT_IMPLEMENTED;
248 : }
249 :
250 : /* attribute boolean offline; */
251 : NS_IMETHODIMP nsIOService::GetOffline(bool *aOffline)
252 : {
253 : return NS_ERROR_NOT_IMPLEMENTED;
254 : }
255 : NS_IMETHODIMP nsIOService::SetOffline(bool aOffline)
256 : {
257 : return NS_ERROR_NOT_IMPLEMENTED;
258 : }
259 :
260 : /* readonly attribute boolean connectivity; */
261 : NS_IMETHODIMP nsIOService::GetConnectivity(bool *aConnectivity)
262 : {
263 : return NS_ERROR_NOT_IMPLEMENTED;
264 : }
265 :
266 : /* boolean allowPort (in long aPort, in string aScheme); */
267 : NS_IMETHODIMP nsIOService::AllowPort(int32_t aPort, const char * aScheme, bool *_retval)
268 : {
269 : return NS_ERROR_NOT_IMPLEMENTED;
270 : }
271 :
272 : /* ACString extractScheme (in AUTF8String urlString); */
273 : NS_IMETHODIMP nsIOService::ExtractScheme(const nsACString & urlString, nsACString & _retval)
274 : {
275 : return NS_ERROR_NOT_IMPLEMENTED;
276 : }
277 :
278 : /* boolean hostnameIsLocalIPAddress (in nsIURI aURI); */
279 : NS_IMETHODIMP nsIOService::HostnameIsLocalIPAddress(nsIURI *aURI, bool *_retval)
280 : {
281 : return NS_ERROR_NOT_IMPLEMENTED;
282 : }
283 :
284 : /* End of implementation class template. */
285 : #endif
286 :
287 : /**
288 : * We send notifications through nsIObserverService with topic
289 : * NS_IOSERVICE_GOING_OFFLINE_TOPIC and data NS_IOSERVICE_OFFLINE
290 : * when 'offline' has changed from false to true, and we are about
291 : * to shut down network services such as DNS. When those
292 : * services have been shut down, we send a notification with
293 : * topic NS_IOSERVICE_OFFLINE_STATUS_TOPIC and data
294 : * NS_IOSERVICE_OFFLINE.
295 : *
296 : * When 'offline' changes from true to false, then after
297 : * network services have been restarted, we send a notification
298 : * with topic NS_IOSERVICE_OFFLINE_STATUS_TOPIC and data
299 : * NS_IOSERVICE_ONLINE.
300 : */
301 : #define NS_IOSERVICE_GOING_OFFLINE_TOPIC "network:offline-about-to-go-offline"
302 : #define NS_IOSERVICE_OFFLINE_STATUS_TOPIC "network:offline-status-changed"
303 : #define NS_IOSERVICE_OFFLINE "offline"
304 : #define NS_IOSERVICE_ONLINE "online"
305 :
306 : /* starting interface: nsIIOServiceInternal */
307 : #define NS_IIOSERVICEINTERNAL_IID_STR "6633c0bf-d97a-428f-8ece-cb6a655fb95a"
308 :
309 : #define NS_IIOSERVICEINTERNAL_IID \
310 : {0x6633c0bf, 0xd97a, 0x428f, \
311 : { 0x8e, 0xce, 0xcb, 0x6a, 0x65, 0x5f, 0xb9, 0x5a }}
312 :
313 3 : class NS_NO_VTABLE nsIIOServiceInternal : public nsISupports {
314 : public:
315 :
316 : NS_DECLARE_STATIC_IID_ACCESSOR(NS_IIOSERVICEINTERNAL_IID)
317 :
318 : /* void SetConnectivity (in boolean connectivity); */
319 : NS_IMETHOD SetConnectivity(bool connectivity) = 0;
320 :
321 : /* void NotifyWakeup (); */
322 : NS_IMETHOD NotifyWakeup(void) = 0;
323 :
324 : };
325 :
326 : NS_DEFINE_STATIC_IID_ACCESSOR(nsIIOServiceInternal, NS_IIOSERVICEINTERNAL_IID)
327 :
328 : /* Use this macro when declaring classes that implement this interface. */
329 : #define NS_DECL_NSIIOSERVICEINTERNAL \
330 : NS_IMETHOD SetConnectivity(bool connectivity) override; \
331 : NS_IMETHOD NotifyWakeup(void) override;
332 :
333 : /* Use this macro when declaring the members of this interface when the
334 : class doesn't implement the interface. This is useful for forwarding. */
335 : #define NS_DECL_NON_VIRTUAL_NSIIOSERVICEINTERNAL \
336 : nsresult SetConnectivity(bool connectivity); \
337 : nsresult NotifyWakeup(void);
338 :
339 : /* Use this macro to declare functions that forward the behavior of this interface to another object. */
340 : #define NS_FORWARD_NSIIOSERVICEINTERNAL(_to) \
341 : NS_IMETHOD SetConnectivity(bool connectivity) override { return _to SetConnectivity(connectivity); } \
342 : NS_IMETHOD NotifyWakeup(void) override { return _to NotifyWakeup(); }
343 :
344 : /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
345 : #define NS_FORWARD_SAFE_NSIIOSERVICEINTERNAL(_to) \
346 : NS_IMETHOD SetConnectivity(bool connectivity) override { return !_to ? NS_ERROR_NULL_POINTER : _to->SetConnectivity(connectivity); } \
347 : NS_IMETHOD NotifyWakeup(void) override { return !_to ? NS_ERROR_NULL_POINTER : _to->NotifyWakeup(); }
348 :
349 : #if 0
350 : /* Use the code below as a template for the implementation class for this interface. */
351 :
352 : /* Header file */
353 : class nsIOServiceInternal : public nsIIOServiceInternal
354 : {
355 : public:
356 : NS_DECL_ISUPPORTS
357 : NS_DECL_NSIIOSERVICEINTERNAL
358 :
359 : nsIOServiceInternal();
360 :
361 : private:
362 : ~nsIOServiceInternal();
363 :
364 : protected:
365 : /* additional members */
366 : };
367 :
368 : /* Implementation file */
369 : NS_IMPL_ISUPPORTS(nsIOServiceInternal, nsIIOServiceInternal)
370 :
371 : nsIOServiceInternal::nsIOServiceInternal()
372 : {
373 : /* member initializers and constructor code */
374 : }
375 :
376 : nsIOServiceInternal::~nsIOServiceInternal()
377 : {
378 : /* destructor code */
379 : }
380 :
381 : /* void SetConnectivity (in boolean connectivity); */
382 : NS_IMETHODIMP nsIOServiceInternal::SetConnectivity(bool connectivity)
383 : {
384 : return NS_ERROR_NOT_IMPLEMENTED;
385 : }
386 :
387 : /* void NotifyWakeup (); */
388 : NS_IMETHODIMP nsIOServiceInternal::NotifyWakeup()
389 : {
390 : return NS_ERROR_NOT_IMPLEMENTED;
391 : }
392 :
393 : /* End of implementation class template. */
394 : #endif
395 :
396 :
397 : #endif /* __gen_nsIIOService_h__ */
|