* Added new folder dialog
[modest] / src / widgets / modest-folder-view.h
index 5cffc0f..76186ce 100644 (file)
@@ -57,27 +57,16 @@ struct _ModestFolderViewClass {
        GtkTreeViewClass parent_class;
 
        /* 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, 
-                                 TnyAccountStore *account_store);
+       void     (*folder_selection_changed) (ModestFolderView* self,
+                                             TnyFolder *folder,
+                                             gboolean selected,
+                                             gpointer user_data);
+
+       void     (*folder_display_name_changed) (ModestFolderView* self,
+                                                const gchar *display_name,
+                                                gpointer user_data);
 };
 
-
-
-/* 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
-};
-
-
 /**
  * modest_folder_view_get_type:
  * 
@@ -85,21 +74,19 @@ enum {
  *  
  * 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:
- * @account_store: a ModestTnyAccountStore instance
- * @query: a folder store query for the folders to watch
+ * @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,
-                                          TnyFolderStoreQuery *query);
+GtkWidget*    modest_folder_view_new            (TnyFolderStoreQuery *query);
 
 /**
  * modest_folder_view_set_title:
@@ -109,37 +96,47 @@ GtkWidget* modest_folder_view_new         (ModestTnyAccountStore *account_store,
  * 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);
-
+void          modest_folder_view_set_title       (ModestFolderView *self, 
+                                                 const gchar *title);
 
 
 /**
- * modest_folder_view_is_empty:
- * @self: a ModestFolderView instance
+ * modest_folder_view_get_selected:
+ * @self: a #ModestFolderView
  * 
- * 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
- */
-gboolean     modest_folder_view_is_empty    (ModestFolderView *self);
+ * gets a new reference to the #TnyFolderStore that is already
+ * selected. The caller must free this reference
+ * 
+ * Returns: the selected #TnyFolderStore or NULL if none is selected
+ **/
+TnyFolderStore*    modest_folder_view_get_selected    (ModestFolderView *self);
 
 
 /**
- * modest_folder_view_guess_folder_type:
- * @folder: a tnymail folder
+ * modest_folder_view_update_model:
+ * @self: a #ModestFolderView
  * 
- * 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);
-
-
+ * refresh the current model
+ * 
+ * Returns: TRUE if the model was succesfully updated
+ **/
+gboolean      modest_folder_view_update_model    (ModestFolderView *self,
+                                                 TnyAccountStore *account_store);
 
-/* FIXME: this is ugly */
-const gchar* modest_folder_view_get_selected_account (ModestFolderView *self);
+/**
+ * modest_folder_view_get_selected_display_name:
+ * @self: a #ModestFolderView
+ * 
+ * returns a the display name of the currently selected
+ * #TnyFolder. Note that it could be different to the name returned by
+ * the #TnyFolder that could be get using
+ * modest_folder_view_get_selected, because it for example could
+ * contain the unread messages between brackets
+ * 
+ * Returns: the display name of the currently selected #TnyFolder or
+ * NULL if none is selected
+ **/
+const gchar* modest_folder_view_get_selected_display_name (ModestFolderView *self);
 
 G_END_DECLS