b1ff8c3983b5609a2253cd5aacb9e8b453140731
[modest] / src / modest-ui.h
1 /* modest-ui.h */
2 /* insert (c)/licensing information) */
3
4 #ifndef __MODEST_UI_H__
5 #define __MODEST_UI_H__
6
7 #include <glib-object.h>
8 #include <gtk/gtkcontainer.h>
9 #include "modest-conf.h"
10 #include "modest-tny-msg-view.h"
11
12 G_BEGIN_DECLS
13
14 /* convenience macros */
15 #define MODEST_TYPE_UI             (modest_ui_get_type())
16 #define MODEST_UI(obj)             (G_TYPE_CHECK_INSTANCE_CAST((obj),MODEST_TYPE_UI,ModestUI))
17 #define MODEST_UI_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST((klass),MODEST_TYPE_UI,GObject))
18 #define MODEST_IS_UI(obj)          (G_TYPE_CHECK_INSTANCE_TYPE((obj),MODEST_TYPE_UI))
19 #define MODEST_IS_UI_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE((klass),MODEST_TYPE_UI))
20 #define MODEST_UI_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS((obj),MODEST_TYPE_UI,ModestUIClass))
21
22 typedef struct _ModestUI      ModestUI;
23 typedef struct _ModestUIClass ModestUIClass;
24
25 struct _ModestUI {
26          GObject parent;
27         /* insert public members, if any */
28 };
29
30 struct _ModestUIClass {
31         GObjectClass parent_class;
32         /* insert signal callback declarations, eg. */
33         /* void (* my_event) (ModestUI* obj); */
34 };
35
36
37 /**
38  * modest_ui_get_type:
39  * 
40  * get the GType for ModestUI
41  *  
42  * Returns: the GType
43  */
44 GType        modest_ui_get_type        (void) G_GNUC_CONST;
45
46
47
48 /**
49  * modest_ui_new:
50  * @modest_conf: a ModestConf instance 
51  *  
52  * Returns: a new ModestUI, or NULL in case of error
53  */
54 GObject*     modest_ui_new             (ModestConf *modest_conf);
55
56
57 /**
58  * modest_ui_show_main_window:
59  * @ui: a ModestUI instance 
60  * 
61  * show the application's main window
62  * 
63  * Returns: TRUE if succeeded, FALSE otherwise
64  */
65 gboolean     modest_ui_show_main_window (ModestUI *ui);
66
67
68 /**
69  * modest_ui_new_edit_window:
70  * @ui: a ModestUI instance 
71  * @to: people to send this to, ';' separated
72  * @cc: people to send carbon-copies (cc), ';' separated
73  * @bcc people to send blind-carbon-copies (bcc),';' separated
74  * @subject: the subject of the message
75  * @body: the body text of the message
76  * @att: a list with the filepaths for attachments
77  *  
78  * Returns: TRUE if succeeded, FALSE otherwise
79  */
80 gboolean     modest_ui_new_edit_window (ModestUI *ui,
81                                          const gchar* to,
82                                          const gchar* cc,
83                                          const gchar* bcc,
84                                          const gchar* subject,
85                                          const gchar* body,
86                                          const GSList* att);
87
88
89 GtkContainer *modest_ui_new_editor_window (ModestUI *modest_ui, gpointer *user_data);
90
91 gboolean modest_ui_editor_window_set_to_header(const gchar *to, gpointer window_data);
92 gboolean modest_ui_editor_window_set_cc_header(const gchar *cc, gpointer window_data);
93 gboolean modest_ui_editor_window_set_bcc_header(const gchar *bcc, gpointer window_data);
94 gboolean modest_ui_editor_window_set_subject_header(const gchar *subject, gpointer window_data);
95 gboolean modest_ui_editor_window_set_body(const gchar *body, gpointer window_data);
96 gboolean modest_ui_editor_window_update_attachments(gpointer window_data);
97
98 GtkContainer *modest_ui_new_viewer_window (ModestUI *modest_ui, GtkWidget *msg_view, TnyMsgIface *msg, gpointer *user_data);
99
100 G_END_DECLS
101
102 #endif /* __MODEST_UI_H__ */