};
#define MODEST_HEADER_VIEW_COLUMN "header-view-column"
+#define MODEST_HEADER_VIEW_FLAG_SORT "header-view-flags-sort"
typedef enum _ModestHeaderViewColumn {
- MODEST_HEADER_VIEW_COLUMN_FROM = 0,
- 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_MSGTYPE,
- MODEST_HEADER_VIEW_COLUMN_ATTACH,
- MODEST_HEADER_VIEW_COLUMN_SIZE,
+ 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,
+
/*
* these two are for compact display on small devices,
* with two line display with all relevant headers
*/
- MODEST_HEADER_VIEW_COLUMN_COMPACT_HEADER_IN, /* incoming mail */
- MODEST_HEADER_VIEW_COLUMN_COMPACT_HEADER_OUT, /* outgoing mail */
+ 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_NUM
-
+
} ModestHeaderViewColumn;
/*
* to make a small-device specific display
*/
typedef enum _ModestHeaderViewStyle {
- MODEST_HEADER_VIEW_STYLE_DETAILS, /* many columns, single line, col headers visible */
- MODEST_HEADER_VIEW_STYLE_TWOLINES, /* two-line headers, col headers invisible */
-
+ MODEST_HEADER_VIEW_STYLE_DETAILS = 0, /* many columns, single line, col headers visible */
+ MODEST_HEADER_VIEW_STYLE_TWOLINES = 1, /* two-line headers, col headers invisible */
+
MODEST_HEADER_VIEW_STYLE_NUM
} ModestHeaderViewStyle;
void (*item_not_found) (ModestHeaderView* self,
ModestItemType type,
gpointer user_data);
-
+
+ void (*header_activated) (ModestHeaderView* self,
+ TnyHeader *header,
+ gpointer user_data);
+
/* msg == NULL implies that the operation is finished, ie.
* the progress indictation can be hidden */
void (*status_update) (ModestHeaderView* self,
* @folder: a TnyFolder object
*
* set the folder for this ModestHeaderView
- *
- * Returns: TRUE if it succeeded, FALSE otherwise
*/
-gboolean modest_header_view_set_folder (ModestHeaderView *self,
+void modest_header_view_set_folder (ModestHeaderView *self,
TnyFolder *folder);
/**
* modest_header_view_set_columns:
* @self: a ModestHeaderView instance
* @columns: a list of ModestHeaderViewColumn
+ * @type: #TnyFolderType type
*
* set the columns for this ModestHeaderView.
*
* Returns: TRUE if it succeeded, FALSE otherwise
*/
gboolean modest_header_view_set_columns (ModestHeaderView *self,
- const GList *columns);
+ const GList *columns,
+ TnyFolderType type);
/**
* modest_header_view_get_columns:
* @self: a ModestHeaderView instance
* with g_object_get_data MODEST_HEADER_VIEW_COLUMN (#define),
* and which contains the corresponding ModestHeaderViewColumn
*
- * Returns: newly allocated list of column ids, or NULL in case of no columns or error
+ * Returns: newly allocated list of #GtkTreeViewColumns objects, or NULL in case of no columns or error
* You must free the list with g_list_free
*/
GList* modest_header_view_get_columns (ModestHeaderView *self);
* modest_header_view_get_selected_headers:
* @self: a ModestHeaderView instance
*
- * get the list of the currently selected TnyHeader's
+ * get the list of the currently selected TnyHeader's. The list and
+ * the headers should be freed by the caller
*
* Returns: the list with the currently selected headers
*/
**/
void modest_header_view_select_next (ModestHeaderView *self);
+/**
+ * modest_header_view_select_prev:
+ * @self: a #ModestHeaderView
+ *
+ * Selects the previous header of the current selected one
+ **/
+void modest_header_view_select_prev (ModestHeaderView *self);
+
/* PROTECTED method. It's useful when we want to force a given
selection to reload a msg. For example if we have selected a header
_modest_header_view_change_selection (GtkTreeSelection *selection,
gpointer user_data);
+/**
+ * modest_header_view_get_sort_column_id:
+ * @self: a #ModestHeaderView
+ * @type: #TnyFolderType type
+ *
+ * Gets the selected logical columnd id for sorting.
+ **/
+gint
+modest_header_view_get_sort_column_id (ModestHeaderView *self, TnyFolderType type);
+
+/**
+ * modest_header_view_get_sort_type:
+ * @self: a #ModestHeaderView
+ * @type: #TnyFolderType type
+ *
+ * Gets the selected sort type.
+ **/
+GtkSortType
+modest_header_view_get_sort_type (ModestHeaderView *self, TnyFolderType type);
+
+/**
+ * modest_header_view_set_sort_params:
+ * @self: a #ModestHeaderView
+ * @sort_colid: logical column id to sort
+ * @sort_type: #GtkSortType sort type
+ * @type: #TnyFolderType type
+ *
+ * Sets the logical columnd id and sort type for sorting operations.
+ **/
+void
+modest_header_view_set_sort_params (ModestHeaderView *self, guint sort_colid, GtkSortType sort_type, TnyFolderType type);
+
+/**
+ * modest_header_view_set_sort_params:
+ * @self: a #ModestHeaderView
+ * @sort_colid: logical column id to sort
+ * @sort_type: #GtkSortType sort type
+ *
+ * Sorts headers treeview by logical column id, @sort_colid, using a
+ * @sort_type sorting method. In addition, new headder settings will be
+ * stored in @self object.
+ **/
+void
+modest_header_view_sort_by_column_id (ModestHeaderView *self,
+ guint sort_colid,
+ GtkSortType sort_type);
+
+
G_END_DECLS
+
#endif /* __MODEST_HEADER_VIEW_H__ */