Updated Hungarian translation
[evolution.git] / mail / message-list.h
blobe5c249ae207adfe776b77bd80c9c7430b2b22120
1 /*
2 * This program is free software; you can redistribute it and/or modify it
3 * under the terms of the GNU Lesser General Public License as published by
4 * the Free Software Foundation.
6 * This program is distributed in the hope that it will be useful, but
7 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
8 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
9 * for more details.
11 * You should have received a copy of the GNU Lesser General Public License
12 * along with this program; if not, see <http://www.gnu.org/licenses/>.
15 * Authors:
16 * Jeffrey Stedfast <fejj@ximian.com>
18 * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
22 #ifndef _MESSAGE_LIST_H_
23 #define _MESSAGE_LIST_H_
25 #include <gtk/gtk.h>
26 #include <camel/camel.h>
28 #include <e-util/e-util.h>
29 #include <libemail-engine/libemail-engine.h>
31 /* Standard GObject macros */
32 #define MESSAGE_LIST_TYPE \
33 (message_list_get_type ())
34 #define MESSAGE_LIST(obj) \
35 (G_TYPE_CHECK_INSTANCE_CAST \
36 ((obj), MESSAGE_LIST_TYPE, MessageList))
37 #define MESSAGE_LIST_CLASS(cls) \
38 (G_TYPE_CHECK_CLASS_CAST \
39 ((cls), MESSAGE_LIST_TYPE, MessageListClass))
40 #define IS_MESSAGE_LIST(obj) \
41 (G_TYPE_CHECK_INSTANCE_TYPE \
42 ((obj), MESSAGE_LIST_TYPE))
43 #define IS_MESSAGE_LIST_CLASS(cls) \
44 (G_TYPE_CHECK_CLASS_TYPE \
45 ((cls), MESSAGE_LIST_TYPE))
46 #define MESSAGE_LIST_GET_CLASS(obj) \
47 (G_TYPE_INSTANCE_GET_CLASS \
48 ((obj), MESSAGE_LIST_TYPE, MessageListClass))
50 G_BEGIN_DECLS
52 enum {
53 COL_MESSAGE_STATUS,
54 COL_FLAGGED,
55 COL_SCORE,
56 COL_ATTACHMENT,
57 COL_FROM,
58 COL_SUBJECT,
59 COL_SENT,
60 COL_RECEIVED,
61 COL_TO,
62 COL_SIZE,
63 COL_FOLLOWUP_FLAG_STATUS,
64 COL_FOLLOWUP_FLAG,
65 COL_FOLLOWUP_DUE_BY,
66 COL_LOCATION, /* vfolder location? */
67 COL_SENDER,
68 COL_RECIPIENTS,
69 COL_MIXED_SENDER,
70 COL_MIXED_RECIPIENTS,
71 COL_LABELS,
73 /* subject with junk removed */
74 COL_SUBJECT_TRIMMED,
76 /* normalised strings */
77 COL_FROM_NORM,
78 COL_SUBJECT_NORM,
79 COL_TO_NORM,
81 COL_LAST,
83 /* Invisible columns */
84 COL_DELETED,
85 COL_UNREAD,
86 COL_COLOUR,
87 COL_ITALIC
90 #define MESSAGE_LIST_COLUMN_IS_ACTIVE(col) (col == COL_MESSAGE_STATUS || \
91 col == COL_FLAGGED)
93 typedef struct _MessageList MessageList;
94 typedef struct _MessageListClass MessageListClass;
95 typedef struct _MessageListPrivate MessageListPrivate;
97 struct _MessageList {
98 ETree parent;
100 MessageListPrivate *priv;
102 /* The table */
103 ETableExtras *extras;
105 GHashTable *uid_nodemap; /* uid (from info) -> tree node mapping */
107 GHashTable *normalised_hash;
109 /* Current search string, or %NULL */
110 gchar *search;
112 /* are we regenerating the message_list because set_folder
113 * was just called? */
114 guint just_set_folder : 1;
116 guint expand_all :1;
117 guint collapse_all :1;
119 /* frozen count */
120 guint frozen : 16;
122 /* Where the ETree cursor is. */
123 gchar *cursor_uid;
125 /* whether the last selection was on a single row or none/multi */
126 gboolean last_sel_single;
128 /* Row-selection and seen-marking timers */
129 guint idle_id, seen_id;
131 gchar *frozen_search; /* to save search took place while we were frozen */
134 struct _MessageListClass {
135 ETreeClass parent_class;
137 /* signals - select a message */
138 void (*message_selected) (MessageList *message_list, const gchar *uid);
139 void (*message_list_built) (MessageList *message_list);
140 void (*message_list_scrolled) (MessageList *message_list);
143 typedef enum {
144 MESSAGE_LIST_SELECT_NEXT = 0,
145 MESSAGE_LIST_SELECT_PREVIOUS = 1,
146 MESSAGE_LIST_SELECT_DIRECTION = 1, /* direction mask */
147 MESSAGE_LIST_SELECT_WRAP = 1 << 1, /* option bit */
148 MESSAGE_LIST_SELECT_INCLUDE_COLLAPSED = 1 << 2 /* whether to search collapsed nodes as well */
149 } MessageListSelectDirection;
151 GType message_list_get_type (void);
152 GtkWidget * message_list_new (EMailSession *session);
153 EMailSession * message_list_get_session (MessageList *message_list);
154 CamelFolder * message_list_ref_folder (MessageList *message_list);
155 void message_list_set_folder (MessageList *message_list,
156 CamelFolder *folder);
157 GtkTargetList * message_list_get_copy_target_list
158 (MessageList *message_list);
159 GtkTargetList * message_list_get_paste_target_list
160 (MessageList *message_list);
161 void message_list_set_expanded_default
162 (MessageList *message_list,
163 gboolean expanded_default);
164 gboolean message_list_get_group_by_threads
165 (MessageList *message_list);
166 void message_list_set_group_by_threads
167 (MessageList *message_list,
168 gboolean group_by_threads);
169 gboolean message_list_get_show_deleted (MessageList *message_list);
170 void message_list_set_show_deleted (MessageList *message_list,
171 gboolean show_deleted);
172 gboolean message_list_get_thread_latest (MessageList *message_list);
173 void message_list_set_thread_latest (MessageList *message_list,
174 gboolean thread_latest);
175 gboolean message_list_get_thread_subject (MessageList *message_list);
176 void message_list_set_thread_subject (MessageList *message_list,
177 gboolean thread_subject);
178 void message_list_freeze (MessageList *message_list);
179 void message_list_thaw (MessageList *message_list);
180 GPtrArray * message_list_get_selected (MessageList *message_list);
181 void message_list_set_selected (MessageList *message_list,
182 GPtrArray *uids);
183 gboolean message_list_select (MessageList *message_list,
184 MessageListSelectDirection direction,
185 guint32 flags,
186 guint32 mask);
187 gboolean message_list_can_select (MessageList *message_list,
188 MessageListSelectDirection direction,
189 guint32 flags,
190 guint32 mask);
191 void message_list_select_uid (MessageList *message_list,
192 const gchar *uid,
193 gboolean with_fallback);
194 void message_list_select_next_thread (MessageList *message_list);
195 void message_list_select_prev_thread (MessageList *message_list);
196 void message_list_select_all (MessageList *message_list);
197 void message_list_select_thread (MessageList *message_list);
198 void message_list_select_subthread (MessageList *message_list);
199 void message_list_copy (MessageList *message_list,
200 gboolean cut);
201 void message_list_paste (MessageList *message_list);
202 guint message_list_count (MessageList *message_list);
203 guint message_list_selected_count (MessageList *message_list);
204 void message_list_set_threaded_expand_all
205 (MessageList *message_list);
206 void message_list_set_threaded_collapse_all
207 (MessageList *message_list);
208 void message_list_set_search (MessageList *message_list,
209 const gchar *search);
210 void message_list_save_state (MessageList *message_list);
212 void message_list_sort_uids (MessageList *message_list,
213 GPtrArray *uids);
215 G_END_DECLS
217 #endif /* _MESSAGE_LIST_H_ */