* handle the save-settings in all cases, when quiting via menu
[modest] / src / modest-widget-factory.h
index a8a72b3..4c023f3 100644 (file)
 #define __MODEST_WIDGET_FACTORY_H__
 
 #include <glib-object.h>
-#include "modest-account-mgr.h"
-#include "modest-tny-account-store.h"
+#include <glib/gi18n.h>
+#include <modest-account-mgr.h>
+#include <modest-tny-account-store.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-header-view.h>
+#include <widgets/modest-folder-view.h>
+#include <widgets/modest-msg-view.h>
+#include <widgets/modest-account-view.h>
+#include <widgets/modest-toolbar.h>
 
 G_BEGIN_DECLS
 
@@ -63,6 +65,16 @@ struct _ModestWidgetFactoryClass {
        /* void (* my_event) (ModestWidgetFactory* obj); */
 };
 
+
+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,
+};
+typedef enum _ModestComboBoxType ModestComboBoxType;
+
+
 /**
  * modest_widget_factory_get_type
  *
@@ -78,8 +90,6 @@ GType        modest_widget_factory_get_type    (void) G_GNUC_CONST;
  * @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)
  *
  * instantiates a ModestWidgetFactory
  *
@@ -87,8 +97,7 @@ GType        modest_widget_factory_get_type    (void) G_GNUC_CONST;
  */
 ModestWidgetFactory*      modest_widget_factory_new   (ModestConf *conf,
                                                       ModestTnyAccountStore *acc_store,
-                                                      ModestAccountMgr *account_mgr,
-                                                      gboolean auto_connect);
+                                                      ModestAccountMgr *account_mgr);
 /**
  * modest_widget_factory_get_folder_view
  * @self: a ModestWidgetFactory instance
@@ -145,6 +154,107 @@ ModestMsgView*           modest_widget_factory_get_msg_preview (ModestWidgetFact
 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_combo
+ * @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 combo box
+ */
+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);
+
+
+/**
+ * modest_widget_factory_get_main_toolbar
+ * @self: a ModestWidgetFactory instance
+ * @items: a list of ModestToolbarButtons (button_ids)
+ *
+ * returns the main toolbar widget; their enabled/disabled state synchronized with
+ * the other widgets. Note that after the first calling, this function will
+ * always return the same toolbar, regardless of the items
+ *  
+ * Returns: the toolbar
+ */
+ModestToolbar *modest_widget_factory_get_main_toolbar (ModestWidgetFactory *self, 
+                                                      GSList *items);
+
+/**
+ * modest_widget_factory_get_edit_toolbar
+ * @self: a ModestWidgetFactory instance
+ * @items: a list of ModestToolbarButtons (button_ids)
+ *
+ * returns the toolbar widget for edit windows; the enabled/disabled
+ * state synchronized with the other widgets.
+ *  
+ * Returns: the toolbar
+ */
+ModestToolbar *modest_widget_factory_get_edit_toolbar (ModestWidgetFactory *self, 
+                                                      GSList *items);
+
+
 G_END_DECLS
 
 #endif /* __MODEST_WIDGET_FACTORY_H__ */