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"
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 {
28 /* insert public members, if any */
31 struct _ModestEditorWindowClass {
32 GtkWindowClass parent_class;
35 /* member functions */
36 GType modest_editor_window_get_type (void) G_GNUC_CONST;
40 * modest_editor_window_new:
41 * @ui: a ModestUI instance
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)
48 * Returns: a GtkWindow* to show and populate
50 GtkWidget *modest_editor_window_new (ModestUI *ui);
53 * modest_editor_window_get_data:
54 * @edit_win: a ModestEditorWindow instance
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.
60 * Returns: a gpointer to the ModestEditorWindow's data store
62 gpointer modest_editor_window_get_data(ModestEditorWindow *edit_win);
65 * modest_editor_window_set_modified:
66 * @edit_win: a ModestEditorWindow instance
67 * @modified: the modified flag for this instance
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.
74 * Returns: gboolean the new state of the modified flag
76 gboolean modest_editor_window_set_modified(ModestEditorWindow *edit_win, gboolean modified);
79 * modest_editor_window_get_modified:
80 * @edit_win: a ModestEditorWindow instance
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_get_modified())
85 * a dialog can be presented to ask the user for confirmation.
87 * Returns: gboolean the new state of the modified flag
89 gboolean modest_editor_window_get_modified(ModestEditorWindow *edit_win);
92 * modest_editor_window_set_to_header:
93 * @edit_win: a ModestEditorWindow instance
94 * @to: The "To:" header string for this editor instance
96 * Sets the "To:" header to the string *to
98 * Returns: TRUE on success, FALSE otherwise
100 gboolean modest_editor_window_set_to_header(ModestEditorWindow *edit_win, const gchar *to);
103 * modest_editor_window_set_cc_header:
104 * @edit_win: a ModestEditorWindow instance
105 * @cc: The "CC:" header string for this editor instance
107 * Sets the "CC:" header to the string *cc
109 * Returns: TRUE on success, FALSE otherwise
111 gboolean modest_editor_window_set_cc_header(ModestEditorWindow *edit_win, const gchar *cc);
114 * modest_editor_window_set_bcc_header:
115 * @edit_win: a ModestEditorWindow instance
116 * @bcc: The "BCC:" header string for this editor instance
118 * Sets the "BCC:" header to the string *bcc
120 * Returns: TRUE on success, FALSE otherwise
122 gboolean modest_editor_window_set_bcc_header(ModestEditorWindow *edit_win, const gchar *bcc);
125 * modest_editor_window_set_subject_header:
126 * @edit_win: a ModestEditorWindow instance
127 * @subject: The "Subject:" header string for this editor instance
129 * Sets the "Subject:" header to the string *subject
131 * Returns: TRUE on success, FALSE otherwise
133 gboolean modest_editor_window_set_subject_header(ModestEditorWindow *edit_win, const gchar *subject);
136 * modest_editor_window_set_body:
137 * @edit_win: a ModestEditorWindow instance
138 * @body: The message body string for this editor instance
140 * Sets the message body to the string *body
142 * Returns: TRUE on success, FALSE otherwise
144 gboolean modest_editor_window_set_body(ModestEditorWindow *edit_win, const gchar *body);
147 * modest_editor_window_attach_file:
148 * @edit_win: a ModestEditorWindow instance
149 * @filename: The name of the file to attach
151 * Attaches the file "filename" to the message contents
153 * Returns: TRUE on success, FALSE otherwise
155 gboolean modest_editor_window_attach_file(ModestEditorWindow *edit_win, const gchar *filename);
158 * modest_editor_window_set_attachments:
159 * @edit_win: a ModestEditorWindow instance
160 * @attachments: a list of attachments
162 * Sets the list of attachments to *attachments
164 * Returns: The new GList* of attachments.
166 GList * modest_editor_window_set_attachments(ModestEditorWindow *edit_win, GList* attachments);
169 * modest_editor_window_get_attachments:
170 * @edit_win: a ModestEditorWindow instance
172 * Gets the GList* of attachments of this instance
174 * Returns: The GList* of attachments of this instance
176 GList * modest_editor_window_get_attachments(ModestEditorWindow *edit_win);
180 #endif /* __MODEST_EDITOR_WINDOW_H__ */