Statistics
| Revision:

root / src / summaryview.h @ 1

History | View | Annotate | Download (6.82 KB)

1
/*
2
 * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
3
 * Copyright (C) 1999-2004 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
typedef struct _SummaryColumnState        SummaryColumnState;
32

    
33
#include "mainwindow.h"
34
#include "folderview.h"
35
#include "headerview.h"
36
#include "messageview.h"
37
#include "compose.h"
38
#include "prefs_filter.h"
39
#include "folder.h"
40
#include "gtksctree.h"
41

    
42
typedef enum
43
{
44
        S_COL_MARK,
45
        S_COL_UNREAD,
46
        S_COL_MIME,
47
        S_COL_SUBJECT,
48
        S_COL_FROM,
49
        S_COL_DATE,
50
        S_COL_SIZE,
51
        S_COL_NUMBER,
52
} SummaryColumnType;
53

    
54
#define N_SUMMARY_COLS        8
55

    
56
typedef enum
57
{
58
        SUMMARY_NONE,
59
        SUMMARY_SELECTED_NONE,
60
        SUMMARY_SELECTED_SINGLE,
61
        SUMMARY_SELECTED_MULTIPLE
62
} SummarySelection;
63

    
64
typedef enum
65
{
66
        TARGET_MAIL_URI_LIST,
67
        TARGET_DUMMY
68
} TargetInfo;
69

    
70
extern GtkTargetEntry summary_drag_types[1];
71

    
72
struct _SummaryColumnState
73
{
74
        SummaryColumnType type;
75
        gboolean visible;
76
};
77

    
78
struct _SummaryView
79
{
80
        GtkWidget *vbox;
81
        GtkWidget *scrolledwin;
82
        GtkWidget *ctree;
83
        GtkWidget *hbox;
84
        GtkWidget *hbox_l;
85
        GtkWidget *statlabel_folder;
86
        GtkWidget *statlabel_select;
87
        GtkWidget *statlabel_msgs;
88
        GtkWidget *toggle_eventbox;
89
        GtkWidget *toggle_arrow;
90
        GtkWidget *popupmenu;
91
        GtkWidget *colorlabel_menu;
92

    
93
        GtkItemFactory *popupfactory;
94

    
95
        GtkWidget *reedit_menuitem;
96
        GtkWidget *reedit_separator;
97

    
98
        GtkWidget *window;
99

    
100
        GtkCTreeNode *selected;
101
        GtkCTreeNode *displayed;
102

    
103
        gboolean display_msg;
104

    
105
        SummaryColumnState col_state[N_SUMMARY_COLS];
106
        gint col_pos[N_SUMMARY_COLS];
107

    
108
        GdkColor color_marked;
109
        GdkColor color_dim;
110

    
111
        guint lock_count;
112

    
113
        MainWindow  *mainwin;
114
        FolderView  *folderview;
115
        HeaderView  *headerview;
116
        MessageView *messageview;
117

    
118
        FolderItem *folder_item;
119

    
120
        /* current message status */
121
        off_t total_size;
122
        gint  deleted;
123
        gint  moved;
124
        gint  copied;
125

    
126
/*
127
private:
128
*/
129
        /* table for looking up message-id */
130
        GHashTable *msgid_table;
131

    
132
        /* list for moving/deleting messages */
133
        GSList *mlist;
134
        /* table for updating folder tree */
135
        GHashTable *folder_table;
136
        /* counter for filtering */
137
        gint filtered;
138
};
139

    
140
SummaryView        *summary_create(void);
141

    
142
void summary_init                  (SummaryView                *summaryview);
143
gboolean summary_show                  (SummaryView                *summaryview,
144
                                   FolderItem                *fitem,
145
                                   gboolean                 update_cache);
