|
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- |
|
2 * |
|
3 * This Source Code Form is subject to the terms of the Mozilla Public |
|
4 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
6 |
|
7 #include "nsISupports.idl" |
|
8 |
|
9 /** |
|
10 * An optional interface for accessing the HTTP or |
|
11 * javascript cookie object |
|
12 */ |
|
13 |
|
14 typedef long nsCookieStatus; |
|
15 typedef long nsCookiePolicy; |
|
16 |
|
17 [scriptable, uuid(8684966b-1877-4f0f-8155-be4490b96bf7)] |
|
18 |
|
19 interface nsICookie : nsISupports { |
|
20 |
|
21 /** |
|
22 * the name of the cookie |
|
23 */ |
|
24 readonly attribute ACString name; |
|
25 |
|
26 /** |
|
27 * the cookie value |
|
28 */ |
|
29 readonly attribute AUTF8String value; |
|
30 |
|
31 /** |
|
32 * true if the cookie is a domain cookie, false otherwise |
|
33 */ |
|
34 readonly attribute boolean isDomain; |
|
35 |
|
36 /** |
|
37 * the host (possibly fully qualified) of the cookie |
|
38 */ |
|
39 readonly attribute AUTF8String host; |
|
40 |
|
41 /** |
|
42 * the path pertaining to the cookie |
|
43 */ |
|
44 readonly attribute AUTF8String path; |
|
45 |
|
46 /** |
|
47 * true if the cookie was transmitted over ssl, false otherwise |
|
48 */ |
|
49 readonly attribute boolean isSecure; |
|
50 |
|
51 /** |
|
52 * @DEPRECATED use nsICookie2.expiry and nsICookie2.isSession instead. |
|
53 * |
|
54 * expiration time in seconds since midnight (00:00:00), January 1, 1970 UTC. |
|
55 * expires = 0 represents a session cookie. |
|
56 * expires = 1 represents an expiration time earlier than Jan 1, 1970. |
|
57 */ |
|
58 readonly attribute uint64_t expires; |
|
59 |
|
60 /** |
|
61 * @DEPRECATED status implementation will return STATUS_UNKNOWN in all cases. |
|
62 */ |
|
63 const nsCookieStatus STATUS_UNKNOWN=0; |
|
64 const nsCookieStatus STATUS_ACCEPTED=1; |
|
65 const nsCookieStatus STATUS_DOWNGRADED=2; |
|
66 const nsCookieStatus STATUS_FLAGGED=3; |
|
67 const nsCookieStatus STATUS_REJECTED=4; |
|
68 readonly attribute nsCookieStatus status; |
|
69 |
|
70 /** |
|
71 * @DEPRECATED policy implementation will return POLICY_UNKNOWN in all cases. |
|
72 */ |
|
73 const nsCookiePolicy POLICY_UNKNOWN=0; |
|
74 const nsCookiePolicy POLICY_NONE=1; |
|
75 const nsCookiePolicy POLICY_NO_CONSENT=2; |
|
76 const nsCookiePolicy POLICY_IMPLICIT_CONSENT=3; |
|
77 const nsCookiePolicy POLICY_EXPLICIT_CONSENT=4; |
|
78 const nsCookiePolicy POLICY_NO_II=5; |
|
79 readonly attribute nsCookiePolicy policy; |
|
80 |
|
81 }; |