GMimeEnrichedToHtml

GMimeEnrichedToHtml — Bounded streaming text/enriched conversion

Functions

Types and Values

Description

Implements MimeKit's RFC 1896 command, parameter, and formatting model. Unknown commands retain their nesting without emitting arbitrary markup. Parameter values are validated before use in CSS or language attributes. Input, parameter, and output limits count Unicode scalar values; output limits include wrappers, escaped content, headers, and footers. CRLF and CR are normalized to LF during parsing.

Functions

g_mime_enriched_to_html_new ()

GMimeTextConverter *
g_mime_enriched_to_html_new (void);

Creates an RFC 1896 text/enriched to HTML converter. By default, the output includes html and body wrappers, and headers and footers are interpreted as plain text.


g_mime_enriched_to_html_get_output_html_fragment ()

gboolean
g_mime_enriched_to_html_get_output_html_fragment
                               (GMimeEnrichedToHtml *converter);

Gets whether the generated html and body wrappers are omitted.

Parameters

converter

a GMimeEnrichedToHtml

 

Returns

TRUE for fragment output, or FALSE for document output (the default).


g_mime_enriched_to_html_set_output_html_fragment ()

void
g_mime_enriched_to_html_set_output_html_fragment
                               (GMimeEnrichedToHtml *converter,
                                gboolean value);

Selects fragment or document output. The div used to preserve whitespace, as well as configured headers and footers, is included in either mode. This setting cannot be changed during conversion.

Parameters

converter

a GMimeEnrichedToHtml

 

value

whether to omit the generated html and body wrappers

 

g_mime_enriched_to_html_get_header_format ()

GMimeHeaderFooterFormat
g_mime_enriched_to_html_get_header_format
                               (GMimeEnrichedToHtml *converter);

Gets how the configured header is interpreted.

Parameters

converter

a GMimeEnrichedToHtml

 

Returns

the header format, initially GMIME_HEADER_FOOTER_FORMAT_TEXT.


g_mime_enriched_to_html_set_header_format ()

void
g_mime_enriched_to_html_set_header_format
                               (GMimeEnrichedToHtml *converter,
                                GMimeHeaderFooterFormat value);

Selects how the header set by g_mime_text_converter_set_header() is written. Text is converted as plain text, not enriched text. HTML is copied verbatim and is not sanitized. This setting cannot be changed during conversion.

Parameters

converter

a GMimeEnrichedToHtml

 

value

the format of the configured header

 

g_mime_enriched_to_html_get_footer_format ()

GMimeHeaderFooterFormat
g_mime_enriched_to_html_get_footer_format
                               (GMimeEnrichedToHtml *converter);

Gets how the configured footer is interpreted.

Parameters

converter

a GMimeEnrichedToHtml

 

Returns

the footer format, initially GMIME_HEADER_FOOTER_FORMAT_TEXT.


g_mime_enriched_to_html_set_footer_format ()

void
g_mime_enriched_to_html_set_footer_format
                               (GMimeEnrichedToHtml *converter,
                                GMimeHeaderFooterFormat value);

Selects how the footer set by g_mime_text_converter_set_footer() is written. Text is converted as plain text, not enriched text. HTML is copied verbatim and is not sanitized. This setting cannot be changed during conversion.

Parameters

converter

a GMimeEnrichedToHtml

 

value

the format of the configured footer

 

g_mime_enriched_to_html_get_max_element_depth ()

guint
g_mime_enriched_to_html_get_max_element_depth
                               (GMimeEnrichedToHtml *converter);

Gets the maximum nesting depth of enriched commands, including unknown commands and nested parameters.

Parameters

converter

a GMimeEnrichedToHtml

 

Returns

the nesting limit, initially 4096.


g_mime_enriched_to_html_set_max_element_depth ()

void
g_mime_enriched_to_html_set_max_element_depth
                               (GMimeEnrichedToHtml *converter,
                                guint value);

Limits enriched command and parameter nesting. Exceeding the limit causes conversion to fail with GMIME_ERROR_PARSE_ERROR. This setting cannot be changed during conversion.

Parameters

converter

a GMimeEnrichedToHtml

 

value

the maximum nesting depth, greater than zero

 

g_mime_enriched_to_html_get_max_parameter_length ()

guint
g_mime_enriched_to_html_get_max_parameter_length
                               (GMimeEnrichedToHtml *converter);

Gets the maximum length of an enriched command parameter, measured in Unicode scalar values rather than bytes or UTF-16 code units.

Parameters

converter

a GMimeEnrichedToHtml

 

Returns

the parameter length limit, initially 4096.


g_mime_enriched_to_html_set_max_parameter_length ()

void
g_mime_enriched_to_html_set_max_parameter_length
                               (GMimeEnrichedToHtml *converter,
                                guint value);

Limits the text in each enriched command parameter. Exceeding the limit causes conversion to fail with GMIME_ERROR_PARSE_ERROR. This setting cannot be changed during conversion.

Parameters

converter

a GMimeEnrichedToHtml

 

value

the maximum parameter length in Unicode scalar values, greater than zero

 

g_mime_enriched_to_html_get_max_input_length ()

gsize
g_mime_enriched_to_html_get_max_input_length
                               (GMimeEnrichedToHtml *converter);

Gets the input length limit in Unicode scalar values, including enriched markup but excluding the configured header and footer.

Parameters

converter

a GMimeEnrichedToHtml

 

Returns

the input length limit, initially 16 * 1024 * 1024.


g_mime_enriched_to_html_set_max_input_length ()

void
g_mime_enriched_to_html_set_max_input_length
                               (GMimeEnrichedToHtml *converter,
                                gsize value);

Limits decoded input, including enriched markup. Exceeding the limit causes conversion to fail with GMIME_ERROR_PARSE_ERROR. This setting cannot be changed during conversion.

Parameters

converter

a GMimeEnrichedToHtml

 

value

the maximum input length in Unicode scalar values, greater than zero

 

g_mime_enriched_to_html_get_max_output_length ()

gsize
g_mime_enriched_to_html_get_max_output_length
                               (GMimeEnrichedToHtml *converter);

Gets the output length limit in Unicode scalar values. Generated markup, escaped text, wrappers, headers and footers all count toward this limit.

Parameters

converter

a GMimeEnrichedToHtml

 

Returns

the output length limit, initially 64 * 1024 * 1024.


g_mime_enriched_to_html_set_max_output_length ()

void
g_mime_enriched_to_html_set_max_output_length
                               (GMimeEnrichedToHtml *converter,
                                gsize value);

Limits the complete generated HTML before output charset encoding. Exceeding the limit causes conversion to fail with GMIME_ERROR_PARSE_ERROR. This setting cannot be changed during conversion.

Parameters

converter

a GMimeEnrichedToHtml

 

value

the maximum output length in Unicode scalar values, greater than zero

 

Types and Values

GMimeEnrichedToHtml

typedef struct _GMimeEnrichedToHtml GMimeEnrichedToHtml;

Converts RFC 1896 text/enriched to HTML with configurable resource limits.