nsIFeedTextConstruct.idl 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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 "nsISupports.idl"
  6. interface nsIURI;
  7. interface nsIDOMElement;
  8. interface nsIDOMDocumentFragment;
  9. /**
  10. * nsIFeedTextConstructs represent feed text fields that can contain
  11. * one of text, HTML, or XHTML. Some extension elements also have "type"
  12. * parameters, and this interface could be used there as well.
  13. */
  14. [scriptable, uuid(fc97a2a9-d649-4494-931e-db81a156c873)]
  15. interface nsIFeedTextConstruct : nsISupports
  16. {
  17. /**
  18. * If the text construct contains (X)HTML, relative references in
  19. * the content should be resolved against this base URI.
  20. */
  21. attribute nsIURI base;
  22. /**
  23. * The language of the text. For example, "en-US" for US English.
  24. */
  25. attribute AString lang;
  26. /**
  27. * One of "text", "html", or "xhtml". If the type is (x)html, a '<'
  28. * character represents markup. To display that character, an escape
  29. * such as &lt; must be used. If the type is "text", the '<'
  30. * character represents the character itself, and such text should
  31. * not be embedded in markup without escaping it first.
  32. */
  33. attribute AString type;
  34. /**
  35. * The content of the text construct.
  36. */
  37. attribute AString text;
  38. /**
  39. * Returns the text of the text construct, with all markup stripped
  40. * and all entities decoded. If the type attribute's value is "text",
  41. * this function returns the value of the text attribute unchanged.
  42. */
  43. AString plainText();
  44. /**
  45. * Return an nsIDocumentFragment containing the text and markup.
  46. */
  47. nsIDOMDocumentFragment createDocumentFragment(in nsIDOMElement element);
  48. };