1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/toolkit/components/feeds/nsIFeedContainer.idl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,85 @@ 1.4 +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +#include "nsIFeedElementBase.idl" 1.10 + 1.11 +interface nsIURI; 1.12 +interface nsIWritablePropertyBag2; 1.13 +interface nsIArray; 1.14 +interface nsIFeedTextConstruct; 1.15 + 1.16 +/** 1.17 + * A shared base for feeds and items, which are pretty similar, 1.18 + * but they have some divergent attributes and require 1.19 + * different convenience methods. 1.20 + */ 1.21 +[scriptable, uuid(577a1b4c-b3d4-4c76-9cf8-753e6606114f)] 1.22 +interface nsIFeedContainer : nsIFeedElementBase 1.23 +{ 1.24 + /** 1.25 + * Many feeds contain an ID distinct from their URI, and 1.26 + * entries have standard fields for this in all major formats. 1.27 + */ 1.28 + attribute AString id; 1.29 + 1.30 + /** 1.31 + * The fields found in the document. Common Atom 1.32 + * and RSS fields are normalized. This includes some namespaced 1.33 + * extensions such as dc:subject and content:encoded. 1.34 + * Consumers can avoid normalization by checking the feed type 1.35 + * and accessing specific fields. 1.36 + * 1.37 + * Common namespaces are accessed using prefixes, like get("dc:subject");. 1.38 + * See nsIFeedResult::registerExtensionPrefix. 1.39 + */ 1.40 + attribute nsIWritablePropertyBag2 fields; 1.41 + 1.42 + /** 1.43 + * Sometimes there's no title, or the title contains markup, so take 1.44 + * care in decoding the attribute. 1.45 + */ 1.46 + attribute nsIFeedTextConstruct title; 1.47 + 1.48 + /** 1.49 + * Returns the primary link for the feed or entry. 1.50 + */ 1.51 + attribute nsIURI link; 1.52 + 1.53 + /** 1.54 + * Returns all links for a feed or entry. 1.55 + */ 1.56 + attribute nsIArray links; 1.57 + 1.58 + /** 1.59 + * Returns the categories found in a feed or entry. 1.60 + */ 1.61 + attribute nsIArray categories; 1.62 + 1.63 + /** 1.64 + * The rights or license associated with a feed or entry. 1.65 + */ 1.66 + attribute nsIFeedTextConstruct rights; 1.67 + 1.68 + /** 1.69 + * A list of nsIFeedPersons that authored the feed. 1.70 + */ 1.71 + attribute nsIArray authors; 1.72 + 1.73 + /** 1.74 + * A list of nsIFeedPersons that contributed to the feed. 1.75 + */ 1.76 + attribute nsIArray contributors; 1.77 + 1.78 + /** 1.79 + * The date the feed was updated, in RFC822 form. Parsable by JS 1.80 + * and mail code. 1.81 + */ 1.82 + attribute AString updated; 1.83 + 1.84 + /** 1.85 + * Syncs a container's fields with its convenience attributes. 1.86 + */ 1.87 + void normalize(); 1.88 +};