1 /* Copyright (c) 2006,2007 Nokia Corporation
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * * Neither the name of the Nokia Corporation nor the names of its
14 * contributors may be used to endorse or promote products derived from
15 * this software without specific prior written permission.
17 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
18 * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
19 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
20 * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
21 * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
22 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
23 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
24 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
25 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 #ifndef __MODEST_WINDOW_MGR_H__
31 #define __MODEST_WINDOW_MGR_H__
33 #include <glib-object.h>
34 #include "widgets/modest-msg-view-window.h"
38 /* convenience macros */
39 #define MODEST_TYPE_WINDOW_MGR (modest_window_mgr_get_type())
40 #define MODEST_WINDOW_MGR(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),MODEST_TYPE_WINDOW_MGR,ModestWindowMgr))
41 #define MODEST_WINDOW_MGR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),MODEST_TYPE_WINDOW_MGR,GObject))
42 #define MODEST_IS_WINDOW_MGR(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),MODEST_TYPE_WINDOW_MGR))
43 #define MODEST_IS_WINDOW_MGR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),MODEST_TYPE_WINDOW_MGR))
44 #define MODEST_WINDOW_MGR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj),MODEST_TYPE_WINDOW_MGR,ModestWindowMgrClass))
46 typedef struct _ModestWindowMgr ModestWindowMgr;
47 typedef struct _ModestWindowMgrClass ModestWindowMgrClass;
49 struct _ModestWindowMgr {
51 /* insert public members, if any */
54 struct _ModestWindowMgrClass {
55 GObjectClass parent_class;
56 /* insert signal callback declarations, eg. */
57 /* void (* my_event) (ModestWindowMgr* obj); */
60 /* member functions */
61 GType modest_window_mgr_get_type (void) G_GNUC_CONST;
63 /* typical parameter-less _new function */
64 ModestWindowMgr* modest_window_mgr_new (void);
68 * modest_window_mgr_register_window:
69 * @self: the #ModestWindowMgr
70 * @window: a #ModestWindow
72 * Registers a new window in the window manager. The window manager
73 * will keep a reference.
75 void modest_window_mgr_register_window (ModestWindowMgr *self,
76 ModestWindow *window);
79 * modest_window_mgr_unregister_window:
80 * @self: the #ModestWindowMgr
81 * @window: a #ModestWindow
83 * Unregisters a given window from the window manager. The window
84 * manager will free its reference to it.
86 void modest_window_mgr_unregister_window (ModestWindowMgr *self,
87 ModestWindow *window);
91 * modest_window_mgr_find_window_by_msguid:
92 * @self: the #ModestWindowMgr
93 * @msgid: the message uid
95 * Looks for a #ModestWindow that shows the message specified by the
96 * message uid passed as argument
98 * Return value: the #ModestWindow if found, else NULL
100 ModestWindow* modest_window_mgr_find_window_by_msguid (ModestWindowMgr *self,
101 const gchar *msguid);
104 * modest_window_mgr_set_fullscreen_mode:
105 * @self: a #ModestWindowMgr
108 * sets/unsets the application windows in fullscreen mode
110 void modest_window_mgr_set_fullscreen_mode (ModestWindowMgr *self,
114 * modest_window_mgr_get_fullscreen_mode:
115 * @self: a #ModestWindowMgr
117 * gets the application current fullscreen mode
119 * Return value: TRUE is the application is in fullscrenn mode,
122 gboolean modest_window_mgr_get_fullscreen_mode (ModestWindowMgr *self);
126 * modest_window_mgr_show_toolbars:
127 * @self: a #ModestWindowMgr
128 * @show_toolbar: whether or not the toolbars should be shown
129 * @fullscreen: TRUE/FALSE for show/hide in fullscreen mode, otherwise
130 * it applies to normal mode
132 * shows or hides the toolbars of the registered windows. Note that if
133 * the #fullscreen attribute is TRUE and the application is in normal
134 * mode, you will not see the changes until the application switches
135 * to fullscreen mode and viceversa
137 void modest_window_mgr_show_toolbars (ModestWindowMgr *self,
138 gboolean show_toolbars,
139 gboolean fullscreen);
141 ModestWindow* modest_window_mgr_get_main_window (ModestWindowMgr *self);
144 * modest_window_mgr_prevent_hibernation_while_window_is_shown:
145 * @self: a #ModestWindowMgr
146 * @window: The window that should prevent hibernation while it is shown.
148 * Call this if hibernation should not be allowed because
149 * windows are open whose state cannot sensible be saved, such as Account
151 * This causes modest_window_mgr_get_hibernation_is_prevented() to return TRUE
152 * until all such windows have been closed. That means, until the windows have
153 * been hidden - window destruction or other memory management is not relevant.
155 void modest_window_mgr_prevent_hibernation_while_window_is_shown (ModestWindowMgr *self,
159 * modest_window_mgr_get_hibernation_is_prevented:
160 * @self: a #ModestWindowMgr
161 * @result: Whether any windows are currently preventing hibernation.
163 * Use this to discover whether hibernation should not be allowed because
164 * windows are open whose state cannot sensible be saved, such as Account
165 * Settings dialogs. This function will return true after someone has called
166 * modest_window_mgr_prevent_hibernation_while_window_is_shown() and before
167 * that window has been closed.
169 gboolean modest_window_mgr_get_hibernation_is_prevented (ModestWindowMgr *self);
172 * modest_window_mgr_save_state_for_all_windows:
173 * @self: a #ModestWindowMgr
175 * Save any state for all windows. For instance, call this before allowing
176 * application hibernation.
178 void modest_window_mgr_save_state_for_all_windows (ModestWindowMgr *self);
182 #endif /* __MODEST_WINDOW_MGR_H__ */