| Top |
Implements MimeKit's line-oriented plain and flowed HTML output algorithms. Input accepts CRLF, LF, and CR; generated output newlines are always LF. Headers and footers in text format are independently converted without the body's callback. HTML-format headers and footers are copied as raw markup.
GMimeTextConverter *
g_mime_text_to_html_new (void);
Creates a plain-text to HTML converter. By default, the output includes html and body wrappers, and headers and footers are interpreted as text.
gboolean
g_mime_text_to_html_get_output_html_fragment
(GMimeTextToHtml *converter);
Gets whether the generated html and body wrappers are omitted.
void g_mime_text_to_html_set_output_html_fragment (GMimeTextToHtml *converter,gboolean value);
Selects fragment or document output. Headers and footers are included in either mode. This setting cannot be changed during conversion.
GMimeHeaderFooterFormat
g_mime_text_to_html_get_header_format (GMimeTextToHtml *converter);
Gets how the configured header is interpreted.
void g_mime_text_to_html_set_header_format (GMimeTextToHtml *converter,GMimeHeaderFooterFormat value);
Selects how the header set by g_mime_text_converter_set_header() is written.
Text is converted to HTML without invoking the body's tag callback; HTML
is copied verbatim and is not sanitized. This setting cannot be changed
during conversion.
GMimeHeaderFooterFormat
g_mime_text_to_html_get_footer_format (GMimeTextToHtml *converter);
Gets how the configured footer is interpreted.
void g_mime_text_to_html_set_footer_format (GMimeTextToHtml *converter,GMimeHeaderFooterFormat value);
Selects how the footer set by g_mime_text_converter_set_footer() is written.
Text is converted to HTML without invoking the body's tag callback; HTML
is copied verbatim and is not sanitized. This setting cannot be changed
during conversion.
GMimeHtmlTagCallback g_mime_text_to_html_get_html_tag_callback (GMimeTextToHtml *converter,gpointer *user_data);
Gets the registered HTML tag callback. This function is C-only because introspection does not support returning callback function pointers.
[skip]
converter |
||
user_data |
return location for the callback's borrowed user data. |
[out][optional][nullable][transfer none] |
void g_mime_text_to_html_set_html_tag_callback (GMimeTextToHtml *converter,GMimeHtmlTagCallback callback,gpointer user_data,GDestroyNotify destroy_notify);
Sets the callback for tags generated from the body, or restores default
tag output if callback
is NULL. The callback must explicitly write any
desired tag; end-tag callbacks are opt-in through GMimeHtmlTagContext.
Wrappers, headers and footers do not invoke the callback.
The previous destroy notifier is called when replacing the registration.
destroy_notify
is called when this registration is replaced or the
converter is finalized. The callback cannot be changed during conversion.