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
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/>.
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_
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))
63 COL_FOLLOWUP_FLAG_STATUS
,
66 COL_LOCATION
, /* vfolder location? */
73 /* subject with junk removed */
76 /* normalised strings */
83 /* Invisible columns */
90 #define MESSAGE_LIST_COLUMN_IS_ACTIVE(col) (col == COL_MESSAGE_STATUS || \
93 typedef struct _MessageList MessageList
;
94 typedef struct _MessageListClass MessageListClass
;
95 typedef struct _MessageListPrivate MessageListPrivate
;
100 MessageListPrivate
*priv
;
103 ETableExtras
*extras
;
105 GHashTable
*uid_nodemap
; /* uid (from info) -> tree node mapping */
107 GHashTable
*normalised_hash
;
109 /* Current search string, or %NULL */
112 /* are we regenerating the message_list because set_folder
113 * was just called? */
114 guint just_set_folder
: 1;
117 guint collapse_all
:1;
122 /* Where the ETree cursor is. */
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
);
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
,
183 gboolean
message_list_select (MessageList
*message_list
,
184 MessageListSelectDirection direction
,
187 gboolean
message_list_can_select (MessageList
*message_list
,
188 MessageListSelectDirection direction
,
191 void message_list_select_uid (MessageList
*message_list
,
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
,
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
,
217 #endif /* _MESSAGE_LIST_H_ */