2006-09-04 [colin] 2.4.0cvs143
[claws.git] / src / textview.h
1 /*
2  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
3  * Copyright (C) 1999-2006 Hiroyuki Yamamoto and the Sylpheed-Claws team
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18  */
19
20 #ifndef __TEXTVIEW_H__
21 #define __TEXTVIEW_H__
22
23 #ifdef HAVE_CONFIG_H
24 #  include "config.h"
25 #endif
26
27 #include <glib.h>
28 #include <gtk/gtkwidget.h>
29 #include <gtk/gtktextiter.h>
30
31 typedef struct _TextView        TextView;
32 typedef struct _ClickableText   ClickableText;
33
34 #include "messageview.h"
35 #include "procmime.h"
36
37 struct _TextView
38 {
39         GtkWidget *vbox;
40         GtkWidget *scrolledwin;
41         GtkWidget *text;
42
43         GtkWidget *link_popup_menu;
44         GtkItemFactory *link_popup_factory;
45         GtkWidget *mail_popup_menu;
46         GtkItemFactory *mail_popup_factory;
47         GtkWidget *file_popup_menu;
48         GtkItemFactory *file_popup_factory;
49
50         gboolean default_text;
51         gboolean is_in_signature;
52         
53         GSList *uri_list;
54         gint body_pos;
55
56         gboolean show_all_headers;
57
58         MessageView *messageview;
59         gint last_buttonpress;
60
61         ClickableText *uri_hover;
62         GtkTextIter uri_hover_start_iter;
63         GtkTextIter uri_hover_end_iter;
64         GtkWidget *image;
65         gboolean loading;
66         gboolean stop_loading;
67 };
68
69 TextView *textview_create               (void);
70 void textview_init                      (TextView       *textview);
71 void textview_reflect_prefs             (TextView       *textview);
72
73 void textview_show_message      (TextView       *textview,
74                                  MimeInfo       *mimeinfo,
75                                  const gchar    *file);
76 void textview_show_part         (TextView       *textview,
77                                  MimeInfo       *mimeinfo,
78                                  FILE           *fp);
79 void textview_show_error        (TextView       *textview);
80 void textview_show_mime_part    (TextView       *textview,
81                                  MimeInfo       *partinfo);
82 void textview_clear             (TextView       *textview);
83 void textview_destroy           (TextView       *textview);
84 void textview_set_all_headers   (TextView       *textview,
85                                  gboolean        all_headers);
86 void textview_set_font          (TextView       *textview,
87                                  const gchar    *codeset);
88 void textview_set_text          (TextView       *textview,
89                                  const gchar    *text);
90 void textview_set_position      (TextView       *textview,
91                                  gint            pos);
92 void textview_scroll_one_line   (TextView       *textview,
93                                  gboolean        up);
94 gboolean textview_scroll_page   (TextView       *textview,
95                                  gboolean        up);
96
97 gboolean textview_search_string                 (TextView       *textview,
98                                                  const gchar    *str,
99                                                  gboolean        case_sens);
100 gboolean textview_search_string_backward        (TextView       *textview,
101                                                  const gchar    *str,
102                                                  gboolean        case_sens);
103 void textview_cursor_wait(TextView *textview);
104 void textview_cursor_normal(TextView *textview);
105
106 #endif /* __TEXTVIEW_H__ */