3e593d1b74d552a3a555a8950363e87ef0a28060
[claws.git] / src / messageview.h
1 /*
2  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
3  * Copyright (C) 1999-2011 Hiroyuki Yamamoto and the Claws Mail 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 3 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, see <http://www.gnu.org/licenses/>.
17  * 
18  */
19
20 #ifndef __MESSAGEVIEW_H__
21 #define __MESSAGEVIEW_H__
22
23 #ifdef HAVE_CONFIG_H
24 #  include "config.h"
25 #endif
26
27 #include <glib.h>
28 #include <gtk/gtk.h>
29
30 typedef struct _MessageView     MessageView;
31
32 #include "mainwindow.h"
33 #include "headerview.h"
34 #include "textview.h"
35 #include "mimeview.h"
36 #include "noticeview.h"
37 #include "procmsg.h"
38 #include "procmime.h"
39 #include "toolbar.h"
40
41 #define MESSAGE_VIEW_SHOW_DONE_HOOKLIST "message_view_show_done_hooklist"
42
43
44 struct _MessageView
45 {
46         GtkWidget *vbox;
47
48         gboolean new_window;
49         GtkWidget *window;
50
51         /* Toolbar handlebox */
52         GtkWidget *handlebox;
53         Toolbar *toolbar;
54         GtkWidget *menubar;
55
56         HeaderView *headerview;
57         MimeView *mimeview;
58         NoticeView *noticeview;
59         GtkWidget *statusbar;
60         gint statusbar_cid;
61
62         MainWindow *mainwin;
63
64         MsgInfo *msginfo;
65
66         gchar *forced_charset;
67         EncodingType forced_encoding;
68
69         gboolean visible;
70
71         /* this message was filtered by an action */
72         gboolean filtered;
73   
74         /* From messageview_show */
75         gboolean all_headers;
76
77         gint msginfo_update_callback_id;
78         gboolean updating;
79         gboolean deferred_destroy;
80         
81         gboolean show_full_text;
82         gboolean partial_display_shown;
83         GtkUIManager *ui_manager;
84 };
85
86 MessageView *messageview_create                 (MainWindow     *mainwin);
87 MessageView *messageview_create_with_new_window (MainWindow     *mainwin);
88
89 void messageview_init                           (MessageView    *messageview);
90 gint messageview_show                           (MessageView    *messageview,
91                                                  MsgInfo        *msginfo,
92                                                  gboolean        all_headers);
93 void messageview_clear                          (MessageView    *messageview);
94 void messageview_destroy                        (MessageView    *messageview);
95
96 TextView *messageview_get_current_textview      (MessageView    *messageview);
97 MimeInfo *messageview_get_selected_mime_part    (MessageView    *messageview);
98
99 void messageview_copy_clipboard                 (MessageView    *messageview);
100 void messageview_select_all                     (MessageView    *messageview);
101 void messageview_set_position                   (MessageView    *messageview,
102                                                  gint            pos);
103 GList *messageview_get_msgview_list             (void);
104 void messageview_delete                         (MessageView    *messageview);
105 gboolean messageview_search_string              (MessageView    *messageview,
106                                                  const gchar    *str,
107                                                  gboolean        case_sens);
108 gboolean messageview_search_string_backward     (MessageView    *messageview,
109                                                  const gchar    *str,
110                                                  gboolean        case_sens);
111
112 gboolean messageview_is_visible                 (MessageView    *messageview);
113
114 void messageview_update_actions_menu            (MessageView    *msgview);
115 void messageview_reflect_prefs_pixmap_theme     (void);
116 gchar *messageview_get_selection                (MessageView    *msgview);
117
118 void messageview_set_menu_sensitive             (MessageView    *msgview);
119 void messageview_learn                          (MessageView    *msgview,
120                                                  gboolean is_spam);
121 void messageview_print                          (MsgInfo        *msginfo,
122                                                  gboolean        all_headers,
123                                                  gint            sel_start,
124                                                  gint            sel_end,
125                                                  gint            partnum);
126 void messageview_list_urls                      (MessageView    *msgview);
127 void messageview_show_partial_display           (MessageView    *msgview, 
128                                                  MsgInfo        *msginfo,
129                                                  size_t          length);
130 #endif /* __MESSAGEVIEW_H__ */