nsIFeedContainer.idl 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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. #include "nsIFeedElementBase.idl"
  6. interface nsIURI;
  7. interface nsIWritablePropertyBag2;
  8. interface nsIArray;
  9. interface nsIFeedTextConstruct;
  10. /**
  11. * A shared base for feeds and items, which are pretty similar,
  12. * but they have some divergent attributes and require
  13. * different convenience methods.
  14. */
  15. [scriptable, uuid(577a1b4c-b3d4-4c76-9cf8-753e6606114f)]
  16. interface nsIFeedContainer : nsIFeedElementBase
  17. {
  18. /**
  19. * Many feeds contain an ID distinct from their URI, and
  20. * entries have standard fields for this in all major formats.
  21. */
  22. attribute AString id;
  23. /**
  24. * The fields found in the document. Common Atom
  25. * and RSS fields are normalized. This includes some namespaced
  26. * extensions such as dc:subject and content:encoded.
  27. * Consumers can avoid normalization by checking the feed type
  28. * and accessing specific fields.
  29. *
  30. * Common namespaces are accessed using prefixes, like get("dc:subject");.
  31. * See nsIFeedResult::registerExtensionPrefix.
  32. */
  33. attribute nsIWritablePropertyBag2 fields;
  34. /**
  35. * Sometimes there's no title, or the title contains markup, so take
  36. * care in decoding the attribute.
  37. */
  38. attribute nsIFeedTextConstruct title;
  39. /**
  40. * Returns the primary link for the feed or entry.
  41. */
  42. attribute nsIURI link;
  43. /**
  44. * Returns all links for a feed or entry.
  45. */
  46. attribute nsIArray links;
  47. /**
  48. * Returns the categories found in a feed or entry.
  49. */
  50. attribute nsIArray categories;
  51. /**
  52. * The rights or license associated with a feed or entry.
  53. */
  54. attribute nsIFeedTextConstruct rights;
  55. /**
  56. * A list of nsIFeedPersons that authored the feed.
  57. */
  58. attribute nsIArray authors;
  59. /**
  60. * A list of nsIFeedPersons that contributed to the feed.
  61. */
  62. attribute nsIArray contributors;
  63. /**
  64. * The date the feed was updated, in RFC822 form. Parsable by JS
  65. * and mail code.
  66. */
  67. attribute AString updated;
  68. /**
  69. * Syncs a container's fields with its convenience attributes.
  70. */
  71. void normalize();
  72. };