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