toolkit/components/feeds/nsIFeedTextConstruct.idl

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/toolkit/components/feeds/nsIFeedTextConstruct.idl	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,57 @@
     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 "nsISupports.idl"
    1.10 +
    1.11 +interface nsIURI;
    1.12 +interface nsIDOMElement;
    1.13 +interface nsIDOMDocumentFragment;
    1.14 +
    1.15 +/**
    1.16 + * nsIFeedTextConstructs represent feed text fields that can contain
    1.17 + * one of text, HTML, or XHTML. Some extension elements also have "type"
    1.18 + * parameters, and this interface could be used there as well.
    1.19 + */ 
    1.20 +[scriptable, uuid(fc97a2a9-d649-4494-931e-db81a156c873)]
    1.21 +interface nsIFeedTextConstruct : nsISupports 
    1.22 +{
    1.23 +  /**
    1.24 +   * If the text construct contains (X)HTML, relative references in
    1.25 +   * the content should be resolved against this base URI.
    1.26 +   */
    1.27 +  attribute nsIURI base;
    1.28 +
    1.29 +  /**
    1.30 +   * The language of the text. For example, "en-US" for US English.
    1.31 +   */
    1.32 +  attribute AString lang;
    1.33 +
    1.34 +  /**
    1.35 +   * One of "text", "html", or "xhtml". If the type is (x)html, a '<'
    1.36 +   * character represents markup. To display that character, an escape
    1.37 +   * such as &lt; must be used. If the type is "text", the '<'
    1.38 +   * character represents the character itself, and such text should
    1.39 +   * not be embedded in markup without escaping it first.
    1.40 +   */
    1.41 +  attribute AString type;
    1.42 +
    1.43 +  /**
    1.44 +   * The content of the text construct.
    1.45 +   */
    1.46 +  attribute AString text;
    1.47 +
    1.48 +  /**
    1.49 +   * Returns the text of the text construct, with all markup stripped 
    1.50 +   * and all entities decoded. If the type attribute's value is "text",
    1.51 +   * this function returns the value of the text attribute unchanged.
    1.52 +   */
    1.53 +  AString plainText();
    1.54 +
    1.55 +  /**
    1.56 +   * Return an nsIDocumentFragment containing the text and markup.
    1.57 +   */
    1.58 +  nsIDOMDocumentFragment createDocumentFragment(in nsIDOMElement element);
    1.59 +};
    1.60 + 

mercurial