
2002-02-19 Jeffrey Stedfast <fejj@ximian.com> * mail-callbacks.c (confirm_goto_next_folder): Prompt the user to find out if he/she wants to go to the next folder with unread mail in it. (find_current_folder): Find a given CamelFolderInfo node based on a given uri. (find_next_folder_r): Recursively look for a CamelFOlderInfo node which has unread messages. (find_next_folder): Given a currently selected CamelFolderInfo node, look for the next node containing unread messages. (do_evil_kludgy_goto_next_folder_hack): Find the currently selected folder and then find the very next folder after it that contains unread messages and then select it via a CORBA call to the shell. (next_unread_msg): If we fail to find an unread message in the message-list, prompt the user to find out if we should jump to the next fodler containing unread messages. If so, call do_evil_kludgy_goto_next_folder_hack(). * message-list.c (message_list_select): Return a boolean value based on whether the call was successfull or not. * mail-config.c (mail_config_get_confirm_goto_next_folder): (mail_config_set_confirm_goto_next_folder): (mail_config_get_goto_next_folder): (mail_config_set_goto_next_folder): All new functions, yay. (config_read): Read in the confirm_goto_next_folder and goto_next_folder config options. (mail_config_write_on_exit): Same the options here. svn path=/trunk/; revision=15770
145 lines
4.0 KiB
C
145 lines
4.0 KiB
C
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
|
|
#ifndef _MESSAGE_LIST_H_
|
|
#define _MESSAGE_LIST_H_
|
|
|
|
#include <gtk/gtkobject.h>
|
|
#include <gtk/gtkwidget.h>
|
|
|
|
#include <gal/e-table/e-table-simple.h>
|
|
#include <gal/e-table/e-tree-scrolled.h>
|
|
#include "mail-types.h"
|
|
|
|
#define MESSAGE_LIST_TYPE (message_list_get_type ())
|
|
#define MESSAGE_LIST(o) (GTK_CHECK_CAST ((o), MESSAGE_LIST_TYPE, MessageList))
|
|
#define MESSAGE_LIST_CLASS(k) (GTK_CHECK_CLASS_CAST((k), MESSAGE_LIST_TYPE, MessageListClass))
|
|
#define IS_MESSAGE_LIST(o) (GTK_CHECK_TYPE ((o), MESSAGE_LIST_TYPE))
|
|
#define IS_MESSAGE_LIST_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), MESSAGE_LIST_TYPE))
|
|
|
|
enum {
|
|
COL_MESSAGE_STATUS,
|
|
COL_FLAGGED,
|
|
COL_SCORE,
|
|
COL_ATTACHMENT,
|
|
COL_FROM,
|
|
COL_SUBJECT,
|
|
COL_SENT,
|
|
COL_RECEIVED,
|
|
COL_TO,
|
|
COL_SIZE,
|
|
COL_FOLLOWUP_FLAG_STATUS,
|
|
COL_FOLLOWUP_FLAG,
|
|
COL_FOLLOWUP_DUE_BY,
|
|
|
|
COL_LAST,
|
|
|
|
/* Invisible columns */
|
|
COL_DELETED,
|
|
COL_UNREAD,
|
|
COL_COLOUR,
|
|
};
|
|
|
|
#define MESSAGE_LIST_COLUMN_IS_ACTIVE(col) (col == COL_MESSAGE_STATUS || \
|
|
col == COL_FLAGGED)
|
|
|
|
#define ML_HIDE_NONE_START (0)
|
|
#define ML_HIDE_NONE_END (2147483647)
|
|
/* dont change */
|
|
#define ML_HIDE_SAME (2147483646)
|
|
|
|
struct _MessageList {
|
|
ETreeScrolled parent;
|
|
|
|
/* The table */
|
|
ETreeModel *model;
|
|
ETree *tree;
|
|
ETreePath tree_root;
|
|
ETableExtras *extras;
|
|
|
|
/* The folder */
|
|
CamelFolder *folder;
|
|
|
|
GHashTable *uid_nodemap; /* uid (from info) -> tree node mapping */
|
|
|
|
/* UID's to hide. Keys in the mempool */
|
|
/* IMPORTANT: You MUST have obtained the hide lock, to operate on this data */
|
|
GHashTable *hidden;
|
|
struct _EMemPool *hidden_pool;
|
|
int hide_unhidden, /* total length, before hiding */
|
|
hide_before, hide_after; /* hide ranges of messages */
|
|
|
|
/* Current search string, or %NULL */
|
|
char *search;
|
|
|
|
/* Are we displaying threaded view? */
|
|
gboolean threaded;
|
|
/* do we automatically hide deleted messages? */
|
|
gboolean hidedeleted;
|
|
|
|
/* Where the ETree cursor is. */
|
|
int cursor_row;
|
|
char *cursor_uid;
|
|
|
|
/* Row-selection and seen-marking timers */
|
|
guint idle_id, seen_id;
|
|
|
|
/* locks */
|
|
GMutex *hide_lock; /* for any 'hide' info above */
|
|
|
|
/* for message/folder chagned event handling */
|
|
struct _MailAsyncEvent *async_event;
|
|
};
|
|
|
|
typedef struct {
|
|
ETreeScrolledClass parent_class;
|
|
|
|
/* signals - select a message */
|
|
void (*message_selected) (MessageList *ml, const char *uid);
|
|
void (*message_list_built) (MessageList *ml);
|
|
} MessageListClass;
|
|
|
|
typedef void (*MessageListForeachFunc) (MessageList *message_list,
|
|
const char *uid,
|
|
gpointer user_data);
|
|
|
|
typedef enum {
|
|
MESSAGE_LIST_SELECT_NEXT = 1,
|
|
MESSAGE_LIST_SELECT_PREVIOUS = -1
|
|
} MessageListSelectDirection;
|
|
|
|
GtkType message_list_get_type (void);
|
|
GtkWidget *message_list_new (void);
|
|
void message_list_set_folder (MessageList *message_list,
|
|
CamelFolder *camel_folder,
|
|
gboolean outgoing);
|
|
|
|
void message_list_foreach (MessageList *message_list,
|
|
MessageListForeachFunc callback,
|
|
gpointer user_data);
|
|
|
|
gboolean message_list_select (MessageList *message_list,
|
|
MessageListSelectDirection direction,
|
|
guint32 flags,
|
|
guint32 mask,
|
|
gboolean wraparound);
|
|
|
|
void message_list_select_uid (MessageList *message_list,
|
|
const char *uid);
|
|
|
|
/* info */
|
|
unsigned int message_list_length(MessageList *ml);
|
|
unsigned int message_list_hidden(MessageList *ml);
|
|
|
|
/* hide specific messages */
|
|
void message_list_hide_add(MessageList *ml, const char *expr, unsigned int lower, unsigned int upper);
|
|
void message_list_hide_uids(MessageList *ml, GPtrArray *uids);
|
|
void message_list_hide_clear(MessageList *ml);
|
|
|
|
void message_list_set_threaded(MessageList *ml, gboolean threaded);
|
|
void message_list_set_hidedeleted(MessageList *ml, gboolean hidedeleted);
|
|
void message_list_set_search(MessageList *ml, const char *search);
|
|
|
|
#define MESSAGE_LIST_LOCK(m, l) g_mutex_lock(((MessageList *)m)->l)
|
|
#define MESSAGE_LIST_UNLOCK(m, l) g_mutex_unlock(((MessageList *)m)->l)
|
|
|
|
#endif /* _MESSAGE_LIST_H_ */
|