1 : /*
2 : * DO NOT EDIT. THIS FILE IS GENERATED FROM /builds/slave/m-beta-lnx-codecoverage/build/netwerk/base/public/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 :
26 : /* starting interface: nsIIOService */
27 : #define NS_IIOSERVICE_IID_STR "bddeda3f-9020-4d12-8c70-984ee9f7935e"
28 :
29 : #define NS_IIOSERVICE_IID \
30 : {0xbddeda3f, 0x9020, 0x4d12, \
31 : { 0x8c, 0x70, 0x98, 0x4e, 0xe9, 0xf7, 0x93, 0x5e }}
32 :
33 1419 : class NS_NO_VTABLE NS_SCRIPTABLE nsIIOService : public nsISupports {
34 : public:
35 :
36 : NS_DECLARE_STATIC_IID_ACCESSOR(NS_IIOSERVICE_IID)
37 :
38 : /* nsIProtocolHandler getProtocolHandler (in string aScheme); */
39 : NS_SCRIPTABLE NS_IMETHOD GetProtocolHandler(const char * aScheme, nsIProtocolHandler * *_retval NS_OUTPARAM) = 0;
40 :
41 : /* unsigned long getProtocolFlags (in string aScheme); */
42 : NS_SCRIPTABLE NS_IMETHOD GetProtocolFlags(const char * aScheme, PRUint32 *_retval NS_OUTPARAM) = 0;
43 :
44 : /* nsIURI newURI (in AUTF8String aSpec, in string aOriginCharset, in nsIURI aBaseURI); */
45 : NS_SCRIPTABLE NS_IMETHOD NewURI(const nsACString & aSpec, const char * aOriginCharset, nsIURI *aBaseURI, nsIURI * *_retval NS_OUTPARAM) = 0;
46 :
47 : /* nsIURI newFileURI (in nsIFile aFile); */
48 : NS_SCRIPTABLE NS_IMETHOD NewFileURI(nsIFile *aFile, nsIURI * *_retval NS_OUTPARAM) = 0;
49 :
50 : /* nsIChannel newChannelFromURI (in nsIURI aURI); */
51 : NS_SCRIPTABLE NS_IMETHOD NewChannelFromURI(nsIURI *aURI, nsIChannel * *_retval NS_OUTPARAM) = 0;
52 :
53 : /* nsIChannel newChannel (in AUTF8String aSpec, in string aOriginCharset, in nsIURI aBaseURI); */
54 : NS_SCRIPTABLE NS_IMETHOD NewChannel(const nsACString & aSpec, const char * aOriginCharset, nsIURI *aBaseURI, nsIChannel * *_retval NS_OUTPARAM) = 0;
55 :
56 : /* attribute boolean offline; */
57 : NS_SCRIPTABLE NS_IMETHOD GetOffline(bool *aOffline) = 0;
58 : NS_SCRIPTABLE NS_IMETHOD SetOffline(bool aOffline) = 0;
59 :
60 : /* boolean allowPort (in long aPort, in string aScheme); */
61 : NS_SCRIPTABLE NS_IMETHOD AllowPort(PRInt32 aPort, const char * aScheme, bool *_retval NS_OUTPARAM) = 0;
62 :
63 : /* ACString extractScheme (in AUTF8String urlString); */
64 : NS_SCRIPTABLE NS_IMETHOD ExtractScheme(const nsACString & urlString, nsACString & _retval NS_OUTPARAM) = 0;
65 :
66 : };
67 :
68 : NS_DEFINE_STATIC_IID_ACCESSOR(nsIIOService, NS_IIOSERVICE_IID)
69 :
70 : /* Use this macro when declaring classes that implement this interface. */
71 : #define NS_DECL_NSIIOSERVICE \
72 : NS_SCRIPTABLE NS_IMETHOD GetProtocolHandler(const char * aScheme, nsIProtocolHandler * *_retval NS_OUTPARAM); \
73 : NS_SCRIPTABLE NS_IMETHOD GetProtocolFlags(const char * aScheme, PRUint32 *_retval NS_OUTPARAM); \
74 : NS_SCRIPTABLE NS_IMETHOD NewURI(const nsACString & aSpec, const char * aOriginCharset, nsIURI *aBaseURI, nsIURI * *_retval NS_OUTPARAM); \
75 : NS_SCRIPTABLE NS_IMETHOD NewFileURI(nsIFile *aFile, nsIURI * *_retval NS_OUTPARAM); \
76 : NS_SCRIPTABLE NS_IMETHOD NewChannelFromURI(nsIURI *aURI, nsIChannel * *_retval NS_OUTPARAM); \
77 : NS_SCRIPTABLE NS_IMETHOD NewChannel(const nsACString & aSpec, const char * aOriginCharset, nsIURI *aBaseURI, nsIChannel * *_retval NS_OUTPARAM); \
78 : NS_SCRIPTABLE NS_IMETHOD GetOffline(bool *aOffline); \
79 : NS_SCRIPTABLE NS_IMETHOD SetOffline(bool aOffline); \
80 : NS_SCRIPTABLE NS_IMETHOD AllowPort(PRInt32 aPort, const char * aScheme, bool *_retval NS_OUTPARAM); \
81 : NS_SCRIPTABLE NS_IMETHOD ExtractScheme(const nsACString & urlString, nsACString & _retval NS_OUTPARAM);
82 :
83 : /* Use this macro to declare functions that forward the behavior of this interface to another object. */
84 : #define NS_FORWARD_NSIIOSERVICE(_to) \
85 : NS_SCRIPTABLE NS_IMETHOD GetProtocolHandler(const char * aScheme, nsIProtocolHandler * *_retval NS_OUTPARAM) { return _to GetProtocolHandler(aScheme, _retval); } \
86 : NS_SCRIPTABLE NS_IMETHOD GetProtocolFlags(const char * aScheme, PRUint32 *_retval NS_OUTPARAM) { return _to GetProtocolFlags(aScheme, _retval); } \
87 : NS_SCRIPTABLE NS_IMETHOD NewURI(const nsACString & aSpec, const char * aOriginCharset, nsIURI *aBaseURI, nsIURI * *_retval NS_OUTPARAM) { return _to NewURI(aSpec, aOriginCharset, aBaseURI, _retval); } \
88 : NS_SCRIPTABLE NS_IMETHOD NewFileURI(nsIFile *aFile, nsIURI * *_retval NS_OUTPARAM) { return _to NewFileURI(aFile, _retval); } \
89 : NS_SCRIPTABLE NS_IMETHOD NewChannelFromURI(nsIURI *aURI, nsIChannel * *_retval NS_OUTPARAM) { return _to NewChannelFromURI(aURI, _retval); } \
90 : NS_SCRIPTABLE NS_IMETHOD NewChannel(const nsACString & aSpec, const char * aOriginCharset, nsIURI *aBaseURI, nsIChannel * *_retval NS_OUTPARAM) { return _to NewChannel(aSpec, aOriginCharset, aBaseURI, _retval); } \
91 : NS_SCRIPTABLE NS_IMETHOD GetOffline(bool *aOffline) { return _to GetOffline(aOffline); } \
92 : NS_SCRIPTABLE NS_IMETHOD SetOffline(bool aOffline) { return _to SetOffline(aOffline); } \
93 : NS_SCRIPTABLE NS_IMETHOD AllowPort(PRInt32 aPort, const char * aScheme, bool *_retval NS_OUTPARAM) { return _to AllowPort(aPort, aScheme, _retval); } \
94 : NS_SCRIPTABLE NS_IMETHOD ExtractScheme(const nsACString & urlString, nsACString & _retval NS_OUTPARAM) { return _to ExtractScheme(urlString, _retval); }
95 :
96 : /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
97 : #define NS_FORWARD_SAFE_NSIIOSERVICE(_to) \
98 : NS_SCRIPTABLE NS_IMETHOD GetProtocolHandler(const char * aScheme, nsIProtocolHandler * *_retval NS_OUTPARAM) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetProtocolHandler(aScheme, _retval); } \
99 : NS_SCRIPTABLE NS_IMETHOD GetProtocolFlags(const char * aScheme, PRUint32 *_retval NS_OUTPARAM) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetProtocolFlags(aScheme, _retval); } \
100 : NS_SCRIPTABLE NS_IMETHOD NewURI(const nsACString & aSpec, const char * aOriginCharset, nsIURI *aBaseURI, nsIURI * *_retval NS_OUTPARAM) { return !_to ? NS_ERROR_NULL_POINTER : _to->NewURI(aSpec, aOriginCharset, aBaseURI, _retval); } \
101 : NS_SCRIPTABLE NS_IMETHOD NewFileURI(nsIFile *aFile, nsIURI * *_retval NS_OUTPARAM) { return !_to ? NS_ERROR_NULL_POINTER : _to->NewFileURI(aFile, _retval); } \
102 : NS_SCRIPTABLE NS_IMETHOD NewChannelFromURI(nsIURI *aURI, nsIChannel * *_retval NS_OUTPARAM) { return !_to ? NS_ERROR_NULL_POINTER : _to->NewChannelFromURI(aURI, _retval); } \
103 : NS_SCRIPTABLE NS_IMETHOD NewChannel(const nsACString & aSpec, const char * aOriginCharset, nsIURI *aBaseURI, nsIChannel * *_retval NS_OUTPARAM) { return !_to ? NS_ERROR_NULL_POINTER : _to->NewChannel(aSpec, aOriginCharset, aBaseURI, _retval); } \
104 : NS_SCRIPTABLE NS_IMETHOD GetOffline(bool *aOffline) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetOffline(aOffline); } \
105 : NS_SCRIPTABLE NS_IMETHOD SetOffline(bool aOffline) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetOffline(aOffline); } \
106 : NS_SCRIPTABLE NS_IMETHOD AllowPort(PRInt32 aPort, const char * aScheme, bool *_retval NS_OUTPARAM) { return !_to ? NS_ERROR_NULL_POINTER : _to->AllowPort(aPort, aScheme, _retval); } \
107 : NS_SCRIPTABLE NS_IMETHOD ExtractScheme(const nsACString & urlString, nsACString & _retval NS_OUTPARAM) { return !_to ? NS_ERROR_NULL_POINTER : _to->ExtractScheme(urlString, _retval); }
108 :
109 : #if 0
110 : /* Use the code below as a template for the implementation class for this interface. */
111 :
112 : /* Header file */
113 : class nsIOService : public nsIIOService
114 : {
115 : public:
116 : NS_DECL_ISUPPORTS
117 : NS_DECL_NSIIOSERVICE
118 :
119 : nsIOService();
120 :
121 : private:
122 : ~nsIOService();
123 :
124 : protected:
125 : /* additional members */
126 : };
127 :
128 : /* Implementation file */
129 : NS_IMPL_ISUPPORTS1(nsIOService, nsIIOService)
130 :
131 : nsIOService::nsIOService()
132 : {
133 : /* member initializers and constructor code */
134 : }
135 :
136 : nsIOService::~nsIOService()
137 : {
138 : /* destructor code */
139 : }
140 :
141 : /* nsIProtocolHandler getProtocolHandler (in string aScheme); */
142 : NS_IMETHODIMP nsIOService::GetProtocolHandler(const char * aScheme, nsIProtocolHandler * *_retval NS_OUTPARAM)
143 : {
144 : return NS_ERROR_NOT_IMPLEMENTED;
145 : }
146 :
147 : /* unsigned long getProtocolFlags (in string aScheme); */
148 : NS_IMETHODIMP nsIOService::GetProtocolFlags(const char * aScheme, PRUint32 *_retval NS_OUTPARAM)
149 : {
150 : return NS_ERROR_NOT_IMPLEMENTED;
151 : }
152 :
153 : /* nsIURI newURI (in AUTF8String aSpec, in string aOriginCharset, in nsIURI aBaseURI); */
154 : NS_IMETHODIMP nsIOService::NewURI(const nsACString & aSpec, const char * aOriginCharset, nsIURI *aBaseURI, nsIURI * *_retval NS_OUTPARAM)
155 : {
156 : return NS_ERROR_NOT_IMPLEMENTED;
157 : }
158 :
159 : /* nsIURI newFileURI (in nsIFile aFile); */
160 : NS_IMETHODIMP nsIOService::NewFileURI(nsIFile *aFile, nsIURI * *_retval NS_OUTPARAM)
161 : {
162 : return NS_ERROR_NOT_IMPLEMENTED;
163 : }
164 :
165 : /* nsIChannel newChannelFromURI (in nsIURI aURI); */
166 : NS_IMETHODIMP nsIOService::NewChannelFromURI(nsIURI *aURI, nsIChannel * *_retval NS_OUTPARAM)
167 : {
168 : return NS_ERROR_NOT_IMPLEMENTED;
169 : }
170 :
171 : /* nsIChannel newChannel (in AUTF8String aSpec, in string aOriginCharset, in nsIURI aBaseURI); */
172 : NS_IMETHODIMP nsIOService::NewChannel(const nsACString & aSpec, const char * aOriginCharset, nsIURI *aBaseURI, nsIChannel * *_retval NS_OUTPARAM)
173 : {
174 : return NS_ERROR_NOT_IMPLEMENTED;
175 : }
176 :
177 : /* attribute boolean offline; */
178 : NS_IMETHODIMP nsIOService::GetOffline(bool *aOffline)
179 : {
180 : return NS_ERROR_NOT_IMPLEMENTED;
181 : }
182 : NS_IMETHODIMP nsIOService::SetOffline(bool aOffline)
183 : {
184 : return NS_ERROR_NOT_IMPLEMENTED;
185 : }
186 :
187 : /* boolean allowPort (in long aPort, in string aScheme); */
188 : NS_IMETHODIMP nsIOService::AllowPort(PRInt32 aPort, const char * aScheme, bool *_retval NS_OUTPARAM)
189 : {
190 : return NS_ERROR_NOT_IMPLEMENTED;
191 : }
192 :
193 : /* ACString extractScheme (in AUTF8String urlString); */
194 : NS_IMETHODIMP nsIOService::ExtractScheme(const nsACString & urlString, nsACString & _retval NS_OUTPARAM)
195 : {
196 : return NS_ERROR_NOT_IMPLEMENTED;
197 : }
198 :
199 : /* End of implementation class template. */
200 : #endif
201 :
202 : /**
203 : * We send notifications through nsIObserverService with topic
204 : * NS_IOSERVICE_GOING_OFFLINE_TOPIC and data NS_IOSERVICE_OFFLINE
205 : * when 'offline' has changed from false to true, and we are about
206 : * to shut down network services such as DNS. When those
207 : * services have been shut down, we send a notification with
208 : * topic NS_IOSERVICE_OFFLINE_STATUS_TOPIC and data
209 : * NS_IOSERVICE_OFFLINE.
210 : *
211 : * When 'offline' changes from true to false, then after
212 : * network services have been restarted, we send a notification
213 : * with topic NS_IOSERVICE_OFFLINE_STATUS_TOPIC and data
214 : * NS_IOSERVICE_ONLINE.
215 : */
216 : #define NS_IOSERVICE_GOING_OFFLINE_TOPIC "network:offline-about-to-go-offline"
217 : #define NS_IOSERVICE_OFFLINE_STATUS_TOPIC "network:offline-status-changed"
218 : #define NS_IOSERVICE_OFFLINE "offline"
219 : #define NS_IOSERVICE_ONLINE "online"
220 :
221 : #endif /* __gen_nsIIOService_h__ */
|