Line data Source code
1 : /*
2 : * DO NOT EDIT. THIS FILE IS GENERATED FROM ../../../dist/idl/nsICookiePermission.idl
3 : */
4 :
5 : #ifndef __gen_nsICookiePermission_h__
6 : #define __gen_nsICookiePermission_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 nsICookie2; /* forward declaration */
18 :
19 : class nsIURI; /* forward declaration */
20 :
21 : class nsIChannel; /* forward declaration */
22 :
23 : typedef int32_t nsCookieAccess;
24 :
25 :
26 : /* starting interface: nsICookiePermission */
27 : #define NS_ICOOKIEPERMISSION_IID_STR "11ddd4ed-8f5b-40b3-b2a0-27c20ea1c88d"
28 :
29 : #define NS_ICOOKIEPERMISSION_IID \
30 : {0x11ddd4ed, 0x8f5b, 0x40b3, \
31 : { 0xb2, 0xa0, 0x27, 0xc2, 0x0e, 0xa1, 0xc8, 0x8d }}
32 :
33 1 : class NS_NO_VTABLE nsICookiePermission : public nsISupports {
34 : public:
35 :
36 : NS_DECLARE_STATIC_IID_ACCESSOR(NS_ICOOKIEPERMISSION_IID)
37 :
38 : enum {
39 : ACCESS_DEFAULT = 0,
40 : ACCESS_ALLOW = 1,
41 : ACCESS_DENY = 2,
42 : ACCESS_SESSION = 8,
43 : ACCESS_ALLOW_FIRST_PARTY_ONLY = 9,
44 : ACCESS_LIMIT_THIRD_PARTY = 10
45 : };
46 :
47 : /* void setAccess (in nsIURI aURI, in nsCookieAccess aAccess); */
48 : NS_IMETHOD SetAccess(nsIURI *aURI, nsCookieAccess aAccess) = 0;
49 :
50 : /* nsCookieAccess canAccess (in nsIURI aURI, in nsIChannel aChannel); */
51 : NS_IMETHOD CanAccess(nsIURI *aURI, nsIChannel *aChannel, nsCookieAccess *_retval) = 0;
52 :
53 : /* boolean canSetCookie (in nsIURI aURI, in nsIChannel aChannel, in nsICookie2 aCookie, inout boolean aIsSession, inout int64_t aExpiry); */
54 : NS_IMETHOD CanSetCookie(nsIURI *aURI, nsIChannel *aChannel, nsICookie2 *aCookie, bool *aIsSession, int64_t *aExpiry, bool *_retval) = 0;
55 :
56 : };
57 :
58 : NS_DEFINE_STATIC_IID_ACCESSOR(nsICookiePermission, NS_ICOOKIEPERMISSION_IID)
59 :
60 : /* Use this macro when declaring classes that implement this interface. */
61 : #define NS_DECL_NSICOOKIEPERMISSION \
62 : NS_IMETHOD SetAccess(nsIURI *aURI, nsCookieAccess aAccess) override; \
63 : NS_IMETHOD CanAccess(nsIURI *aURI, nsIChannel *aChannel, nsCookieAccess *_retval) override; \
64 : NS_IMETHOD CanSetCookie(nsIURI *aURI, nsIChannel *aChannel, nsICookie2 *aCookie, bool *aIsSession, int64_t *aExpiry, bool *_retval) override;
65 :
66 : /* Use this macro when declaring the members of this interface when the
67 : class doesn't implement the interface. This is useful for forwarding. */
68 : #define NS_DECL_NON_VIRTUAL_NSICOOKIEPERMISSION \
69 : nsresult SetAccess(nsIURI *aURI, nsCookieAccess aAccess); \
70 : nsresult CanAccess(nsIURI *aURI, nsIChannel *aChannel, nsCookieAccess *_retval); \
71 : nsresult CanSetCookie(nsIURI *aURI, nsIChannel *aChannel, nsICookie2 *aCookie, bool *aIsSession, int64_t *aExpiry, bool *_retval);
72 :
73 : /* Use this macro to declare functions that forward the behavior of this interface to another object. */
74 : #define NS_FORWARD_NSICOOKIEPERMISSION(_to) \
75 : NS_IMETHOD SetAccess(nsIURI *aURI, nsCookieAccess aAccess) override { return _to SetAccess(aURI, aAccess); } \
76 : NS_IMETHOD CanAccess(nsIURI *aURI, nsIChannel *aChannel, nsCookieAccess *_retval) override { return _to CanAccess(aURI, aChannel, _retval); } \
77 : NS_IMETHOD CanSetCookie(nsIURI *aURI, nsIChannel *aChannel, nsICookie2 *aCookie, bool *aIsSession, int64_t *aExpiry, bool *_retval) override { return _to CanSetCookie(aURI, aChannel, aCookie, aIsSession, aExpiry, _retval); }
78 :
79 : /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
80 : #define NS_FORWARD_SAFE_NSICOOKIEPERMISSION(_to) \
81 : NS_IMETHOD SetAccess(nsIURI *aURI, nsCookieAccess aAccess) override { return !_to ? NS_ERROR_NULL_POINTER : _to->SetAccess(aURI, aAccess); } \
82 : NS_IMETHOD CanAccess(nsIURI *aURI, nsIChannel *aChannel, nsCookieAccess *_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->CanAccess(aURI, aChannel, _retval); } \
83 : NS_IMETHOD CanSetCookie(nsIURI *aURI, nsIChannel *aChannel, nsICookie2 *aCookie, bool *aIsSession, int64_t *aExpiry, bool *_retval) override { return !_to ? NS_ERROR_NULL_POINTER : _to->CanSetCookie(aURI, aChannel, aCookie, aIsSession, aExpiry, _retval); }
84 :
85 : #if 0
86 : /* Use the code below as a template for the implementation class for this interface. */
87 :
88 : /* Header file */
89 : class nsCookiePermission : public nsICookiePermission
90 : {
91 : public:
92 : NS_DECL_ISUPPORTS
93 : NS_DECL_NSICOOKIEPERMISSION
94 :
95 : nsCookiePermission();
96 :
97 : private:
98 : ~nsCookiePermission();
99 :
100 : protected:
101 : /* additional members */
102 : };
103 :
104 : /* Implementation file */
105 : NS_IMPL_ISUPPORTS(nsCookiePermission, nsICookiePermission)
106 :
107 : nsCookiePermission::nsCookiePermission()
108 : {
109 : /* member initializers and constructor code */
110 : }
111 :
112 : nsCookiePermission::~nsCookiePermission()
113 : {
114 : /* destructor code */
115 : }
116 :
117 : /* void setAccess (in nsIURI aURI, in nsCookieAccess aAccess); */
118 : NS_IMETHODIMP nsCookiePermission::SetAccess(nsIURI *aURI, nsCookieAccess aAccess)
119 : {
120 : return NS_ERROR_NOT_IMPLEMENTED;
121 : }
122 :
123 : /* nsCookieAccess canAccess (in nsIURI aURI, in nsIChannel aChannel); */
124 : NS_IMETHODIMP nsCookiePermission::CanAccess(nsIURI *aURI, nsIChannel *aChannel, nsCookieAccess *_retval)
125 : {
126 : return NS_ERROR_NOT_IMPLEMENTED;
127 : }
128 :
129 : /* boolean canSetCookie (in nsIURI aURI, in nsIChannel aChannel, in nsICookie2 aCookie, inout boolean aIsSession, inout int64_t aExpiry); */
130 : NS_IMETHODIMP nsCookiePermission::CanSetCookie(nsIURI *aURI, nsIChannel *aChannel, nsICookie2 *aCookie, bool *aIsSession, int64_t *aExpiry, bool *_retval)
131 : {
132 : return NS_ERROR_NOT_IMPLEMENTED;
133 : }
134 :
135 : /* End of implementation class template. */
136 : #endif
137 :
138 : /**
139 : * The nsICookiePermission implementation is an XPCOM service registered
140 : * under the ContractID:
141 : */
142 : #define NS_COOKIEPERMISSION_CONTRACTID "@mozilla.org/cookie/permission;1"
143 :
144 : #endif /* __gen_nsICookiePermission_h__ */
|