kill score / folder scoring / buf fixed for local account prefs
[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 } SummarySortType;
65
66 typedef enum
67 {
68         SUMMARY_NONE,
69         SUMMARY_SELECTED_NONE,
70         SUMMARY_SELECTED_SINGLE,
71         SUMMARY_SELECTED_MULTIPLE
72 } SummarySelection;
73
74 typedef enum
75 {
76         TARGET_MAIL_URI_LIST,
77         TARGET_DUMMY
78 } TargetInfo;
79
80 extern GtkTargetEntry summary_drag_types[1];
81
82 struct _SummaryView
83 {
84         GtkWidget *vbox;
85         GtkWidget *scrolledwin;
86         GtkWidget *ctree;
87         GtkWidget *hbox;
88         GtkWidget *statlabel_folder;
89         GtkWidget *statlabel_select;
90         GtkWidget *statlabel_msgs;
91         GtkWidget *toggle_eventbox;
92         GtkWidget *toggle_arrow;
93         GtkWidget *popupmenu;
94
95         GtkItemFactory *popupfactory;
96
97         GtkWidget *window;
98
99         GtkCTreeNode *selected;
100         GtkCTreeNode *displayed;
101
102         gboolean msg_is_toggled_on;
103         gboolean display_msg;
104
105         GdkColor color_important;
106         GdkColor color_marked;
107         GdkColor color_dim;
108         GdkColor color_normal;
109
110         MainWindow   *mainwin;
111         FolderView   *folderview;
112         HeaderView   *headerview;
113         MessageView  *messageview;
114         HeaderWindow *headerwin;
115
116         FolderItem *folder_item;
117
118         GSList * killed_messages;
119         gint important_score;
120
121         /* current message status */
122         gint   newmsgs;
123         gint   unread;
124         gint   messages;
125         off_t  total_size;
126         gint   deleted;
127         gint   moved;
128         gint   copied;
129
130 /*
131 private:
132 */
133         /* table for looking up message-id */
134         GHashTable *msgid_table;
135
136         /* list for moving/deleting messages */
137         GSList *mlist;
138         /* table for updating folder tree */
139         GHashTable *folder_table;
140
141         /* current sorting state */
142         SummarySortType sort_mode;
143         GtkSortType sort_type;
144 };
145
146 SummaryView     *summary_create(void);
147
148 void summary_init                 (SummaryView          *summaryview);
149 gboolean summary_show             (SummaryView          *summaryview,
150                                    FolderItem           *fitem,
151                                    gboolean              update_cache);
152 void summary_clear_list           (SummaryView          *summaryview);
153 void summary_clear_all            (SummaryView          *summaryview);
154
155 void summary_select_next_unread   (SummaryView          *summaryview);
156 void summary_select_next_marked   (SummaryView          *summaryview);
157 void summary_select_prev_marked   (SummaryView          *summaryview);
158 void summary_select_by_msgnum     (SummaryView          *summaryview,
159                                    guint                 msgnum);
160 guint summary_get_current_msgnum  (SummaryView          *summaryview);
161 void summary_thread_build         (SummaryView          *summaryview);
162 void summary_unthread             (SummaryView          *summaryview);
163 void summary_filter               (SummaryView          *summaryview);
164 void summary_sort                 (SummaryView          *summaryview,
165                                    SummarySortType       type);
166
167 void summary_delete               (SummaryView          *summaryview);
168 void summary_delete_duplicated    (SummaryView          *summaryview);
169 void summary_execute              (SummaryView          *summaryview);
170 void summary_attract_by_subject   (SummaryView          *summaryview);
171 gint summary_write_cache          (SummaryView          *summaryview);
172 void summary_pass_key_press_event (SummaryView          *summaryview,
173                                    GdkEventKey          *event);
174 void summary_change_display_item  (SummaryView          *summaryview);
175 void summary_redisplay_msg        (SummaryView          *summaryview);
176 void summary_open_msg             (SummaryView          *summaryview);
177 void summary_view_source          (SummaryView          *summaryview);
178 void summary_reedit               (SummaryView          *summaryview);
179 void summary_step                 (SummaryView          *summaryview,
180                                    GtkScrollType         type);
181 void summary_set_marks_selected   (SummaryView          *summaryview);
182
183 void summary_move_selected_to     (SummaryView          *summaryview,
184                                    FolderItem           *to_folder);
185 void summary_move_to              (SummaryView          *summaryview);
186 void summary_copy_selected_to     (SummaryView          *summaryview,
187                                    FolderItem           *to_folder);
188 void summary_copy_to              (SummaryView          *summaryview);
189 void summary_save_as              (SummaryView          *summaryview);
190 void summary_print                (SummaryView          *summaryview);
191 void summary_mark                 (SummaryView          *summaryview);
192 void summary_unmark               (SummaryView          *summaryview);
193 void summary_mark_as_unread       (SummaryView          *summaryview);
194 void summary_mark_as_read         (SummaryView          *summaryview);
195 void summary_select_all           (SummaryView          *summaryview);
196 void summary_unselect_all         (SummaryView          *summaryview);
197
198 #endif /* __SUMMARY_H__ */