diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2002-12-17 03:36:35 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2002-12-17 03:36:35 +0800 |
commit | 9d70bad4944b3f00c7b6e0a214e8c5ed9566e8ac (patch) | |
tree | 003b299901d5c449ef95ad8384415597b111cbf6 /camel | |
parent | aed127b4f487bc6026b1c89eeb7034973511ba6b (diff) | |
download | gsoc2013-evolution-9d70bad4944b3f00c7b6e0a214e8c5ed9566e8ac.tar.gz gsoc2013-evolution-9d70bad4944b3f00c7b6e0a214e8c5ed9566e8ac.tar.zst gsoc2013-evolution-9d70bad4944b3f00c7b6e0a214e8c5ed9566e8ac.zip |
New convenience function to replace calls to e_text_to_html() in the
2002-12-16 Jeffrey Stedfast <fejj@ximian.com>
* camel-mime-filter-tohtml.c (camel_text_to_html): New convenience
function to replace calls to e_text_to_html() in the
mailer/composer etc.
svn path=/trunk/; revision=19128
Diffstat (limited to 'camel')
-rw-r--r-- | camel/ChangeLog | 4 | ||||
-rw-r--r-- | camel/camel-mime-filter-tohtml.c | 22 | ||||
-rw-r--r-- | camel/camel-mime-filter-tohtml.h | 6 |
3 files changed, 32 insertions, 0 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog index e37403899b..64768a5425 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,5 +1,9 @@ 2002-12-16 Jeffrey Stedfast <fejj@ximian.com> + * camel-mime-filter-tohtml.c (camel_text_to_html): New convenience + function to replace calls to e_text_to_html() in the + mailer/composer etc. + * camel.h: #include some headers we had forgotten to add previously, also added camel-mime-filter-enriched.h. diff --git a/camel/camel-mime-filter-tohtml.c b/camel/camel-mime-filter-tohtml.c index a3494ba72f..4f9d972625 100644 --- a/camel/camel-mime-filter-tohtml.c +++ b/camel/camel-mime-filter-tohtml.c @@ -404,3 +404,25 @@ camel_mime_filter_tohtml_new (guint32 flags, guint32 colour) return CAMEL_MIME_FILTER (new); } + + +char * +camel_text_to_html (const char *in, guint32 flags, guint32 colour) +{ + CamelMimeFilter *filter; + size_t outlen, outpre; + char *outbuf; + + g_return_val_if_fail (in != NULL, NULL); + + filter = camel_mime_filter_tohtml_new (flags, colour); + + camel_mime_filter_complete (filter, (char *) in, strlen (in), 0, + &outbuf, &outlen, &outpre); + + outbuf = g_strndup (outbuf, outlen); + + camel_object_unref (filter); + + return outbuf; +} diff --git a/camel/camel-mime-filter-tohtml.h b/camel/camel-mime-filter-tohtml.h index 2c1c07e5e3..de8690a1e0 100644 --- a/camel/camel-mime-filter-tohtml.h +++ b/camel/camel-mime-filter-tohtml.h @@ -44,6 +44,7 @@ extern "C" { #define CAMEL_MIME_FILTER_TOHTML_ESCAPE_8BIT (1 << 6) #define CAMEL_MIME_FILTER_TOHTML_CITE (1 << 7) #define CAMEL_MIME_FILTER_TOHTML_PRESERVE_8BIT (1 << 8) +#define CAMEL_MIME_FILTER_TOHTML_FORMAT_FLOWED (1 << 9) typedef struct _CamelMimeFilterToHTMLClass CamelMimeFilterToHTMLClass; typedef struct _CamelMimeFilterToHTML CamelMimeFilterToHTML; @@ -69,6 +70,11 @@ CamelType camel_mime_filter_tohtml_get_type (void); CamelMimeFilter *camel_mime_filter_tohtml_new (guint32 flags, guint32 colour); + +/* utility functions to replace e_text_to_html shit */ + +char *camel_text_to_html (const char *in, guint32 flags, guint32 colour); + #ifdef __cplusplus } #endif /* __cplusplus */ |