* remove some needless warnings (ie. edit windows don't have to
[modest] / src / widgets / modest-window-mgr.h
index 1453d86..6baf711 100644 (file)
@@ -31,7 +31,7 @@
 #define __MODEST_WINDOW_MGR_H__
 
 #include <glib-object.h>
-#include "widgets/modest-window.h"
+#include "widgets/modest-msg-view-window.h"
 
 G_BEGIN_DECLS
 
@@ -48,15 +48,13 @@ typedef struct _ModestWindowMgrClass ModestWindowMgrClass;
 
 struct _ModestWindowMgr {
         GObject parent;
-       /* insert public members, if any */
 };
 
 struct _ModestWindowMgrClass {
        GObjectClass parent_class;
-       /* insert signal callback declarations, eg. */
-       /* void (* my_event) (ModestWindowMgr* obj); */
 };
 
+
 /* member functions */
 GType        modest_window_mgr_get_type    (void) G_GNUC_CONST;
 
@@ -80,28 +78,163 @@ void           modest_window_mgr_register_window       (ModestWindowMgr *self,
  * @self: the #ModestWindowMgr
  * @window: a #ModestWindow
  * 
- * Unegisters a given window from the window manager. The window
+ * Unregisters a given window from the window manager. The window
  * manager will free its reference to it.
  **/
 void           modest_window_mgr_unregister_window     (ModestWindowMgr *self, 
                                                        ModestWindow *window);
 
 
+
 /**
- * modest_window_mgr_find_window_for_msgid:
- * @self: the #ModestWindowMgr
- * @msgid: the message id
- * @modest_window_type: the type of the #ModestWindow we're looking for
+ * modest_window_mgr_set_fullscreen_mode:
+ * @self: a #ModestWindowMgr
+ * @on: a #gboolean
+ * 
+ * sets/unsets the application windows in fullscreen mode
+ **/
+void           modest_window_mgr_set_fullscreen_mode   (ModestWindowMgr *self,
+                                                       gboolean on);
+
+/**
+ * modest_window_mgr_get_fullscreen_mode:
+ * @self: a #ModestWindowMgr
  * 
- * Looks for a window of a given type that have a relationship with
- * the message specified by the message id passed as argument
+ * gets the application current fullscreen mode
+ *
+ * Return value: TRUE is the application is in fullscrenn mode,
+ * otherwise FALSE
+ **/
+gboolean       modest_window_mgr_get_fullscreen_mode   (ModestWindowMgr *self);
+
+
+/**
+ * modest_window_mgr_show_toolbars:
+ * @self: a #ModestWindowMgr
+ * @show_toolbar: whether or not the toolbars should be shown
+ * @fullscreen: TRUE/FALSE for show/hide in fullscreen mode, otherwise
+ * it applies to normal mode
+ * 
+ * shows or hides the toolbars of the registered windows. Note that if
+ * the #fullscreen attribute is TRUE and the application is in normal
+ * mode, you will not see the changes until the application switches
+ * to fullscreen mode and viceversa
+ **/
+void           modest_window_mgr_show_toolbars         (ModestWindowMgr *self,
+                                                       gboolean show_toolbars,
+                                                       gboolean fullscreen);
+/**
+ * modest_window_mgr_get_main_window:
+ * @self: a #ModestWindowMgr
  *
- * Return value: the #ModestWindow if found, else NULL
+ * get the main window, or create if it's not there. don't destroy
+ * it.
+ *
+ * Returns: the main window or NULL in case of error
+ **/
+ModestWindow*  modest_window_mgr_get_main_window       (ModestWindowMgr *self);
+
+
+/**
+ * modest_window_mgr_get_easysetup_dialog:
+ * @self: a #ModestWindowMgr
+ *
+ * get the easysetup dialog; if it's NULL, there's no active dialog
+ *
+ * Returns: the easy setup dialog or NULL
+ **/
+GtkDialog*    modest_window_mgr_get_easysetup_dialog  (ModestWindowMgr *self);
+
+
+/**
+ * modest_window_mgr_get_easysetup_dialog:
+ * @self: a #ModestWindowMgr
+ *
+ * set the easysetup dialog; set it to NULL after destroying the dialog
+ *
+ * Returns: the easy setup dialog just set
+ **/
+GtkDialog*    modest_window_mgr_set_easysetup_dialog  (ModestWindowMgr *self,
+                                                      GtkDialog *dialog);
+
+
+/**
+ * modest_window_mgr_prevent_hibernation_while_window_is_shown:
+ * @self: a #ModestWindowMgr
+ * @window: The window that should prevent hibernation while it is shown.
+ * 
+ * Call this if hibernation should not be allowed because 
+ * windows are open whose state cannot sensible be saved, such as Account 
+ * Settings dialogs.
+ * This causes modest_window_mgr_get_hibernation_is_prevented() to return TRUE 
+ * until all such windows have been closed. That means, until the windows have 
+ * been hidden - window destruction or other memory management is not relevant.
+ **/
+void modest_window_mgr_prevent_hibernation_while_window_is_shown (ModestWindowMgr *self, 
+       GtkWindow *window);
+
+
+/**
+ * modest_window_mgr_find_registered_header
+ * @self: a #ModestWindowMgr
+ * @header: a valid #TnyHeader
+ * 
+ * search for the given uid in both the list of preregistered uids and in the window list;
+ * if it's available in the window list, fill the *win out-param
+ *
+ * returns TRUE if found, FALSE otherwise
+ **/
+gboolean modest_window_mgr_find_registered_header (ModestWindowMgr *self,  TnyHeader *header,
+                                              ModestWindow **win);
+
+
+/**
+ * modest_window_mgr_register_header
+ * @self: a #ModestWindowMgr
+ * @header: a valid #TnyHeader
+ * 
+ * register the uid, even before the window is created. thus, we know when
+ * some window creation might already be underway. the uid will automatically be
+ * removed when the window itself will registered
+ * 
+ **/
+void  modest_window_mgr_register_header   (ModestWindowMgr *self,  TnyHeader *header);
+       
+
+/**
+ * modest_window_mgr_unregister_header
+ * @self: a #ModestWindowMgr
+ * @header: a valid #TnyHeader
+ * 
+ * unregister the uid. We could need to do that if there is any error
+ * retrieving a message. In that case the window will not be
+ * registered and thus the header will not be removed, so we must do
+ * it manually
+ **/
+void  modest_window_mgr_unregister_header (ModestWindowMgr *self,  TnyHeader *header);
+
+/**
+ * modest_window_mgr_get_hibernation_is_prevented:
+ * @self: a #ModestWindowMgr
+ * @result: Whether any windows are currently preventing hibernation.
+ * 
+ * Use this to discover whether hibernation should not be allowed because 
+ * windows are open whose state cannot sensible be saved, such as Account 
+ * Settings dialogs. This function will return true after someone has called 
+ * modest_window_mgr_prevent_hibernation_while_window_is_shown() and before 
+ * that window has been closed.
+ **/
+gboolean modest_window_mgr_get_hibernation_is_prevented (ModestWindowMgr *self);
+
+/**
+ * modest_window_mgr_save_state_for_all_windows:
+ * @self: a #ModestWindowMgr
+ * 
+ * Save any state for all windows. For instance, call this before allowing 
+ * application hibernation.
  **/
-ModestWindow*  modest_window_mgr_find_window_for_msgid (ModestWindowMgr *self, 
-                                                       gchar *msgid, 
-                                                       GType modest_window_type);
+void modest_window_mgr_save_state_for_all_windows (ModestWindowMgr *self);
+       
 G_END_DECLS
 
 #endif /* __MODEST_WINDOW_MGR_H__ */