Line data Source code
1 : /*
2 : * DO NOT EDIT. THIS FILE IS GENERATED FROM ../../../dist/idl/nsIHttpProtocolHandler.idl
3 : */
4 :
5 : #ifndef __gen_nsIHttpProtocolHandler_h__
6 : #define __gen_nsIHttpProtocolHandler_h__
7 :
8 :
9 : #ifndef __gen_nsIProxiedProtocolHandler_h__
10 : #include "nsIProxiedProtocolHandler.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 :
18 : /* starting interface: nsIHttpProtocolHandler */
19 : #define NS_IHTTPPROTOCOLHANDLER_IID_STR "c48126d9-2ddd-485b-a51a-378e917e75f8"
20 :
21 : #define NS_IHTTPPROTOCOLHANDLER_IID \
22 : {0xc48126d9, 0x2ddd, 0x485b, \
23 : { 0xa5, 0x1a, 0x37, 0x8e, 0x91, 0x7e, 0x75, 0xf8 }}
24 :
25 3 : class NS_NO_VTABLE nsIHttpProtocolHandler : public nsIProxiedProtocolHandler {
26 : public:
27 :
28 : NS_DECLARE_STATIC_IID_ACCESSOR(NS_IHTTPPROTOCOLHANDLER_IID)
29 :
30 : /* [must_use] readonly attribute ACString userAgent; */
31 : MOZ_MUST_USE NS_IMETHOD GetUserAgent(nsACString & aUserAgent) = 0;
32 :
33 : /* [must_use] readonly attribute ACString appName; */
34 : MOZ_MUST_USE NS_IMETHOD GetAppName(nsACString & aAppName) = 0;
35 :
36 : /* [must_use] readonly attribute ACString appVersion; */
37 : MOZ_MUST_USE NS_IMETHOD GetAppVersion(nsACString & aAppVersion) = 0;
38 :
39 : /* [must_use] readonly attribute ACString platform; */
40 : MOZ_MUST_USE NS_IMETHOD GetPlatform(nsACString & aPlatform) = 0;
41 :
42 : /* [must_use] readonly attribute ACString oscpu; */
43 : MOZ_MUST_USE NS_IMETHOD GetOscpu(nsACString & aOscpu) = 0;
44 :
45 : /* [must_use] readonly attribute ACString misc; */
46 : MOZ_MUST_USE NS_IMETHOD GetMisc(nsACString & aMisc) = 0;
47 :
48 : };
49 :
50 : NS_DEFINE_STATIC_IID_ACCESSOR(nsIHttpProtocolHandler, NS_IHTTPPROTOCOLHANDLER_IID)
51 :
52 : /* Use this macro when declaring classes that implement this interface. */
53 : #define NS_DECL_NSIHTTPPROTOCOLHANDLER \
54 : MOZ_MUST_USE NS_IMETHOD GetUserAgent(nsACString & aUserAgent) override; \
55 : MOZ_MUST_USE NS_IMETHOD GetAppName(nsACString & aAppName) override; \
56 : MOZ_MUST_USE NS_IMETHOD GetAppVersion(nsACString & aAppVersion) override; \
57 : MOZ_MUST_USE NS_IMETHOD GetPlatform(nsACString & aPlatform) override; \
58 : MOZ_MUST_USE NS_IMETHOD GetOscpu(nsACString & aOscpu) override; \
59 : MOZ_MUST_USE NS_IMETHOD GetMisc(nsACString & aMisc) override;
60 :
61 : /* Use this macro when declaring the members of this interface when the
62 : class doesn't implement the interface. This is useful for forwarding. */
63 : #define NS_DECL_NON_VIRTUAL_NSIHTTPPROTOCOLHANDLER \
64 : MOZ_MUST_USE nsresult GetUserAgent(nsACString & aUserAgent); \
65 : MOZ_MUST_USE nsresult GetAppName(nsACString & aAppName); \
66 : MOZ_MUST_USE nsresult GetAppVersion(nsACString & aAppVersion); \
67 : MOZ_MUST_USE nsresult GetPlatform(nsACString & aPlatform); \
68 : MOZ_MUST_USE nsresult GetOscpu(nsACString & aOscpu); \
69 : MOZ_MUST_USE nsresult GetMisc(nsACString & aMisc);
70 :
71 : /* Use this macro to declare functions that forward the behavior of this interface to another object. */
72 : #define NS_FORWARD_NSIHTTPPROTOCOLHANDLER(_to) \
73 : MOZ_MUST_USE NS_IMETHOD GetUserAgent(nsACString & aUserAgent) override { return _to GetUserAgent(aUserAgent); } \
74 : MOZ_MUST_USE NS_IMETHOD GetAppName(nsACString & aAppName) override { return _to GetAppName(aAppName); } \
75 : MOZ_MUST_USE NS_IMETHOD GetAppVersion(nsACString & aAppVersion) override { return _to GetAppVersion(aAppVersion); } \
76 : MOZ_MUST_USE NS_IMETHOD GetPlatform(nsACString & aPlatform) override { return _to GetPlatform(aPlatform); } \
77 : MOZ_MUST_USE NS_IMETHOD GetOscpu(nsACString & aOscpu) override { return _to GetOscpu(aOscpu); } \
78 : MOZ_MUST_USE NS_IMETHOD GetMisc(nsACString & aMisc) override { return _to GetMisc(aMisc); }
79 :
80 : /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
81 : #define NS_FORWARD_SAFE_NSIHTTPPROTOCOLHANDLER(_to) \
82 : MOZ_MUST_USE NS_IMETHOD GetUserAgent(nsACString & aUserAgent) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetUserAgent(aUserAgent); } \
83 : MOZ_MUST_USE NS_IMETHOD GetAppName(nsACString & aAppName) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetAppName(aAppName); } \
84 : MOZ_MUST_USE NS_IMETHOD GetAppVersion(nsACString & aAppVersion) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetAppVersion(aAppVersion); } \
85 : MOZ_MUST_USE NS_IMETHOD GetPlatform(nsACString & aPlatform) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetPlatform(aPlatform); } \
86 : MOZ_MUST_USE NS_IMETHOD GetOscpu(nsACString & aOscpu) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetOscpu(aOscpu); } \
87 : MOZ_MUST_USE NS_IMETHOD GetMisc(nsACString & aMisc) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetMisc(aMisc); }
88 :
89 : #if 0
90 : /* Use the code below as a template for the implementation class for this interface. */
91 :
92 : /* Header file */
93 : class nsHttpProtocolHandler : public nsIHttpProtocolHandler
94 : {
95 : public:
96 : NS_DECL_ISUPPORTS
97 : NS_DECL_NSIHTTPPROTOCOLHANDLER
98 :
99 : nsHttpProtocolHandler();
100 :
101 : private:
102 : ~nsHttpProtocolHandler();
103 :
104 : protected:
105 : /* additional members */
106 : };
107 :
108 : /* Implementation file */
109 : NS_IMPL_ISUPPORTS(nsHttpProtocolHandler, nsIHttpProtocolHandler)
110 :
111 : nsHttpProtocolHandler::nsHttpProtocolHandler()
112 : {
113 : /* member initializers and constructor code */
114 : }
115 :
116 : nsHttpProtocolHandler::~nsHttpProtocolHandler()
117 : {
118 : /* destructor code */
119 : }
120 :
121 : /* [must_use] readonly attribute ACString userAgent; */
122 : MOZ_MUST_USE NS_IMETHODIMP nsHttpProtocolHandler::GetUserAgent(nsACString & aUserAgent)
123 : {
124 : return NS_ERROR_NOT_IMPLEMENTED;
125 : }
126 :
127 : /* [must_use] readonly attribute ACString appName; */
128 : MOZ_MUST_USE NS_IMETHODIMP nsHttpProtocolHandler::GetAppName(nsACString & aAppName)
129 : {
130 : return NS_ERROR_NOT_IMPLEMENTED;
131 : }
132 :
133 : /* [must_use] readonly attribute ACString appVersion; */
134 : MOZ_MUST_USE NS_IMETHODIMP nsHttpProtocolHandler::GetAppVersion(nsACString & aAppVersion)
135 : {
136 : return NS_ERROR_NOT_IMPLEMENTED;
137 : }
138 :
139 : /* [must_use] readonly attribute ACString platform; */
140 : MOZ_MUST_USE NS_IMETHODIMP nsHttpProtocolHandler::GetPlatform(nsACString & aPlatform)
141 : {
142 : return NS_ERROR_NOT_IMPLEMENTED;
143 : }
144 :
145 : /* [must_use] readonly attribute ACString oscpu; */
146 : MOZ_MUST_USE NS_IMETHODIMP nsHttpProtocolHandler::GetOscpu(nsACString & aOscpu)
147 : {
148 : return NS_ERROR_NOT_IMPLEMENTED;
149 : }
150 :
151 : /* [must_use] readonly attribute ACString misc; */
152 : MOZ_MUST_USE NS_IMETHODIMP nsHttpProtocolHandler::GetMisc(nsACString & aMisc)
153 : {
154 : return NS_ERROR_NOT_IMPLEMENTED;
155 : }
156 :
157 : /* End of implementation class template. */
158 : #endif
159 :
160 : // ----------- Categories -----------
161 : /**
162 : * At initialization time, the HTTP handler will initialize each service
163 : * registered under this category:
164 : */
165 : #define NS_HTTP_STARTUP_CATEGORY "http-startup-category"
166 : // ----------- Observer topics -----------
167 : /**
168 : * nsIObserver notification corresponding to startup category. Services
169 : * registered under the startup category will receive this observer topic at
170 : * startup if they implement nsIObserver. The "subject" of the notification
171 : * is the nsIHttpProtocolHandler instance.
172 : */
173 : #define NS_HTTP_STARTUP_TOPIC "http-startup"
174 : /**
175 : * This observer topic is notified when an HTTP channel is opened.
176 : * It is similar to http-on-modify-request, except that
177 : * 1) The notification is guaranteed to occur before on-modify-request, during
178 : * the AsyncOpen call itself.
179 : * 2) It only occurs for the initial open of a channel, not for internal
180 : * asyncOpens that happen during redirects, etc.
181 : * 3) Some information (most notably nsIProxiedChannel.proxyInfo) may not be set
182 : * on the channel object yet.
183 : *
184 : * The "subject" of the notification is the nsIHttpChannel instance.
185 : *
186 : * Generally the 'http-on-modify-request' notification is preferred unless the
187 : * synchronous, during-asyncOpen behavior that this notification provides is
188 : * required.
189 : */
190 : #define NS_HTTP_ON_OPENING_REQUEST_TOPIC "http-on-opening-request"
191 : /**
192 : * Before an HTTP request is sent to the server, this observer topic is
193 : * notified. The observer of this topic can then choose to set any additional
194 : * headers for this request before the request is actually sent to the server.
195 : * The "subject" of the notification is the nsIHttpChannel instance.
196 : */
197 : #define NS_HTTP_ON_MODIFY_REQUEST_TOPIC "http-on-modify-request"
198 : /**
199 : * After an HTTP server response is received, this observer topic is notified.
200 : * The observer of this topic can interrogate the response. The "subject" of
201 : * the notification is the nsIHttpChannel instance.
202 : */
203 : #define NS_HTTP_ON_EXAMINE_RESPONSE_TOPIC "http-on-examine-response"
204 : /**
205 : * The observer of this topic is notified after the received HTTP response
206 : * is merged with data from the browser cache. This means that, among other
207 : * things, the Content-Type header will be set correctly.
208 : */
209 : #define NS_HTTP_ON_EXAMINE_MERGED_RESPONSE_TOPIC "http-on-examine-merged-response"
210 : /**
211 : * The observer of this topic is notified before data is read from the cache.
212 : * The notification is sent if and only if there is no network communication
213 : * at all.
214 : */
215 : #define NS_HTTP_ON_EXAMINE_CACHED_RESPONSE_TOPIC "http-on-examine-cached-response"
216 : /**
217 : * Before an HTTP request corresponding to a channel with the LOAD_DOCUMENT_URI
218 : * flag is sent to the server, this observer topic is notified. The observer of
219 : * this topic can then choose to modify the user agent for this request before
220 : * the request is actually sent to the server. Additionally, the modified user
221 : * agent will be propagated to sub-resource requests from the same load group.
222 : */
223 : #define NS_HTTP_ON_USERAGENT_REQUEST_TOPIC "http-on-useragent-request"
224 :
225 : #endif /* __gen_nsIHttpProtocolHandler_h__ */
|