1 /* modest-editor-window.h */
2 /* insert (c)/licensing information) */
4 #ifndef __MODEST_EDITOR_WINDOW_H__
5 #define __MODEST_EDITOR_WINDOW_H__
7 #include <glib-object.h>
8 #include <gtk/gtkwindow.h>
10 #include "modest-ui.h"
11 #include "modest-tny-attachment.h"
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))
23 typedef struct _ModestEditorWindow ModestEditorWindow;
24 typedef struct _ModestEditorWindowClass ModestEditorWindowClass;
26 struct _ModestEditorWindow {
29 /* insert public members, if any */
32 struct _ModestEditorWindowClass {
33 GtkWindowClass parent_class;
36 /* member functions */
37 GType modest_editor_window_get_type (void) G_GNUC_CONST;
41 * modest_editor_window_new:
42 * @ui: a ModestUI instance
44 * Creates a new editor window instance which is a subclass of GtkWindow and
45 * lives in the ModestUI context *ui
46 * It uses an interface function modest_ui_new_editor_window() to create the
47 * the actual window contents (see its documentation for the interface specification)
49 * Returns: a GtkWindow* to show and populate
51 GObject *modest_editor_window_new (ModestUI *ui);
54 * modest_editor_window_get_data:
55 * @edit_win: a ModestEditorWindow instance
57 * Retrieves the generic data pointer from the ModestEditorWindow (which
58 * the UI interface code can use to store arbitrary (state-)data in the
59 * ModestEditorWindow widget.
61 * Returns: a gpointer to the ModestEditorWindow's data store
63 gpointer modest_editor_window_get_data(ModestEditorWindow *edit_win);
66 * modest_editor_window_set_modified:
67 * @edit_win: a ModestEditorWindow instance
68 * @modified: the modified flag for this instance
70 * Set/reset the modified flag for the instance. This flag can be used to store
71 * information whether the contents of the editor window was modified by the
72 * user or not. If it was modified (see also modest_editor_window_get_modified())
73 * a dialog can be presented to ask the user for confirmation.
75 * Returns: gboolean the new state of the modified flag
77 gboolean modest_editor_window_set_modified(ModestEditorWindow *edit_win, gboolean modified);
80 * modest_editor_window_get_modified:
81 * @edit_win: a ModestEditorWindow instance
83 * Gets the state of the modified-flag of this instance. This flag can be used to store
84 * information whether the contents of the editor window was modified by the
85 * user or not. If it was modified (see also modest_editor_window_set_modified())
86 * a dialog can be presented to ask the user for confirmation.
88 * Returns: gboolean the new state of the modified flag
90 gboolean modest_editor_window_get_modified(ModestEditorWindow *edit_win);
93 * modest_editor_window_set_to_header:
94 * @edit_win: a ModestEditorWindow instance
95 * @to: The "To:" header string for this editor instance
97 * Sets the "To:" header to the string *to
99 * Returns: TRUE on success, FALSE otherwise
101 gboolean modest_editor_window_set_to_header(ModestEditorWindow *edit_win, const gchar *to);
104 * modest_editor_window_set_cc_header:
105 * @edit_win: a ModestEditorWindow instance
106 * @cc: The "CC:" header string for this editor instance
108 * Sets the "CC:" header to the string *cc
110 * Returns: TRUE on success, FALSE otherwise
112 gboolean modest_editor_window_set_cc_header(ModestEditorWindow *edit_win, const gchar *cc);
115 * modest_editor_window_set_bcc_header:
116 * @edit_win: a ModestEditorWindow instance
117 * @bcc: The "BCC:" header string for this editor instance
119 * Sets the "BCC:" header to the string *bcc
121 * Returns: TRUE on success, FALSE otherwise
123 gboolean modest_editor_window_set_bcc_header(ModestEditorWindow *edit_win, const gchar *bcc);
126 * modest_editor_window_set_subject_header:
127 * @edit_win: a ModestEditorWindow instance
128 * @subject: The "Subject:" header string for this editor instance
130 * Sets the "Subject:" header to the string *subject
132 * Returns: TRUE on success, FALSE otherwise
134 gboolean modest_editor_window_set_subject_header(ModestEditorWindow *edit_win, const gchar *subject);
137 * modest_editor_window_set_body:
138 * @edit_win: a ModestEditorWindow instance
139 * @body: The message body string for this editor instance
141 * Sets the message body to the string *body
143 * Returns: TRUE on success, FALSE otherwise
145 gboolean modest_editor_window_set_body(ModestEditorWindow *edit_win, const gchar *body);
148 * modest_editor_window_attach_file:
149 * @edit_win: a ModestEditorWindow instance
150 * @filename: The name of the file to attach
152 * Attaches the file "filename" to the message contents
154 * Returns: TRUE on success, FALSE otherwise
156 gboolean modest_editor_window_attach_file(ModestEditorWindow *edit_win, ModestTnyAttachment *attachment);
159 * modest_editor_window_set_attachments:
160 * @edit_win: a ModestEditorWindow instance
161 * @attachments: a list of attachments
163 * Frees the current attachments, then sets the list of attachments to *attachments
165 * Returns: The new GList* of attachments.
167 GList * modest_editor_window_set_attachments(ModestEditorWindow *edit_win, const GList* attachments);
170 * modest_editor_window_get_attachments:
171 * @edit_win: a ModestEditorWindow instance
173 * Gets the GList* of attachments of this instance
175 * Returns: The GList* of attachments of this instance
177 GList * modest_editor_window_get_attachments(ModestEditorWindow *edit_win);
179 void modest_editor_window_set_identity(ModestEditorWindow *edit_win, const gchar *identity);
180 const gchar * modest_editor_window_get_identity(ModestEditorWindow *edit_win);
182 void modest_editor_window_set_transport(ModestEditorWindow *edit_win, const gchar *transport);
183 const gchar * modest_editor_window_get_transport(ModestEditorWindow *edit_win);
186 #endif /* __MODEST_EDITOR_WINDOW_H__ */