colour message instead of mark it
[claws.git] / src / summaryview.h
1 /*
2  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
3  * Copyright (C) 1999-2001 Hiroyuki Yamamoto
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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18  */
19
20 #ifndef __SUMMARY_H__
21 #define __SUMMARY_H__
22
23 #include <glib.h>
24 #include <gdk/gdk.h>
25 #include <gtk/gtkwidget.h>
26 #include <gtk/gtkitemfactory.h>
27 #include <gtk/gtkctree.h>
28 #include <gtk/gtkdnd.h>
29
30 typedef struct _SummaryView     SummaryView;
31
32 #include "mainwindow.h"
33 #include "folderview.h"
34 #include "headerview.h"
35 #include "messageview.h"
36 #include "headerwindow.h"
37 #include "folder.h"
38 #include "gtksctree.h"
39
40 typedef enum
41 {
42         S_COL_MARK      = 0,
43         S_COL_UNREAD    = 1,
44         S_COL_MIME      = 2,
45         S_COL_NUMBER    = 3,
46         S_COL_SCORE     = 4,
47         S_COL_SIZE      = 5,
48         S_COL_DATE      = 6,
49         S_COL_FROM      = 7,
50         S_COL_SUBJECT   = 8
51 } SummaryColumnPos;
52
53 #define N_SUMMARY_COLS  9
54
55 typedef enum
56 {
57         SORT_BY_NONE,
58         SORT_BY_NUMBER,
59         SORT_BY_SIZE,
60         SORT_BY_DATE,
61         SORT_BY_FROM,
62         SORT_BY_SUBJECT,
63         SORT_BY_SCORE,
64         SORT_BY_LABEL
65 } SummarySortType;
66
67 typedef enum
68 {
69         SUMMARY_NONE,
70         SUMMARY_SELECTED_NONE,
71         SUMMARY_SELECTED_SINGLE,
72         SUMMARY_SELECTED_MULTIPLE
73 } SummarySelection;
74
75 typedef enum
76 {
77         TARGET_MAIL_URI_LIST,
78         TARGET_DUMMY
79 } TargetInfo;
80
81 extern GtkTargetEntry summary_drag_types[1];
82
83 struct _SummaryView
84 {
85         GtkWidget *vbox;
86         GtkWidget *scrolledwin;
87         GtkWidget *ctree;
88         GtkWidget *hbox;
89         GtkWidget *statlabel_folder;
90         GtkWidget *statlabel_select;
91         GtkWidget *statlabel_msgs;
92         GtkWidget *toggle_eventbox;
93         GtkWidget *toggle_arrow;
94         GtkWidget *popupmenu;
95
96         GtkItemFactory *popupfactory;
97
98         GtkWidget *window;
99
100         GtkCTreeNode *selected;
101         GtkCTreeNode *displayed;
102
103         gboolean msg_is_toggled_on;
104         gboolean display_msg;
105
106         GdkColor color_important;
107         GdkColor color_marked;
108         GdkColor color_dim;
109         GdkColor color_normal;
110
111         MainWindow   *mainwin;
112         FolderView   *folderview;
113         HeaderView   *headerview;
114         MessageView  *messageview;
115         HeaderWindow *headerwin;
116
117         FolderItem *folder_item;
118
119         GSList * killed_messages;
120         gint important_score;
121
122         /* current message status */
123         gint   newmsgs;
124         gint   unread;
125         gint   messages;
126         off_t  total_size;
127         gint   deleted;
128         gint   moved;
129         gint   copied;
130
131 /*
132 private:
133 */
134         /* table for looking up message-id */
135         GHashTable *msgid_table;
136         GHashTable *subject_table;
137
138         /* list for moving/deleting messages */
139         GSList *mlist;
140         /* table for updating folder tree */
141         GHashTable *folder_table;
142
143         /* current sorting state */
144         SummarySortType sort_mode;
145         GtkSortType sort_type;
146 };
147
148 SummaryView     *summary_create(void);
149
150 void summary_init                 (SummaryView          *summaryview);
151 gboolean summary_show             (SummaryView          *summaryview,
152                                    FolderItem           *fitem,
153                                    gboolean              update_cache);
154 void summary_clear_list           (SummaryView          *summaryview);
155 void summary_clear_all            (SummaryView          *summaryview);
156
157 void summary_select_next_unread   (SummaryView          *summaryview);
158 void summary_select_next_marked   (SummaryView          *summaryview);
159 void summary_select_prev_marked   (SummaryView          *summaryview);
160 void summary_select_by_msgnum     (SummaryView          *summaryview,
161                                    guint                 msgnum);
162 guint summary_get_current_msgnum  (SummaryView          *summaryview);
163 void summary_thread_build         (SummaryView          *summaryview);
164 void summary_unthread             (SummaryView          *summaryview);
165 void summary_filter               (SummaryView          *summaryview);
166 void summary_sort                 (SummaryView          *summaryview,
167                                    SummarySortType       type);
168
169 void summary_delete               (SummaryView          *summaryview);
170 void summary_delete_duplicated    (SummaryView          *summaryview);
171 void summary_execute              (SummaryView          *summaryview);
172 void summary_attract_by_subject   (SummaryView          *summaryview);
173 gint summary_write_cache          (SummaryView          *summaryview);
174 void summary_pass_key_press_event (SummaryView          *summaryview,
175                                    GdkEventKey          *event);
176 void summary_change_display_item  (SummaryView          *summaryview);
177 void summary_redisplay_msg        (SummaryView          *summaryview);
178 void summary_open_msg             (SummaryView          *summaryview);
179 void summary_view_source          (SummaryView          *summaryview);
180 void summary_reedit               (SummaryView          *summaryview);
181 void summary_step                 (SummaryView          *summaryview,
182                                    GtkScrollType         type);
183 void summary_set_marks_selected   (SummaryView          *summaryview);
184
185 void summary_move_selected_to     (SummaryView          *summaryview,
186                                    FolderItem           *to_folder);
187 void summary_move_to              (SummaryView          *summaryview);
188 void summary_copy_selected_to     (SummaryView          *summaryview,
189                                    FolderItem           *to_folder);
190 void summary_copy_to              (SummaryView          *summaryview);
191 void summary_save_as              (SummaryView          *summaryview);
192 void summary_print                (SummaryView          *summaryview);
193 void summary_mark                 (SummaryView          *summaryview);
194 void summary_unmark               (SummaryView          *summaryview);
195 void summary_mark_as_unread       (SummaryView          *summaryview);
196 void summary_mark_as_read         (SummaryView          *summaryview);
197 void summary_select_all           (SummaryView          *summaryview);
198 void summary_unselect_all         (SummaryView          *summaryview);
199 void summary_set_label            (SummaryView          *summaryview, guint labelcolor, GtkWidget *widget);
200 void summary_set_label_color      (GtkCTree *ctree, GtkCTreeNode *node, guint labelcolor);
201
202 #endif /* __SUMMARY_H__ */