#ifndef __MODEST_HEADER_VIEW_H__
#define __MODEST_HEADER_VIEW_H__
-#include <gtk/gtk.h>
#include <tny-folder.h>
#include <tny-gtk-account-list-model.h>
#include <tny-msg.h>
MODEST_HEADER_VIEW_COLUMN_RECEIVED_DATE,
MODEST_HEADER_VIEW_COLUMN_MSGTYPE,
MODEST_HEADER_VIEW_COLUMN_ATTACH,
- MODEST_HEADER_VIEW_COLUMN_COMPACT_HEADER,
+ MODEST_HEADER_VIEW_COLUMN_SIZE,
+ /*
+ * 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_NUM
+
} ModestHeaderViewColumn;
+/*
+ * this can be extended with more style thingies,
+ * to make a small-device specific display
+ */
typedef enum _ModestHeaderViewStyle {
- MODEST_HEADER_VIEW_STYLE_NORMAL,
- MODEST_HEADER_VIEW_STYLE_COMPACT,
- MODEST_HEADER_VIEW_STYLE_NUM
+ 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_NUM
} ModestHeaderViewStyle;
typedef enum _ModestItemType {
MODEST_ITEM_TYPE_NUM
} ModestItemType;
+
struct _ModestHeaderViewClass {
GtkTreeViewClass parent_class;
/**
* modest_header_view_new:
* @folder: a TnyMsgFolder object
- * @columns: a list of ModestHeaderViewColumn
* @style: a ModestHeaderViewColumn with the style of this listview
* ( MODEST_HEADER_VIEW_STYLE_NORMAL or MODEST_HEADER_VIEW_STYLE_COMPACT)
*
* Returns: a new GtkWidget (a GtkTreeView-subclass)
*/
GtkWidget* modest_header_view_new (TnyFolder *folder,
- const GList *columns,
ModestHeaderViewStyle style);
/**
gboolean modest_header_view_set_folder (ModestHeaderView *self,
TnyFolder *folder);
-
-
-
/**
* modest_header_view_get_folder:
* @self: a ModestHeaderView instance
* You must free the list with g_list_free
*/
GList* modest_header_view_get_columns (ModestHeaderView *self);
-
+
/**
* modest_header_view_set_style:
* @self: a ModestHeaderView instance
* @style: the style for this tree view
*
- * set the style this ModestHeaderView
+ * set the style for this ModestHeaderView
*
* Returns: TRUE if it succeeded, FALSE otherwise
*/
/**
+ * modest_header_view_is_empty:
+ * @self: a valid ModestHeaderView instance
+ *
+ * see if this header view is empty; use this function instead of
+ * using the GtkTreeView parent directly, as 'empty' in this case
+ * may mean that there is one "This is empty"-message, and of course
+ * GtkTreeView then thinks it is *not* empty
+ *
+ * Returns: TRUE if the header view is empty, FALSE otherwise
+ */
+gboolean modest_header_view_is_empty (ModestHeaderView *self);
+
+
+
+/**
* modest_header_view_select_next:
* @self: a #ModestHeaderView
*
* Selects the header next to the current selected one
**/
-void modest_header_view_select_next (ModestHeaderView *self);
+void modest_header_view_select_next (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
+ in offline mode, when Modest become online, we want to reload the
+ message automatically without an user click over the header */
+void
+_modest_header_view_change_selection (GtkTreeSelection *selection,
+ gpointer user_data);
G_END_DECLS