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/>.
22 #include <sys/types.h>
33 #include "viewtypes.h"
34 typedef struct _SummaryColumnState SummaryColumnState
;
36 #define MAIL_MANUAL_FILTERING_HOOKLIST "mail_manual_filtering_hooklist"
54 #define N_SUMMARY_COLS 12
59 SUMMARY_SELECTED_NONE
,
60 SUMMARY_SELECTED_SINGLE
,
61 SUMMARY_SELECTED_MULTIPLE
68 TARGET_MAIL_CM_PATH_LIST
,
71 #include "mainwindow.h"
74 #include "gtksctree.h"
75 #include "prefs_filtering.h"
76 #include "quicksearch.h"
78 extern GtkTargetEntry summary_drag_types
[3];
80 struct _SummaryColumnState
82 SummaryColumnType type
;
89 GtkWidget
*mainwidget_book
;
90 GtkWidget
*scrolledwin
;
97 GtkWidget
*folder_pixmap
;
98 GtkWidget
*folder_pixmap_eventbox
;
99 GtkWidget
*statlabel_folder
;
100 GtkWidget
*statlabel_select
;
101 GtkWidget
*statlabel_msgs
;
102 GtkWidget
*toggle_eventbox
;
103 GtkWidget
*toggle_arrow
;
105 GtkWidget
*multiple_sel_togbtn
;
106 GtkWidget
*multiple_sel_image
;
108 GtkWidget
*toggle_search
;
109 GtkWidget
*quick_search_pixmap
;
110 GtkWidget
*popupmenu
;
111 GtkWidget
*headerpopupmenu
;
112 GtkWidget
*colorlabel_menu
;
113 GtkWidget
*tags_menu
;
116 GtkCMCTreeNode
*selected
;
117 GtkCMCTreeNode
*displayed
;
119 gboolean display_msg
;
121 SummaryColumnState col_state
[N_SUMMARY_COLS
];
122 gint col_pos
[N_SUMMARY_COLS
];
124 GdkColor color_marked
;
130 FolderView
*folderview
;
131 HeaderView
*headerview
;
132 MessageView
*messageview
;
133 MessageView
*ext_messageview
;
134 QuickSearch
*quicksearch
;
136 FolderItem
*folder_item
;
138 /* summaryview prefs */
139 gint important_score
;
140 FolderSortKey sort_key
;
141 FolderSortType sort_type
;
143 guint thread_collapsed
;
145 /* Extra data for summaryview */
146 regex_t
*simplify_subject_preg
;
148 /* current message status */
158 /* table for looking up message-id */
159 GHashTable
*msgid_table
;
160 GHashTable
*subject_table
;
162 /* list for moving/deleting messages */
164 int msginfo_update_callback_id
;
166 /* update folder label when renaming */
167 gint folder_item_update_callback_id
;
168 gint folder_update_callback_id
;
170 GtkTargetList
*target_list
; /* DnD */
172 /* folders with matches for recursive quicksearch queries */
173 GSList
*recursive_matched_folders
;
174 FolderItem
*search_root_folder
;
176 guint mark_as_read_timeout_tag
;
178 /* A flag to indicate to header popup menuitem handlers that
179 * they should not do anything, because the menu items are
180 * being set up prior to the popup menu being displayed. */
181 gboolean header_menu_lock
;
183 GtkActionGroup
*action_group
;
184 GtkUIManager
*ui_manager
;
187 SummaryView
*summary_create(MainWindow
*mainwin
);
188 void summaryview_destroy(SummaryView
*summaryview
);
189 void summary_init (SummaryView
*summaryview
);
190 gboolean
summary_show (SummaryView
*summaryview
,
192 gboolean avoid_refresh
);
193 void summary_clear_list (SummaryView
*summaryview
);
194 void summary_clear_all (SummaryView
*summaryview
);
196 void summary_lock (SummaryView
*summaryview
);
197 void summary_unlock (SummaryView
*summaryview
);
198 void summary_freeze (SummaryView
*summaryview
);
199 void summary_thaw (SummaryView
*summaryview
);
200 void summary_thaw_with_status (SummaryView
*summaryview
);
201 void summary_grab_focus (SummaryView
*summaryview
);
202 GtkWidget
*summary_get_main_widget(SummaryView
*summaryview
);
203 gboolean
summary_is_locked (SummaryView
*summaryview
);
205 SummarySelection
summary_get_selection_type (SummaryView
*summaryview
);
206 MsgInfo
*summary_get_selected_msg (SummaryView
*summaryview
);
207 GSList
*summary_get_selected_msg_list (SummaryView
*summaryview
);
209 void summary_select_prev (SummaryView
*summaryview
);
210 void summary_select_next (SummaryView
*summaryview
);
211 void summary_select_prev_unread (SummaryView
*summaryview
);
212 void summary_select_next_unread (SummaryView
*summaryview
);
213 void summary_select_prev_new (SummaryView
*summaryview
);
214 void summary_select_next_new (SummaryView
*summaryview
);
215 void summary_select_prev_marked (SummaryView
*summaryview
);
216 void summary_select_next_marked (SummaryView
*summaryview
);
217 void summary_select_prev_labeled (SummaryView
*summaryview
);
218 void summary_select_next_labeled (SummaryView
*summaryview
);
219 void summary_select_parent (SummaryView
*summaryview
);
220 void summary_select_by_msgnum (SummaryView
*summaryview
,
223 void summary_select_by_msg_list (SummaryView
*summaryview
, GSList
*msginfos
);
224 guint
summary_get_current_msgnum (SummaryView
*summaryview
);
225 void summary_select_node (SummaryView
*summaryview
,
226 GtkCMCTreeNode
*node
,
227 gboolean display_msg
);
229 void summary_expand_threads (SummaryView
*summaryview
);
230 void summary_collapse_threads (SummaryView
*summaryview
);
231 void summary_toggle_ignore_thread (SummaryView
*summaryview
);
232 void summary_toggle_watch_thread (SummaryView
*summaryview
);
234 void summary_filter (SummaryView
*summaryview
,
235 gboolean selected_only
);
236 void summary_filter_open (SummaryView
*summaryview
,
237 PrefsFilterType type
,
238 gint processing_rule
);
239 void summary_msginfo_filter_open (FolderItem
* item
, MsgInfo
*msginfo
,
240 PrefsFilterType type
, gint processing_rule
);
242 void summary_sort (SummaryView
*summaryview
,
243 FolderSortKey sort_key
,
244 FolderSortType sort_type
);
246 void summary_delete (SummaryView
*summaryview
);
247 void summary_delete_trash (SummaryView
*summaryview
);
249 void summary_cancel (SummaryView
*summaryview
);
251 gboolean
summary_execute (SummaryView
*summaryview
);
252 gboolean
summary_expunge (SummaryView
*summaryview
);
254 void summary_attract_by_subject (SummaryView
*summaryview
);
256 gint
summary_write_cache (SummaryView
*summaryview
);
258 gboolean
summary_pass_key_press_event (SummaryView
*summaryview
,
261 void summary_display_msg_selected (SummaryView
*summaryview
,
262 gboolean all_headers
);
263 void summary_redisplay_msg (SummaryView
*summaryview
);
264 void summary_open_msg (SummaryView
*summaryview
);
265 void summary_open_row (GtkSCTree
*sctree
, SummaryView
*summaryview
);
266 void summary_view_source (SummaryView
*summaryview
);
267 void summary_reedit (SummaryView
*summaryview
);
268 gboolean
summary_step (SummaryView
*summaryview
,
270 void summary_toggle_view (SummaryView
*summaryview
);
271 void summary_set_marks_selected (SummaryView
*summaryview
);
272 guint
summary_get_msgnum (SummaryView
*summaryview
,
273 GtkCMCTreeNode
*node
);
275 void summary_move_selected_to (SummaryView
*summaryview
,
276 FolderItem
*to_folder
);
277 void summary_move_to (SummaryView
*summaryview
);
278 void summary_copy_selected_to (SummaryView
*summaryview
,
279 FolderItem
*to_folder
);
280 GSList
*summary_get_selection (SummaryView
*summaryview
);
281 guint
summary_get_selection_count (SummaryView
*summaryview
);
282 void summary_copy_to (SummaryView
*summaryview
);
283 void summary_save_as (SummaryView
*summaryview
);
284 void summary_print (SummaryView
*summaryview
);
285 void summary_mark (SummaryView
*summaryview
);
286 void summary_unmark (SummaryView
*summaryview
);
287 void summary_mark_as_read (SummaryView
*summaryview
);
288 void summary_mark_as_unread (SummaryView
*summaryview
);
289 void summary_msgs_lock (SummaryView
*summaryview
);
290 void summary_msgs_unlock (SummaryView
*summaryview
);
291 void summary_mark_all_read (SummaryView
*summaryview
, gboolean ask_if_needed
);
292 void summary_mark_all_unread (SummaryView
*summaryview
, gboolean ask_if_needed
);
293 void summary_mark_as_spam (SummaryView
*summaryview
,
296 void summary_ignore_thread (SummaryView
*summaryview
);
297 void summary_unignore_thread (SummaryView
*summaryview
);
298 void summary_watch_thread (SummaryView
*summaryview
);
299 void summary_unwatch_thread (SummaryView
*summaryview
);
301 void summary_add_address (SummaryView
*summaryview
);
302 void summary_select_all (SummaryView
*summaryview
);
303 void summary_unselect_all (SummaryView
*summaryview
);
304 void summary_select_thread (SummaryView
*summaryview
,
305 gboolean delete_thread
,
306 gboolean trash_thread
);
308 void summary_set_colorlabel (SummaryView
*summaryview
,
311 void summary_set_tag (SummaryView
*summaryview
,
315 void summary_set_column_order (SummaryView
*summaryview
);
317 void summary_toggle_show_read_messages
318 (SummaryView
*summaryview
);
319 void summary_toggle_show_read_threads
320 (SummaryView
*summaryview
);
321 void summary_toggle_show_del_messages
322 (SummaryView
*summaryview
);
324 void summary_toggle_view_real (SummaryView
*summaryview
);
326 void summary_reflect_prefs_pixmap_theme
327 (SummaryView
*summaryview
);
328 void summary_reflect_prefs_custom_colors(SummaryView
*summaryview
);
329 void summary_reflect_tags_changes(SummaryView
*summaryview
);
330 void summary_harvest_address (SummaryView
*summaryview
);
331 void summary_set_prefs_from_folderitem
332 (SummaryView
*summaryview
, FolderItem
*item
);
333 void summary_save_prefs_to_folderitem
334 (SummaryView
*summaryview
, FolderItem
*item
);
335 gint
summaryview_export_mbox_list (SummaryView
*summaryview
);
336 void summaryview_lock(SummaryView
*summaryview
, FolderItem
*item
);
337 void summaryview_unlock(SummaryView
*summaryview
, FolderItem
*item
);
338 void summary_reflect_prefs(void);
339 void summaryview_activate_quicksearch(SummaryView
*summaryview
, gboolean show
);
340 void summary_set_menu_sensitive (SummaryView
*summaryview
);
341 void summary_relayout(SummaryView
*summaryview
);
342 void summary_update_unread(SummaryView
*summaryview
, FolderItem
*removed_item
);
343 gboolean
summary_is_list(SummaryView
*summaryview
);
344 gboolean
summaryview_search_root_progress(gpointer data
, guint at
, guint matched
, guint total
);
345 gboolean
summary_is_opened_message_selected(SummaryView
*summaryview
);
346 gboolean
summary_has_opened_message(SummaryView
*summaryview
);
347 #endif /* __SUMMARY_H__ */