* tests:
[modest] / src / modest-widget-factory.h
index 53cf3b0..7c0db2e 100644 (file)
 #ifndef __MODEST_WIDGET_FACTORY_H__
 #define __MODEST_WIDGET_FACTORY_H__
 
-#include <glib-object.h>
 #include "modest-account-mgr.h"
 #include "modest-tny-account-store.h"
-#include "modest-tny-header-tree-view.h"
-#include "modest-tny-folder-tree-view.h"
-#include "modest-tny-msg-view.h"
-#include "modest-account-view.h"
-
+#include "widgets/modest-header-view.h"
+#include "widgets/modest-folder-view.h"
+#include "widgets/modest-msg-view.h"
+#include "widgets/modest-account-view.h"
+#include "widgets/modest-combo-box.h"
 
 G_BEGIN_DECLS
 
@@ -54,15 +53,23 @@ typedef struct _ModestWidgetFactoryClass ModestWidgetFactoryClass;
 
 struct _ModestWidgetFactory {
         GObject parent;
-       /* insert public members, if any */
 };
 
 struct _ModestWidgetFactoryClass {
        GObjectClass parent_class;
-       /* insert signal callback declarations, eg. */
-       /* void (* my_event) (ModestWidgetFactory* obj); */
 };
 
+
+typedef enum _ModestComboBoxType {
+       MODEST_COMBO_BOX_TYPE_STORE_PROTOS,
+       MODEST_COMBO_BOX_TYPE_TRANSPORT_PROTOS,
+       MODEST_COMBO_BOX_TYPE_SECURITY_PROTOS,
+       MODEST_COMBO_BOX_TYPE_AUTH_PROTOS,
+       MODEST_COMBO_BOX_TYPE_TRANSPORTS,
+       MODEST_COMBO_BOX_TYPE_REMOTE_STORES
+} ModestComboBoxType;
+
+
 /**
  * modest_widget_factory_get_type
  *
@@ -75,22 +82,17 @@ GType        modest_widget_factory_get_type    (void) G_GNUC_CONST;
 
 /**
  * modest_widget_factory_new
- * @conf: a modest conf instance
- * @acc_store: a modest account store instance
- * @acc_mgr: a modest account mgr instance
- * @autoconnect: should we autoconnect the widgets (ie. depedent widgets are update
- * automagically)
- *
+ * @account_store: a valid ModestTnyAccountStore instance
+ * 
  * instantiates a ModestWidgetFactory
  *
  * Returns: a new ModestWidgetFactory, or NULL in case of error
  */
-ModestWidgetFactory*      modest_widget_factory_new   (ModestConf *conf,
-                                                      ModestTnyAccountStore *acc_store,
-                                                      ModestAccountMgr *account_mgr,
-                                                      gboolean auto_connect);
+ModestWidgetFactory*      modest_widget_factory_new   (ModestTnyAccountStore *account_store);
+
+
 /**
- * modest_widget_factory_get_folder_tree_widget
+ * modest_widget_factory_get_folder_view
  * @self: a ModestWidgetFactory instance
  * 
  * return the folder tree widget (ie. the widget with the list of folders);
@@ -100,11 +102,11 @@ ModestWidgetFactory*      modest_widget_factory_new   (ModestConf *conf,
  *
  * Returns: a folder tree view, or NULL in case of error
  */
-ModestTnyFolderTreeView*    modest_widget_factory_get_folder_tree_widget (ModestWidgetFactory *self);
+ModestFolderView*    modest_widget_factory_get_folder_view (ModestWidgetFactory *self);
 
 
 /**
- * modest_widget_factory_get_header_tree_widget
+ * modest_widget_factory_get_header_view
  * @self: a ModestWidgetFactory instance
  * 
  * return the header tree widget (ie. the widget with the list of headers);
@@ -114,11 +116,11 @@ ModestTnyFolderTreeView*    modest_widget_factory_get_folder_tree_widget (Modest
  *
  * Returns: a header tree view, or NULL in case of error
  */
