X-Git-Url: http://git.maemo.org/git/?a=blobdiff_plain;f=src%2Fwidgets%2Fmodest-window-mgr.h;h=455f17c067948b83b465befea47f862029339903;hb=f7a80e39c3b0725566145d3bc2357846610bdcfb;hp=43c636c373f4dc20b581714a268f4d5f88a37db1;hpb=8790badc52054c9d03d55037b10599bf828008d4;p=modest diff --git a/src/widgets/modest-window-mgr.h b/src/widgets/modest-window-mgr.h index 43c636c..455f17c 100644 --- a/src/widgets/modest-window-mgr.h +++ b/src/widgets/modest-window-mgr.h @@ -80,25 +80,13 @@ 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_by_msguid: - * @self: the #ModestWindowMgr - * @msgid: the message uid - * - * Looks for a #ModestWindow that shows the message specified by the - * message uid passed as argument - * - * Return value: the #ModestWindow if found, else NULL - **/ -ModestWindow* modest_window_mgr_find_window_by_msguid (ModestWindowMgr *self, - const gchar *msguid); /** * modest_window_mgr_set_fullscreen_mode: @@ -137,6 +125,86 @@ gboolean modest_window_mgr_get_fullscreen_mode (ModestWindowMgr *self); void modest_window_mgr_show_toolbars (ModestWindowMgr *self, gboolean show_toolbars, gboolean fullscreen); + +ModestWindow* modest_window_mgr_get_main_window (ModestWindowMgr *self); + +/** + * 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. + **/ +void modest_window_mgr_save_state_for_all_windows (ModestWindowMgr *self); + G_END_DECLS #endif /* __MODEST_WINDOW_MGR_H__ */