Interface nsIDocumentEncoderType

Hierarchy

Properties

mimeType: string

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

  • Increases the reference count for this interface. The associated instance will not be deleted unless the reference count is returned to zero.

    Returns

    The resulting reference count.

    Returns number

  • Parameters

    • aIID: object
    • Optional aInstancePtr: object

    Returns any

  • A run time mechanism for interface discovery.

    Returns

    NS_OK if the interface is supported by the associated instance, NS_NOINTERFACE if it is not.

    aInstancePtr must not be null.

    Parameters

    • aIID: object

      [in] A requested interface IID

    • aInstancePtr: object

      [out] A pointer to an interface pointer to receive the result.

    Returns void

  • Decreases the reference count for this interface. Generally, if the reference count returns to zero, the associated instance is deleted.

    Returns

    The resulting reference count.

    Returns number

  • Encode the document and send the result to the nsIOutputStream.

    Possible result codes are the stream errors which might have been encountered.

    Parameters

    • aStream: nsIOutputStream

      Stream into which to encode.

    Returns void

  • Encode the document into a string.

    Returns

    The document encoded into a string.

    Returns string

  • Encode the document into a string. Stores the extra context information into the two arguments.

    Returns

    The document encoded as a string.

    Parameters

    • aContextString: string
    • aInfoString: string

    Returns string

  • Encode the document into a string of limited size.

    Returns

    The document encoded into a string.

    Parameters

    • aMaxLength: number

      After aMaxLength characters, the encoder will stop encoding new data. Only values > 0 will be considered. The returned string may be slightly larger than aMaxLength because some serializers (eg. HTML) may need to close some tags after they stop encoding new data, or finish a line (72 columns by default for the plain text serializer).

    Returns string

  • Initialize with a pointer to the document and the mime type. Resets wrap column to 72 and resets node fixup.

    Parameters

    • aDocument: Document

      Document to encode.

    • aMimeType: string

      MimeType to use. May also be set by SetMimeType.

    • aFlags: number

      Flags to use while encoding. May also be set by SetFlags.

    Returns void

  • Parameters

    • aDocument: Document
    • aMimeType: string
    • aFlags: number

    Returns void

  • 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.

    Parameters

    • aCharset: string

      Overrides the both the intrinsic or platform character set when encoding the document.

      Possible result codes: NS_ERROR_NO_CHARSET_CONVERTER

    Returns void

  • 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.

    Parameters

    • aContainer: Node

      The node which child nodes will be encoded.

    Returns void

  • 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.

    Parameters

    • aNode: Node

      The node to encode.

    Returns void

  • Set the fixup object associated with node persistence.

    Parameters

    • aFixup: nsIDocumentEncoderNodeFixup

      The fixup object.

    Returns void

  • 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.

    Parameters

    • aRange: Range

      The range to encode.

    Returns void

  • If the selection is set to a non-null value, then the selection is used for encoding, otherwise the entire document is encoded.

    Parameters

    • aSelection: Selection

      The selection to encode.

    Returns void

  • Set a wrap column. This may have no effect in some types of encoders.

    Parameters

    • aWrapColumn: number

      Column to which to wrap. If 0, wrapping is disabled.

    Returns void

Generated using TypeDoc