X-Git-Url: http://git.maemo.org/git/?a=blobdiff_plain;f=src%2Fwidgets%2Fmodest-header-view.h;h=ebd24faa99cee4974bf9345f0013d55d00a69d25;hb=82a8a24cd7ae31c19e9eb787cd6cd43a918e148e;hp=c59d4db9c8d56a59b85ecf6868fec13b0a7dce20;hpb=9ac452ac9a046897f12fefbe4223ae274c8a53fb;p=modest diff --git a/src/widgets/modest-header-view.h b/src/widgets/modest-header-view.h index c59d4db..ebd24fa 100644 --- a/src/widgets/modest-header-view.h +++ b/src/widgets/modest-header-view.h @@ -36,6 +36,7 @@ #include #include #include +#include "modest-window.h" #include "modest-mail-operation.h" #include "modest-header-view-observer.h" @@ -61,25 +62,24 @@ struct _ModestHeaderView { #define MODEST_HEADER_VIEW_FLAG_SORT "header-view-flags-sort" typedef enum _ModestHeaderViewColumn { - MODEST_HEADER_VIEW_COLUMN_FROM = 0, - MODEST_HEADER_VIEW_COLUMN_TO = 1, - MODEST_HEADER_VIEW_COLUMN_SUBJECT = 2, - MODEST_HEADER_VIEW_COLUMN_SENT_DATE = 3, - MODEST_HEADER_VIEW_COLUMN_RECEIVED_DATE = 4, - MODEST_HEADER_VIEW_COLUMN_MSGTYPE = 5, - MODEST_HEADER_VIEW_COLUMN_ATTACH = 6, - MODEST_HEADER_VIEW_COLUMN_SIZE = 7, - MODEST_HEADER_VIEW_COLUMN_STATUS = 8, + MODEST_HEADER_VIEW_COLUMN_FROM, + MODEST_HEADER_VIEW_COLUMN_TO, + MODEST_HEADER_VIEW_COLUMN_SUBJECT, + MODEST_HEADER_VIEW_COLUMN_SENT_DATE, + MODEST_HEADER_VIEW_COLUMN_RECEIVED_DATE, + MODEST_HEADER_VIEW_COLUMN_ATTACH, + MODEST_HEADER_VIEW_COLUMN_SIZE, + MODEST_HEADER_VIEW_COLUMN_STATUS, /* * these two are for compact display on small devices, * with two line display with all relevant headers */ - MODEST_HEADER_VIEW_COLUMN_COMPACT_FLAG = 9, /* priority and attachments */ - MODEST_HEADER_VIEW_COLUMN_COMPACT_HEADER_IN = 10, /* incoming mail */ - MODEST_HEADER_VIEW_COLUMN_COMPACT_HEADER_OUT = 11,/* outgoing mail */ - MODEST_HEADER_VIEW_COLUMN_COMPACT_SENT_DATE = 12, - MODEST_HEADER_VIEW_COLUMN_COMPACT_RECEIVED_DATE = 13, + MODEST_HEADER_VIEW_COLUMN_COMPACT_FLAG, /* priority and attachments */ + MODEST_HEADER_VIEW_COLUMN_COMPACT_HEADER_IN, /* incoming mail */ + MODEST_HEADER_VIEW_COLUMN_COMPACT_HEADER_OUT,/* outgoing mail */ + MODEST_HEADER_VIEW_COLUMN_COMPACT_SENT_DATE, + MODEST_HEADER_VIEW_COLUMN_COMPACT_RECEIVED_DATE, MODEST_HEADER_VIEW_COLUMN_NUM @@ -103,6 +103,12 @@ typedef enum _ModestItemType { } ModestItemType; +typedef enum _ModestHeaderViewFilter { + MODEST_HEADER_VIEW_FILTER_NONE = 0, + MODEST_HEADER_VIEW_FILTER_MOVEABLE = 1 << 0, + MODEST_HEADER_VIEW_FILTER_DELETABLE = 1 << 1, +} ModestHeaderViewFilter; + struct _ModestHeaderViewClass { GtkTreeViewClass parent_class; @@ -116,6 +122,7 @@ struct _ModestHeaderViewClass { void (*header_activated) (ModestHeaderView* self, TnyHeader *header, + GtkTreePath *path, gpointer user_data); void (*msg_count_changed) (ModestHeaderView* self, @@ -161,6 +168,7 @@ GtkWidget* modest_header_view_new (TnyFolder *folder, void modest_header_view_set_folder (ModestHeaderView *self, TnyFolder *folder, gboolean refresh, + ModestWindow *progress_window, RefreshAsyncUserCallback callback, gpointer user_data); @@ -392,6 +400,40 @@ modest_header_view_paste_selection (ModestHeaderView *header_view, void modest_header_view_refilter (ModestHeaderView *header_view); /** + * modest_header_view_set_filter: + * @self: a #ModestHeaderView + * @filter: a filter mask to be applied to messages + * + * sets the special filter to be applied (affects visibility of items). + * It's a mask, and filters applied are applied with an AND. + */ +void modest_header_view_set_filter (ModestHeaderView *self, + ModestHeaderViewFilter filter); + +/** + * modest_header_view_unset_filter: + * @self: a #ModestHeaderView + * @filter: a filter mask to be unapplied to headers + * + * Unsets the special filter to be applied (affects visibility of + * items). It's a mask, and filters applied are applied with an AND. + */ +void modest_header_view_unset_filter (ModestHeaderView *self, + ModestHeaderViewFilter filter); + +/** + * modest_header_view_set_filter_string: + * @self: a #ModestHeaderView + * @filter_string: a string + * + * Set a string for filtering visible messages. If %NULL, no filtering is done. + */ +void modest_header_view_set_filter_string (ModestHeaderView *self, + const gchar *filter_string); + + + +/** * modest_header_view_add_observer: * @header_view: a #ModestHeaderView * @observer: The observer to notify. @@ -419,6 +461,22 @@ void modest_header_view_remove_observer( ModestHeaderView *header_view, ModestHeaderViewObserver *observer); +/** + * modest_header_view_get_header_at_pos: + * @header_view: a #ModestHeaderView + * @initial_x: the x coordinate + * @initial_y: the y coordinate + * + * Return the #TnyHeader stored in the row at (x,y) coordinates + * relatives to the widget. It returns a new reference so you must + * unref it once you're done with it. + * + * Returns: a #TnyHeader if found, else NULL + **/ +TnyHeader* modest_header_view_get_header_at_pos (ModestHeaderView *header_view, + gint initial_x, + gint initial_y); + G_END_DECLS