X-Git-Url: http://git.maemo.org/git/?a=blobdiff_plain;f=src%2Fwidgets%2Fmodest-folder-view.h;h=cd877cc9850c5a5c9136c22e1ee169ae67013265;hb=a40fb865ad24b5534834c2af2a1b4ced85c82ada;hp=ffa99bf4d1928b42a8f848cd8af910bd67df788a;hpb=9ad90e9053e1e0cc87885f714f513061ac734632;p=modest diff --git a/src/widgets/modest-folder-view.h b/src/widgets/modest-folder-view.h index ffa99bf..cd877cc 100644 --- a/src/widgets/modest-folder-view.h +++ b/src/widgets/modest-folder-view.h @@ -30,9 +30,10 @@ #ifndef __MODEST_FOLDER_VIEW_H__ #define __MODEST_FOLDER_VIEW_H__ -#include -#include #include +#include +#include +#include G_BEGIN_DECLS @@ -55,17 +56,13 @@ struct _ModestFolderView { struct _ModestFolderViewClass { GtkTreeViewClass parent_class; - /* emitted when a folder is clicked */ - void (*folder_selected) (ModestFolderView* self, - TnyFolderIface *folder, - gpointer user_data); - - gboolean (*update_model) (ModestFolderView *self, - TnyAccountStoreIface *iface); - + /* emitted when a folder is selected or unselected */ + void (*folder_selection_changed) (ModestFolderView* self, + TnyFolder *folder, + gboolean selected, + gpointer user_data); }; - /** * modest_folder_view_get_type: * @@ -73,33 +70,54 @@ struct _ModestFolderViewClass { * * Returns: the GType */ -GType modest_folder_view_get_type (void) G_GNUC_CONST; +GType modest_folder_view_get_type (void) G_GNUC_CONST; + /** * modest_folder_view_new: - * @iface: a ModestTnyAccountStore instance + * @query: a #TnyFolderStoreQuery that specifies the folders to show * - * create a new ModestFolderView instance, based on an account store + * create a new #ModestFolderView instance * - * Returns: a new GtkWidget (a GtkTreeView-subclass) + * Returns: a new #GtkWidget (a #GtkTreeView subclass) */ -GtkWidget* modest_folder_view_new (ModestTnyAccountStore *account_store); - +GtkWidget* modest_folder_view_new (TnyFolderStoreQuery *query); /** - * modest_folder_view_is_empty: + * modest_folder_view_set_title: * @self: a ModestFolderView instance + * @title: the new title * - * check to see of the view is empty. Note that when it is empty, - * there will still be one item, telling "(empty)" or similar - * - * Returns: TRUE if the tree view is empty, FALSE otherwise + * set the title for the folder view; if title is NULL, the title column + * header will be hidden */ -gboolean modest_folder_view_is_empty (ModestFolderView *self); +void modest_folder_view_set_title (ModestFolderView *self, + const gchar *title); +/** + * modest_folder_view_get_selected: + * @self: a #ModestFolderView + * + * returns a new reference to the #TnyFolder that is already selected + * + * Returns: the selected folder or NULL if none is selected + **/ +TnyFolder* modest_folder_view_get_selected (ModestFolderView *self); + + +/** + * modest_folder_view_update_model: + * @self: a #ModestFolderView + * + * refresh the current model + * + * Returns: TRUE if the model was succesfully updated + **/ +gboolean modest_folder_view_update_model (ModestFolderView *self, + TnyAccountStore *account_store); + G_END_DECLS #endif /* __MODEST_FOLDER_VIEW_H__ */ -