2 * Claws Mail -- a GTK+ based, lightweight, and fast e-mail client
3 * Copyright (C) 1999-2015 Hiroyuki Yamamoto and the Claws Mail team
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 3 of the License, or
8 * (at your option) any later version.
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.
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 #ifndef __TEXTVIEW_H__
20 #define __TEXTVIEW_H__
23 #include "claws-features.h"
29 typedef struct _ClickableText ClickableText
;
49 #include "viewtypes.h"
55 GtkWidget
*scrolledwin
;
58 GtkUIManager
*ui_manager
;
59 GtkActionGroup
*link_action_group
;
60 GtkWidget
*link_popup_menu
;
61 GtkActionGroup
*mail_action_group
;
62 GtkWidget
*mail_popup_menu
;
63 GtkActionGroup
*file_action_group
;
64 GtkWidget
*file_popup_menu
;
66 gboolean default_text
;
67 gboolean is_in_signature
;
73 MessageView
*messageview
;
74 gint last_buttonpress
;
76 ClickableText
*uri_hover
;
77 GtkTextIter uri_hover_start_iter
;
78 GtkTextIter uri_hover_end_iter
;
82 gboolean stop_loading
;
83 gint prev_quote_level
;
86 TextView
*textview_create (void);
87 void textview_init (TextView
*textview
);
88 void textview_reflect_prefs (TextView
*textview
);
90 void textview_show_part (TextView
*textview
,
93 void textview_show_error (TextView
*textview
);
94 void textview_show_info (TextView
*textview
,
95 const gchar
*info_str
);
96 void textview_show_mime_part (TextView
*textview
,
98 void textview_clear (TextView
*textview
);
99 void textview_destroy (TextView
*textview
);
100 void textview_set_font (TextView
*textview
,
101 const gchar
*codeset
);
102 void textview_set_text (TextView
*textview
,
104 void textview_set_position (TextView
*textview
,
106 void textview_scroll_one_line (TextView
*textview
,
108 gboolean
textview_scroll_page (TextView
*textview
,
110 void textview_scroll_max (TextView
*textview
,
113 gboolean
textview_search_string (TextView
*textview
,
116 gboolean
textview_search_string_backward (TextView
*textview
,
119 void textview_cursor_wait(TextView
*textview
);
120 void textview_cursor_normal(TextView
*textview
);
121 void textview_show_icon(TextView
*textview
, const gchar
*stock_id
);
122 void textview_get_selection_offsets (TextView
*textview
,
125 gboolean
textview_uri_security_check (TextView
*textview
,
127 gchar
*textview_get_visible_uri (TextView
*textview
,
130 #define TEXTVIEW_INSERT(str) \
131 gtk_text_buffer_insert_with_tags_by_name \
132 (buffer, &iter, str, -1,\
135 #define TEXTVIEW_INSERT_BOLD(str) \
136 gtk_text_buffer_insert_with_tags_by_name \
137 (buffer, &iter, str, -1,\
138 "header", "header_title", NULL)
140 #define TEXTVIEW_INSERT_LINK(str, fname, udata) { \
141 ClickableText *uri; \
142 uri = g_new0(ClickableText, 1); \
143 uri->uri = g_strdup(""); \
144 uri->start = gtk_text_iter_get_offset(&iter); \
145 gtk_text_buffer_insert_with_tags_by_name \
146 (buffer, &iter, str, -1, \
147 "link", "header_title", "header", \
149 uri->end = gtk_text_iter_get_offset(&iter); \
150 uri->filename = fname?g_strdup(fname):NULL; \
152 textview->uri_list = \
153 g_slist_prepend(textview->uri_list, uri); \
156 #endif /* __TEXTVIEW_H__ */