nsIDocumentEncoder
| IID: | f85c5a20-258d-11db-a98b-0800200c9a66 |
| Inherits From: | nsISupports |
Constants
Properties
readonly AString mimeType
The mime type preferred by the encoder. This piece of api was added because the copy encoder may need to switch mime types on you if you ask it to copy html that really represents plaintext content. Call this AFTER Init() and SetSelection() have both been called.
Methods
void encodeToStream ( nsIOutputStream stream )
AString encodeToString ( )
AString encodeToStringWithContext ( out AString contextString , out AString infoString )
void init ( nsIDOMDocument document , AString mimeType , PRUint32 flags )
void setCharset ( ACString charset )
void setContainerNode ( nsIDOMNode container )
void setNode ( nsIDOMNode node )
void setNodeFixup ( nsIDocumentEncoderNodeFixup fixup )
void setRange ( nsIDOMRange range )
void setSelection ( nsISelection selection )
void setWrapColumn ( PRUint32 wrapColumn )
void encodeToStream ( nsIOutputStream stream )
Encode the document and send the result to the nsIOutputStream.
Possible result codes are the stream errors which might have been encountered.
- Arguments:
- stream: Stream into which to encode.
Encode the document into a string.
- Returns:
- The document encoded into a string.
AString encodeToStringWithContext ( out AString contextString , out AString infoString )
Encode the document into a string. Stores the extra context information into the two arguments.
- Arguments:
- contextString
- infoString
- Returns:
- The document encoded as a string.
void init ( nsIDOMDocument document , AString mimeType , PRUint32 flags )
Initialize with a pointer to the document and the mime type.
- Arguments:
- document: Document to encode.
- mimeType: MimeType to use. May also be set by SetMimeType.
- flags: Flags to use while encoding. May also be set by SetFlags.
void setCharset ( ACString charset )
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.
Possible result codes: NS_ERROR_NO_CHARSET_CONVERTER
- Arguments:
- charset: Overrides the both the intrinsic or platform character set when encoding the document.
void setContainerNode ( nsIDOMNode container )
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.
- Arguments:
- container: The node which child nodes will be encoded.
void setNode ( nsIDOMNode node )
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.
- Arguments:
- node: The node to encode.
void setNodeFixup ( nsIDocumentEncoderNodeFixup fixup )
Set the fixup object associated with node persistence.
- Arguments:
- fixup: The fixup object.
void setRange ( nsIDOMRange range )
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.
- Arguments:
- range: The range to encode.
void setSelection ( nsISelection selection )
If the selection is set to a non-null value, then the selection is used for encoding, otherwise the entire document is encoded.
- Arguments:
- selection: The selection to encode.
void setWrapColumn ( PRUint32 wrapColumn )
Set a wrap column. This may have no effect in some types of encoders.
- Arguments:
- wrapColumn: Column to which to wrap.
Reference documentation is generated from Mozilla's source.
