From: Jose Dapena Paz Date: Thu, 25 Jun 2009 18:46:08 +0000 (+0200) Subject: Added method to know if we have hit the limits in the text to html stream. X-Git-Tag: 3.0.17-rc20~5 X-Git-Url: http://git.maemo.org/git/?p=modest;a=commitdiff_plain;h=84c2d2312698ff4c23e26058841305c9b1632a46 Added method to know if we have hit the limits in the text to html stream. --- diff --git a/src/modest-stream-text-to-html.c b/src/modest-stream-text-to-html.c index c99ff95..fc59bf3 100644 --- a/src/modest-stream-text-to-html.c +++ b/src/modest-stream-text-to-html.c @@ -183,6 +183,16 @@ modest_stream_text_to_html_set_full_limit (ModestStreamTextToHtml *self, gssize priv->full_limit = limit; } +gboolean +modest_stream_text_to_html_limit_reached (ModestStreamTextToHtml *self) +{ + ModestStreamTextToHtmlPrivate *priv = MODEST_STREAM_TEXT_TO_HTML_GET_PRIVATE (self); + + return (priv->full_limit > 0 && priv->total_output > priv->full_limit) || + (priv->line_limit > 0 && priv->total_lines_output > priv->line_limit); + +} + /* the rest are interface functions */ diff --git a/src/modest-stream-text-to-html.h b/src/modest-stream-text-to-html.h index 1d3424e..18041ed 100644 --- a/src/modest-stream-text-to-html.h +++ b/src/modest-stream-text-to-html.h @@ -74,6 +74,7 @@ GObject* modest_stream_text_to_html_new (TnyStream *out_stream); void modest_stream_text_to_html_set_linkify_limit (ModestStreamTextToHtml *self, gssize limit); void modest_stream_text_to_html_set_full_limit (ModestStreamTextToHtml *self, gssize limit); void modest_stream_text_to_html_set_line_limit (ModestStreamTextToHtml *self, gssize limit); +gboolean modest_stream_text_to_html_limit_reached (ModestStreamTextToHtml *self); G_END_DECLS