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 "nsISupports.idl" michael@0: michael@0: interface nsIURI; michael@0: interface nsIDOMElement; michael@0: interface nsIDOMDocumentFragment; michael@0: michael@0: /** michael@0: * nsIFeedTextConstructs represent feed text fields that can contain michael@0: * one of text, HTML, or XHTML. Some extension elements also have "type" michael@0: * parameters, and this interface could be used there as well. michael@0: */ michael@0: [scriptable, uuid(fc97a2a9-d649-4494-931e-db81a156c873)] michael@0: interface nsIFeedTextConstruct : nsISupports michael@0: { michael@0: /** michael@0: * If the text construct contains (X)HTML, relative references in michael@0: * the content should be resolved against this base URI. michael@0: */ michael@0: attribute nsIURI base; michael@0: michael@0: /** michael@0: * The language of the text. For example, "en-US" for US English. michael@0: */ michael@0: attribute AString lang; michael@0: michael@0: /** michael@0: * One of "text", "html", or "xhtml". If the type is (x)html, a '<' michael@0: * character represents markup. To display that character, an escape michael@0: * such as < must be used. If the type is "text", the '<' michael@0: * character represents the character itself, and such text should michael@0: * not be embedded in markup without escaping it first. michael@0: */ michael@0: attribute AString type; michael@0: michael@0: /** michael@0: * The content of the text construct. michael@0: */ michael@0: attribute AString text; michael@0: michael@0: /** michael@0: * Returns the text of the text construct, with all markup stripped michael@0: * and all entities decoded. If the type attribute's value is "text", michael@0: * this function returns the value of the text attribute unchanged. michael@0: */ michael@0: AString plainText(); michael@0: michael@0: /** michael@0: * Return an nsIDocumentFragment containing the text and markup. michael@0: */ michael@0: nsIDOMDocumentFragment createDocumentFragment(in nsIDOMElement element); michael@0: }; michael@0: