Fixes NB#104083, show the proper folders in move to dialog
[modest] / src / widgets / modest-folder-view.h
index ed7e973..ce58cea 100644 (file)
@@ -34,6 +34,7 @@
 #include <tny-gtk-account-list-model.h>
 #include <tny-account-store.h>
 #include <modest-tny-account-store.h>
+#include <modest-tny-folder.h>
 
 G_BEGIN_DECLS
 
@@ -50,6 +51,25 @@ typedef enum _ModestFolderViewStyle {
        MODEST_FOLDER_VIEW_STYLE_SHOW_ONE
 } ModestFolderViewStyle;
 
+typedef enum _ModestFolderViewCellStyle {
+       MODEST_FOLDER_VIEW_CELL_STYLE_DEFAULT,
+       MODEST_FOLDER_VIEW_CELL_STYLE_COMPACT
+} ModestFolderViewCellStyle;
+
+typedef enum _ModestFolderViewFilter {
+       MODEST_FOLDER_VIEW_FILTER_NONE = 0,
+       MODEST_FOLDER_VIEW_FILTER_CAN_HAVE_FOLDERS = 1 << 0,
+       MODEST_FOLDER_VIEW_FILTER_HIDE_MANDATORY_FOLDERS = 1 << 1,
+       MODEST_FOLDER_VIEW_FILTER_RENAMEABLE = 1 << 2,
+       MODEST_FOLDER_VIEW_FILTER_MOVEABLE = 1 << 3,
+       MODEST_FOLDER_VIEW_FILTER_DELETABLE = 1 << 4,
+       MODEST_FOLDER_VIEW_FILTER_HIDE_ACCOUNTS = 1 << 5,
+       MODEST_FOLDER_VIEW_FILTER_HIDE_FOLDERS = 1 << 6,
+       MODEST_FOLDER_VIEW_FILTER_HIDE_LOCAL_FOLDERS = 1 << 7,
+       MODEST_FOLDER_VIEW_FILTER_HIDE_MCC_FOLDERS = 1 << 8,
+       MODEST_FOLDER_VIEW_FILTER_SHOW_ONLY_MAILBOXES = 1<< 9,
+} ModestFolderViewFilter;
+
 typedef struct _ModestFolderView      ModestFolderView;
 typedef struct _ModestFolderViewClass ModestFolderViewClass;
 
@@ -70,6 +90,14 @@ struct _ModestFolderViewClass {
        void     (*folder_display_name_changed) (ModestFolderView* self,
                                                 const gchar *display_name,
                                                 gpointer user_data);
+
+       void     (*folder_activated) (ModestFolderView *self,
+                                     TnyFolderStore *folder,
+                                     gpointer userdata);
+
+       void     (*visible_account_changed) (ModestFolderView* self,
+                                            const gchar *account_id,
+                                            gpointer user_data);
 };
 
 /**
@@ -157,6 +185,27 @@ void         modest_folder_view_set_account_id_of_visible_server_account (Modest
                                                                          const gchar *account_id);
 
 /**
+ * modest_folder_view_set_visible_mailbox:
+ * @self: a #ModestFolderView
+ * @account_id: the remote account mailbox to show
+ * 
+ * if set an account id to filter, this filters also to show only
+ * folders of a specific mailbox.
+ **/
+void         modest_folder_view_set_mailbox (ModestFolderView *self,
+                                            const gchar *mailbox);
+
+/**
+ * modest_folder_view_get_mailbox:
+ * @self: a #ModestFolderView
+ *
+ * Return the current mailbox set for filtering in folder view
+ *
+ * Returns: a string, or %NULL
+ */
+const gchar *modest_folder_view_get_mailbox (ModestFolderView *self);
+
+/**
  * modest_folder_view_get_account_id_of_visible_server_account:
  * @self: a #ModestFolderView
  * 
@@ -242,6 +291,52 @@ void modest_folder_view_copy_model (ModestFolderView *folder_view_src, ModestFol
  **/
 void modest_folder_view_disable_next_folder_selection (ModestFolderView *self);
 
+/**
+ * modest_folder_view_set_cell_style:
+ * @self: a #ModestFolderView
+ * @cell_style: a #ModestFolderViewCellStyle
+ *
+ * Sets the way cells are shown
+ */
+void modest_folder_view_set_cell_style (ModestFolderView *self,
+                                       ModestFolderViewCellStyle cell_style);
+
+/**
+ * modest_folder_view_set_filter:
+ * @self: a #ModestFolderView
+ * @filter: a filter mask to be applied to files
+ *
+ * sets the special filter to be applied (affects visibility of items).
+ * It's a mask, and filters applied are applied with an AND.
+ */
+void modest_folder_view_set_filter (ModestFolderView *self,
+                                   ModestFolderViewFilter filter);
+
+/**
+ * modest_folder_view_unset_filter:
+ * @self: a #ModestFolderView
+ * @filter: a filter mask to be unapplied to files
+ *
+ * Unsets the special filter to be applied (affects visibility of
+ * items).  It's a mask, and filters applied are applied with an AND.
+ */
+void modest_folder_view_unset_filter (ModestFolderView *self,
+                                     ModestFolderViewFilter filter);
+
+gboolean modest_folder_view_any_folder_fulfils_rules (ModestFolderView *self,
+                                                     ModestTnyFolderRules rules);
+
+/**
+ * modest_folder_view_set_list_to_move:
+ * @self: a #ModestFolderView
+ * @list: a #TnyList, or %NULL for unsetting the current list.
+ * 
+ * list of folders or messages we're moving. This has some effects on 
+ * "show_non_move_to".
+ */
+void modest_folder_view_set_list_to_move (ModestFolderView *self,
+                                         TnyList *list);
+
 G_END_DECLS
 
 #endif /* __MODEST_FOLDER_VIEW_H__ */