2 * Claws Mail -- a GTK based, lightweight, and fast e-mail client
3 * Copyright (C) 1999-2022 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>
29 #include "viewtypes.h"
30 typedef struct _SummaryColumnState SummaryColumnState
;
32 #define MAIL_MANUAL_FILTERING_HOOKLIST "mail_manual_filtering_hooklist"
50 #define N_SUMMARY_COLS 12
55 SUMMARY_SELECTED_NONE
,
56 SUMMARY_SELECTED_SINGLE
,
57 SUMMARY_SELECTED_MULTIPLE
64 TARGET_MAIL_CM_PATH_LIST
,
67 #include "mainwindow.h"
70 #include "gtksctree.h"
71 #include "prefs_filtering.h"
72 #include "quicksearch.h"
74 extern GtkTargetEntry summary_drag_types
[3];
76 struct _SummaryColumnState
78 SummaryColumnType type
;
85 GtkWidget
*mainwidget_book
;
86 GtkWidget
*scrolledwin
;
93 GtkWidget
*folder_pixmap
;
94 GtkWidget
*folder_pixmap_eventbox
;
95 GtkWidget
*statlabel_folder
;
96 GtkWidget
*statlabel_select
;
97 GtkWidget
*statlabel_msgs
;
98 GtkWidget
*toggle_eventbox
;
99 GtkWidget
*toggle_arrow
;
101 GtkWidget
*multiple_sel_togbtn
;
102 GtkWidget
*multiple_sel_image
;
104 GtkWidget
*toggle_search
;
105 GtkWidget
*quick_search_pixmap
;
106 GtkWidget
*popupmenu
;
107 GtkWidget
*headerpopupmenu
;
108 GtkWidget
*colorlabel_menu
;
109 GtkWidget
*tags_menu
;
112 GtkCMCTreeNode
*selected
;
113 GtkCMCTreeNode
*displayed
;
115 gboolean display_msg
;
117 SummaryColumnState col_state
[N_SUMMARY_COLS
];
118 gint col_pos
[N_SUMMARY_COLS
];
120 GdkRGBA color_marked
;
126 FolderView
*folderview
;
127 HeaderView
*headerview
;
128 MessageView
*messageview
;
129 MessageView
*ext_messageview
;
130 QuickSearch
*quicksearch
;
132 FolderItem
*folder_item
;
134 /* summaryview prefs */
135 gint important_score
;
136 FolderSortKey sort_key
;
137 FolderSortType sort_type
;
139 guint thread_collapsed
;
141 /* Extra data for summaryview */
142 regex_t
*simplify_subject_preg
;
144 /* current message status */
154 /* table for looking up message-id */
155 GHashTable
*msgid_table
;
156 GHashTable
*subject_table
;
158 /* list for moving/deleting messages */
160 int msginfo_update_callback_id
;
162 /* update folder label when renaming */
163 gint folder_item_update_callback_id
;
164 gint folder_update_callback_id
;
166 GtkTargetList
*target_list
; /* DnD */
168 /* folders with matches for recursive quicksearch queries */
169 GSList
*recursive_matched_folders
;
170 FolderItem
*search_root_folder
;
172 guint mark_as_read_timeout_tag
;
174 /* A flag to indicate to header popup menuitem handlers that
175 * they should not do anything, because the menu items are
176 * being set up prior to the popup menu being displayed. */
177 gboolean header_menu_lock
;
179 GtkActionGroup
*action_group
;
180 GtkUIManager
*ui_manager
;
183 SummaryView
*summary_create(MainWindow
*mainwin
);
184 void summaryview_destroy(SummaryView
*summaryview
);
185 void summary_init (SummaryView
*summaryview
);
186 gboolean
summary_show (SummaryView
*summaryview
,
188 gboolean avoid_refresh
);
189 void summary_clear_list (SummaryView
*summaryview
);
190 void summary_clear_all (SummaryView
*summaryview
);
192 void summary_lock (SummaryView
*summaryview
);
193 void summary_unlock (SummaryView
*summaryview
);
194 void summary_freeze (SummaryView
*summaryview
);
195 void summary_thaw (SummaryView
*summaryview
);
196 void summary_thaw_with_status (SummaryView
*summaryview
);
197 void summary_grab_focus (SummaryView
*summaryview
);
198 GtkWidget
*summary_get_main_widget(SummaryView
*summaryview
);
199 gboolean
summary_is_locked (SummaryView
*summaryview
);
201 SummarySelection
summary_get_selection_type (SummaryView
*summaryview
);
202 MsgInfo
*summary_get_selected_msg (SummaryView
*summaryview
);
203 GSList
*summary_get_selected_msg_list (SummaryView
*summaryview
);
205 void summary_select_prev (SummaryView
*summaryview
);
206 void summary_select_next (SummaryView
*summaryview
);
207 void summary_select_prev_unread (SummaryView
*summaryview
);
208 void summary_select_next_unread (SummaryView
*summaryview
);
209 void summary_select_prev_new (SummaryView
*summaryview
);
210 void summary_select_next_new (SummaryView
*summaryview
);
211 void summary_select_prev_marked (SummaryView
*summaryview
);
212 void summary_select_next_marked (SummaryView
*summaryview
);
213 void summary_select_prev_labeled (SummaryView
*summaryview
);
214 void summary_select_next_labeled (SummaryView
*summaryview
);
215 void summary_select_parent (SummaryView
*summaryview
);
216 void summary_select_by_msgnum (SummaryView
*summaryview
,
219 void summary_select_by_msg_list (SummaryView
*summaryview
, GSList
*msginfos
);
220 guint
summary_get_current_msgnum (SummaryView
*summaryview
);
221 void summary_select_node (SummaryView
*summaryview
,
222 GtkCMCTreeNode
*node
,
223 gboolean display_msg
);
225 void summary_expand_threads (SummaryView
*summaryview
);
226 void summary_collapse_threads (SummaryView
*summaryview
);
227 void summary_toggle_ignore_thread (SummaryView
*summaryview
);
228 void summary_toggle_watch_thread (SummaryView
*summaryview
);
230 void summary_filter (SummaryView
*summaryview
,
231 gboolean selected_only
);
232 void summary_filter_open (SummaryView
*summaryview
,
233 PrefsFilterType type
,
234 gint processing_rule
);
235 void summary_msginfo_filter_open (FolderItem
* item
, MsgInfo
*msginfo
,
236 PrefsFilterType type
, gint processing_rule
);
238 void summary_sort (SummaryView
*summaryview
,
239 FolderSortKey sort_key
,
240 FolderSortType sort_type
);
242 void summary_delete (SummaryView
*summaryview
);
243 void summary_delete_trash (SummaryView
*summaryview
);
245 void summary_cancel (SummaryView
*summaryview
);
247 gboolean
summary_execute (SummaryView
*summaryview
);
248 gboolean
summary_expunge (SummaryView
*summaryview
);
250 void summary_attract_by_subject (SummaryView
*summaryview
);
252 gint
summary_write_cache (SummaryView
*summaryview
);
254 gboolean
summary_pass_key_press_event (SummaryView
*summaryview
,
257 void summary_display_msg_selected (SummaryView
*summaryview
,
258 gboolean all_headers
);
259 void summary_redisplay_msg (SummaryView
*summaryview
);
260 void summary_open_msg (SummaryView
*summaryview
);
261 void summary_open_row (GtkSCTree
*sctree
, SummaryView
*summaryview
);
262 void summary_view_source (SummaryView
*summaryview
);
263 void summary_reedit (SummaryView
*summaryview
);
264 gboolean
summary_step (SummaryView
*summaryview
,
266 void summary_toggle_view (SummaryView
*summaryview
);
267 void summary_set_marks_selected (SummaryView
*summaryview
);
268 guint
summary_get_msgnum (SummaryView
*summaryview
,
269 GtkCMCTreeNode
*node
);
271 void summary_move_selected_to (SummaryView
*summaryview
,
272 FolderItem
*to_folder
);
273 void summary_move_to (SummaryView
*summaryview
);
274 void summary_copy_selected_to (SummaryView
*summaryview
,
275 FolderItem
*to_folder
);
276 GSList
*summary_get_selection (SummaryView
*summaryview
);
277 guint
summary_get_selection_count (SummaryView
*summaryview
);
278 void summary_copy_to (SummaryView
*summaryview
);
279 void summary_save_as (SummaryView
*summaryview
);
280 void summary_print (SummaryView
*summaryview
);
281 void summary_mark (SummaryView
*summaryview
);
282 void summary_unmark (SummaryView
*summaryview
);
283 void summary_mark_as_read (SummaryView
*summaryview
);
284 void summary_mark_as_unread (SummaryView
*summaryview
);
285 void summary_msgs_lock (SummaryView
*summaryview
);
286 void summary_msgs_unlock (SummaryView
*summaryview
);
287 void summary_mark_all_read (SummaryView
*summaryview
, gboolean ask_if_needed
);
288 void summary_mark_all_unread (SummaryView
*summaryview
, gboolean ask_if_needed
);
289 void summary_mark_as_spam (SummaryView
*summaryview
,
292 void summary_ignore_thread (SummaryView
*summaryview
);
293 void summary_unignore_thread (SummaryView
*summaryview
);
294 void summary_watch_thread (SummaryView
*summaryview
);
295 void summary_unwatch_thread (SummaryView
*summaryview
);
297 void summary_add_address (SummaryView
*summaryview
);
298 void summary_select_all (SummaryView
*summaryview
);
299 void summary_unselect_all (SummaryView
*summaryview
);
300 void summary_select_thread (SummaryView
*summaryview
,
301 gboolean delete_thread
,
302 gboolean trash_thread
);
304 void summary_set_colorlabel (SummaryView
*summaryview
,
307 void summary_set_tag (SummaryView
*summaryview
,
311 void summary_set_column_order (SummaryView
*summaryview
);
313 void summary_toggle_show_read_messages
314 (SummaryView
*summaryview
);
315 void summary_toggle_show_read_threads
316 (SummaryView
*summaryview
);
317 void summary_toggle_show_del_messages
318 (SummaryView
*summaryview
);
320 void summary_toggle_view_real (SummaryView
*summaryview
);
322 void summary_reflect_prefs_pixmap_theme
323 (SummaryView
*summaryview
);
324 void summary_reflect_prefs_custom_colors(SummaryView
*summaryview
);
325 void summary_reflect_tags_changes(SummaryView
*summaryview
);
326 void summary_harvest_address (SummaryView
*summaryview
);
327 void summary_set_prefs_from_folderitem
328 (SummaryView
*summaryview
, FolderItem
*item
);
329 void summary_save_prefs_to_folderitem
330 (SummaryView
*summaryview
, FolderItem
*item
);
331 gint
summaryview_export_mbox_list (SummaryView
*summaryview
);
332 void summary_reflect_prefs(void);
333 void summaryview_activate_quicksearch(SummaryView
*summaryview
, gboolean show
);
334 void summary_set_menu_sensitive (SummaryView
*summaryview
);
335 void summary_relayout(SummaryView
*summaryview
);
336 void summary_update_unread(SummaryView
*summaryview
, FolderItem
*removed_item
);
337 gboolean
summary_is_list(SummaryView
*summaryview
);
338 gboolean
summaryview_search_root_progress(gpointer data
, guint at
, guint matched
, guint total
);
339 gboolean
summary_is_opened_message_selected(SummaryView
*summaryview
);
340 gboolean
summary_has_opened_message(SummaryView
*summaryview
);
341 #endif /* __SUMMARY_H__ */