* lots of cleanups, removed destructive settings / test install settings
[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          GObject parent;
28          GtkWindow *window;
29         /* insert public members, if any */
30 };
31
32 struct _ModestEditorWindowClass {
33         GtkWindowClass parent_class;
34 };
35
36 /* member functions */
37 GType        modest_editor_window_get_type    (void) G_GNUC_CONST;
38
39
40 /**
41  * modest_editor_window_new:
42  * @ui: a ModestUI instance
43  *
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)
48  *
49  * Returns: a GtkWindow* to show and populate
50  */
51 GObject *modest_editor_window_new         (ModestUI *ui);
52
53 /**
54  * modest_editor_window_get_data:
55  * @edit_win: a ModestEditorWindow instance
56  *
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.
60  *
61  * Returns: a gpointer to the ModestEditorWindow's data store
62  */
63 gpointer modest_editor_window_get_data(ModestEditorWindow *edit_win);
64
65 /**
66  * modest_editor_window_set_modified:
67  * @edit_win: a ModestEditorWindow instance
68  * @modified: the modified flag for this instance
69  *
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.
74  *
75  * Returns: gboolean the new state of the modified flag
76  */
77 gboolean modest_editor_window_set_modified(ModestEditorWindow *edit_win, gboolean modified);
78
79 /**
80  * modest_editor_window_get_modified:
81  * @edit_win: a ModestEditorWindow instance
82  *
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.
87  *
88  * Returns: gboolean the new state of the modified flag
89  */
90 gboolean modest_editor_window_get_modified(ModestEditorWindow *edit_win);
91
92 /**
93  * modest_editor_window_set_to_header:
94  * @edit_win: a ModestEditorWindow instance
95  * @to: The "To:" header string for this editor instance
96  *
97  * Sets the "To:" header to the string *to
98  *
99  * Returns: TRUE on success, FALSE otherwise
100  */
101 gboolean modest_editor_window_set_to_header(ModestEditorWindow *edit_win, const gchar *to);
102
103 /**
104  * modest_editor_window_set_cc_header:
105  * @edit_win: a ModestEditorWindow instance
106  * @cc: The "CC:" header string for this editor instance
107  *
108  * Sets the "CC:" header to the string *cc
109  *
110  * Returns: TRUE on success, FALSE otherwise
111  */
112 gboolean modest_editor_window_set_cc_header(ModestEditorWindow *edit_win, const gchar *cc);
113
114 /**
115  * modest_editor_window_set_bcc_header:
116  * @edit_win: a ModestEditorWindow instance
117  * @bcc: The "BCC:" header string for this editor instance
118  *
119  * Sets the "BCC:" header to the string *bcc
120  *
121  * Returns: TRUE on success, FALSE otherwise
122  */
123 gboolean modest_editor_window_set_bcc_header(ModestEditorWindow *edit_win, const gchar *bcc);
124
125 /**
126  * modest_editor_window_set_subject_header:
127  * @edit_win: a ModestEditorWindow instance
128  * @subject: The "Subject:" header string for this editor instance
129  *
130  * Sets the "Subject:" header to the string *subject
131  *
132  * Returns: TRUE on success, FALSE otherwise
133  */
134 gboolean modest_editor_window_set_subject_header(ModestEditorWindow *edit_win, const gchar *subject);
135
136 /**
137  * modest_editor_window_set_body:
138  * @edit_win: a ModestEditorWindow instance
139  * @body: The message body string for this editor instance
140  *
141  * Sets the message body to the string *body
142  *
143  * Returns: TRUE on success, FALSE otherwise
144  */
145 gboolean modest_editor_window_set_body(ModestEditorWindow *edit_win, const gchar *body);
146
147 /**
148  * modest_editor_window_attach_file:
149  * @edit_win: a ModestEditorWindow instance
150  * @filename: The name of the file to attach
151  *
152  * Attaches the file "filename" to the message contents
153  *
154  * Returns: TRUE on success, FALSE otherwise
155  */
156 gboolean modest_editor_window_attach_file(ModestEditorWindow *edit_win, ModestTnyAttachment *attachment);
157
158 /**
159  * modest_editor_window_set_attachments:
160  * @edit_win: a ModestEditorWindow instance
161  * @attachments: a list of attachments
162  *
163  * Frees the current attachments, then sets the list of attachments to *attachments
164  *
165  * Returns: The new GList* of attachments.
166  */
167 GList * modest_editor_window_set_attachments(ModestEditorWindow *edit_win, const GList* attachments);
168
169 /**
170  * modest_editor_window_get_attachments:
171  * @edit_win: a ModestEditorWindow instance
172  *
173  * Gets the GList* of attachments of this instance
174  *
175  * Returns: The GList* of attachments of this instance
176  */
177 GList * modest_editor_window_get_attachments(ModestEditorWindow *edit_win);
178
179 void modest_editor_window_set_identity(ModestEditorWindow *edit_win, const gchar *identity);
180 const gchar * modest_editor_window_get_identity(ModestEditorWindow *edit_win);
181
182 void modest_editor_window_set_transport(ModestEditorWindow *edit_win, const gchar *transport);
183 const gchar * modest_editor_window_get_transport(ModestEditorWindow *edit_win);
184 G_END_DECLS
185
186 #endif /* __MODEST_EDITOR_WINDOW_H__ */