interface nsIDocumentEncoder : nsISupports
Output only the selection (as opposed to the whole document).
Plaintext output: Convert html to plaintext that looks like the html. Implies wrap (except inside <pre>), since html wraps. HTML, XHTML and XML output: do prettyprinting, ignoring existing formatting. XML output : it doesn't implicitly wrap
Don't do prettyprinting. Don't do any wrapping that's not in the existing HTML/XML source. This option overrides OutputFormatted if both are set. HTML/XHTML output: If neither are set, there won't be prettyprinting too, but long lines will be wrapped. Supported also in XML and Plaintext output. @note This option does not affect entity conversion.
Output as though the content is preformatted (e.g. maybe it's wrapped in a PRE or PRE_WRAP style tag) Plaintext output only. XXXbz How does this interact with OutputFormatted/OutputRaw/OutputPreformatted/OutputFormatFlowed?
Wrap even if we're not doing formatted output (e.g. for text fields). Supported in XML, XHTML, HTML and Plaintext output. Set implicitly in HTML/XHTML output when no OutputRaw. Ignored when OutputRaw. XXXLJ: set implicitly in HTML/XHTML output, to keep compatible behaviors for old callers of this interface XXXbz How does this interact with OutputFormatFlowed?
Output for format flowed (RFC 2646). This is used when converting to text for mail sending. This differs just slightly but in an important way from normal formatted, and that is that lines are space stuffed. This can't (correctly) be done later. PlainText output only. XXXbz How does this interact with OutputFormatted/OutputRaw/OutputPreformatted/OutputWrap?
Convert links, image src, and script src to absolute URLs when possible. XHTML/HTML output only.
Attempt to encode entities standardized at W3C (HTML, MathML, etc). This is a catch-all flag for documents with mixed contents. Beware of interoperability issues. See below for other flags which might likely do what you want. XHTML/HTML output only.
LineBreak processing: if this flag is set than CR line breaks will be written. If neither this nor OutputLFLineBreak is set, then we will use platform line breaks. The combination of the two flags will cause CRLF line breaks to be written.
LineBreak processing: if this flag is set than LF line breaks will be written. If neither this nor OutputCRLineBreak is set, then we will use platform line breaks. The combination of the two flags will cause CRLF line breaks to be written.
Output the content of noscript elements (only for serializing to plaintext).
Output the content of noframes elements (only for serializing to plaintext).
Don't allow any formatting nodes (e.g. <br>, <b>) inside a <pre>. This is used primarily by mail. XHTML/HTML output only.
Encode entities when outputting to a string. E.g. If set, we'll output if clear, we'll output 0xa0. The basic set is just & < > " for interoperability with older products that don't support α and friends. XHTML/HTML output only.
Encode entities when outputting to a string. The Latin1 entity set additionally includes 8bit accented letters between 128 and 255. XHTML/HTML output only.
Encode entities when outputting to a string. The HTML entity set additionally includes accented letters, greek letters, and other special markup symbols as defined in HTML4. XHTML/HTML output only.
Encode the document and send the result to the nsIOutputStream. Possible result codes are the stream errors which might have been encountered. @param aStream Stream into which to encode.
void encodeToStream(in nsIOutputStream aStream)
Encode the document into a string. @return The document encoded into a string.
Encode the document into a string. Stores the extra context information into the two arguments. @param [OUT] aContextString The string where the parent heirarchy information will be stored. @param [OUT] aInfoString The string where extra context info will be stored. @return The document encoded as a string.
Initialize with a pointer to the document and the mime type. @param aDocument Document to encode. @param aMimeType MimeType to use. May also be set by SetMimeType. @param aFlags Flags to use while encoding. May also be set by SetFlags.
void init(in nsIDOMDocument aDocument, in AString aMimeType, in unsigned long aFlags)
Documents typically have an intrinsic character set, but if no intrinsic value is found, the platform character set is used. This function overrides both the intrinisc and platform charset. @param aCharset Overrides the both the intrinsic or platform character set when encoding the document. Possible result codes: NS_ERROR_NO_CHARSET_CONVERTER
If the container is set to a non-null value, then its child nodes are used for encoding, otherwise the entire document or range or selection or node is encoded. @param aContainer The node which child nodes will be encoded.
void setContainerNode(in nsIDOMNode aContainer)
If the node is set to a non-null value, then the node is used for encoding, otherwise the entire document or range or selection is encoded. @param aNode The node to encode.
void setNode(in nsIDOMNode aNode)
Set the fixup object associated with node persistence. @param aFixup The fixup object.
void setNodeFixup(in nsIDocumentEncoderNodeFixup aFixup)
If the range is set to a non-null value, then the range is used for encoding, otherwise the entire document or selection is encoded. @param aRange The range to encode.
void setRange(in nsIDOMRange aRange)
If the selection is set to a non-null value, then the selection is used for encoding, otherwise the entire document is encoded. @param aSelection The selection to encode.
void setSelection(in nsISelection aSelection)