Line data Source code
1 : /*
2 : * DO NOT EDIT. THIS FILE IS GENERATED FROM ../../../dist/idl/nsIProtocolHandler.idl
3 : */
4 :
5 : #ifndef __gen_nsIProtocolHandler_h__
6 : #define __gen_nsIProtocolHandler_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 : #include "nsCOMPtr.h"
18 : /**
19 : * Protocol handlers are registered with XPCOM under the following CONTRACTID prefix:
20 : */
21 : #define NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "@mozilla.org/network/protocol;1?name="
22 : /**
23 : * For example, "@mozilla.org/network/protocol;1?name=http"
24 : */
25 : #if defined(MOZ_THUNDERBIRD) || defined(MOZ_SUITE)
26 : #define IS_ORIGIN_IS_FULL_SPEC_DEFINED 1
27 : #endif
28 : class nsIURI; /* forward declaration */
29 :
30 : class nsIChannel; /* forward declaration */
31 :
32 : class nsILoadInfo; /* forward declaration */
33 :
34 :
35 : /* starting interface: nsIProtocolHandlerWithDynamicFlags */
36 : #define NS_IPROTOCOLHANDLERWITHDYNAMICFLAGS_IID_STR "65a8e823-0591-4fc0-a56a-03265e0a4ce8"
37 :
38 : #define NS_IPROTOCOLHANDLERWITHDYNAMICFLAGS_IID \
39 : {0x65a8e823, 0x0591, 0x4fc0, \
40 : { 0xa5, 0x6a, 0x03, 0x26, 0x5e, 0x0a, 0x4c, 0xe8 }}
41 :
42 3 : class NS_NO_VTABLE nsIProtocolHandlerWithDynamicFlags : public nsISupports {
43 : public:
44 :
45 : NS_DECLARE_STATIC_IID_ACCESSOR(NS_IPROTOCOLHANDLERWITHDYNAMICFLAGS_IID)
46 :
47 : /* unsigned long getFlagsForURI (in nsIURI aURI); */
48 : NS_IMETHOD GetFlagsForURI(nsIURI *aURI, uint32_t *_retval) = 0;
49 :
50 : };
51 :
52 : NS_DEFINE_STATIC_IID_ACCESSOR(nsIProtocolHandlerWithDynamicFlags, NS_IPROTOCOLHANDLERWITHDYNAMICFLAGS_IID)
53 :
54 : /* Use this macro when declaring classes that implement this interface. */
55 : #define NS_DECL_NSIPROTOCOLHANDLERWITHDYNAMICFLAGS \
56 : NS_IMETHOD GetFlagsForURI(nsIURI *aURI, uint32_t *_retval) override;
57 :
58 : /* Use this macro when declaring the members of this interface when the
59 : class doesn't implement the interface. This is useful for forwarding. */
60 : #define NS_DECL_NON_VIRTUAL_NSIPROTOCOLHANDLERWITHDYNAMICFLAGS \
61 : nsresult GetFlagsForURI(nsIURI *aURI, uint32_t *_retval);
62 :
63 : /* Use this macro to declare functions that forward the behavior of this interface to another object. */
64 : #define NS_FORWARD_NSIPROTOCOLHANDLERWITHDYNAMICFLAGS(_to) \
65 : NS_IMETHOD GetFlagsForURI(nsIURI *aURI, uint32_t *_retval) override { return _to GetFlagsForURI(aURI, _retval); }
66 :
67 : /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
68 : #define NS_FORWARD_SAFE_NSIPROTOCOLHANDLERWITHDYNAMICFLAGS(_to) \
69 : NS_IMETHOD GetFlagsForURI(nsIURI *aURI, uint32_t *_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetFlagsForURI(aURI, _retval); }
70 :
71 : #if 0
72 : /* Use the code below as a template for the implementation class for this interface. */
73 :
74 : /* Header file */
75 : class nsProtocolHandlerWithDynamicFlags : public nsIProtocolHandlerWithDynamicFlags
76 : {
77 : public:
78 : NS_DECL_ISUPPORTS
79 : NS_DECL_NSIPROTOCOLHANDLERWITHDYNAMICFLAGS
80 :
81 : nsProtocolHandlerWithDynamicFlags();
82 :
83 : private:
84 : ~nsProtocolHandlerWithDynamicFlags();
85 :
86 : protected:
87 : /* additional members */
88 : };
89 :
90 : /* Implementation file */
91 : NS_IMPL_ISUPPORTS(nsProtocolHandlerWithDynamicFlags, nsIProtocolHandlerWithDynamicFlags)
92 :
93 : nsProtocolHandlerWithDynamicFlags::nsProtocolHandlerWithDynamicFlags()
94 : {
95 : /* member initializers and constructor code */
96 : }
97 :
98 : nsProtocolHandlerWithDynamicFlags::~nsProtocolHandlerWithDynamicFlags()
99 : {
100 : /* destructor code */
101 : }
102 :
103 : /* unsigned long getFlagsForURI (in nsIURI aURI); */
104 : NS_IMETHODIMP nsProtocolHandlerWithDynamicFlags::GetFlagsForURI(nsIURI *aURI, uint32_t *_retval)
105 : {
106 : return NS_ERROR_NOT_IMPLEMENTED;
107 : }
108 :
109 : /* End of implementation class template. */
110 : #endif
111 :
112 :
113 : /* starting interface: nsIProtocolHandler */
114 : #define NS_IPROTOCOLHANDLER_IID_STR "a87210e6-7c8c-41f7-864d-df809015193e"
115 :
116 : #define NS_IPROTOCOLHANDLER_IID \
117 : {0xa87210e6, 0x7c8c, 0x41f7, \
118 : { 0x86, 0x4d, 0xdf, 0x80, 0x90, 0x15, 0x19, 0x3e }}
119 :
120 28 : class nsIProtocolHandler : public nsISupports {
121 : public:
122 :
123 : NS_DECLARE_STATIC_IID_ACCESSOR(NS_IPROTOCOLHANDLER_IID)
124 :
125 : /* readonly attribute ACString scheme; */
126 : NS_IMETHOD GetScheme(nsACString & aScheme) = 0;
127 :
128 : /* readonly attribute long defaultPort; */
129 : NS_IMETHOD GetDefaultPort(int32_t *aDefaultPort) = 0;
130 :
131 : /* readonly attribute unsigned long protocolFlags; */
132 : NS_IMETHOD GetProtocolFlags(uint32_t *aProtocolFlags) = 0;
133 :
134 : // Helper method to get the protocol flags in the right way.
135 3784 : nsresult DoGetProtocolFlags(nsIURI* aURI, uint32_t* aFlags)
136 : {
137 7568 : nsCOMPtr<nsIProtocolHandlerWithDynamicFlags> dh = do_QueryInterface(this);
138 3784 : nsresult rv = dh ? dh->GetFlagsForURI(aURI, aFlags) : GetProtocolFlags(aFlags);
139 3784 : if (NS_SUCCEEDED(rv)) {
140 : #if !IS_ORIGIN_IS_FULL_SPEC_DEFINED
141 3784 : MOZ_RELEASE_ASSERT(!(*aFlags & nsIProtocolHandler::ORIGIN_IS_FULL_SPEC),
142 : "ORIGIN_IS_FULL_SPEC is unsupported but used");
143 : #endif
144 : }
145 7568 : return rv;
146 : }
147 : /* nsIURI newURI (in AUTF8String aSpec, [optional] in string aOriginCharset, [optional] in nsIURI aBaseURI); */
148 : NS_IMETHOD NewURI(const nsACString & aSpec, const char * aOriginCharset, nsIURI *aBaseURI, nsIURI * *_retval) = 0;
149 :
150 : /* nsIChannel newChannel2 (in nsIURI aURI, in nsILoadInfo aLoadinfo); */
151 : NS_IMETHOD NewChannel2(nsIURI *aURI, nsILoadInfo *aLoadinfo, nsIChannel * *_retval) = 0;
152 :
153 : /* nsIChannel newChannel (in nsIURI aURI); */
154 : NS_IMETHOD NewChannel(nsIURI *aURI, nsIChannel * *_retval) = 0;
155 :
156 : /* boolean allowPort (in long port, in string scheme); */
157 : NS_IMETHOD AllowPort(int32_t port, const char * scheme, bool *_retval) = 0;
158 :
159 : enum {
160 : URI_STD = 0U,
161 : URI_NORELATIVE = 1U,
162 : URI_NOAUTH = 2U,
163 : ALLOWS_PROXY = 4U,
164 : ALLOWS_PROXY_HTTP = 8U,
165 : URI_INHERITS_SECURITY_CONTEXT = 16U,
166 : URI_FORBIDS_AUTOMATIC_DOCUMENT_REPLACEMENT = 32U,
167 : URI_LOADABLE_BY_ANYONE = 64U,
168 : URI_DANGEROUS_TO_LOAD = 128U,
169 : URI_IS_UI_RESOURCE = 256U,
170 : URI_IS_LOCAL_FILE = 512U,
171 : URI_LOADABLE_BY_SUBSUMERS = 1024U,
172 : URI_DOES_NOT_RETURN_DATA = 2048U,
173 : URI_IS_LOCAL_RESOURCE = 4096U,
174 : URI_OPENING_EXECUTES_SCRIPT = 8192U,
175 : URI_NON_PERSISTABLE = 16384U,
176 : URI_FORBIDS_COOKIE_ACCESS = 32768U,
177 : URI_CROSS_ORIGIN_NEEDS_WEBAPPS_PERM = 65536U,
178 : URI_SYNC_LOAD_IS_OK = 131072U,
179 : URI_SAFE_TO_LOAD_IN_SECURE_CONTEXT = 262144U,
180 : URI_FETCHABLE_BY_ANYONE = 524288U,
181 : ORIGIN_IS_FULL_SPEC = 1048576U,
182 : URI_SCHEME_NOT_SELF_LINKABLE = 2097152U
183 : };
184 :
185 : };
186 :
187 : NS_DEFINE_STATIC_IID_ACCESSOR(nsIProtocolHandler, NS_IPROTOCOLHANDLER_IID)
188 :
189 : /* Use this macro when declaring classes that implement this interface. */
190 : #define NS_DECL_NSIPROTOCOLHANDLER \
191 : NS_IMETHOD GetScheme(nsACString & aScheme) override; \
192 : NS_IMETHOD GetDefaultPort(int32_t *aDefaultPort) override; \
193 : NS_IMETHOD GetProtocolFlags(uint32_t *aProtocolFlags) override; \
194 : NS_IMETHOD NewURI(const nsACString & aSpec, const char * aOriginCharset, nsIURI *aBaseURI, nsIURI * *_retval) override; \
195 : NS_IMETHOD NewChannel2(nsIURI *aURI, nsILoadInfo *aLoadinfo, nsIChannel * *_retval) override; \
196 : NS_IMETHOD NewChannel(nsIURI *aURI, nsIChannel * *_retval) override; \
197 : NS_IMETHOD AllowPort(int32_t port, const char * scheme, bool *_retval) override; \
198 :
199 : /* Use this macro when declaring the members of this interface when the
200 : class doesn't implement the interface. This is useful for forwarding. */
201 : #define NS_DECL_NON_VIRTUAL_NSIPROTOCOLHANDLER \
202 : nsresult GetScheme(nsACString & aScheme); \
203 : nsresult GetDefaultPort(int32_t *aDefaultPort); \
204 : nsresult GetProtocolFlags(uint32_t *aProtocolFlags); \
205 : nsresult NewURI(const nsACString & aSpec, const char * aOriginCharset, nsIURI *aBaseURI, nsIURI * *_retval); \
206 : nsresult NewChannel2(nsIURI *aURI, nsILoadInfo *aLoadinfo, nsIChannel * *_retval); \
207 : nsresult NewChannel(nsIURI *aURI, nsIChannel * *_retval); \
208 : nsresult AllowPort(int32_t port, const char * scheme, bool *_retval); \
209 :
210 : /* Use this macro to declare functions that forward the behavior of this interface to another object. */
211 : #define NS_FORWARD_NSIPROTOCOLHANDLER(_to) \
212 : NS_IMETHOD GetScheme(nsACString & aScheme) override { return _to GetScheme(aScheme); } \
213 : NS_IMETHOD GetDefaultPort(int32_t *aDefaultPort) override { return _to GetDefaultPort(aDefaultPort); } \
214 : NS_IMETHOD GetProtocolFlags(uint32_t *aProtocolFlags) override { return _to GetProtocolFlags(aProtocolFlags); } \
215 : NS_IMETHOD NewURI(const nsACString & aSpec, const char * aOriginCharset, nsIURI *aBaseURI, nsIURI * *_retval) override { return _to NewURI(aSpec, aOriginCharset, aBaseURI, _retval); } \
216 : NS_IMETHOD NewChannel2(nsIURI *aURI, nsILoadInfo *aLoadinfo, nsIChannel * *_retval) override { return _to NewChannel2(aURI, aLoadinfo, _retval); } \
217 : NS_IMETHOD NewChannel(nsIURI *aURI, nsIChannel * *_retval) override { return _to NewChannel(aURI, _retval); } \
218 : NS_IMETHOD AllowPort(int32_t port, const char * scheme, bool *_retval) override { return _to AllowPort(port, scheme, _retval); } \
219 :
220 : /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
221 : #define NS_FORWARD_SAFE_NSIPROTOCOLHANDLER(_to) \
222 : NS_IMETHOD GetScheme(nsACString & aScheme) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetScheme(aScheme); } \
223 : NS_IMETHOD GetDefaultPort(int32_t *aDefaultPort) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetDefaultPort(aDefaultPort); } \
224 : NS_IMETHOD GetProtocolFlags(uint32_t *aProtocolFlags) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetProtocolFlags(aProtocolFlags); } \
225 : 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); } \
226 : NS_IMETHOD NewChannel2(nsIURI *aURI, nsILoadInfo *aLoadinfo, nsIChannel * *_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->NewChannel2(aURI, aLoadinfo, _retval); } \
227 : NS_IMETHOD NewChannel(nsIURI *aURI, nsIChannel * *_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->NewChannel(aURI, _retval); } \
228 : NS_IMETHOD AllowPort(int32_t port, const char * scheme, bool *_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->AllowPort(port, scheme, _retval); } \
229 :
230 : #if 0
231 : /* Use the code below as a template for the implementation class for this interface. */
232 :
233 : /* Header file */
234 : class nsProtocolHandler : public nsIProtocolHandler
235 : {
236 : public:
237 : NS_DECL_ISUPPORTS
238 : NS_DECL_NSIPROTOCOLHANDLER
239 :
240 : nsProtocolHandler();
241 :
242 : private:
243 : ~nsProtocolHandler();
244 :
245 : protected:
246 : /* additional members */
247 : };
248 :
249 : /* Implementation file */
250 : NS_IMPL_ISUPPORTS(nsProtocolHandler, nsIProtocolHandler)
251 :
252 : nsProtocolHandler::nsProtocolHandler()
253 : {
254 : /* member initializers and constructor code */
255 : }
256 :
257 : nsProtocolHandler::~nsProtocolHandler()
258 : {
259 : /* destructor code */
260 : }
261 :
262 : /* readonly attribute ACString scheme; */
263 : NS_IMETHODIMP nsProtocolHandler::GetScheme(nsACString & aScheme)
264 : {
265 : return NS_ERROR_NOT_IMPLEMENTED;
266 : }
267 :
268 : /* readonly attribute long defaultPort; */
269 : NS_IMETHODIMP nsProtocolHandler::GetDefaultPort(int32_t *aDefaultPort)
270 : {
271 : return NS_ERROR_NOT_IMPLEMENTED;
272 : }
273 :
274 : /* readonly attribute unsigned long protocolFlags; */
275 : NS_IMETHODIMP nsProtocolHandler::GetProtocolFlags(uint32_t *aProtocolFlags)
276 : {
277 : return NS_ERROR_NOT_IMPLEMENTED;
278 : }
279 :
280 : /* nsIURI newURI (in AUTF8String aSpec, [optional] in string aOriginCharset, [optional] in nsIURI aBaseURI); */
281 : NS_IMETHODIMP nsProtocolHandler::NewURI(const nsACString & aSpec, const char * aOriginCharset, nsIURI *aBaseURI, nsIURI * *_retval)
282 : {
283 : return NS_ERROR_NOT_IMPLEMENTED;
284 : }
285 :
286 : /* nsIChannel newChannel2 (in nsIURI aURI, in nsILoadInfo aLoadinfo); */
287 : NS_IMETHODIMP nsProtocolHandler::NewChannel2(nsIURI *aURI, nsILoadInfo *aLoadinfo, nsIChannel * *_retval)
288 : {
289 : return NS_ERROR_NOT_IMPLEMENTED;
290 : }
291 :
292 : /* nsIChannel newChannel (in nsIURI aURI); */
293 : NS_IMETHODIMP nsProtocolHandler::NewChannel(nsIURI *aURI, nsIChannel * *_retval)
294 : {
295 : return NS_ERROR_NOT_IMPLEMENTED;
296 : }
297 :
298 : /* boolean allowPort (in long port, in string scheme); */
299 : NS_IMETHODIMP nsProtocolHandler::AllowPort(int32_t port, const char * scheme, bool *_retval)
300 : {
301 : return NS_ERROR_NOT_IMPLEMENTED;
302 : }
303 :
304 : /* End of implementation class template. */
305 : #endif
306 :
307 :
308 : #endif /* __gen_nsIProtocolHandler_h__ */
|