#ifndef __MODEST_FOLDER_VIEW_H__
#define __MODEST_FOLDER_VIEW_H__
-#include <tny-account-tree-model.h>
-#include <tny-account-store-iface.h>
#include <glib-object.h>
+#include <tny-gtk-account-list-model.h>
+#include <tny-account-store.h>
+#include <modest-tny-account-store.h>
G_BEGIN_DECLS
struct _ModestFolderViewClass {
GtkTreeViewClass parent_class;
- /* emitted when a folder is clicked */
- void (*folder_selected) (ModestFolderView* self,
- TnyFolderIface *folder,
- gpointer user_data);
-
+ /* emitted when a folder is selected or unselected */
+ void (*folder_selection_changed) (ModestFolderView* self,
+ TnyFolder *folder,
+ gboolean selected,
+ gpointer user_data);
+
gboolean (*update_model) (ModestFolderView *self,
- TnyAccountStoreIface *iface);
+ TnyAccountStore *account_store);
+};
+
+
+/* FIXME: move these to TnyMail */
+enum {
+
+ TNY_FOLDER_TYPE_NOTES = TNY_FOLDER_TYPE_ROOT + 1, /* urgh */
+ TNY_FOLDER_TYPE_DRAFTS,
+ TNY_FOLDER_TYPE_CONTACTS,
+ TNY_FOLDER_TYPE_CALENDAR
};
GType modest_folder_view_get_type (void) G_GNUC_CONST;
+
/**
* modest_folder_view_new:
- * @iface: a ModestTnyAccountStore instance
+ * @account_store: a ModestTnyAccountStore instance
+ * @query: a folder store query for the folders to watch
*
* create a new ModestFolderView instance, based on an account store
*
* Returns: a new GtkWidget (a GtkTreeView-subclass)
*/
-GtkWidget* modest_folder_view_new (ModestTnyAccountStore *account_store);
+GtkWidget* modest_folder_view_new (ModestTnyAccountStore *account_store,
+ TnyFolderStoreQuery *query);
+
+/**
+ * modest_folder_view_set_title:
+ * @self: a ModestFolderView instance
+ * @title: the new title
+ *
+ * set the title for the folder view; if title is NULL, the title column
+ * header will be hidden
+ */
+void modest_folder_view_set_title (ModestFolderView *self, const gchar *title);
+
/**
gboolean modest_folder_view_is_empty (ModestFolderView *self);
+/**
+ * modest_folder_view_guess_folder_type:
+ * @folder: a tnymail folder
+ *
+ * guess the type of the folder, this is a class method so it does not need
+ * an ModestFolderView instance
+ *
+ * Returns: the folder type, or -1 in case of error
+ */
+TnyFolderType modest_folder_view_guess_folder_type (TnyFolder *folder);
+
+
+
+/* FIXME: this is ugly */
+const gchar* modest_folder_view_get_selected_account (ModestFolderView *self);
+
G_END_DECLS
#endif /* __MODEST_FOLDER_VIEW_H__ */
-