-ModestTnyHeaderTreeView*    modest_widget_factory_get_header_tree_widget (ModestWidgetFactory *self);
+ModestHeaderView*    modest_widget_factory_get_header_view (ModestWidgetFactory *self);
 
 
 /**
- * modest_widget_factory_get_header_tree_widget
+ * modest_widget_factory_get_msg_preview
  * @self: a ModestWidgetFactory instance
  * 
  * return the message preview widget (ie. the widget with shows the currently selected message);
@@ -128,12 +130,11 @@ ModestTnyHeaderTreeView*    modest_widget_factory_get_header_tree_widget (Modest
  *
  * Returns: a header tree view, or NULL in case of error
  */
-ModestTnyMsgView*           modest_widget_factory_get_msg_preview_widget (ModestWidgetFactory *self);
-
+ModestMsgView*        modest_widget_factory_get_msg_preview (ModestWidgetFactory *self);
 
 
 /**
- * modest_widget_factory_get_account_view_widget
+ * modest_widget_factory_get_account_view
  * @self: a ModestWidgetFactory instance
  * 
  * return an account view widget (ie. the widget that shows a list of accounts)
@@ -143,11 +144,77 @@ ModestTnyMsgView*           modest_widget_factory_get_msg_preview_widget (Modest
  *
  * Returns: the account view, or NULL in case of error
  */
-ModestAccountView*    modest_widget_factory_get_account_view_widget (ModestWidgetFactory *self);
+ModestAccountView*    modest_widget_factory_get_account_view (ModestWidgetFactory *self);
+
+
+/**
+ * modest_widget_factory_get_progress_bar
+ * @self: a ModestWidgetFactory instance
+ * 
+ * return an progress bar widget 
+ * if the widget factory was created with 'auto_connect', then this progress bar
+ * will automatically update for changes in the other widgets
+ * NOTE the naming inconsistency: GtkProgressBar vs GtkStatusbar 
+ * 
+ * This factory will always return the
+ * same widget, and takes care of its lifetime - users should *not* destroy it.
+ *
+ * Returns: the progress bar widget
+ */
+GtkWidget*       modest_widget_factory_get_progress_bar (ModestWidgetFactory *self);
+
+
+
+/**
+ * modest_widget_factory_get_status_bar
+ * @self: a ModestWidgetFactory instance
+ * 
+ * return an status bar widget 
+ * if the widget factory was created with 'auto_connect', then this status bar
+ * will automatically update for changes in the other widgets
+ * NOTE the naming inconsistency: GtkProgressBar vs GtkStatusbar 
+ * 
+ * This factory will always return the
+ * same widget, and takes care of its lifetime - users should *not* destroy it.
+ *
+ * Returns: the status bar widget
+ */
+GtkWidget*     modest_widget_factory_get_status_bar (ModestWidgetFactory *self);
 
+/**
+ * modest_widget_factory_get_store
+ * @self: a ModestWidgetFactory instance
+ * @type: the type of items we want a combo box for
+ * 
+ * return a combobox with with the given items
+ *  
+ * Returns: the combo box
+ */
+GtkWidget*     modest_widget_factory_get_combo_box (ModestWidgetFactory *self,
+                                                   ModestComboBoxType type);
 
 
+/**
+ * modest_widget_factory_get_online_toggle
+ * @self: a ModestWidgetFactory instance
+ *
+ * return a toggle which with one can see whether online/offline mode is active.
+ * In case of auto-connect, this will automatically be sync'd with the
+ * account_store / device
+ *
+ * Returns: the toggle button
+ */
+GtkWidget*  modest_widget_factory_get_online_toggle (ModestWidgetFactory *self);
 
+/**
+ * modest_widget_factory_get_folder_info_label
+ * @self: a ModestWidgetFactory instance
+ *
+ * return a label with the number of items, unread items in the current folder
+ *
+ * Returns: the label
+ */
+GtkWidget*  modest_widget_factory_get_folder_info_label (ModestWidgetFactory *self);
 
 G_END_DECLS