1 /* modest-window-mgr.h */
2 /* insert (c)/licensing information) */
4 #ifndef __MODEST_WINDOW_MGR_H__
5 #define __MODEST_WINDOW_MGR_H__
7 #include <glib-object.h>
8 /* other include files */
12 /* convenience macros */
13 #define MODEST_TYPE_WINDOW_MGR (modest_window_mgr_get_type())
14 #define MODEST_WINDOW_MGR(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),MODEST_TYPE_WINDOW_MGR,ModestWindowMgr))
15 #define MODEST_WINDOW_MGR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),MODEST_TYPE_WINDOW_MGR,GObject))
16 #define MODEST_IS_WINDOW_MGR(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),MODEST_TYPE_WINDOW_MGR))
17 #define MODEST_IS_WINDOW_MGR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),MODEST_TYPE_WINDOW_MGR))
18 #define MODEST_WINDOW_MGR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj),MODEST_TYPE_WINDOW_MGR,ModestWindowMgrClass))
21 MODEST_MAIN_WINDOW, /* the main window */
22 MODEST_EDIT_WINDOW, /* a window to edit a mail */
23 MODEST_ACCOUNT_WINDOW, /* a window to edit account information */
24 MODEST_VIEW_WINDOW /* a window to view mails */
26 typedef guint ModestWindowType;
29 typedef struct _ModestOpenWindow ModestOpenWindow;
30 struct _ModestOpenWindow {
32 ModestWindowType type;
37 typedef struct _ModestWindowMgr ModestWindowMgr;
38 typedef struct _ModestWindowMgrClass ModestWindowMgrClass;
40 struct _ModestWindowMgr {
44 struct _ModestWindowMgrClass {
45 GObjectClass parent_class;
47 void (* last_window_closed) (ModestWindowMgr* obj);
50 /* member functions */
51 GType modest_window_mgr_get_type (void) G_GNUC_CONST;
54 * modest_window_mgr_new:
56 * creates a new ModestWindowMgr instance
58 * Returns: a new ModestWindowMgr, or NULL in case of error
60 GObject* modest_window_mgr_new (void);
63 * modest_window_mgr_register:
64 * @self: a ModestWindowMgr instance
65 * @win: the GObject of the window to register
66 * @type: ModestWindowType of the window to register
67 * @window_id: a guint window_id of the window
69 * register a window with the ModestWindowMgr instance *self
71 * Returns: TRUE on success, else FALSE
73 gboolean modest_window_mgr_register (ModestWindowMgr *self, GObject *win,
74 ModestWindowType type, guint window_id);
77 * modest_window_mgr_unregister:
78 * @self: a ModestWindowMgr instance
79 * @win: the GObject of the window to register
81 * unregister a window from the ModestWindowMgr instance *self
83 * Returns: TRUE on success, else FALSE
85 gboolean modest_window_mgr_unregister (ModestWindowMgr *self, GObject *win);
88 * modest_window_mgr_find_by_type:
89 * @self: a ModestWindowMgr instance
90 * @type: the ModestWindowType to search for
92 * search for a window of type 'type' in the ModestWindowMgr instance *self
94 * Returns: the GObject of the window, else NULL
96 GObject* modest_window_mgr_find_by_type (ModestWindowMgr *self, ModestWindowType type);
99 * modest_window_mgr_find_by_id:
100 * @self: a ModestWindowMgr instance
101 * @window_id: the ModestWindowType to search for
103 * search for a window with a specific 'window_id' in the ModestWindowMgr instance *self
105 * Returns: the GObject of the window, else NULL
107 GObject* modest_window_mgr_find_by_id (ModestWindowMgr *self, gint window_id);
111 #endif /* __MODEST_WINDOW_MGR_H__ */