2001-04-19 14:21:46 +02:00
|
|
|
/*
|
|
|
|
* Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
|
2007-01-03 06:42:43 +01:00
|
|
|
* Copyright (C) 1999-2007 Hiroyuki Yamamoto and the Claws Mail team
|
2001-04-19 14:21:46 +02:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
2005-09-21 20:22:51 +02:00
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2001-04-19 14:21:46 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __SUMMARY_H__
|
|
|
|
#define __SUMMARY_H__
|
|
|
|
|
2004-05-22 09:27:30 +02:00
|
|
|
#include <sys/types.h>
|
2002-08-19 19:55:14 +02:00
|
|
|
#include <regex.h>
|
|
|
|
|
2001-04-19 14:21:46 +02:00
|
|
|
#include <glib.h>
|
|
|
|
#include <gdk/gdk.h>
|
|
|
|
#include <gtk/gtkwidget.h>
|
|
|
|
#include <gtk/gtkitemfactory.h>
|
|
|
|
#include <gtk/gtkctree.h>
|
|
|
|
#include <gtk/gtkdnd.h>
|
|
|
|
|
2001-10-12 12:23:58 +02:00
|
|
|
typedef struct _SummaryView SummaryView;
|
|
|
|
typedef struct _SummaryColumnState SummaryColumnState;
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2005-03-19 04:19:22 +01:00
|
|
|
#define MAIL_MANUAL_FILTERING_HOOKLIST "mail_manual_filtering_hooklist"
|
|
|
|
|
2001-04-19 14:21:46 +02:00
|
|
|
typedef enum
|
|
|
|
{
|
2001-10-12 12:23:58 +02:00
|
|
|
S_COL_MARK,
|
2003-01-26 13:56:56 +01:00
|
|
|
S_COL_STATUS,
|
2001-10-12 12:23:58 +02:00
|
|
|
S_COL_MIME,
|
|
|
|
S_COL_SUBJECT,
|
2001-10-22 10:42:36 +02:00
|
|
|
S_COL_FROM,
|
2005-08-05 21:57:42 +02:00
|
|
|
S_COL_TO,
|
2001-10-22 10:42:36 +02:00
|
|
|
S_COL_DATE,
|
|
|
|
S_COL_SIZE,
|
|
|
|
S_COL_NUMBER,
|
2001-11-19 21:35:46 +01:00
|
|
|
S_COL_SCORE,
|
|
|
|
S_COL_LOCKED
|
2001-10-12 12:23:58 +02:00
|
|
|
} SummaryColumnType;
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2005-08-05 21:57:42 +02:00
|
|
|
#define N_SUMMARY_COLS 11
|
2001-04-19 14:21:46 +02:00
|
|
|
|
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
SUMMARY_NONE,
|
|
|
|
SUMMARY_SELECTED_NONE,
|
|
|
|
SUMMARY_SELECTED_SINGLE,
|
|
|
|
SUMMARY_SELECTED_MULTIPLE
|
|
|
|
} SummarySelection;
|
|
|
|
|
|
|
|
typedef enum
|
|
|
|
{
|
|
|
|
TARGET_MAIL_URI_LIST,
|
|
|
|
TARGET_DUMMY
|
|
|
|
} TargetInfo;
|
|
|
|
|
2003-07-20 00:36:53 +02:00
|
|
|
#include "mainwindow.h"
|
|
|
|
#include "folderview.h"
|
|
|
|
#include "headerview.h"
|
|
|
|
#include "messageview.h"
|
|
|
|
#include "compose.h"
|
|
|
|
#include "folder.h"
|
|
|
|
#include "gtksctree.h"
|
|
|
|
#include "prefs_filtering.h"
|
2004-06-25 10:05:09 +02:00
|
|
|
#include "quicksearch.h"
|
2003-07-20 00:36:53 +02:00
|
|
|
|
2006-02-04 18:17:33 +01:00
|
|
|
extern GtkTargetEntry summary_drag_types[2];
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2001-10-12 12:23:58 +02:00
|
|
|
struct _SummaryColumnState
|
|
|
|
{
|
|
|
|
SummaryColumnType type;
|
|
|
|
gboolean visible;
|
|
|
|
};
|
|
|
|
|
2001-04-19 14:21:46 +02:00
|
|
|
struct _SummaryView
|
|
|
|
{
|
|
|
|
GtkWidget *vbox;
|
|
|
|
GtkWidget *scrolledwin;
|
|
|
|
GtkWidget *ctree;
|
|
|
|
GtkWidget *hbox;
|
2002-04-02 10:02:57 +02:00
|
|
|
GtkWidget *hbox_l;
|
2007-01-19 19:16:09 +01:00
|
|
|
GtkWidget *hbox_spc;
|
|
|
|
GtkWidget *stat_box;
|
|
|
|
GtkWidget *stat_box2;
|
2002-02-11 20:46:04 +01:00
|
|
|
GtkWidget *folder_pixmap;
|
2001-04-19 14:21:46 +02:00
|
|
|
GtkWidget *statlabel_folder;
|
|
|
|
GtkWidget *statlabel_select;
|
|
|
|
GtkWidget *statlabel_msgs;
|
2002-06-11 23:46:03 +02:00
|
|
|
GtkWidget *toggle_eventbox;
|
|
|
|
GtkWidget *toggle_arrow;
|
2002-08-22 16:35:57 +02:00
|
|
|
GtkWidget *toggle_search;
|
2002-09-29 23:46:05 +02:00
|
|
|
GtkWidget *quick_search_pixmap;
|
2001-04-19 14:21:46 +02:00
|
|
|
GtkWidget *popupmenu;
|
2001-08-27 13:07:43 +02:00
|
|
|
GtkWidget *colorlabel_menu;
|
2001-04-19 14:21:46 +02:00
|
|
|
|
|
|
|
GtkItemFactory *popupfactory;
|
|
|
|
|
|
|
|
GtkWidget *window;
|
|
|
|
|
|
|
|
GtkCTreeNode *selected;
|
|
|
|
GtkCTreeNode *displayed;
|
2006-07-31 14:11:12 +02:00
|
|
|
GtkCTreeNode *last_displayed;
|
2001-04-19 14:21:46 +02:00
|
|
|
|
|
|
|
gboolean display_msg;
|
|
|
|
|
2001-06-01 13:06:33 +02:00
|
|
|
GdkColor color_important;
|
2001-10-12 12:23:58 +02:00
|
|
|
SummaryColumnState col_state[N_SUMMARY_COLS];
|
|
|
|
gint col_pos[N_SUMMARY_COLS];
|
|
|
|
|
2001-04-19 14:21:46 +02:00
|
|
|
GdkColor color_marked;
|
|
|
|
GdkColor color_dim;
|
|
|
|
|
2001-10-02 10:34:49 +02:00
|
|
|
guint lock_count;
|
|
|
|
|
2001-04-19 14:21:46 +02:00
|
|
|
MainWindow *mainwin;
|
|
|
|
FolderView *folderview;
|
|
|
|
HeaderView *headerview;
|
|
|
|
MessageView *messageview;
|
2004-06-25 10:05:09 +02:00
|
|
|
QuickSearch *quicksearch;
|
2001-04-19 14:21:46 +02:00
|
|
|
|
|
|
|
FolderItem *folder_item;
|
|
|
|
|
2002-08-19 19:55:14 +02:00
|
|
|
/* summaryview prefs */
|
2001-06-01 13:06:33 +02:00
|
|
|
gint important_score;
|
2002-08-20 21:50:04 +02:00
|
|
|
FolderSortKey sort_key;
|
|
|
|
FolderSortType sort_type;
|
2002-08-21 15:11:35 +02:00
|
|
|
guint threaded;
|
2003-01-25 02:30:03 +01:00
|
|
|
guint thread_collapsed;
|
2001-06-01 13:06:33 +02:00
|
|
|
|
2002-08-19 19:55:14 +02:00
|
|
|
/* Extra data for summaryview */
|
|
|
|
regex_t *simplify_subject_preg;
|
|
|
|
|
2001-04-19 14:21:46 +02:00
|
|
|
/* current message status */
|
2002-11-25 16:38:06 +01:00
|
|
|
gint unreadmarked;
|
2001-04-19 14:21:46 +02:00
|
|
|
off_t total_size;
|
|
|
|
gint deleted;
|
|
|
|
gint moved;
|
|
|
|
gint copied;
|
|
|
|
|
|
|
|
/*
|
|
|
|
private:
|
|
|
|
*/
|
|
|
|
/* table for looking up message-id */
|
|
|
|
GHashTable *msgid_table;
|
2001-06-18 02:50:21 +02:00
|
|
|
GHashTable *subject_table;
|
2001-04-19 14:21:46 +02:00
|
|
|
|
|
|
|
/* list for moving/deleting messages */
|
|
|
|
GSList *mlist;
|
2002-11-15 15:04:35 +01:00
|
|
|
int msginfo_update_callback_id;
|
2003-07-17 10:39:41 +02:00
|
|
|
|
2006-09-19 18:13:08 +02:00
|
|
|
/* update folder label when renaming */
|
|
|
|
gint folder_item_update_callback_id;
|
|
|
|
|
2003-07-17 10:39:41 +02:00
|
|
|
GtkTargetList *target_list; /* DnD */
|
2001-04-19 14:21:46 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
SummaryView *summary_create(void);
|
|
|
|
|
|
|
|
void summary_init (SummaryView *summaryview);
|
|
|
|
gboolean summary_show (SummaryView *summaryview,
|
2002-07-25 14:21:11 +02:00
|
|
|
FolderItem *fitem);
|
2001-04-19 14:21:46 +02:00
|
|
|
void summary_clear_list (SummaryView *summaryview);
|
|
|
|
void summary_clear_all (SummaryView *summaryview);
|
|
|
|
|
2001-10-02 10:34:49 +02:00
|
|
|
void summary_lock (SummaryView *summaryview);
|
|
|
|
void summary_unlock (SummaryView *summaryview);
|
2006-09-28 21:08:03 +02:00
|
|
|
void summary_freeze (SummaryView *summaryview);
|
|
|
|
void summary_thaw (SummaryView *summaryview);
|
|
|
|
void summary_grab_focus (SummaryView *summaryview);
|
|
|
|
GtkWidget *summary_get_main_widget(SummaryView *summaryview);
|
2001-10-02 10:34:49 +02:00
|
|
|
gboolean summary_is_locked (SummaryView *summaryview);
|
|
|
|
|
2001-08-22 12:58:38 +02:00
|
|
|
SummarySelection summary_get_selection_type (SummaryView *summaryview);
|
2004-05-10 12:22:28 +02:00
|
|
|
MsgInfo *summary_get_selected_msg (SummaryView *summaryview);
|
2003-04-22 15:53:19 +02:00
|
|
|
GSList *summary_get_selected_msg_list (SummaryView *summaryview);
|
2001-08-22 12:58:38 +02:00
|
|
|
|
2001-09-13 15:38:32 +02:00
|
|
|
void summary_select_prev_unread (SummaryView *summaryview);
|
2001-04-19 14:21:46 +02:00
|
|
|
void summary_select_next_unread (SummaryView *summaryview);
|
2002-06-25 11:20:06 +02:00
|
|
|
void summary_select_prev_new (SummaryView *summaryview);
|
|
|
|
void summary_select_next_new (SummaryView *summaryview);
|
2001-09-13 15:38:32 +02:00
|
|
|
void summary_select_prev_marked (SummaryView *summaryview);
|
|
|
|
void summary_select_next_marked (SummaryView *summaryview);
|
|
|
|
void summary_select_prev_labeled (SummaryView *summaryview);
|
|
|
|
void summary_select_next_labeled (SummaryView *summaryview);
|
2006-07-31 14:11:12 +02:00
|
|
|
void summary_select_last_read (SummaryView *summaryview);
|
|
|
|
void summary_select_parent (SummaryView *summaryview);
|
2001-04-19 14:21:46 +02:00
|
|
|
void summary_select_by_msgnum (SummaryView *summaryview,
|
|
|
|
guint msgnum);
|
|
|
|
guint summary_get_current_msgnum (SummaryView *summaryview);
|
2001-09-24 10:15:52 +02:00
|
|
|
void summary_select_node (SummaryView *summaryview,
|
|
|
|
GtkCTreeNode *node,
|
2002-02-15 10:26:31 +01:00
|
|
|
gboolean display_msg,
|
|
|
|
gboolean do_refresh);
|
2001-10-22 10:42:36 +02:00
|
|
|
|
2001-10-17 11:25:12 +02:00
|
|
|
void summary_thread_build (SummaryView *summaryview);
|
2001-10-22 10:42:36 +02:00
|
|
|
|
2002-05-18 17:22:17 +02:00
|
|
|
void summary_expand_threads (SummaryView *summaryview);
|
|
|
|
void summary_collapse_threads (SummaryView *summaryview);
|
2003-05-13 13:15:22 +02:00
|
|
|
void summary_toggle_ignore_thread (SummaryView *summaryview);
|
2002-05-18 17:22:17 +02:00
|
|
|
|
2004-05-10 12:22:28 +02:00
|
|
|
void summary_filter (SummaryView *summaryview,
|
|
|
|
gboolean selected_only);
|
2004-01-12 22:28:31 +01:00
|
|
|
void summary_filter_open (SummaryView *summaryview,
|
|
|
|
PrefsFilterType type,
|
|
|
|
gint processing_rule);
|
|
|
|
void summary_msginfo_filter_open (FolderItem * item, MsgInfo *msginfo,
|
|
|
|
PrefsFilterType type, gint processing_rule);
|
2002-01-31 12:15:55 +01:00
|
|
|
|
2001-04-19 14:21:46 +02:00
|
|
|
void summary_sort (SummaryView *summaryview,
|
2002-06-05 08:25:18 +02:00
|
|
|
FolderSortKey sort_key,
|
|
|
|
FolderSortType sort_type);
|
2001-04-19 14:21:46 +02:00
|
|
|
|
|
|
|
void summary_delete (SummaryView *summaryview);
|
2005-06-22 20:23:15 +02:00
|
|
|
void summary_delete_trash (SummaryView *summaryview);
|
2001-10-22 10:42:36 +02:00
|
|
|
|
2002-08-27 00:53:35 +02:00
|
|
|
void summary_cancel (SummaryView *summaryview);
|
|
|
|
|
2001-10-02 10:34:49 +02:00
|
|
|
gboolean summary_execute (SummaryView *summaryview);
|
2001-10-22 10:42:36 +02:00
|
|
|
|
2001-04-19 14:21:46 +02:00
|
|
|
void summary_attract_by_subject (SummaryView *summaryview);
|
2001-10-22 10:42:36 +02:00
|
|
|
|
2001-04-19 14:21:46 +02:00
|
|
|
gint summary_write_cache (SummaryView *summaryview);
|
2001-10-22 10:42:36 +02:00
|
|
|
|
2006-04-25 08:33:15 +02:00
|
|
|
gboolean summary_pass_key_press_event (SummaryView *summaryview,
|
2001-04-19 14:21:46 +02:00
|
|
|
GdkEventKey *event);
|
2001-10-22 10:42:36 +02:00
|
|
|
|
2002-02-05 14:27:32 +01:00
|
|
|
void summary_display_msg_selected (SummaryView *summaryview,
|
2002-02-04 10:56:44 +01:00
|
|
|
gboolean all_headers);
|
2002-02-05 14:27:32 +01:00
|
|
|
void summary_redisplay_msg (SummaryView *summaryview);
|
2001-04-19 14:21:46 +02:00
|
|
|
void summary_open_msg (SummaryView *summaryview);
|
|
|
|
void summary_view_source (SummaryView *summaryview);
|
|
|
|
void summary_reedit (SummaryView *summaryview);
|
2005-03-30 14:01:26 +02:00
|
|
|
gboolean summary_step (SummaryView *summaryview,
|
2001-04-19 14:21:46 +02:00
|
|
|
GtkScrollType type);
|
2002-06-11 23:46:03 +02:00
|
|
|
void summary_toggle_view (SummaryView *summaryview);
|
2001-04-19 14:21:46 +02:00
|
|
|
void summary_set_marks_selected (SummaryView *summaryview);
|
2006-03-24 19:28:37 +01:00
|
|
|
guint summary_get_msgnum (SummaryView *summaryview,
|
|
|
|
GtkCTreeNode *node);
|
2001-04-19 14:21:46 +02:00
|
|
|
|
|
|
|
void summary_move_selected_to (SummaryView *summaryview,
|
|
|
|
FolderItem *to_folder);
|
|
|
|
void summary_move_to (SummaryView *summaryview);
|
|
|
|
void summary_copy_selected_to (SummaryView *summaryview,
|
|
|
|
FolderItem *to_folder);
|
2003-03-03 20:03:23 +01:00
|
|
|
GSList *summary_get_selection (SummaryView *summaryview);
|
2001-04-19 14:21:46 +02:00
|
|
|
void summary_copy_to (SummaryView *summaryview);
|
|
|
|
void summary_save_as (SummaryView *summaryview);
|
|
|
|
void summary_print (SummaryView *summaryview);
|
|
|
|
void summary_mark (SummaryView *summaryview);
|
|
|
|
void summary_unmark (SummaryView *summaryview);
|
|
|
|
void summary_mark_as_unread (SummaryView *summaryview);
|
|
|
|
void summary_mark_as_read (SummaryView *summaryview);
|
2003-04-15 22:00:23 +02:00
|
|
|
void summary_msgs_lock (SummaryView *summaryview);
|
|
|
|
void summary_msgs_unlock (SummaryView *summaryview);
|
2001-09-13 15:38:32 +02:00
|
|
|
void summary_mark_all_read (SummaryView *summaryview);
|
2006-02-24 18:48:13 +01:00
|
|
|
void summary_mark_as_spam (SummaryView *summaryview,
|
|
|
|
guint action,
|
|
|
|
GtkWidget *widget);
|
2006-09-13 08:42:36 +02:00
|
|
|
void summary_ignore_thread (SummaryView *summaryview);
|
|
|
|
void summary_unignore_thread (SummaryView *summaryview);
|
|
|
|
|
2001-09-13 15:38:32 +02:00
|
|
|
void summary_add_address (SummaryView *summaryview);
|
2001-04-19 14:21:46 +02:00
|
|
|
void summary_select_all (SummaryView *summaryview);
|
|
|
|
void summary_unselect_all (SummaryView *summaryview);
|
2007-01-13 19:23:51 +01:00
|
|
|
void summary_select_thread (SummaryView *summaryview,
|
|
|
|
gboolean delete_thread);
|
2002-09-21 00:22:19 +02:00
|
|
|
|
2001-08-27 13:07:43 +02:00
|
|
|
void summary_set_colorlabel (SummaryView *summaryview,
|
|
|
|
guint labelcolor,
|
|
|
|
GtkWidget *widget);
|
|
|
|
void summary_set_colorlabel_color (GtkCTree *ctree,
|
|
|
|
GtkCTreeNode *node,
|
|
|
|
guint labelcolor);
|
2001-04-19 14:21:46 +02:00
|
|
|
|
2001-10-22 10:42:36 +02:00
|
|
|
void summary_set_column_order (SummaryView *summaryview);
|
|
|
|
|
2002-08-20 21:50:04 +02:00
|
|
|
void summary_toggle_show_read_messages
|
|
|
|
(SummaryView *summaryview);
|
2001-12-11 16:06:46 +01:00
|
|
|
|
2002-08-20 21:50:04 +02:00
|
|
|
void summary_toggle_view_real (SummaryView *summaryview);
|
2002-01-21 11:54:32 +01:00
|
|
|
|
2002-08-20 21:50:04 +02:00
|
|
|
void summary_reflect_prefs_pixmap_theme
|
|
|
|
(SummaryView *summaryview);
|
2006-03-17 19:10:51 +01:00
|
|
|
void summary_reflect_prefs_custom_colors(SummaryView *summaryview);
|
2002-08-20 21:50:04 +02:00
|
|
|
void summary_harvest_address (SummaryView *summaryview);
|
|
|
|
void summary_set_prefs_from_folderitem
|
|
|
|
(SummaryView *summaryview, FolderItem *item);
|
|
|
|
void summary_save_prefs_to_folderitem
|
|
|
|
(SummaryView *summaryview, FolderItem *item);
|
2006-05-13 12:02:33 +02:00
|
|
|
gint summaryview_export_mbox_list (SummaryView *summaryview);
|
2005-06-15 18:38:17 +02:00
|
|
|
void summaryview_lock(SummaryView *summaryview, FolderItem *item);
|
|
|
|
void summaryview_unlock(SummaryView *summaryview, FolderItem *item);
|
2005-08-01 19:18:42 +02:00
|
|
|
void summary_reflect_prefs(void);
|
2006-12-14 09:38:09 +01:00
|
|
|
void summaryview_activate_quicksearch(SummaryView *summaryview, gboolean show);
|
2006-02-24 20:20:17 +01:00
|
|
|
void summary_set_menu_sensitive (SummaryView *summaryview);
|
2007-01-19 19:16:09 +01:00
|
|
|
void summary_relayout(SummaryView *summaryview);
|
2001-04-19 14:21:46 +02:00
|
|
|
#endif /* __SUMMARY_H__ */
|