123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257 |
- #ifndef __gen_nsICookie_h__
- #define __gen_nsICookie_h__
- #ifndef __gen_nsISupports_h__
- #include "nsISupports.h"
- #endif
- #ifndef NS_NO_VTABLE
- #define NS_NO_VTABLE
- #endif
- typedef PRInt32 nsCookieStatus;
- typedef PRInt32 nsCookiePolicy;
- #define NS_ICOOKIE_IID_STR "e9fcb9a4-d376-458f-b720-e65e7df593bc"
- #define NS_ICOOKIE_IID \
- {0xe9fcb9a4, 0xd376, 0x458f, \
- { 0xb7, 0x20, 0xe6, 0x5e, 0x7d, 0xf5, 0x93, 0xbc }}
- class NS_NO_VTABLE nsICookie : public nsISupports {
- public:
- NS_DEFINE_STATIC_IID_ACCESSOR(NS_ICOOKIE_IID)
-
-
- NS_IMETHOD GetName(nsACString & aName) = 0;
-
-
- NS_IMETHOD GetValue(nsACString & aValue) = 0;
-
-
- NS_IMETHOD GetIsDomain(PRBool *aIsDomain) = 0;
-
-
- NS_IMETHOD GetHost(nsACString & aHost) = 0;
-
-
- NS_IMETHOD GetPath(nsACString & aPath) = 0;
-
-
- NS_IMETHOD GetIsSecure(PRBool *aIsSecure) = 0;
-
-
- NS_IMETHOD GetExpires(PRUint64 *aExpires) = 0;
-
- enum { STATUS_UNKNOWN = 0 };
- enum { STATUS_ACCEPTED = 1 };
- enum { STATUS_DOWNGRADED = 2 };
- enum { STATUS_FLAGGED = 3 };
- enum { STATUS_REJECTED = 4 };
-
- NS_IMETHOD GetStatus(nsCookieStatus *aStatus) = 0;
-
- enum { POLICY_UNKNOWN = 0 };
- enum { POLICY_NONE = 1 };
- enum { POLICY_NO_CONSENT = 2 };
- enum { POLICY_IMPLICIT_CONSENT = 3 };
- enum { POLICY_EXPLICIT_CONSENT = 4 };
- enum { POLICY_NO_II = 5 };
-
- NS_IMETHOD GetPolicy(nsCookiePolicy *aPolicy) = 0;
- };
- #define NS_DECL_NSICOOKIE \
- NS_IMETHOD GetName(nsACString & aName); \
- NS_IMETHOD GetValue(nsACString & aValue); \
- NS_IMETHOD GetIsDomain(PRBool *aIsDomain); \
- NS_IMETHOD GetHost(nsACString & aHost); \
- NS_IMETHOD GetPath(nsACString & aPath); \
- NS_IMETHOD GetIsSecure(PRBool *aIsSecure); \
- NS_IMETHOD GetExpires(PRUint64 *aExpires); \
- NS_IMETHOD GetStatus(nsCookieStatus *aStatus); \
- NS_IMETHOD GetPolicy(nsCookiePolicy *aPolicy);
- #define NS_FORWARD_NSICOOKIE(_to) \
- NS_IMETHOD GetName(nsACString & aName) { return _to GetName(aName); } \
- NS_IMETHOD GetValue(nsACString & aValue) { return _to GetValue(aValue); } \
- NS_IMETHOD GetIsDomain(PRBool *aIsDomain) { return _to GetIsDomain(aIsDomain); } \
- NS_IMETHOD GetHost(nsACString & aHost) { return _to GetHost(aHost); } \
- NS_IMETHOD GetPath(nsACString & aPath) { return _to GetPath(aPath); } \
- NS_IMETHOD GetIsSecure(PRBool *aIsSecure) { return _to GetIsSecure(aIsSecure); } \
- NS_IMETHOD GetExpires(PRUint64 *aExpires) { return _to GetExpires(aExpires); } \
- NS_IMETHOD GetStatus(nsCookieStatus *aStatus) { return _to GetStatus(aStatus); } \
- NS_IMETHOD GetPolicy(nsCookiePolicy *aPolicy) { return _to GetPolicy(aPolicy); }
- #define NS_FORWARD_SAFE_NSICOOKIE(_to) \
- NS_IMETHOD GetName(nsACString & aName) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetName(aName); } \
- NS_IMETHOD GetValue(nsACString & aValue) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetValue(aValue); } \
- NS_IMETHOD GetIsDomain(PRBool *aIsDomain) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetIsDomain(aIsDomain); } \
- NS_IMETHOD GetHost(nsACString & aHost) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetHost(aHost); } \
- NS_IMETHOD GetPath(nsACString & aPath) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetPath(aPath); } \
- NS_IMETHOD GetIsSecure(PRBool *aIsSecure) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetIsSecure(aIsSecure); } \
- NS_IMETHOD GetExpires(PRUint64 *aExpires) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetExpires(aExpires); } \
- NS_IMETHOD GetStatus(nsCookieStatus *aStatus) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetStatus(aStatus); } \
- NS_IMETHOD GetPolicy(nsCookiePolicy *aPolicy) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetPolicy(aPolicy); }
- #if 0
- class nsCookie : public nsICookie
- {
- public:
- NS_DECL_ISUPPORTS
- NS_DECL_NSICOOKIE
- nsCookie();
- private:
- ~nsCookie();
- protected:
-
- };
- NS_IMPL_ISUPPORTS1(nsCookie, nsICookie)
- nsCookie::nsCookie()
- {
-
- }
- nsCookie::~nsCookie()
- {
-
- }
- NS_IMETHODIMP nsCookie::GetName(nsACString & aName)
- {
- return NS_ERROR_NOT_IMPLEMENTED;
- }
- NS_IMETHODIMP nsCookie::GetValue(nsACString & aValue)
- {
- return NS_ERROR_NOT_IMPLEMENTED;
- }
- NS_IMETHODIMP nsCookie::GetIsDomain(PRBool *aIsDomain)
- {
- return NS_ERROR_NOT_IMPLEMENTED;
- }
- NS_IMETHODIMP nsCookie::GetHost(nsACString & aHost)
- {
- return NS_ERROR_NOT_IMPLEMENTED;
- }
- NS_IMETHODIMP nsCookie::GetPath(nsACString & aPath)
- {
- return NS_ERROR_NOT_IMPLEMENTED;
- }
- NS_IMETHODIMP nsCookie::GetIsSecure(PRBool *aIsSecure)
- {
- return NS_ERROR_NOT_IMPLEMENTED;
- }
- NS_IMETHODIMP nsCookie::GetExpires(PRUint64 *aExpires)
- {
- return NS_ERROR_NOT_IMPLEMENTED;
- }
- NS_IMETHODIMP nsCookie::GetStatus(nsCookieStatus *aStatus)
- {
- return NS_ERROR_NOT_IMPLEMENTED;
- }
- NS_IMETHODIMP nsCookie::GetPolicy(nsCookiePolicy *aPolicy)
- {
- return NS_ERROR_NOT_IMPLEMENTED;
- }
- #endif
- #endif
|