nsICookie.h 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257
  1. /*
  2. * DO NOT EDIT. THIS FILE IS GENERATED FROM c:/mozilla/netwerk/cookie/public/nsICookie.idl
  3. */
  4. #ifndef __gen_nsICookie_h__
  5. #define __gen_nsICookie_h__
  6. #ifndef __gen_nsISupports_h__
  7. #include "nsISupports.h"
  8. #endif
  9. /* For IDL files that don't want to include root IDL files. */
  10. #ifndef NS_NO_VTABLE
  11. #define NS_NO_VTABLE
  12. #endif
  13. /**
  14. * An optional interface for accessing the HTTP or
  15. * javascript cookie object
  16. *
  17. * @status FROZEN
  18. */
  19. typedef PRInt32 nsCookieStatus;
  20. typedef PRInt32 nsCookiePolicy;
  21. /* starting interface: nsICookie */
  22. #define NS_ICOOKIE_IID_STR "e9fcb9a4-d376-458f-b720-e65e7df593bc"
  23. #define NS_ICOOKIE_IID \
  24. {0xe9fcb9a4, 0xd376, 0x458f, \
  25. { 0xb7, 0x20, 0xe6, 0x5e, 0x7d, 0xf5, 0x93, 0xbc }}
  26. class NS_NO_VTABLE nsICookie : public nsISupports {
  27. public:
  28. NS_DEFINE_STATIC_IID_ACCESSOR(NS_ICOOKIE_IID)
  29. /**
  30. * the name of the cookie
  31. */
  32. /* readonly attribute ACString name; */
  33. NS_IMETHOD GetName(nsACString & aName) = 0;
  34. /**
  35. * the cookie value
  36. */
  37. /* readonly attribute ACString value; */
  38. NS_IMETHOD GetValue(nsACString & aValue) = 0;
  39. /**
  40. * true if the cookie is a domain cookie, false otherwise
  41. */
  42. /* readonly attribute boolean isDomain; */
  43. NS_IMETHOD GetIsDomain(PRBool *aIsDomain) = 0;
  44. /**
  45. * the host (possibly fully qualified) of the cookie
  46. */
  47. /* readonly attribute AUTF8String host; */
  48. NS_IMETHOD GetHost(nsACString & aHost) = 0;
  49. /**
  50. * the path pertaining to the cookie
  51. */
  52. /* readonly attribute AUTF8String path; */
  53. NS_IMETHOD GetPath(nsACString & aPath) = 0;
  54. /**
  55. * true if the cookie was transmitted over ssl, false otherwise
  56. */
  57. /* readonly attribute boolean isSecure; */
  58. NS_IMETHOD GetIsSecure(PRBool *aIsSecure) = 0;
  59. /**
  60. * expiration time (local timezone) expressed as number of seconds since Jan 1, 1970
  61. */
  62. /* readonly attribute PRUint64 expires; */
  63. NS_IMETHOD GetExpires(PRUint64 *aExpires) = 0;
  64. /**
  65. * P3P status of cookie. Values are
  66. *
  67. * STATUS_UNKNOWN -- cookie collected in a previous session and this info no longer available
  68. * STATUS_ACCEPTED -- cookie was accepted as it
  69. * STATUS_DOWNGRADED -- cookie was accepted but downgraded to a session cookie
  70. * STATUS_FLAGGED -- cookie was accepted with a warning being issued to the user
  71. * STATUS_REJECTED -- cookie was not accepted
  72. */
  73. enum { STATUS_UNKNOWN = 0 };
  74. enum { STATUS_ACCEPTED = 1 };
  75. enum { STATUS_DOWNGRADED = 2 };
  76. enum { STATUS_FLAGGED = 3 };
  77. enum { STATUS_REJECTED = 4 };
  78. /* readonly attribute nsCookieStatus status; */
  79. NS_IMETHOD GetStatus(nsCookieStatus *aStatus) = 0;
  80. /**
  81. * Site's compact policy. Values are
  82. *
  83. * POLICY_UNKNOWN -- cookie collected in a previous session and this info no longer available
  84. * POLICY_NONE -- site did not send a compact policy along with the cookie
  85. * POLICY_NO_CONSENT -- site collects identfiable information without user involvement
  86. * POLICY_IMPLICIT_CONSENT -- site collects identifiable information unless user opts out
  87. * POLICY_EXPLICIT_CONSENT -- site does not collect identifiable information unless user opts in
  88. * POLICY_NO_II -- site does not collect identifiable information
  89. */
  90. enum { POLICY_UNKNOWN = 0 };
  91. enum { POLICY_NONE = 1 };
  92. enum { POLICY_NO_CONSENT = 2 };
  93. enum { POLICY_IMPLICIT_CONSENT = 3 };
  94. enum { POLICY_EXPLICIT_CONSENT = 4 };
  95. enum { POLICY_NO_II = 5 };
  96. /* readonly attribute nsCookiePolicy policy; */
  97. NS_IMETHOD GetPolicy(nsCookiePolicy *aPolicy) = 0;
  98. };
  99. /* Use this macro when declaring classes that implement this interface. */
  100. #define NS_DECL_NSICOOKIE \
  101. NS_IMETHOD GetName(nsACString & aName); \
  102. NS_IMETHOD GetValue(nsACString & aValue); \
  103. NS_IMETHOD GetIsDomain(PRBool *aIsDomain); \
  104. NS_IMETHOD GetHost(nsACString & aHost); \
  105. NS_IMETHOD GetPath(nsACString & aPath); \
  106. NS_IMETHOD GetIsSecure(PRBool *aIsSecure); \
  107. NS_IMETHOD GetExpires(PRUint64 *aExpires); \
  108. NS_IMETHOD GetStatus(nsCookieStatus *aStatus); \
  109. NS_IMETHOD GetPolicy(nsCookiePolicy *aPolicy);
  110. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  111. #define NS_FORWARD_NSICOOKIE(_to) \
  112. NS_IMETHOD GetName(nsACString & aName) { return _to GetName(aName); } \
  113. NS_IMETHOD GetValue(nsACString & aValue) { return _to GetValue(aValue); } \
  114. NS_IMETHOD GetIsDomain(PRBool *aIsDomain) { return _to GetIsDomain(aIsDomain); } \
  115. NS_IMETHOD GetHost(nsACString & aHost) { return _to GetHost(aHost); } \
  116. NS_IMETHOD GetPath(nsACString & aPath) { return _to GetPath(aPath); } \
  117. NS_IMETHOD GetIsSecure(PRBool *aIsSecure) { return _to GetIsSecure(aIsSecure); } \
  118. NS_IMETHOD GetExpires(PRUint64 *aExpires) { return _to GetExpires(aExpires); } \
  119. NS_IMETHOD GetStatus(nsCookieStatus *aStatus) { return _to GetStatus(aStatus); } \
  120. NS_IMETHOD GetPolicy(nsCookiePolicy *aPolicy) { return _to GetPolicy(aPolicy); }
  121. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  122. #define NS_FORWARD_SAFE_NSICOOKIE(_to) \
  123. NS_IMETHOD GetName(nsACString & aName) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetName(aName); } \
  124. NS_IMETHOD GetValue(nsACString & aValue) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetValue(aValue); } \
  125. NS_IMETHOD GetIsDomain(PRBool *aIsDomain) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetIsDomain(aIsDomain); } \
  126. NS_IMETHOD GetHost(nsACString & aHost) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetHost(aHost); } \
  127. NS_IMETHOD GetPath(nsACString & aPath) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetPath(aPath); } \
  128. NS_IMETHOD GetIsSecure(PRBool *aIsSecure) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetIsSecure(aIsSecure); } \
  129. NS_IMETHOD GetExpires(PRUint64 *aExpires) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetExpires(aExpires); } \
  130. NS_IMETHOD GetStatus(nsCookieStatus *aStatus) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetStatus(aStatus); } \
  131. NS_IMETHOD GetPolicy(nsCookiePolicy *aPolicy) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetPolicy(aPolicy); }
  132. #if 0
  133. /* Use the code below as a template for the implementation class for this interface. */
  134. /* Header file */
  135. class nsCookie : public nsICookie
  136. {
  137. public:
  138. NS_DECL_ISUPPORTS
  139. NS_DECL_NSICOOKIE
  140. nsCookie();
  141. private:
  142. ~nsCookie();
  143. protected:
  144. /* additional members */
  145. };
  146. /* Implementation file */
  147. NS_IMPL_ISUPPORTS1(nsCookie, nsICookie)
  148. nsCookie::nsCookie()
  149. {
  150. /* member initializers and constructor code */
  151. }
  152. nsCookie::~nsCookie()
  153. {
  154. /* destructor code */
  155. }
  156. /* readonly attribute ACString name; */
  157. NS_IMETHODIMP nsCookie::GetName(nsACString & aName)
  158. {
  159. return NS_ERROR_NOT_IMPLEMENTED;
  160. }
  161. /* readonly attribute ACString value; */
  162. NS_IMETHODIMP nsCookie::GetValue(nsACString & aValue)
  163. {
  164. return NS_ERROR_NOT_IMPLEMENTED;
  165. }
  166. /* readonly attribute boolean isDomain; */
  167. NS_IMETHODIMP nsCookie::GetIsDomain(PRBool *aIsDomain)
  168. {
  169. return NS_ERROR_NOT_IMPLEMENTED;
  170. }
  171. /* readonly attribute AUTF8String host; */
  172. NS_IMETHODIMP nsCookie::GetHost(nsACString & aHost)
  173. {
  174. return NS_ERROR_NOT_IMPLEMENTED;
  175. }
  176. /* readonly attribute AUTF8String path; */
  177. NS_IMETHODIMP nsCookie::GetPath(nsACString & aPath)
  178. {
  179. return NS_ERROR_NOT_IMPLEMENTED;
  180. }
  181. /* readonly attribute boolean isSecure; */
  182. NS_IMETHODIMP nsCookie::GetIsSecure(PRBool *aIsSecure)
  183. {
  184. return NS_ERROR_NOT_IMPLEMENTED;
  185. }
  186. /* readonly attribute PRUint64 expires; */
  187. NS_IMETHODIMP nsCookie::GetExpires(PRUint64 *aExpires)
  188. {
  189. return NS_ERROR_NOT_IMPLEMENTED;
  190. }
  191. /* readonly attribute nsCookieStatus status; */
  192. NS_IMETHODIMP nsCookie::GetStatus(nsCookieStatus *aStatus)
  193. {
  194. return NS_ERROR_NOT_IMPLEMENTED;
  195. }
  196. /* readonly attribute nsCookiePolicy policy; */
  197. NS_IMETHODIMP nsCookie::GetPolicy(nsCookiePolicy *aPolicy)
  198. {
  199. return NS_ERROR_NOT_IMPLEMENTED;
  200. }
  201. /* End of implementation class template. */
  202. #endif
  203. #endif /* __gen_nsICookie_h__ */