X-Git-Url: http://git.maemo.org/git/?p=modest;a=blobdiff_plain;f=src%2Fwidgets%2Fmodest-window-mgr.h;h=1ef0c5902610cf152a035713e6cb6fda6c6123b9;hp=93cffb9f3bd917f63db87b170e98407270ebfcf1;hb=HEAD;hpb=cc379b2109f5c1b1a70419454d1a0e53c26559e6 diff --git a/src/widgets/modest-window-mgr.h b/src/widgets/modest-window-mgr.h index 93cffb9..1ef0c59 100644 --- a/src/widgets/modest-window-mgr.h +++ b/src/widgets/modest-window-mgr.h @@ -31,7 +31,8 @@ #define __MODEST_WINDOW_MGR_H__ #include -#include "widgets/modest-msg-view-window.h" +#include "modest-window.h" +#include G_BEGIN_DECLS @@ -54,8 +55,8 @@ struct _ModestWindowMgrClass { GObjectClass parent_class; /* Virtuals */ - gboolean (*register_window) (ModestWindowMgr *self, - ModestWindow *window, + gboolean (*register_window) (ModestWindowMgr *self, + ModestWindow *window, ModestWindow *parent); void (*unregister_window) (ModestWindowMgr *self, ModestWindow *window); @@ -66,21 +67,30 @@ struct _ModestWindowMgrClass { GType window_type, gboolean show_toolbars, gboolean fullscreen); - ModestWindow * (*get_main_window) (ModestWindowMgr *self, - gboolean show); - void (*close_all_windows) (ModestWindowMgr *self); + gboolean (*close_all_windows) (ModestWindowMgr *self); GtkWindow * (*get_modal) (ModestWindowMgr *self); void (*set_modal) (ModestWindowMgr *self, GtkWindow *window, GtkWindow *parent); - gboolean (*find_registered_header) (ModestWindowMgr *self, + gboolean (*find_registered_header) (ModestWindowMgr *self, TnyHeader *header, ModestWindow **win); + gboolean (*find_registered_message_uid) (ModestWindowMgr *self, + const gchar *msg_uid, + ModestWindow **win); GList * (*get_window_list) (ModestWindowMgr *self); - + ModestWindow * (*show_initial_window) (ModestWindowMgr *self); + ModestWindow * (*get_current_top) (ModestWindowMgr *self); + gboolean (*close_all_but_initial) (ModestWindowMgr *self); + + gboolean (*screen_is_on) (ModestWindowMgr *self); + void (*create_caches) (ModestWindowMgr *self); + + ModestWindow * (*get_folder_window) (ModestWindowMgr *self); /* Signals */ void (*window_list_empty) (ModestWindowMgr *self); + void (*progress_list_changed) (ModestWindowMgr *self); }; @@ -169,38 +179,6 @@ 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 - * @show: if TRUE, create the main window and show it if it was not 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 show); - -/** - * modest_window_mgr_set_main_window: - * @self: a #ModestWindowMgr - * @main_win: a #ModestMainWindow - */ -void modest_window_mgr_set_main_window (ModestWindowMgr *self, ModestWindow *main_win); - - -/** - * 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: @@ -281,6 +259,20 @@ modest_window_mgr_get_help_id (ModestWindowMgr *self, GtkWindow *win); gboolean modest_window_mgr_find_registered_header (ModestWindowMgr *self, TnyHeader *header, ModestWindow **win); + +/** + * modest_window_mgr_find_registered_header + * @self: a #ModestWindowMgr + * @msg_uid: a message uid + * + * 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_message_uid (ModestWindowMgr *self, const gchar *msg_uid, + ModestWindow **win); + /** * modest_window_mgr_get_window_list: * @self: a #ModestWindowMgr @@ -295,9 +287,10 @@ GList *modest_window_mgr_get_window_list (ModestWindowMgr *self); * modest_window_mgr_close_all_windows * @self: a #ModestWindowMgr * - * Close all registered windows. + * Close all registered windows. If failed (for example because + * one confirmation dialog rejected the operation), return %FALSE **/ -void modest_window_mgr_close_all_windows (ModestWindowMgr *self); +gboolean modest_window_mgr_close_all_windows (ModestWindowMgr *self); /** * modest_window_mgr_register_header @@ -348,14 +341,14 @@ gboolean modest_window_mgr_get_hibernation_is_prevented (ModestWindowMgr *self); void modest_window_mgr_save_state_for_all_windows (ModestWindowMgr *self); /** - * modest_window_mgr_num_windows: + * modest_window_mgr_get_num_windows: * @self: a #ModestWindowMgr * * Gets the number of already registered windows, and pending banners * * Returns: the number of already registered windows, and pending banners **/ -gint modest_window_mgr_num_windows (ModestWindowMgr *self); +guint modest_window_mgr_get_num_windows (ModestWindowMgr *self); /** * modest_window_mgr_get_msg_view_window: @@ -378,8 +371,96 @@ GtkWidget * modest_window_mgr_get_msg_view_window (ModestWindowMgr *self); * Returns: a #ModestMsgEditWindow */ GtkWidget * modest_window_mgr_get_msg_edit_window (ModestWindowMgr *self); - + +/** + * modest_window_mgr_show_initial_window: + * @self: a #ModestWindowMgr + * + * This function determines which is the window that should be + * initially launched. After that it shows that window. If there is no + * account available this function also launches the account setup + * wizard. + * + * Returns: the initial window. NULL if something goes wrong + **/ +ModestWindow* modest_window_mgr_show_initial_window (ModestWindowMgr *self); + +/** + * modest_window_mgr_get_current_top: + * @self: a #ModestWindowMgr + * + * this function returns the ModestWindow that is currently on top of all the others + * + * Returns: the topmost #ModestWindow + **/ +ModestWindow* modest_window_mgr_get_current_top (ModestWindowMgr *self); + +/** + * modest_window_mgr_screen_is_on: + * @self: a #ModestWindowMgr + * + * this function returns if device display is on or not + * + * Returns: %TRUE if screen is on, %FALSE if not + */ +gboolean modest_window_mgr_screen_is_on (ModestWindowMgr *self); + +/** + * modest_window_mgr_get_progress_operations: + * @self: a #ModestWindowMgr + * + * get a list of operations in progress + * + * Returns: a newly allocated #TnyList + */ +TnyList *modest_window_mgr_get_progress_operations (ModestWindowMgr *self); + +/** + * modest_window_mgr_has_progress_operation: + * @self: a #ModestWindowMgr + * + * is there are send/receive or receive operations in progress for any account. + * + * Returns: %TRUE if receive progress operations are in progress. + */ +gboolean modest_window_mgr_has_progress_operation (ModestWindowMgr *self); + +/** + * modest_window_mgr_has_progress_operation_on_account: + * @self: a #ModestWindowMgr + * @account_name: a string + * + * is there are send/receive or receive operations in progress for @account_name. + * + * Returns: %TRUE if receive progress operations are in progress. + */ +gboolean modest_window_mgr_has_progress_operation_on_account (ModestWindowMgr *self, + const gchar *account_name); + +/** + * modest_window_mgr_create_caches: + * @self: a #ModestWindowMgr + * + * creates cached windows. This is called in modest main, just before the show-ui + * code. So it should be valid for the two startup ways (with --show-ui and without). + */ +void modest_window_mgr_create_caches (ModestWindowMgr *self); + +/** + * modest_window_mgr_close_all_but_initial: + * @self: a #ModestWindowMgr + * + * closes all but the initial window. + * + * Returns: %TRUE if the initial window is returned in @initial_window + * and it does not have any other dialog or window on top, otherwhise + * %FALSE + */ +gboolean modest_window_mgr_close_all_but_initial (ModestWindowMgr *self); + +ModestWindow *modest_window_mgr_get_folder_window (ModestWindowMgr *self); + + G_END_DECLS #endif /* __MODEST_WINDOW_MGR_H__ */ -