146
void summary_clear_list                  (SummaryView                *summaryview);
147
void summary_clear_all                  (SummaryView                *summaryview);
148

    
149
void summary_lock                  (SummaryView                *summaryview);
150
void summary_unlock                  (SummaryView                *summaryview);
151
gboolean summary_is_locked          (SummaryView                *summaryview);
152

    
153
SummarySelection summary_get_selection_type        (SummaryView        *summaryview);
154
GSList *summary_get_selected_msg_list                (SummaryView        *summaryview);
155

    
156
void summary_select_prev_unread          (SummaryView                *summaryview);
157
void summary_select_next_unread          (SummaryView                *summaryview);
158
void summary_select_prev_new          (SummaryView                *summaryview);
159
void summary_select_next_new          (SummaryView                *summaryview);
160
void summary_select_prev_marked          (SummaryView                *summaryview);
161
void summary_select_next_marked          (SummaryView                *summaryview);
162
void summary_select_prev_labeled  (SummaryView                *summaryview);
163
void summary_select_next_labeled  (SummaryView                *summaryview);
164
void summary_select_by_msgnum          (SummaryView                *summaryview,
165
                                   guint                 msgnum);
166
void summary_select_node          (SummaryView                *summaryview,
167
                                   GtkCTreeNode                *node,
168
                                   gboolean                 display_msg,
169
                                   gboolean                 do_refresh);
170

    
171
void summary_thread_build          (SummaryView                *summaryview);
172
void summary_unthread                  (SummaryView                *summaryview);
173

    
174
void summary_expand_threads          (SummaryView                *summaryview);
175
void summary_collapse_threads          (SummaryView                *summaryview);
176

    
177
void summary_filter                  (SummaryView                *summaryview,
178
                                   gboolean                 selected_only);
179
void summary_filter_open          (SummaryView                *summaryview,
180
                                   PrefsFilterType         type);
181

    
182
void summary_sort                  (SummaryView                *summaryview,
183
                                   FolderSortKey         sort_key,
184
                                   FolderSortType         sort_type);
185

    
186
void summary_delete                  (SummaryView                *summaryview);
187
void summary_delete_duplicated          (SummaryView                *summaryview);
188

    
189
gboolean summary_execute          (SummaryView                *summaryview);
190

    
191
void summary_attract_by_subject          (SummaryView                *summaryview);
192

    
193
gint summary_write_cache          (SummaryView                *summaryview);
194

    
195
void summary_pass_key_press_event (SummaryView                *summaryview,
196
                                   GdkEventKey                *event);
197

    
198
void summary_display_msg_selected (SummaryView                *summaryview,
199
                                   gboolean                 all_headers);
200
void summary_redisplay_msg          (SummaryView                *summaryview);
201
void summary_open_msg                  (SummaryView                *summaryview);
202
void summary_view_source          (SummaryView                *summaryview);
203
void summary_reedit                  (SummaryView                *summaryview);
204
void summary_step                  (SummaryView                *summaryview,
205
                                   GtkScrollType         type);
206
void summary_toggle_view          (SummaryView                *summaryview);
207
void summary_set_marks_selected          (SummaryView                *summaryview);
208

    
209
void summary_move_selected_to          (SummaryView                *summaryview,
210
                                   FolderItem                *to_folder);
211
void summary_move_to                  (SummaryView                *summaryview);
212
void summary_copy_selected_to          (SummaryView                *summaryview,
213
                                   FolderItem                *to_folder);
214
void summary_copy_to                  (SummaryView                *summaryview);
215
void summary_save_as                  (SummaryView                *summaryview);
216
void summary_print                  (SummaryView                *summaryview);
217
void summary_mark                  (SummaryView                *summaryview);
218
void summary_unmark                  (SummaryView                *summaryview);
219
void summary_mark_as_unread          (SummaryView                *summaryview);
220
void summary_mark_as_read          (SummaryView                *summaryview);
221
void summary_mark_all_read          (SummaryView                *summaryview);
222
void summary_add_address          (SummaryView                *summaryview);
223
void summary_select_all                  (SummaryView                *summaryview);
224
void summary_unselect_all          (SummaryView                *summaryview);
225
void summary_select_thread          (SummaryView                *summaryview);
226

    
227
void summary_reply                  (SummaryView                *summaryview,
228
                                   ComposeMode                 mode);
229

    
230
void summary_set_colorlabel          (SummaryView                *summaryview,
231
                                   guint                 labelcolor,
232
                                   GtkWidget                *widget);
233
void summary_set_colorlabel_color (GtkCTree                *ctree,
234
                                   GtkCTreeNode                *node,
235
                                   guint                 labelcolor);
236

    
237
void summary_set_column_order          (SummaryView                *summaryview);
238

    
239
#endif /* __SUMMARY_H__ */