Line data Source code
1 : /*
2 : * DO NOT EDIT. THIS FILE IS GENERATED FROM ../../../dist/idl/nsIPushService.idl
3 : */
4 :
5 : #ifndef __gen_nsIPushService_h__
6 : #define __gen_nsIPushService_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 : class nsIPrincipal; /* forward declaration */
20 :
21 :
22 : /* starting interface: nsIPushSubscription */
23 : #define NS_IPUSHSUBSCRIPTION_IID_STR "1de32d5c-ea88-4c9e-9626-b032bd87f415"
24 :
25 : #define NS_IPUSHSUBSCRIPTION_IID \
26 : {0x1de32d5c, 0xea88, 0x4c9e, \
27 : { 0x96, 0x26, 0xb0, 0x32, 0xbd, 0x87, 0xf4, 0x15 }}
28 :
29 : class NS_NO_VTABLE nsIPushSubscription : public nsISupports {
30 : public:
31 :
32 : NS_DECLARE_STATIC_IID_ACCESSOR(NS_IPUSHSUBSCRIPTION_IID)
33 :
34 : /* readonly attribute DOMString endpoint; */
35 : NS_IMETHOD GetEndpoint(nsAString & aEndpoint) = 0;
36 :
37 : /* readonly attribute long long pushCount; */
38 : NS_IMETHOD GetPushCount(int64_t *aPushCount) = 0;
39 :
40 : /* readonly attribute long long lastPush; */
41 : NS_IMETHOD GetLastPush(int64_t *aLastPush) = 0;
42 :
43 : /* readonly attribute long quota; */
44 : NS_IMETHOD GetQuota(int32_t *aQuota) = 0;
45 :
46 : /* readonly attribute bool isSystemSubscription; */
47 : NS_IMETHOD GetIsSystemSubscription(bool *aIsSystemSubscription) = 0;
48 :
49 : /* readonly attribute jsval p256dhPrivateKey; */
50 : NS_IMETHOD GetP256dhPrivateKey(JS::MutableHandleValue aP256dhPrivateKey) = 0;
51 :
52 : /* bool quotaApplies (); */
53 : NS_IMETHOD QuotaApplies(bool *_retval) = 0;
54 :
55 : /* bool isExpired (); */
56 : NS_IMETHOD IsExpired(bool *_retval) = 0;
57 :
58 : /* void getKey (in DOMString name, [optional] out uint32_t keyLen, [array, size_is (keyLen), retval] out uint8_t key); */
59 : NS_IMETHOD GetKey(const nsAString & name, uint32_t *keyLen, uint8_t **key) = 0;
60 :
61 : };
62 :
63 : NS_DEFINE_STATIC_IID_ACCESSOR(nsIPushSubscription, NS_IPUSHSUBSCRIPTION_IID)
64 :
65 : /* Use this macro when declaring classes that implement this interface. */
66 : #define NS_DECL_NSIPUSHSUBSCRIPTION \
67 : NS_IMETHOD GetEndpoint(nsAString & aEndpoint) override; \
68 : NS_IMETHOD GetPushCount(int64_t *aPushCount) override; \
69 : NS_IMETHOD GetLastPush(int64_t *aLastPush) override; \
70 : NS_IMETHOD GetQuota(int32_t *aQuota) override; \
71 : NS_IMETHOD GetIsSystemSubscription(bool *aIsSystemSubscription) override; \
72 : NS_IMETHOD GetP256dhPrivateKey(JS::MutableHandleValue aP256dhPrivateKey) override; \
73 : NS_IMETHOD QuotaApplies(bool *_retval) override; \
74 : NS_IMETHOD IsExpired(bool *_retval) override; \
75 : NS_IMETHOD GetKey(const nsAString & name, uint32_t *keyLen, uint8_t **key) override;
76 :
77 : /* Use this macro when declaring the members of this interface when the
78 : class doesn't implement the interface. This is useful for forwarding. */
79 : #define NS_DECL_NON_VIRTUAL_NSIPUSHSUBSCRIPTION \
80 : nsresult GetEndpoint(nsAString & aEndpoint); \
81 : nsresult GetPushCount(int64_t *aPushCount); \
82 : nsresult GetLastPush(int64_t *aLastPush); \
83 : nsresult GetQuota(int32_t *aQuota); \
84 : nsresult GetIsSystemSubscription(bool *aIsSystemSubscription); \
85 : nsresult GetP256dhPrivateKey(JS::MutableHandleValue aP256dhPrivateKey); \
86 : nsresult QuotaApplies(bool *_retval); \
87 : nsresult IsExpired(bool *_retval); \
88 : nsresult GetKey(const nsAString & name, uint32_t *keyLen, uint8_t **key);
89 :
90 : /* Use this macro to declare functions that forward the behavior of this interface to another object. */
91 : #define NS_FORWARD_NSIPUSHSUBSCRIPTION(_to) \
92 : NS_IMETHOD GetEndpoint(nsAString & aEndpoint) override { return _to GetEndpoint(aEndpoint); } \
93 : NS_IMETHOD GetPushCount(int64_t *aPushCount) override { return _to GetPushCount(aPushCount); } \
94 : NS_IMETHOD GetLastPush(int64_t *aLastPush) override { return _to GetLastPush(aLastPush); } \
95 : NS_IMETHOD GetQuota(int32_t *aQuota) override { return _to GetQuota(aQuota); } \
96 : NS_IMETHOD GetIsSystemSubscription(bool *aIsSystemSubscription) override { return _to GetIsSystemSubscription(aIsSystemSubscription); } \
97 : NS_IMETHOD GetP256dhPrivateKey(JS::MutableHandleValue aP256dhPrivateKey) override { return _to GetP256dhPrivateKey(aP256dhPrivateKey); } \
98 : NS_IMETHOD QuotaApplies(bool *_retval) override { return _to QuotaApplies(_retval); } \
99 : NS_IMETHOD IsExpired(bool *_retval) override { return _to IsExpired(_retval); } \
100 : NS_IMETHOD GetKey(const nsAString & name, uint32_t *keyLen, uint8_t **key) override { return _to GetKey(name, keyLen, key); }
101 :
102 : /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
103 : #define NS_FORWARD_SAFE_NSIPUSHSUBSCRIPTION(_to) \
104 : NS_IMETHOD GetEndpoint(nsAString & aEndpoint) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetEndpoint(aEndpoint); } \
105 : NS_IMETHOD GetPushCount(int64_t *aPushCount) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetPushCount(aPushCount); } \
106 : NS_IMETHOD GetLastPush(int64_t *aLastPush) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetLastPush(aLastPush); } \
107 : NS_IMETHOD GetQuota(int32_t *aQuota) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetQuota(aQuota); } \
108 : NS_IMETHOD GetIsSystemSubscription(bool *aIsSystemSubscription) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetIsSystemSubscription(aIsSystemSubscription); } \
109 : NS_IMETHOD GetP256dhPrivateKey(JS::MutableHandleValue aP256dhPrivateKey) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetP256dhPrivateKey(aP256dhPrivateKey); } \
110 : NS_IMETHOD QuotaApplies(bool *_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->QuotaApplies(_retval); } \
111 : NS_IMETHOD IsExpired(bool *_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->IsExpired(_retval); } \
112 : NS_IMETHOD GetKey(const nsAString & name, uint32_t *keyLen, uint8_t **key) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetKey(name, keyLen, key); }
113 :
114 : #if 0
115 : /* Use the code below as a template for the implementation class for this interface. */
116 :
117 : /* Header file */
118 : class nsPushSubscription : public nsIPushSubscription
119 : {
120 : public:
121 : NS_DECL_ISUPPORTS
122 : NS_DECL_NSIPUSHSUBSCRIPTION
123 :
124 : nsPushSubscription();
125 :
126 : private:
127 : ~nsPushSubscription();
128 :
129 : protected:
130 : /* additional members */
131 : };
132 :
133 : /* Implementation file */
134 : NS_IMPL_ISUPPORTS(nsPushSubscription, nsIPushSubscription)
135 :
136 : nsPushSubscription::nsPushSubscription()
137 : {
138 : /* member initializers and constructor code */
139 : }
140 :
141 : nsPushSubscription::~nsPushSubscription()
142 : {
143 : /* destructor code */
144 : }
145 :
146 : /* readonly attribute DOMString endpoint; */
147 : NS_IMETHODIMP nsPushSubscription::GetEndpoint(nsAString & aEndpoint)
148 : {
149 : return NS_ERROR_NOT_IMPLEMENTED;
150 : }
151 :
152 : /* readonly attribute long long pushCount; */
153 : NS_IMETHODIMP nsPushSubscription::GetPushCount(int64_t *aPushCount)
154 : {
155 : return NS_ERROR_NOT_IMPLEMENTED;
156 : }
157 :
158 : /* readonly attribute long long lastPush; */
159 : NS_IMETHODIMP nsPushSubscription::GetLastPush(int64_t *aLastPush)
160 : {
161 : return NS_ERROR_NOT_IMPLEMENTED;
162 : }
163 :
164 : /* readonly attribute long quota; */
165 : NS_IMETHODIMP nsPushSubscription::GetQuota(int32_t *aQuota)
166 : {
167 : return NS_ERROR_NOT_IMPLEMENTED;
168 : }
169 :
170 : /* readonly attribute bool isSystemSubscription; */
171 : NS_IMETHODIMP nsPushSubscription::GetIsSystemSubscription(bool *aIsSystemSubscription)
172 : {
173 : return NS_ERROR_NOT_IMPLEMENTED;
174 : }
175 :
176 : /* readonly attribute jsval p256dhPrivateKey; */
177 : NS_IMETHODIMP nsPushSubscription::GetP256dhPrivateKey(JS::MutableHandleValue aP256dhPrivateKey)
178 : {
179 : return NS_ERROR_NOT_IMPLEMENTED;
180 : }
181 :
182 : /* bool quotaApplies (); */
183 : NS_IMETHODIMP nsPushSubscription::QuotaApplies(bool *_retval)
184 : {
185 : return NS_ERROR_NOT_IMPLEMENTED;
186 : }
187 :
188 : /* bool isExpired (); */
189 : NS_IMETHODIMP nsPushSubscription::IsExpired(bool *_retval)
190 : {
191 : return NS_ERROR_NOT_IMPLEMENTED;
192 : }
193 :
194 : /* void getKey (in DOMString name, [optional] out uint32_t keyLen, [array, size_is (keyLen), retval] out uint8_t key); */
195 : NS_IMETHODIMP nsPushSubscription::GetKey(const nsAString & name, uint32_t *keyLen, uint8_t **key)
196 : {
197 : return NS_ERROR_NOT_IMPLEMENTED;
198 : }
199 :
200 : /* End of implementation class template. */
201 : #endif
202 :
203 :
204 : /* starting interface: nsIPushSubscriptionCallback */
205 : #define NS_IPUSHSUBSCRIPTIONCALLBACK_IID_STR "1799c074-9d52-46b0-ab3c-c09790732f6f"
206 :
207 : #define NS_IPUSHSUBSCRIPTIONCALLBACK_IID \
208 : {0x1799c074, 0x9d52, 0x46b0, \
209 : { 0xab, 0x3c, 0xc0, 0x97, 0x90, 0x73, 0x2f, 0x6f }}
210 :
211 0 : class NS_NO_VTABLE nsIPushSubscriptionCallback : public nsISupports {
212 : public:
213 :
214 : NS_DECLARE_STATIC_IID_ACCESSOR(NS_IPUSHSUBSCRIPTIONCALLBACK_IID)
215 :
216 : /* void onPushSubscription (in nsresult status, in nsIPushSubscription subscription); */
217 : NS_IMETHOD OnPushSubscription(nsresult status, nsIPushSubscription *subscription) = 0;
218 :
219 : };
220 :
221 : NS_DEFINE_STATIC_IID_ACCESSOR(nsIPushSubscriptionCallback, NS_IPUSHSUBSCRIPTIONCALLBACK_IID)
222 :
223 : /* Use this macro when declaring classes that implement this interface. */
224 : #define NS_DECL_NSIPUSHSUBSCRIPTIONCALLBACK \
225 : NS_IMETHOD OnPushSubscription(nsresult status, nsIPushSubscription *subscription) override;
226 :
227 : /* Use this macro when declaring the members of this interface when the
228 : class doesn't implement the interface. This is useful for forwarding. */
229 : #define NS_DECL_NON_VIRTUAL_NSIPUSHSUBSCRIPTIONCALLBACK \
230 : nsresult OnPushSubscription(nsresult status, nsIPushSubscription *subscription);
231 :
232 : /* Use this macro to declare functions that forward the behavior of this interface to another object. */
233 : #define NS_FORWARD_NSIPUSHSUBSCRIPTIONCALLBACK(_to) \
234 : NS_IMETHOD OnPushSubscription(nsresult status, nsIPushSubscription *subscription) override { return _to OnPushSubscription(status, subscription); }
235 :
236 : /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
237 : #define NS_FORWARD_SAFE_NSIPUSHSUBSCRIPTIONCALLBACK(_to) \
238 : NS_IMETHOD OnPushSubscription(nsresult status, nsIPushSubscription *subscription) override { return !_to ? NS_ERROR_NULL_POINTER : _to->OnPushSubscription(status, subscription); }
239 :
240 : #if 0
241 : /* Use the code below as a template for the implementation class for this interface. */
242 :
243 : /* Header file */
244 : class nsPushSubscriptionCallback : public nsIPushSubscriptionCallback
245 : {
246 : public:
247 : NS_DECL_ISUPPORTS
248 : NS_DECL_NSIPUSHSUBSCRIPTIONCALLBACK
249 :
250 : nsPushSubscriptionCallback();
251 :
252 : private:
253 : ~nsPushSubscriptionCallback();
254 :
255 : protected:
256 : /* additional members */
257 : };
258 :
259 : /* Implementation file */
260 : NS_IMPL_ISUPPORTS(nsPushSubscriptionCallback, nsIPushSubscriptionCallback)
261 :
262 : nsPushSubscriptionCallback::nsPushSubscriptionCallback()
263 : {
264 : /* member initializers and constructor code */
265 : }
266 :
267 : nsPushSubscriptionCallback::~nsPushSubscriptionCallback()
268 : {
269 : /* destructor code */
270 : }
271 :
272 : /* void onPushSubscription (in nsresult status, in nsIPushSubscription subscription); */
273 : NS_IMETHODIMP nsPushSubscriptionCallback::OnPushSubscription(nsresult status, nsIPushSubscription *subscription)
274 : {
275 : return NS_ERROR_NOT_IMPLEMENTED;
276 : }
277 :
278 : /* End of implementation class template. */
279 : #endif
280 :
281 :
282 : /* starting interface: nsIUnsubscribeResultCallback */
283 : #define NS_IUNSUBSCRIBERESULTCALLBACK_IID_STR "d574118f-61a9-4270-b1f6-4461aa85c4f5"
284 :
285 : #define NS_IUNSUBSCRIBERESULTCALLBACK_IID \
286 : {0xd574118f, 0x61a9, 0x4270, \
287 : { 0xb1, 0xf6, 0x44, 0x61, 0xaa, 0x85, 0xc4, 0xf5 }}
288 :
289 0 : class NS_NO_VTABLE nsIUnsubscribeResultCallback : public nsISupports {
290 : public:
291 :
292 : NS_DECLARE_STATIC_IID_ACCESSOR(NS_IUNSUBSCRIBERESULTCALLBACK_IID)
293 :
294 : /* void onUnsubscribe (in nsresult status, in bool success); */
295 : NS_IMETHOD OnUnsubscribe(nsresult status, bool success) = 0;
296 :
297 : };
298 :
299 : NS_DEFINE_STATIC_IID_ACCESSOR(nsIUnsubscribeResultCallback, NS_IUNSUBSCRIBERESULTCALLBACK_IID)
300 :
301 : /* Use this macro when declaring classes that implement this interface. */
302 : #define NS_DECL_NSIUNSUBSCRIBERESULTCALLBACK \
303 : NS_IMETHOD OnUnsubscribe(nsresult status, bool success) override;
304 :
305 : /* Use this macro when declaring the members of this interface when the
306 : class doesn't implement the interface. This is useful for forwarding. */
307 : #define NS_DECL_NON_VIRTUAL_NSIUNSUBSCRIBERESULTCALLBACK \
308 : nsresult OnUnsubscribe(nsresult status, bool success);
309 :
310 : /* Use this macro to declare functions that forward the behavior of this interface to another object. */
311 : #define NS_FORWARD_NSIUNSUBSCRIBERESULTCALLBACK(_to) \
312 : NS_IMETHOD OnUnsubscribe(nsresult status, bool success) override { return _to OnUnsubscribe(status, success); }
313 :
314 : /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
315 : #define NS_FORWARD_SAFE_NSIUNSUBSCRIBERESULTCALLBACK(_to) \
316 : NS_IMETHOD OnUnsubscribe(nsresult status, bool success) override { return !_to ? NS_ERROR_NULL_POINTER : _to->OnUnsubscribe(status, success); }
317 :
318 : #if 0
319 : /* Use the code below as a template for the implementation class for this interface. */
320 :
321 : /* Header file */
322 : class nsUnsubscribeResultCallback : public nsIUnsubscribeResultCallback
323 : {
324 : public:
325 : NS_DECL_ISUPPORTS
326 : NS_DECL_NSIUNSUBSCRIBERESULTCALLBACK
327 :
328 : nsUnsubscribeResultCallback();
329 :
330 : private:
331 : ~nsUnsubscribeResultCallback();
332 :
333 : protected:
334 : /* additional members */
335 : };
336 :
337 : /* Implementation file */
338 : NS_IMPL_ISUPPORTS(nsUnsubscribeResultCallback, nsIUnsubscribeResultCallback)
339 :
340 : nsUnsubscribeResultCallback::nsUnsubscribeResultCallback()
341 : {
342 : /* member initializers and constructor code */
343 : }
344 :
345 : nsUnsubscribeResultCallback::~nsUnsubscribeResultCallback()
346 : {
347 : /* destructor code */
348 : }
349 :
350 : /* void onUnsubscribe (in nsresult status, in bool success); */
351 : NS_IMETHODIMP nsUnsubscribeResultCallback::OnUnsubscribe(nsresult status, bool success)
352 : {
353 : return NS_ERROR_NOT_IMPLEMENTED;
354 : }
355 :
356 : /* End of implementation class template. */
357 : #endif
358 :
359 :
360 : /* starting interface: nsIPushClearResultCallback */
361 : #define NS_IPUSHCLEARRESULTCALLBACK_IID_STR "bd47b38e-8bfa-4f92-834e-832a4431e05e"
362 :
363 : #define NS_IPUSHCLEARRESULTCALLBACK_IID \
364 : {0xbd47b38e, 0x8bfa, 0x4f92, \
365 : { 0x83, 0x4e, 0x83, 0x2a, 0x44, 0x31, 0xe0, 0x5e }}
366 :
367 : class NS_NO_VTABLE nsIPushClearResultCallback : public nsISupports {
368 : public:
369 :
370 : NS_DECLARE_STATIC_IID_ACCESSOR(NS_IPUSHCLEARRESULTCALLBACK_IID)
371 :
372 : /* void onClear (in nsresult status); */
373 : NS_IMETHOD OnClear(nsresult status) = 0;
374 :
375 : };
376 :
377 : NS_DEFINE_STATIC_IID_ACCESSOR(nsIPushClearResultCallback, NS_IPUSHCLEARRESULTCALLBACK_IID)
378 :
379 : /* Use this macro when declaring classes that implement this interface. */
380 : #define NS_DECL_NSIPUSHCLEARRESULTCALLBACK \
381 : NS_IMETHOD OnClear(nsresult status) override;
382 :
383 : /* Use this macro when declaring the members of this interface when the
384 : class doesn't implement the interface. This is useful for forwarding. */
385 : #define NS_DECL_NON_VIRTUAL_NSIPUSHCLEARRESULTCALLBACK \
386 : nsresult OnClear(nsresult status);
387 :
388 : /* Use this macro to declare functions that forward the behavior of this interface to another object. */
389 : #define NS_FORWARD_NSIPUSHCLEARRESULTCALLBACK(_to) \
390 : NS_IMETHOD OnClear(nsresult status) override { return _to OnClear(status); }
391 :
392 : /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
393 : #define NS_FORWARD_SAFE_NSIPUSHCLEARRESULTCALLBACK(_to) \
394 : NS_IMETHOD OnClear(nsresult status) override { return !_to ? NS_ERROR_NULL_POINTER : _to->OnClear(status); }
395 :
396 : #if 0
397 : /* Use the code below as a template for the implementation class for this interface. */
398 :
399 : /* Header file */
400 : class nsPushClearResultCallback : public nsIPushClearResultCallback
401 : {
402 : public:
403 : NS_DECL_ISUPPORTS
404 : NS_DECL_NSIPUSHCLEARRESULTCALLBACK
405 :
406 : nsPushClearResultCallback();
407 :
408 : private:
409 : ~nsPushClearResultCallback();
410 :
411 : protected:
412 : /* additional members */
413 : };
414 :
415 : /* Implementation file */
416 : NS_IMPL_ISUPPORTS(nsPushClearResultCallback, nsIPushClearResultCallback)
417 :
418 : nsPushClearResultCallback::nsPushClearResultCallback()
419 : {
420 : /* member initializers and constructor code */
421 : }
422 :
423 : nsPushClearResultCallback::~nsPushClearResultCallback()
424 : {
425 : /* destructor code */
426 : }
427 :
428 : /* void onClear (in nsresult status); */
429 : NS_IMETHODIMP nsPushClearResultCallback::OnClear(nsresult status)
430 : {
431 : return NS_ERROR_NOT_IMPLEMENTED;
432 : }
433 :
434 : /* End of implementation class template. */
435 : #endif
436 :
437 :
438 : /* starting interface: nsIPushService */
439 : #define NS_IPUSHSERVICE_IID_STR "678ef584-bf25-47aa-ac84-03efc0865b68"
440 :
441 : #define NS_IPUSHSERVICE_IID \
442 : {0x678ef584, 0xbf25, 0x47aa, \
443 : { 0xac, 0x84, 0x03, 0xef, 0xc0, 0x86, 0x5b, 0x68 }}
444 :
445 : class NS_NO_VTABLE nsIPushService : public nsISupports {
446 : public:
447 :
448 : NS_DECLARE_STATIC_IID_ACCESSOR(NS_IPUSHSERVICE_IID)
449 :
450 : /* readonly attribute DOMString pushTopic; */
451 : NS_IMETHOD GetPushTopic(nsAString & aPushTopic) = 0;
452 :
453 : /* readonly attribute DOMString subscriptionChangeTopic; */
454 : NS_IMETHOD GetSubscriptionChangeTopic(nsAString & aSubscriptionChangeTopic) = 0;
455 :
456 : /* readonly attribute DOMString subscriptionModifiedTopic; */
457 : NS_IMETHOD GetSubscriptionModifiedTopic(nsAString & aSubscriptionModifiedTopic) = 0;
458 :
459 : /* void subscribe (in DOMString scope, in nsIPrincipal principal, in nsIPushSubscriptionCallback callback); */
460 : NS_IMETHOD Subscribe(const nsAString & scope, nsIPrincipal *principal, nsIPushSubscriptionCallback *callback) = 0;
461 :
462 : /* void subscribeWithKey (in DOMString scope, in nsIPrincipal principal, in uint32_t keyLength, [array, size_is (keyLength), const] in uint8_t key, in nsIPushSubscriptionCallback callback); */
463 : NS_IMETHOD SubscribeWithKey(const nsAString & scope, nsIPrincipal *principal, uint32_t keyLength, const uint8_t *key, nsIPushSubscriptionCallback *callback) = 0;
464 :
465 : /* void unsubscribe (in DOMString scope, in nsIPrincipal principal, in nsIUnsubscribeResultCallback callback); */
466 : NS_IMETHOD Unsubscribe(const nsAString & scope, nsIPrincipal *principal, nsIUnsubscribeResultCallback *callback) = 0;
467 :
468 : /* void getSubscription (in DOMString scope, in nsIPrincipal principal, in nsIPushSubscriptionCallback callback); */
469 : NS_IMETHOD GetSubscription(const nsAString & scope, nsIPrincipal *principal, nsIPushSubscriptionCallback *callback) = 0;
470 :
471 : /* void clearForDomain (in DOMString domain, in nsIPushClearResultCallback callback); */
472 : NS_IMETHOD ClearForDomain(const nsAString & domain, nsIPushClearResultCallback *callback) = 0;
473 :
474 : };
475 :
476 : NS_DEFINE_STATIC_IID_ACCESSOR(nsIPushService, NS_IPUSHSERVICE_IID)
477 :
478 : /* Use this macro when declaring classes that implement this interface. */
479 : #define NS_DECL_NSIPUSHSERVICE \
480 : NS_IMETHOD GetPushTopic(nsAString & aPushTopic) override; \
481 : NS_IMETHOD GetSubscriptionChangeTopic(nsAString & aSubscriptionChangeTopic) override; \
482 : NS_IMETHOD GetSubscriptionModifiedTopic(nsAString & aSubscriptionModifiedTopic) override; \
483 : NS_IMETHOD Subscribe(const nsAString & scope, nsIPrincipal *principal, nsIPushSubscriptionCallback *callback) override; \
484 : NS_IMETHOD SubscribeWithKey(const nsAString & scope, nsIPrincipal *principal, uint32_t keyLength, const uint8_t *key, nsIPushSubscriptionCallback *callback) override; \
485 : NS_IMETHOD Unsubscribe(const nsAString & scope, nsIPrincipal *principal, nsIUnsubscribeResultCallback *callback) override; \
486 : NS_IMETHOD GetSubscription(const nsAString & scope, nsIPrincipal *principal, nsIPushSubscriptionCallback *callback) override; \
487 : NS_IMETHOD ClearForDomain(const nsAString & domain, nsIPushClearResultCallback *callback) override;
488 :
489 : /* Use this macro when declaring the members of this interface when the
490 : class doesn't implement the interface. This is useful for forwarding. */
491 : #define NS_DECL_NON_VIRTUAL_NSIPUSHSERVICE \
492 : nsresult GetPushTopic(nsAString & aPushTopic); \
493 : nsresult GetSubscriptionChangeTopic(nsAString & aSubscriptionChangeTopic); \
494 : nsresult GetSubscriptionModifiedTopic(nsAString & aSubscriptionModifiedTopic); \
495 : nsresult Subscribe(const nsAString & scope, nsIPrincipal *principal, nsIPushSubscriptionCallback *callback); \
496 : nsresult SubscribeWithKey(const nsAString & scope, nsIPrincipal *principal, uint32_t keyLength, const uint8_t *key, nsIPushSubscriptionCallback *callback); \
497 : nsresult Unsubscribe(const nsAString & scope, nsIPrincipal *principal, nsIUnsubscribeResultCallback *callback); \
498 : nsresult GetSubscription(const nsAString & scope, nsIPrincipal *principal, nsIPushSubscriptionCallback *callback); \
499 : nsresult ClearForDomain(const nsAString & domain, nsIPushClearResultCallback *callback);
500 :
501 : /* Use this macro to declare functions that forward the behavior of this interface to another object. */
502 : #define NS_FORWARD_NSIPUSHSERVICE(_to) \
503 : NS_IMETHOD GetPushTopic(nsAString & aPushTopic) override { return _to GetPushTopic(aPushTopic); } \
504 : NS_IMETHOD GetSubscriptionChangeTopic(nsAString & aSubscriptionChangeTopic) override { return _to GetSubscriptionChangeTopic(aSubscriptionChangeTopic); } \
505 : NS_IMETHOD GetSubscriptionModifiedTopic(nsAString & aSubscriptionModifiedTopic) override { return _to GetSubscriptionModifiedTopic(aSubscriptionModifiedTopic); } \
506 : NS_IMETHOD Subscribe(const nsAString & scope, nsIPrincipal *principal, nsIPushSubscriptionCallback *callback) override { return _to Subscribe(scope, principal, callback); } \
507 : NS_IMETHOD SubscribeWithKey(const nsAString & scope, nsIPrincipal *principal, uint32_t keyLength, const uint8_t *key, nsIPushSubscriptionCallback *callback) override { return _to SubscribeWithKey(scope, principal, keyLength, key, callback); } \
508 : NS_IMETHOD Unsubscribe(const nsAString & scope, nsIPrincipal *principal, nsIUnsubscribeResultCallback *callback) override { return _to Unsubscribe(scope, principal, callback); } \
509 : NS_IMETHOD GetSubscription(const nsAString & scope, nsIPrincipal *principal, nsIPushSubscriptionCallback *callback) override { return _to GetSubscription(scope, principal, callback); } \
510 : NS_IMETHOD ClearForDomain(const nsAString & domain, nsIPushClearResultCallback *callback) override { return _to ClearForDomain(domain, callback); }
511 :
512 : /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
513 : #define NS_FORWARD_SAFE_NSIPUSHSERVICE(_to) \
514 : NS_IMETHOD GetPushTopic(nsAString & aPushTopic) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetPushTopic(aPushTopic); } \
515 : NS_IMETHOD GetSubscriptionChangeTopic(nsAString & aSubscriptionChangeTopic) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetSubscriptionChangeTopic(aSubscriptionChangeTopic); } \
516 : NS_IMETHOD GetSubscriptionModifiedTopic(nsAString & aSubscriptionModifiedTopic) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetSubscriptionModifiedTopic(aSubscriptionModifiedTopic); } \
517 : NS_IMETHOD Subscribe(const nsAString & scope, nsIPrincipal *principal, nsIPushSubscriptionCallback *callback) override { return !_to ? NS_ERROR_NULL_POINTER : _to->Subscribe(scope, principal, callback); } \
518 : NS_IMETHOD SubscribeWithKey(const nsAString & scope, nsIPrincipal *principal, uint32_t keyLength, const uint8_t *key, nsIPushSubscriptionCallback *callback) override { return !_to ? NS_ERROR_NULL_POINTER : _to->SubscribeWithKey(scope, principal, keyLength, key, callback); } \
519 : NS_IMETHOD Unsubscribe(const nsAString & scope, nsIPrincipal *principal, nsIUnsubscribeResultCallback *callback) override { return !_to ? NS_ERROR_NULL_POINTER : _to->Unsubscribe(scope, principal, callback); } \
520 : NS_IMETHOD GetSubscription(const nsAString & scope, nsIPrincipal *principal, nsIPushSubscriptionCallback *callback) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetSubscription(scope, principal, callback); } \
521 : NS_IMETHOD ClearForDomain(const nsAString & domain, nsIPushClearResultCallback *callback) override { return !_to ? NS_ERROR_NULL_POINTER : _to->ClearForDomain(domain, callback); }
522 :
523 : #if 0
524 : /* Use the code below as a template for the implementation class for this interface. */
525 :
526 : /* Header file */
527 : class nsPushService : public nsIPushService
528 : {
529 : public:
530 : NS_DECL_ISUPPORTS
531 : NS_DECL_NSIPUSHSERVICE
532 :
533 : nsPushService();
534 :
535 : private:
536 : ~nsPushService();
537 :
538 : protected:
539 : /* additional members */
540 : };
541 :
542 : /* Implementation file */
543 : NS_IMPL_ISUPPORTS(nsPushService, nsIPushService)
544 :
545 : nsPushService::nsPushService()
546 : {
547 : /* member initializers and constructor code */
548 : }
549 :
550 : nsPushService::~nsPushService()
551 : {
552 : /* destructor code */
553 : }
554 :
555 : /* readonly attribute DOMString pushTopic; */
556 : NS_IMETHODIMP nsPushService::GetPushTopic(nsAString & aPushTopic)
557 : {
558 : return NS_ERROR_NOT_IMPLEMENTED;
559 : }
560 :
561 : /* readonly attribute DOMString subscriptionChangeTopic; */
562 : NS_IMETHODIMP nsPushService::GetSubscriptionChangeTopic(nsAString & aSubscriptionChangeTopic)
563 : {
564 : return NS_ERROR_NOT_IMPLEMENTED;
565 : }
566 :
567 : /* readonly attribute DOMString subscriptionModifiedTopic; */
568 : NS_IMETHODIMP nsPushService::GetSubscriptionModifiedTopic(nsAString & aSubscriptionModifiedTopic)
569 : {
570 : return NS_ERROR_NOT_IMPLEMENTED;
571 : }
572 :
573 : /* void subscribe (in DOMString scope, in nsIPrincipal principal, in nsIPushSubscriptionCallback callback); */
574 : NS_IMETHODIMP nsPushService::Subscribe(const nsAString & scope, nsIPrincipal *principal, nsIPushSubscriptionCallback *callback)
575 : {
576 : return NS_ERROR_NOT_IMPLEMENTED;
577 : }
578 :
579 : /* void subscribeWithKey (in DOMString scope, in nsIPrincipal principal, in uint32_t keyLength, [array, size_is (keyLength), const] in uint8_t key, in nsIPushSubscriptionCallback callback); */
580 : NS_IMETHODIMP nsPushService::SubscribeWithKey(const nsAString & scope, nsIPrincipal *principal, uint32_t keyLength, const uint8_t *key, nsIPushSubscriptionCallback *callback)
581 : {
582 : return NS_ERROR_NOT_IMPLEMENTED;
583 : }
584 :
585 : /* void unsubscribe (in DOMString scope, in nsIPrincipal principal, in nsIUnsubscribeResultCallback callback); */
586 : NS_IMETHODIMP nsPushService::Unsubscribe(const nsAString & scope, nsIPrincipal *principal, nsIUnsubscribeResultCallback *callback)
587 : {
588 : return NS_ERROR_NOT_IMPLEMENTED;
589 : }
590 :
591 : /* void getSubscription (in DOMString scope, in nsIPrincipal principal, in nsIPushSubscriptionCallback callback); */
592 : NS_IMETHODIMP nsPushService::GetSubscription(const nsAString & scope, nsIPrincipal *principal, nsIPushSubscriptionCallback *callback)
593 : {
594 : return NS_ERROR_NOT_IMPLEMENTED;
595 : }
596 :
597 : /* void clearForDomain (in DOMString domain, in nsIPushClearResultCallback callback); */
598 : NS_IMETHODIMP nsPushService::ClearForDomain(const nsAString & domain, nsIPushClearResultCallback *callback)
599 : {
600 : return NS_ERROR_NOT_IMPLEMENTED;
601 : }
602 :
603 : /* End of implementation class template. */
604 : #endif
605 :
606 :
607 : /* starting interface: nsIPushQuotaManager */
608 : #define NS_IPUSHQUOTAMANAGER_IID_STR "a2555e70-46f8-4b52-bf02-d978b979d143"
609 :
610 : #define NS_IPUSHQUOTAMANAGER_IID \
611 : {0xa2555e70, 0x46f8, 0x4b52, \
612 : { 0xbf, 0x02, 0xd9, 0x78, 0xb9, 0x79, 0xd1, 0x43 }}
613 :
614 : class NS_NO_VTABLE nsIPushQuotaManager : public nsISupports {
615 : public:
616 :
617 : NS_DECLARE_STATIC_IID_ACCESSOR(NS_IPUSHQUOTAMANAGER_IID)
618 :
619 : /* void notificationForOriginShown (in string origin); */
620 : NS_IMETHOD NotificationForOriginShown(const char * origin) = 0;
621 :
622 : /* void notificationForOriginClosed (in string origin); */
623 : NS_IMETHOD NotificationForOriginClosed(const char * origin) = 0;
624 :
625 : };
626 :
627 : NS_DEFINE_STATIC_IID_ACCESSOR(nsIPushQuotaManager, NS_IPUSHQUOTAMANAGER_IID)
628 :
629 : /* Use this macro when declaring classes that implement this interface. */
630 : #define NS_DECL_NSIPUSHQUOTAMANAGER \
631 : NS_IMETHOD NotificationForOriginShown(const char * origin) override; \
632 : NS_IMETHOD NotificationForOriginClosed(const char * origin) override;
633 :
634 : /* Use this macro when declaring the members of this interface when the
635 : class doesn't implement the interface. This is useful for forwarding. */
636 : #define NS_DECL_NON_VIRTUAL_NSIPUSHQUOTAMANAGER \
637 : nsresult NotificationForOriginShown(const char * origin); \
638 : nsresult NotificationForOriginClosed(const char * origin);
639 :
640 : /* Use this macro to declare functions that forward the behavior of this interface to another object. */
641 : #define NS_FORWARD_NSIPUSHQUOTAMANAGER(_to) \
642 : NS_IMETHOD NotificationForOriginShown(const char * origin) override { return _to NotificationForOriginShown(origin); } \
643 : NS_IMETHOD NotificationForOriginClosed(const char * origin) override { return _to NotificationForOriginClosed(origin); }
644 :
645 : /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
646 : #define NS_FORWARD_SAFE_NSIPUSHQUOTAMANAGER(_to) \
647 : NS_IMETHOD NotificationForOriginShown(const char * origin) override { return !_to ? NS_ERROR_NULL_POINTER : _to->NotificationForOriginShown(origin); } \
648 : NS_IMETHOD NotificationForOriginClosed(const char * origin) override { return !_to ? NS_ERROR_NULL_POINTER : _to->NotificationForOriginClosed(origin); }
649 :
650 : #if 0
651 : /* Use the code below as a template for the implementation class for this interface. */
652 :
653 : /* Header file */
654 : class nsPushQuotaManager : public nsIPushQuotaManager
655 : {
656 : public:
657 : NS_DECL_ISUPPORTS
658 : NS_DECL_NSIPUSHQUOTAMANAGER
659 :
660 : nsPushQuotaManager();
661 :
662 : private:
663 : ~nsPushQuotaManager();
664 :
665 : protected:
666 : /* additional members */
667 : };
668 :
669 : /* Implementation file */
670 : NS_IMPL_ISUPPORTS(nsPushQuotaManager, nsIPushQuotaManager)
671 :
672 : nsPushQuotaManager::nsPushQuotaManager()
673 : {
674 : /* member initializers and constructor code */
675 : }
676 :
677 : nsPushQuotaManager::~nsPushQuotaManager()
678 : {
679 : /* destructor code */
680 : }
681 :
682 : /* void notificationForOriginShown (in string origin); */
683 : NS_IMETHODIMP nsPushQuotaManager::NotificationForOriginShown(const char * origin)
684 : {
685 : return NS_ERROR_NOT_IMPLEMENTED;
686 : }
687 :
688 : /* void notificationForOriginClosed (in string origin); */
689 : NS_IMETHODIMP nsPushQuotaManager::NotificationForOriginClosed(const char * origin)
690 : {
691 : return NS_ERROR_NOT_IMPLEMENTED;
692 : }
693 :
694 : /* End of implementation class template. */
695 : #endif
696 :
697 :
698 : #endif /* __gen_nsIPushService_h__ */
|