Line data Source code
1 : /*
2 : * DO NOT EDIT. THIS FILE IS GENERATED FROM ../../../dist/idl/nsIPushNotifier.idl
3 : */
4 :
5 : #ifndef __gen_nsIPushNotifier_h__
6 : #define __gen_nsIPushNotifier_h__
7 :
8 :
9 : #ifndef __gen_nsISupports_h__
10 : #include "nsISupports.h"
11 : #endif
12 :
13 : #include "js/Value.h"
14 :
15 : /* For IDL files that don't want to include root IDL files. */
16 : #ifndef NS_NO_VTABLE
17 : #define NS_NO_VTABLE
18 : #endif
19 : #define PUSHNOTIFIER_CONTRACTID \
20 : "@mozilla.org/push/Notifier;1"
21 : // These constants are duplicated in `PushComponents.js`.
22 : #define OBSERVER_TOPIC_PUSH "push-message"
23 : #define OBSERVER_TOPIC_SUBSCRIPTION_CHANGE "push-subscription-change"
24 : #define OBSERVER_TOPIC_SUBSCRIPTION_MODIFIED "push-subscription-modified"
25 : class nsIPrincipal; /* forward declaration */
26 :
27 :
28 : /* starting interface: nsIPushNotifier */
29 : #define NS_IPUSHNOTIFIER_IID_STR "b00dfdeb-14e5-425b-adc7-b531442e3216"
30 :
31 : #define NS_IPUSHNOTIFIER_IID \
32 : {0xb00dfdeb, 0x14e5, 0x425b, \
33 : { 0xad, 0xc7, 0xb5, 0x31, 0x44, 0x2e, 0x32, 0x16 }}
34 :
35 2 : class NS_NO_VTABLE nsIPushNotifier : public nsISupports {
36 : public:
37 :
38 : NS_DECLARE_STATIC_IID_ACCESSOR(NS_IPUSHNOTIFIER_IID)
39 :
40 : /* void notifyPush (in ACString scope, in nsIPrincipal principal, in DOMString messageId); */
41 : NS_IMETHOD NotifyPush(const nsACString & scope, nsIPrincipal *principal, const nsAString & messageId) = 0;
42 :
43 : /* void notifyPushWithData (in ACString scope, in nsIPrincipal principal, in DOMString messageId, [optional] in uint32_t dataLen, [array, size_is (dataLen)] in uint8_t data); */
44 : NS_IMETHOD NotifyPushWithData(const nsACString & scope, nsIPrincipal *principal, const nsAString & messageId, uint32_t dataLen, uint8_t *data) = 0;
45 :
46 : /* void notifySubscriptionChange (in ACString scope, in nsIPrincipal principal); */
47 : NS_IMETHOD NotifySubscriptionChange(const nsACString & scope, nsIPrincipal *principal) = 0;
48 :
49 : /* void notifySubscriptionModified (in ACString scope, in nsIPrincipal principal); */
50 : NS_IMETHOD NotifySubscriptionModified(const nsACString & scope, nsIPrincipal *principal) = 0;
51 :
52 : /* void notifyError (in ACString scope, in nsIPrincipal principal, in DOMString message, in uint32_t flags); */
53 : NS_IMETHOD NotifyError(const nsACString & scope, nsIPrincipal *principal, const nsAString & message, uint32_t flags) = 0;
54 :
55 : };
56 :
57 : NS_DEFINE_STATIC_IID_ACCESSOR(nsIPushNotifier, NS_IPUSHNOTIFIER_IID)
58 :
59 : /* Use this macro when declaring classes that implement this interface. */
60 : #define NS_DECL_NSIPUSHNOTIFIER \
61 : NS_IMETHOD NotifyPush(const nsACString & scope, nsIPrincipal *principal, const nsAString & messageId) override; \
62 : NS_IMETHOD NotifyPushWithData(const nsACString & scope, nsIPrincipal *principal, const nsAString & messageId, uint32_t dataLen, uint8_t *data) override; \
63 : NS_IMETHOD NotifySubscriptionChange(const nsACString & scope, nsIPrincipal *principal) override; \
64 : NS_IMETHOD NotifySubscriptionModified(const nsACString & scope, nsIPrincipal *principal) override; \
65 : NS_IMETHOD NotifyError(const nsACString & scope, nsIPrincipal *principal, const nsAString & message, uint32_t flags) override;
66 :
67 : /* Use this macro when declaring the members of this interface when the
68 : class doesn't implement the interface. This is useful for forwarding. */
69 : #define NS_DECL_NON_VIRTUAL_NSIPUSHNOTIFIER \
70 : nsresult NotifyPush(const nsACString & scope, nsIPrincipal *principal, const nsAString & messageId); \
71 : nsresult NotifyPushWithData(const nsACString & scope, nsIPrincipal *principal, const nsAString & messageId, uint32_t dataLen, uint8_t *data); \
72 : nsresult NotifySubscriptionChange(const nsACString & scope, nsIPrincipal *principal); \
73 : nsresult NotifySubscriptionModified(const nsACString & scope, nsIPrincipal *principal); \
74 : nsresult NotifyError(const nsACString & scope, nsIPrincipal *principal, const nsAString & message, uint32_t flags);
75 :
76 : /* Use this macro to declare functions that forward the behavior of this interface to another object. */
77 : #define NS_FORWARD_NSIPUSHNOTIFIER(_to) \
78 : NS_IMETHOD NotifyPush(const nsACString & scope, nsIPrincipal *principal, const nsAString & messageId) override { return _to NotifyPush(scope, principal, messageId); } \
79 : NS_IMETHOD NotifyPushWithData(const nsACString & scope, nsIPrincipal *principal, const nsAString & messageId, uint32_t dataLen, uint8_t *data) override { return _to NotifyPushWithData(scope, principal, messageId, dataLen, data); } \
80 : NS_IMETHOD NotifySubscriptionChange(const nsACString & scope, nsIPrincipal *principal) override { return _to NotifySubscriptionChange(scope, principal); } \
81 : NS_IMETHOD NotifySubscriptionModified(const nsACString & scope, nsIPrincipal *principal) override { return _to NotifySubscriptionModified(scope, principal); } \
82 : NS_IMETHOD NotifyError(const nsACString & scope, nsIPrincipal *principal, const nsAString & message, uint32_t flags) override { return _to NotifyError(scope, principal, message, flags); }
83 :
84 : /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
85 : #define NS_FORWARD_SAFE_NSIPUSHNOTIFIER(_to) \
86 : NS_IMETHOD NotifyPush(const nsACString & scope, nsIPrincipal *principal, const nsAString & messageId) override { return !_to ? NS_ERROR_NULL_POINTER : _to->NotifyPush(scope, principal, messageId); } \
87 : NS_IMETHOD NotifyPushWithData(const nsACString & scope, nsIPrincipal *principal, const nsAString & messageId, uint32_t dataLen, uint8_t *data) override { return !_to ? NS_ERROR_NULL_POINTER : _to->NotifyPushWithData(scope, principal, messageId, dataLen, data); } \
88 : NS_IMETHOD NotifySubscriptionChange(const nsACString & scope, nsIPrincipal *principal) override { return !_to ? NS_ERROR_NULL_POINTER : _to->NotifySubscriptionChange(scope, principal); } \
89 : NS_IMETHOD NotifySubscriptionModified(const nsACString & scope, nsIPrincipal *principal) override { return !_to ? NS_ERROR_NULL_POINTER : _to->NotifySubscriptionModified(scope, principal); } \
90 : NS_IMETHOD NotifyError(const nsACString & scope, nsIPrincipal *principal, const nsAString & message, uint32_t flags) override { return !_to ? NS_ERROR_NULL_POINTER : _to->NotifyError(scope, principal, message, flags); }
91 :
92 : #if 0
93 : /* Use the code below as a template for the implementation class for this interface. */
94 :
95 : /* Header file */
96 : class nsPushNotifier : public nsIPushNotifier
97 : {
98 : public:
99 : NS_DECL_ISUPPORTS
100 : NS_DECL_NSIPUSHNOTIFIER
101 :
102 : nsPushNotifier();
103 :
104 : private:
105 : ~nsPushNotifier();
106 :
107 : protected:
108 : /* additional members */
109 : };
110 :
111 : /* Implementation file */
112 : NS_IMPL_ISUPPORTS(nsPushNotifier, nsIPushNotifier)
113 :
114 : nsPushNotifier::nsPushNotifier()
115 : {
116 : /* member initializers and constructor code */
117 : }
118 :
119 : nsPushNotifier::~nsPushNotifier()
120 : {
121 : /* destructor code */
122 : }
123 :
124 : /* void notifyPush (in ACString scope, in nsIPrincipal principal, in DOMString messageId); */
125 : NS_IMETHODIMP nsPushNotifier::NotifyPush(const nsACString & scope, nsIPrincipal *principal, const nsAString & messageId)
126 : {
127 : return NS_ERROR_NOT_IMPLEMENTED;
128 : }
129 :
130 : /* void notifyPushWithData (in ACString scope, in nsIPrincipal principal, in DOMString messageId, [optional] in uint32_t dataLen, [array, size_is (dataLen)] in uint8_t data); */
131 : NS_IMETHODIMP nsPushNotifier::NotifyPushWithData(const nsACString & scope, nsIPrincipal *principal, const nsAString & messageId, uint32_t dataLen, uint8_t *data)
132 : {
133 : return NS_ERROR_NOT_IMPLEMENTED;
134 : }
135 :
136 : /* void notifySubscriptionChange (in ACString scope, in nsIPrincipal principal); */
137 : NS_IMETHODIMP nsPushNotifier::NotifySubscriptionChange(const nsACString & scope, nsIPrincipal *principal)
138 : {
139 : return NS_ERROR_NOT_IMPLEMENTED;
140 : }
141 :
142 : /* void notifySubscriptionModified (in ACString scope, in nsIPrincipal principal); */
143 : NS_IMETHODIMP nsPushNotifier::NotifySubscriptionModified(const nsACString & scope, nsIPrincipal *principal)
144 : {
145 : return NS_ERROR_NOT_IMPLEMENTED;
146 : }
147 :
148 : /* void notifyError (in ACString scope, in nsIPrincipal principal, in DOMString message, in uint32_t flags); */
149 : NS_IMETHODIMP nsPushNotifier::NotifyError(const nsACString & scope, nsIPrincipal *principal, const nsAString & message, uint32_t flags)
150 : {
151 : return NS_ERROR_NOT_IMPLEMENTED;
152 : }
153 :
154 : /* End of implementation class template. */
155 : #endif
156 :
157 :
158 : /* starting interface: nsIPushData */
159 : #define NS_IPUSHDATA_IID_STR "dfc4f151-cead-40df-8eb7-7a7a67c54b16"
160 :
161 : #define NS_IPUSHDATA_IID \
162 : {0xdfc4f151, 0xcead, 0x40df, \
163 : { 0x8e, 0xb7, 0x7a, 0x7a, 0x67, 0xc5, 0x4b, 0x16 }}
164 :
165 0 : class NS_NO_VTABLE nsIPushData : public nsISupports {
166 : public:
167 :
168 : NS_DECLARE_STATIC_IID_ACCESSOR(NS_IPUSHDATA_IID)
169 :
170 : /* DOMString text (); */
171 : NS_IMETHOD Text(nsAString & _retval) = 0;
172 :
173 : /* [implicit_jscontext] jsval json (); */
174 : NS_IMETHOD Json(JSContext* cx, JS::MutableHandleValue _retval) = 0;
175 :
176 : /* void binary ([optional] out uint32_t dataLen, [array, size_is (dataLen), retval] out uint8_t data); */
177 : NS_IMETHOD Binary(uint32_t *dataLen, uint8_t **data) = 0;
178 :
179 : };
180 :
181 : NS_DEFINE_STATIC_IID_ACCESSOR(nsIPushData, NS_IPUSHDATA_IID)
182 :
183 : /* Use this macro when declaring classes that implement this interface. */
184 : #define NS_DECL_NSIPUSHDATA \
185 : NS_IMETHOD Text(nsAString & _retval) override; \
186 : NS_IMETHOD Json(JSContext* cx, JS::MutableHandleValue _retval) override; \
187 : NS_IMETHOD Binary(uint32_t *dataLen, uint8_t **data) override;
188 :
189 : /* Use this macro when declaring the members of this interface when the
190 : class doesn't implement the interface. This is useful for forwarding. */
191 : #define NS_DECL_NON_VIRTUAL_NSIPUSHDATA \
192 : nsresult Text(nsAString & _retval); \
193 : nsresult Json(JSContext* cx, JS::MutableHandleValue _retval); \
194 : nsresult Binary(uint32_t *dataLen, uint8_t **data);
195 :
196 : /* Use this macro to declare functions that forward the behavior of this interface to another object. */
197 : #define NS_FORWARD_NSIPUSHDATA(_to) \
198 : NS_IMETHOD Text(nsAString & _retval) override { return _to Text(_retval); } \
199 : NS_IMETHOD Json(JSContext* cx, JS::MutableHandleValue _retval) override { return _to Json(cx, _retval); } \
200 : NS_IMETHOD Binary(uint32_t *dataLen, uint8_t **data) override { return _to Binary(dataLen, data); }
201 :
202 : /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
203 : #define NS_FORWARD_SAFE_NSIPUSHDATA(_to) \
204 : NS_IMETHOD Text(nsAString & _retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->Text(_retval); } \
205 : NS_IMETHOD Json(JSContext* cx, JS::MutableHandleValue _retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->Json(cx, _retval); } \
206 : NS_IMETHOD Binary(uint32_t *dataLen, uint8_t **data) override { return !_to ? NS_ERROR_NULL_POINTER : _to->Binary(dataLen, data); }
207 :
208 : #if 0
209 : /* Use the code below as a template for the implementation class for this interface. */
210 :
211 : /* Header file */
212 : class nsPushData : public nsIPushData
213 : {
214 : public:
215 : NS_DECL_ISUPPORTS
216 : NS_DECL_NSIPUSHDATA
217 :
218 : nsPushData();
219 :
220 : private:
221 : ~nsPushData();
222 :
223 : protected:
224 : /* additional members */
225 : };
226 :
227 : /* Implementation file */
228 : NS_IMPL_ISUPPORTS(nsPushData, nsIPushData)
229 :
230 : nsPushData::nsPushData()
231 : {
232 : /* member initializers and constructor code */
233 : }
234 :
235 : nsPushData::~nsPushData()
236 : {
237 : /* destructor code */
238 : }
239 :
240 : /* DOMString text (); */
241 : NS_IMETHODIMP nsPushData::Text(nsAString & _retval)
242 : {
243 : return NS_ERROR_NOT_IMPLEMENTED;
244 : }
245 :
246 : /* [implicit_jscontext] jsval json (); */
247 : NS_IMETHODIMP nsPushData::Json(JSContext* cx, JS::MutableHandleValue _retval)
248 : {
249 : return NS_ERROR_NOT_IMPLEMENTED;
250 : }
251 :
252 : /* void binary ([optional] out uint32_t dataLen, [array, size_is (dataLen), retval] out uint8_t data); */
253 : NS_IMETHODIMP nsPushData::Binary(uint32_t *dataLen, uint8_t **data)
254 : {
255 : return NS_ERROR_NOT_IMPLEMENTED;
256 : }
257 :
258 : /* End of implementation class template. */
259 : #endif
260 :
261 :
262 : /* starting interface: nsIPushMessage */
263 : #define NS_IPUSHMESSAGE_IID_STR "b9d063ca-0e3f-4fee-be4b-ea9103263433"
264 :
265 : #define NS_IPUSHMESSAGE_IID \
266 : {0xb9d063ca, 0x0e3f, 0x4fee, \
267 : { 0xbe, 0x4b, 0xea, 0x91, 0x03, 0x26, 0x34, 0x33 }}
268 :
269 0 : class NS_NO_VTABLE nsIPushMessage : public nsISupports {
270 : public:
271 :
272 : NS_DECLARE_STATIC_IID_ACCESSOR(NS_IPUSHMESSAGE_IID)
273 :
274 : /* readonly attribute nsIPrincipal principal; */
275 : NS_IMETHOD GetPrincipal(nsIPrincipal * *aPrincipal) = 0;
276 :
277 : /* readonly attribute nsIPushData data; */
278 : NS_IMETHOD GetData(nsIPushData * *aData) = 0;
279 :
280 : };
281 :
282 : NS_DEFINE_STATIC_IID_ACCESSOR(nsIPushMessage, NS_IPUSHMESSAGE_IID)
283 :
284 : /* Use this macro when declaring classes that implement this interface. */
285 : #define NS_DECL_NSIPUSHMESSAGE \
286 : NS_IMETHOD GetPrincipal(nsIPrincipal * *aPrincipal) override; \
287 : NS_IMETHOD GetData(nsIPushData * *aData) override;
288 :
289 : /* Use this macro when declaring the members of this interface when the
290 : class doesn't implement the interface. This is useful for forwarding. */
291 : #define NS_DECL_NON_VIRTUAL_NSIPUSHMESSAGE \
292 : nsresult GetPrincipal(nsIPrincipal * *aPrincipal); \
293 : nsresult GetData(nsIPushData * *aData);
294 :
295 : /* Use this macro to declare functions that forward the behavior of this interface to another object. */
296 : #define NS_FORWARD_NSIPUSHMESSAGE(_to) \
297 : NS_IMETHOD GetPrincipal(nsIPrincipal * *aPrincipal) override { return _to GetPrincipal(aPrincipal); } \
298 : NS_IMETHOD GetData(nsIPushData * *aData) override { return _to GetData(aData); }
299 :
300 : /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
301 : #define NS_FORWARD_SAFE_NSIPUSHMESSAGE(_to) \
302 : NS_IMETHOD GetPrincipal(nsIPrincipal * *aPrincipal) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetPrincipal(aPrincipal); } \
303 : NS_IMETHOD GetData(nsIPushData * *aData) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetData(aData); }
304 :
305 : #if 0
306 : /* Use the code below as a template for the implementation class for this interface. */
307 :
308 : /* Header file */
309 : class nsPushMessage : public nsIPushMessage
310 : {
311 : public:
312 : NS_DECL_ISUPPORTS
313 : NS_DECL_NSIPUSHMESSAGE
314 :
315 : nsPushMessage();
316 :
317 : private:
318 : ~nsPushMessage();
319 :
320 : protected:
321 : /* additional members */
322 : };
323 :
324 : /* Implementation file */
325 : NS_IMPL_ISUPPORTS(nsPushMessage, nsIPushMessage)
326 :
327 : nsPushMessage::nsPushMessage()
328 : {
329 : /* member initializers and constructor code */
330 : }
331 :
332 : nsPushMessage::~nsPushMessage()
333 : {
334 : /* destructor code */
335 : }
336 :
337 : /* readonly attribute nsIPrincipal principal; */
338 : NS_IMETHODIMP nsPushMessage::GetPrincipal(nsIPrincipal * *aPrincipal)
339 : {
340 : return NS_ERROR_NOT_IMPLEMENTED;
341 : }
342 :
343 : /* readonly attribute nsIPushData data; */
344 : NS_IMETHODIMP nsPushMessage::GetData(nsIPushData * *aData)
345 : {
346 : return NS_ERROR_NOT_IMPLEMENTED;
347 : }
348 :
349 : /* End of implementation class template. */
350 : #endif
351 :
352 :
353 : #endif /* __gen_nsIPushNotifier_h__ */
|