|
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
|
2 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
3 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
5 |
|
6 #include "nsIFeedElementBase.idl" |
|
7 |
|
8 interface nsIURI; |
|
9 interface nsIWritablePropertyBag2; |
|
10 interface nsIArray; |
|
11 interface nsIFeedTextConstruct; |
|
12 |
|
13 /** |
|
14 * A shared base for feeds and items, which are pretty similar, |
|
15 * but they have some divergent attributes and require |
|
16 * different convenience methods. |
|
17 */ |
|
18 [scriptable, uuid(577a1b4c-b3d4-4c76-9cf8-753e6606114f)] |
|
19 interface nsIFeedContainer : nsIFeedElementBase |
|
20 { |
|
21 /** |
|
22 * Many feeds contain an ID distinct from their URI, and |
|
23 * entries have standard fields for this in all major formats. |
|
24 */ |
|
25 attribute AString id; |
|
26 |
|
27 /** |
|
28 * The fields found in the document. Common Atom |
|
29 * and RSS fields are normalized. This includes some namespaced |
|
30 * extensions such as dc:subject and content:encoded. |
|
31 * Consumers can avoid normalization by checking the feed type |
|
32 * and accessing specific fields. |
|
33 * |
|
34 * Common namespaces are accessed using prefixes, like get("dc:subject");. |
|
35 * See nsIFeedResult::registerExtensionPrefix. |
|
36 */ |
|
37 attribute nsIWritablePropertyBag2 fields; |
|
38 |
|
39 /** |
|
40 * Sometimes there's no title, or the title contains markup, so take |
|
41 * care in decoding the attribute. |
|
42 */ |
|
43 attribute nsIFeedTextConstruct title; |
|
44 |
|
45 /** |
|
46 * Returns the primary link for the feed or entry. |
|
47 */ |
|
48 attribute nsIURI link; |
|
49 |
|
50 /** |
|
51 * Returns all links for a feed or entry. |
|
52 */ |
|
53 attribute nsIArray links; |
|
54 |
|
55 /** |
|
56 * Returns the categories found in a feed or entry. |
|
57 */ |
|
58 attribute nsIArray categories; |
|
59 |
|
60 /** |
|
61 * The rights or license associated with a feed or entry. |
|
62 */ |
|
63 attribute nsIFeedTextConstruct rights; |
|
64 |
|
65 /** |
|
66 * A list of nsIFeedPersons that authored the feed. |
|
67 */ |
|
68 attribute nsIArray authors; |
|
69 |
|
70 /** |
|
71 * A list of nsIFeedPersons that contributed to the feed. |
|
72 */ |
|
73 attribute nsIArray contributors; |
|
74 |
|
75 /** |
|
76 * The date the feed was updated, in RFC822 form. Parsable by JS |
|
77 * and mail code. |
|
78 */ |
|
79 attribute AString updated; |
|
80 |
|
81 /** |
|
82 * Syncs a container's fields with its convenience attributes. |
|
83 */ |
|
84 void normalize(); |
|
85 }; |