From 84c2d2312698ff4c23e26058841305c9b1632a46 Mon Sep 17 00:00:00 2001 From: Jose Dapena Paz Date: Thu, 25 Jun 2009 20:46:08 +0200 Subject: [PATCH] Added method to know if we have hit the limits in the text to html stream. --- src/modest-stream-text-to-html.c | 10 ++++++++++ src/modest-stream-text-to-html.h | 1 + 2 files changed, 11 insertions(+) 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 -- 1.7.9.5