michael@0: /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "nsIFeedElementBase.idl" michael@0: michael@0: interface nsIURI; michael@0: interface nsIWritablePropertyBag2; michael@0: interface nsIArray; michael@0: interface nsIFeedTextConstruct; michael@0: michael@0: /** michael@0: * A shared base for feeds and items, which are pretty similar, michael@0: * but they have some divergent attributes and require michael@0: * different convenience methods. michael@0: */ michael@0: [scriptable, uuid(577a1b4c-b3d4-4c76-9cf8-753e6606114f)] michael@0: interface nsIFeedContainer : nsIFeedElementBase michael@0: { michael@0: /** michael@0: * Many feeds contain an ID distinct from their URI, and michael@0: * entries have standard fields for this in all major formats. michael@0: */ michael@0: attribute AString id; michael@0: michael@0: /** michael@0: * The fields found in the document. Common Atom michael@0: * and RSS fields are normalized. This includes some namespaced michael@0: * extensions such as dc:subject and content:encoded. michael@0: * Consumers can avoid normalization by checking the feed type michael@0: * and accessing specific fields. michael@0: * michael@0: * Common namespaces are accessed using prefixes, like get("dc:subject");. michael@0: * See nsIFeedResult::registerExtensionPrefix. michael@0: */ michael@0: attribute nsIWritablePropertyBag2 fields; michael@0: michael@0: /** michael@0: * Sometimes there's no title, or the title contains markup, so take michael@0: * care in decoding the attribute. michael@0: */ michael@0: attribute nsIFeedTextConstruct title; michael@0: michael@0: /** michael@0: * Returns the primary link for the feed or entry. michael@0: */ michael@0: attribute nsIURI link; michael@0: michael@0: /** michael@0: * Returns all links for a feed or entry. michael@0: */ michael@0: attribute nsIArray links; michael@0: michael@0: /** michael@0: * Returns the categories found in a feed or entry. michael@0: */ michael@0: attribute nsIArray categories; michael@0: michael@0: /** michael@0: * The rights or license associated with a feed or entry. michael@0: */ michael@0: attribute nsIFeedTextConstruct rights; michael@0: michael@0: /** michael@0: * A list of nsIFeedPersons that authored the feed. michael@0: */ michael@0: attribute nsIArray authors; michael@0: michael@0: /** michael@0: * A list of nsIFeedPersons that contributed to the feed. michael@0: */ michael@0: attribute nsIArray contributors; michael@0: michael@0: /** michael@0: * The date the feed was updated, in RFC822 form. Parsable by JS michael@0: * and mail code. michael@0: */ michael@0: attribute AString updated; michael@0: michael@0: /** michael@0: * Syncs a container's fields with its convenience attributes. michael@0: */ michael@0: void normalize(); michael@0: };