* added REALNAME to identities
[modest] / src / modest-editor-window.h
1 /* modest-editor-window.h */
2 /* insert (c)/licensing information) */
3
4 #ifndef __MODEST_EDITOR_WINDOW_H__
5 #define __MODEST_EDITOR_WINDOW_H__
6
7 #include <glib-object.h>
8 #include <gtk/gtkwindow.h>
9
10 #include "modest-ui.h"
11 #include "modest-tny-attachment.h"
12
13 G_BEGIN_DECLS
14
15 /* convenience macros */
16 #define MODEST_TYPE_EDITOR_WINDOW             (modest_editor_window_get_type())
17 #define MODEST_EDITOR_WINDOW(obj)             (G_TYPE_CHECK_INSTANCE_CAST((obj),MODEST_TYPE_EDITOR_WINDOW,ModestEditorWindow))
18 #define MODEST_EDITOR_WINDOW_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST((klass),MODEST_TYPE_EDITOR_WINDOW,GtkWindow))
19 #define MODEST_IS_EDITOR_WINDOW(obj)          (G_TYPE_CHECK_INSTANCE_TYPE((obj),MODEST_TYPE_EDITOR_WINDOW))
20 #define MODEST_IS_EDITOR_WINDOW_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE((klass),MODEST_TYPE_EDITOR_WINDOW))
21 #define MODEST_EDITOR_WINDOW_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS((obj),MODEST_TYPE_EDITOR_WINDOW,ModestEditorWindowClass))
22
23 typedef struct _ModestEditorWindow      ModestEditorWindow;
24 typedef struct _ModestEditorWindowClass ModestEditorWindowClass;
25
26 struct _ModestEditorWindow {
27          GtkWindow parent;
28         /* insert public members, if any */
29 };
30
31 struct _ModestEditorWindowClass {
32         GtkWindowClass parent_class;
33 };
34
35 /* member functions */
36 GType        modest_editor_window_get_type    (void) G_GNUC_CONST;
37
38
39 /**
40  * modest_editor_window_new:
41  * @ui: a ModestUI instance
42  *
43  * Creates a new editor window instance which is a subclass of GtkWindow and
44  * lives in the ModestUI context *ui
45  * It uses an interface function modest_ui_new_editor_window() to create the
46  * the actual window contents (see its documentation for the interface specification)
47  *
48  * Returns: a GtkWindow* to show and populate
49  */
50 GtkWidget *modest_editor_window_new         (ModestUI *ui);
51
52 /**
53  * modest_editor_window_get_data:
54  * @edit_win: a ModestEditorWindow instance
55  *
56  * Retrieves the generic data pointer from the ModestEditorWindow (which
57  * the UI interface code can use to store arbitrary (state-)data in the
58  * ModestEditorWindow widget.
59  *
60  * Returns: a gpointer to the ModestEditorWindow's data store
61  */
62 gpointer modest_editor_window_get_data(ModestEditorWindow *edit_win);
63
64 /**
65  * modest_editor_window_set_modified:
66  * @edit_win: a ModestEditorWindow instance
67  * @modified: the modified flag for this instance
68  *
69  * Set/reset the modified flag for the instance. This flag can be used to store
70  * information whether the contents of the editor window was modified by the
71  * user or not. If it was modified (see also modest_editor_window_get_modified())
72  * a dialog can be presented to ask the user for confirmation.
73  *
74  * Returns: gboolean the new state of the modified flag
75  */
76 gboolean modest_editor_window_set_modified(ModestEditorWindow *edit_win, gboolean modified);
77
78 /**
79  * modest_editor_window_get_modified:
80  * @edit_win: a ModestEditorWindow instance
81  *
82  * Gets the state of the modified-flag of this instance. This flag can be used to store
83  * information whether the contents of the editor window was modified by the
84  * user or not. If it was modified (see also modest_editor_window_set_modified())
85  * a dialog can be presented to ask the user for confirmation.
86  *
87  * Returns: gboolean the new state of the modified flag
88  */
89 gboolean modest_editor_window_get_modified(ModestEditorWindow *edit_win);
90
91 /**
92  * modest_editor_window_set_to_header:
93  * @edit_win: a ModestEditorWindow instance
94  * @to: The "To:" header string for this editor instance
95  *
96  * Sets the "To:" header to the string *to
97  *
98  * Returns: TRUE on success, FALSE otherwise
99  */
100 gboolean modest_editor_window_set_to_header(ModestEditorWindow *edit_win, const gchar *to);
101
102 /**
103  * modest_editor_window_set_cc_header:
104  * @edit_win: a ModestEditorWindow instance
105  * @cc: The "CC:" header string for this editor instance
106  *
107  * Sets the "CC:" header to the string *cc
108  *
109  * Returns: TRUE on success, FALSE otherwise
110  */
111 gboolean modest_editor_window_set_cc_header(ModestEditorWindow *edit_win, const gchar *cc);
112
113 /**
114  * modest_editor_window_set_bcc_header:
115  * @edit_win: a ModestEditorWindow instance
116  * @bcc: The "BCC:" header string for this editor instance
117  *
118  * Sets the "BCC:" header to the string *bcc
119  *
120  * Returns: TRUE on success, FALSE otherwise
121  */
122 gboolean modest_editor_window_set_bcc_header(ModestEditorWindow *edit_win, const gchar *bcc);
123
124 /**
125  * modest_editor_window_set_subject_header:
126  * @edit_win: a ModestEditorWindow instance
127  * @subject: The "Subject:" header string for this editor instance
128  *
129  * Sets the "Subject:" header to the string *subject
130  *
131  * Returns: TRUE on success, FALSE otherwise
132  */
133 gboolean modest_editor_window_set_subject_header(ModestEditorWindow *edit_win, const gchar *subject);
134
135 /**
136  * modest_editor_window_set_body:
137  * @edit_win: a ModestEditorWindow instance
138  * @body: The message body string for this editor instance
139  *
140  * Sets the message body to the string *body
141  *
142  * Returns: TRUE on success, FALSE otherwise
143  */
144 gboolean modest_editor_window_set_body(ModestEditorWindow *edit_win, const gchar *body);
145
146 /**
147  * modest_editor_window_attach_file:
148  * @edit_win: a ModestEditorWindow instance
149  * @filename: The name of the file to attach
150  *
151  * Attaches the file "filename" to the message contents
152  *
153  * Returns: TRUE on success, FALSE otherwise
154  */
155 gboolean modest_editor_window_attach_file(ModestEditorWindow *edit_win, ModestTnyAttachment *attachment);
156
157 /**
158  * modest_editor_window_set_attachments:
159  * @edit_win: a ModestEditorWindow instance
160  * @attachments: a list of attachments
161  *
162  * Frees the current attachments, then sets the list of attachments to *attachments
163  *
164  * Returns: The new GList* of attachments.
165  */
166 GList * modest_editor_window_set_attachments(ModestEditorWindow *edit_win, const GList* attachments);
167
168 /**
169  * modest_editor_window_get_attachments:
170  * @edit_win: a ModestEditorWindow instance
171  *
172  * Gets the GList* of attachments of this instance
173  *
174  * Returns: The GList* of attachments of this instance
175  */
176 GList * modest_editor_window_get_attachments(ModestEditorWindow *edit_win);
177
178 void modest_editor_window_set_identity(ModestEditorWindow *edit_win, const gchar *identity);
179 const gchar * modest_editor_window_get_identity(ModestEditorWindow *edit_win);
180
181 void modest_editor_window_set_transport(ModestEditorWindow *edit_win, const gchar *transport);
182 const gchar * modest_editor_window_get_transport(ModestEditorWindow *edit_win);
183 G_END_DECLS
184
185 #endif /* __MODEST_EDITOR_WINDOW_H__ */