nsICookie.idl 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
  2. *
  3. * ***** BEGIN LICENSE BLOCK *****
  4. * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  5. *
  6. * The contents of this file are subject to the Mozilla Public License Version
  7. * 1.1 (the "License"); you may not use this file except in compliance with
  8. * the License. You may obtain a copy of the License at
  9. * http://www.mozilla.org/MPL/
  10. *
  11. * Software distributed under the License is distributed on an "AS IS" basis,
  12. * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  13. * for the specific language governing rights and limitations under the
  14. * License.
  15. *
  16. * The Original Code is mozilla.org code.
  17. *
  18. * The Initial Developer of the Original Code is
  19. * Netscape Communications, Inc.
  20. * Portions created by the Initial Developer are Copyright (C) 2001
  21. * the Initial Developer. All Rights Reserved.
  22. *
  23. * Contributor(s):
  24. *
  25. * Alternatively, the contents of this file may be used under the terms of
  26. * either the GNU General Public License Version 2 or later (the "GPL"), or
  27. * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  28. * in which case the provisions of the GPL or the LGPL are applicable instead
  29. * of those above. If you wish to allow use of your version of this file only
  30. * under the terms of either the GPL or the LGPL, and not to allow others to
  31. * use your version of this file under the terms of the MPL, indicate your
  32. * decision by deleting the provisions above and replace them with the notice
  33. * and other provisions required by the GPL or the LGPL. If you do not delete
  34. * the provisions above, a recipient may use your version of this file under
  35. * the terms of any one of the MPL, the GPL or the LGPL.
  36. *
  37. * ***** END LICENSE BLOCK ***** */
  38. #include "nsISupports.idl"
  39. /**
  40. * An optional interface for accessing the HTTP or
  41. * javascript cookie object
  42. *
  43. * @status FROZEN
  44. */
  45. typedef long nsCookieStatus;
  46. typedef long nsCookiePolicy;
  47. [scriptable, uuid(E9FCB9A4-D376-458f-B720-E65E7DF593BC)]
  48. interface nsICookie : nsISupports {
  49. /**
  50. * the name of the cookie
  51. */
  52. readonly attribute ACString name;
  53. /**
  54. * the cookie value
  55. */
  56. readonly attribute ACString value;
  57. /**
  58. * true if the cookie is a domain cookie, false otherwise
  59. */
  60. readonly attribute boolean isDomain;
  61. /**
  62. * the host (possibly fully qualified) of the cookie
  63. */
  64. readonly attribute AUTF8String host;
  65. /**
  66. * the path pertaining to the cookie
  67. */
  68. readonly attribute AUTF8String path;
  69. /**
  70. * true if the cookie was transmitted over ssl, false otherwise
  71. */
  72. readonly attribute boolean isSecure;
  73. /**
  74. * expiration time (local timezone) expressed as number of seconds since Jan 1, 1970
  75. */
  76. readonly attribute PRUint64 expires;
  77. /**
  78. * P3P status of cookie. Values are
  79. *
  80. * STATUS_UNKNOWN -- cookie collected in a previous session and this info no longer available
  81. * STATUS_ACCEPTED -- cookie was accepted as it
  82. * STATUS_DOWNGRADED -- cookie was accepted but downgraded to a session cookie
  83. * STATUS_FLAGGED -- cookie was accepted with a warning being issued to the user
  84. * STATUS_REJECTED -- cookie was not accepted
  85. */
  86. const nsCookieStatus STATUS_UNKNOWN=0;
  87. const nsCookieStatus STATUS_ACCEPTED=1;
  88. const nsCookieStatus STATUS_DOWNGRADED=2;
  89. const nsCookieStatus STATUS_FLAGGED=3;
  90. const nsCookieStatus STATUS_REJECTED=4;
  91. readonly attribute nsCookieStatus status;
  92. /**
  93. * Site's compact policy. Values are
  94. *
  95. * POLICY_UNKNOWN -- cookie collected in a previous session and this info no longer available
  96. * POLICY_NONE -- site did not send a compact policy along with the cookie
  97. * POLICY_NO_CONSENT -- site collects identfiable information without user involvement
  98. * POLICY_IMPLICIT_CONSENT -- site collects identifiable information unless user opts out
  99. * POLICY_EXPLICIT_CONSENT -- site does not collect identifiable information unless user opts in
  100. * POLICY_NO_II -- site does not collect identifiable information
  101. */
  102. const nsCookiePolicy POLICY_UNKNOWN=0;
  103. const nsCookiePolicy POLICY_NONE=1;
  104. const nsCookiePolicy POLICY_NO_CONSENT=2;
  105. const nsCookiePolicy POLICY_IMPLICIT_CONSENT=3;
  106. const nsCookiePolicy POLICY_EXPLICIT_CONSENT=4;
  107. const nsCookiePolicy POLICY_NO_II=5;
  108. readonly attribute nsCookiePolicy policy;
  109. };