
2002-11-27 Not Zed <NotZed@Ximian.com> * message-tag-followup.c (construct): gnome_pixmap -> gtkimage. (construct): gtk_clist -> gtk_tree_view, setup columns. They dont size well :-/ (message_tag_followup_append_message): Append using model, remove clist stuff. (construct): Show date edit (glade bugs?) * folder-browser.c (folder_browser_class_init): gtk_marshal -> g_cclosure_marshal (setup_popup_icons): gnome_pixmap -> gtk_image. (on_right_click): gtk_pixmap -> gtk_image. * mail-accounts.c (account_delete_clicked): removed #if 0'd out code. * mail-send-recv.c (receive_done): remove FIXME and extra unref. * mail-session.c (request_password): Removed #if 0'd out stuff. * mail-vfolder.c (new_rule_clicked): proper cast for g_object_get_data. * mail-local.c (reconfigure_response): cast for g_object_get_data. * mail-account-editor.c (construct): GNOME_DIALOG -> GTK_DIALOG. * *.[ch]: re-ran fix.sh for e_notice change * mail-callbacks.c (save_msg_ok): g_object_get_data + gtk_object_remove_no_notify -> g_object_steal_data. (find_socket): gtk_container_children -> gtk_container_get_children (edit_msg): gnome_*_dialog -> gtk_message_dialog. (resent_msg): " (search_msg): " (confirm_goto_next_folder): gtkmessagedialogised (even if not used). (confirm_expunge): gtkmessagedialogised (filter_edit): " (do_mail_print): e_notice -> gtk_message_dialog. (are_you_sure): removed e_gnome_ok_cancel_dialog crap, replaced with a gtk dialog. (are_you_sure): gtkmessagedialogised. (edit_msg_internal): Dont free uids array, are_you_sure() free's it. (resend_msg): Same. (check_send_configuration): Use e_notice for stuff. Sigh, here we go again ...! (e_question): A utility function to ask a question, potentially with 'dont ask again' as well. (configure_mail): use e_question to save code. Here we go again, again ... (ask_confirm_for_unwanted_html_mail): " (ask_confirm_for_only_bcc): " (ask_confirm_for_only_bcc): " (composer_get_message): Use e_notice. (composer_save_draft_cb): Use e_question (edit_msg): use e_notice, & change to an ERROR. (resend_msg): same. (save_msg_ok): Properly initialise ret to OK, and use e_question, and use access() to determine existance/write access rather than stat, display an error if we can't write to a file that exists, and print the filename in all dialogues. (confirm_goto_next_folder): Use e_question. (confirm_expunge): use e_question. (filter_edit): Use e_notice. (do_mail_print): use e_notice. svn path=/trunk/; revision=18974
161 lines
4.4 KiB
C
161 lines
4.4 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) (G_TYPE_CHECK_INSTANCE_CAST ((o), MESSAGE_LIST_TYPE, MessageList))
|
|
#define MESSAGE_LIST_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), MESSAGE_LIST_TYPE, MessageListClass))
|
|
#define IS_MESSAGE_LIST(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), MESSAGE_LIST_TYPE))
|
|
#define IS_MESSAGE_LIST_CLASS(k) (G_TYPE_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_LOCATION, /* vfolder location? */
|
|
|
|
/* normalised strings */
|
|
COL_FROM_NORM,
|
|
COL_SUBJECT_NORM,
|
|
COL_TO_NORM,
|
|
|
|
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 */
|
|
|
|
GHashTable *normalised_hash;
|
|
|
|
/* 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 */
|
|
|
|
/* list of outstanding regeneration requests */
|
|
GList *regen;
|
|
|
|
/* the current camel folder thread tree, if any */
|
|
struct _CamelFolderThread *thread_tree;
|
|
|
|
/* 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);
|
|
|
|
void message_list_select_next_thread (MessageList *messageList);
|
|
|
|
/* 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_ */
|