X-Git-Url: http://git.maemo.org/git/?a=blobdiff_plain;f=src%2Fwidgets%2Fmodest-window-mgr.h;h=60ef0ae10adca127daafcd1b36b7413b39246fbe;hb=afe78d490ee95a6758862c43780686343c5a55d7;hp=700faa2c83bb701c94b732f5a25b3c2f9cd52449;hpb=38b186699f0cfd984f71dccb62b7006e07b0f0a8;p=modest diff --git a/src/widgets/modest-window-mgr.h b/src/widgets/modest-window-mgr.h index 700faa2..60ef0ae 100644 --- a/src/widgets/modest-window-mgr.h +++ b/src/widgets/modest-window-mgr.h @@ -48,15 +48,16 @@ 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); */ + + /* Signals */ + void (*window_list_empty) (ModestWindowMgr *self); }; + /* member functions */ GType modest_window_mgr_get_type (void) G_GNUC_CONST; @@ -87,18 +88,6 @@ void modest_window_mgr_unregister_window (ModestWindowMgr *self, ModestWindow *window); -/** - * modest_window_mgr_find_window_by_header: - * @self: the #ModestWindowMgr - * @msgid: the message uid - * - * Looks for a #ModestWindow that shows the message whose header is - * passed as argument - * - * Return value: the #ModestWindow if found, else NULL - **/ -ModestWindow* modest_window_mgr_find_window_by_header (ModestWindowMgr *self, - TnyHeader *header); /** * modest_window_mgr_set_fullscreen_mode: @@ -125,6 +114,7 @@ gboolean modest_window_mgr_get_fullscreen_mode (ModestWindowMgr *self); /** * modest_window_mgr_show_toolbars: * @self: a #ModestWindowMgr + * @window_type: apply the show toolbars command only to the windows of this type * @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 @@ -135,10 +125,56 @@ gboolean modest_window_mgr_get_fullscreen_mode (ModestWindowMgr *self); * to fullscreen mode and viceversa **/ void modest_window_mgr_show_toolbars (ModestWindowMgr *self, + GType window_type, gboolean show_toolbars, gboolean fullscreen); +/** + * modest_window_mgr_get_main_window: + * @self: a #ModestWindowMgr + * @create: if TRUE, create the main window if it was not yet existing + * + * get the main window, and depending on @create, create one if it does not exist yet + * + * Returns: the main window or NULL in case of error, or the main-window + * did not yet exist + **/ +ModestWindow* modest_window_mgr_get_main_window (ModestWindowMgr *self, + gboolean create); + + +/** + * modest_window_mgr_main_window_exists: + * @self: a #ModestWindowMgr + * + * do we have a main window? + * + * Returns: TRUE if there's a main window, FALSE otherwise + **/ +gboolean modest_window_mgr_main_window_exists (ModestWindowMgr *self); + + + +/** + * modest_window_mgr_get_modal: + * @self: a #ModestWindowMgr + * + * get the modal window; if it's NULL, there's no active modal window + * + * Returns: the modal window or NULL + **/ +GtkWindow* modest_window_mgr_get_modal (ModestWindowMgr *self); + -ModestWindow* modest_window_mgr_get_main_window (ModestWindowMgr *self); +/** + * modest_window_mgr_get_easysetup_dialog: + * @self: a #ModestWindowMgr + * + * set the modal dialog; set it to NULL after destroying the dialog + * + * Returns: the modal dialog just set + **/ +void modest_window_mgr_set_modal (ModestWindowMgr *self, + GtkWindow *window); /** * modest_window_mgr_prevent_hibernation_while_window_is_shown: @@ -155,6 +191,83 @@ ModestWindow* modest_window_mgr_get_main_window (ModestWindowMgr *self); void modest_window_mgr_prevent_hibernation_while_window_is_shown (ModestWindowMgr *self, GtkWindow *window); + + +/** + * modest_window_mgr_register_help_id + * @self: a #ModestWindowMgr + * @win: some window + * @help_id: the help_id for this window + * + * register a help id for a window + **/ +void +modest_window_mgr_register_help_id (ModestWindowMgr *self, GtkWindow *win, const gchar* help_id); + + +/** + * modest_window_mgr_get_help_id: + * @self: a #ModestWindowMgr + * @win: some window + * + * get the help id for a window; if the window is the main-window and some folder is + * selected, it will return the proper help_id for that + * + * Returns: a help _id + **/ +const gchar* +modest_window_mgr_get_help_id (ModestWindowMgr *self, GtkWindow *win); + + + +/** + * 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_close_all_windows + * @self: a #ModestWindowMgr + * + * Close all registered windows. + **/ +void modest_window_mgr_close_all_windows (ModestWindowMgr *self); + +/** + * modest_window_mgr_register_header + * @self: a #ModestWindowMgr + * @header: a valid #TnyHeader + * @alt_uid: alternative uid in case @header does not provide one + * + * 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, const gchar *alt_uid); + + +/** + * 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 @@ -176,6 +289,38 @@ gboolean modest_window_mgr_get_hibernation_is_prevented (ModestWindowMgr *self); * application hibernation. **/ void modest_window_mgr_save_state_for_all_windows (ModestWindowMgr *self); + +/** + * modest_window_mgr_num_windows: + * @self: a #ModestWindowMgr + * + * Gets the number of already registered windows + * + * Returns: the number of already registered windows + **/ +gint modest_window_mgr_num_windows (ModestWindowMgr *self); + +/** + * modest_window_mgr_get_msg_view_window: + * @self: a #ModestWindowMgr + * + * obtain a cached #ModestMsgViewWindow if available, or construct a new + * one. + * + * Returns: a #ModestMsgViewWindow + */ +GtkWidget * modest_window_mgr_get_msg_view_window (ModestWindowMgr *self); + +/** + * modest_window_mgr_get_msg_edit_window: + * @self: a #ModestWindowMgr + * + * obtain a cached #ModestMsgEditWindow if available, or construct a new + * one. + * + * Returns: a #ModestMsgEditWindow + */ +GtkWidget * modest_window_mgr_get_msg_edit_window (ModestWindowMgr *self); G_END_DECLS