toolkit/components/feeds/nsIFeedContainer.idl

Fri, 16 Jan 2015 18:13:44 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Fri, 16 Jan 2015 18:13:44 +0100
branch
TOR_BUG_9701
changeset 14
925c144e1f1f
permissions
-rw-r--r--

Integrate suggestion from review to improve consistency with existing code.

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

mercurial