1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
3 * This program is free software; you can redistribute it and/or modify it
4 * under the terms of the GNU Lesser General Public License as published by
5 * the Free Software Foundation.
7 * This program is distributed in the hope that it will be useful, but
8 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
9 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * You should have received a copy of the GNU Lesser General Public License
13 * along with this program; if not, see <http://www.gnu.org/licenses/>.
17 * Ettore Perazzoli <ettore@ximian.com>
19 * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
23 #ifndef E_MSG_COMPOSER_H
24 #define E_MSG_COMPOSER_H
26 #include <camel/camel.h>
27 #include <libebook/libebook.h>
29 #include <shell/e-shell.h>
31 #include <composer/e-composer-header-table.h>
33 /* Standard GObject macros */
34 #define E_TYPE_MSG_COMPOSER \
35 (e_msg_composer_get_type ())
36 #define E_MSG_COMPOSER(obj) \
37 (G_TYPE_CHECK_INSTANCE_CAST \
38 ((obj), E_TYPE_MSG_COMPOSER, EMsgComposer))
39 #define E_MSG_COMPOSER_CLASS(cls) \
40 (G_TYPE_CHECK_CLASS_CAST \
41 ((cls), E_TYPE_MSG_COMPOSER, EMsgComposerClass))
42 #define E_IS_MSG_COMPOSER(obj) \
43 (G_TYPE_CHECK_INSTANCE_TYPE \
44 ((obj), E_TYPE_MSG_COMPOSER))
45 #define E_IS_MSG_COMPOSER_CLASS(cls) \
46 (G_TYPE_CHECK_CLASS_TYPE \
47 ((obj), E_TYPE_MSG_COMPOSER))
48 #define E_MSG_COMPOSER_GET_CLASS(obj) \
49 (G_TYPE_INSTANCE_GET_CLASS \
50 ((obj), E_TYPE_MSG_COMPOSER, EMsgComposerClass))
54 typedef struct _EMsgComposer EMsgComposer
;
55 typedef struct _EMsgComposerClass EMsgComposerClass
;
56 typedef struct _EMsgComposerPrivate EMsgComposerPrivate
;
58 struct _EMsgComposer
{
60 EMsgComposerPrivate
*priv
;
63 struct _EMsgComposerClass
{
64 GtkWindowClass parent_class
;
67 gboolean (*presend
) (EMsgComposer
*composer
);
68 void (*print
) (EMsgComposer
*composer
,
69 GtkPrintOperationAction print_action
,
70 CamelMimeMessage
*message
,
72 void (*save_to_drafts
) (EMsgComposer
*composer
,
73 CamelMimeMessage
*message
,
75 void (*save_to_outbox
) (EMsgComposer
*composer
,
76 CamelMimeMessage
*message
,
78 void (*send
) (EMsgComposer
*composer
,
79 CamelMimeMessage
*message
,
83 GType
e_msg_composer_get_type (void);
84 EMsgComposer
* e_msg_composer_new (EShell
*shell
);
85 EMsgComposer
* e_msg_composer_new_with_message (EShell
*shell
,
86 CamelMimeMessage
*message
,
87 gboolean keep_signature
,
88 const gchar
*override_identity_uid
,
89 GCancellable
*cancellable
);
90 EMsgComposer
* e_msg_composer_new_from_url (EShell
*shell
,
92 EMsgComposer
* e_msg_composer_new_redirect (EShell
*shell
,
93 CamelMimeMessage
*message
,
94 const gchar
*identity_uid
,
95 GCancellable
*cancellable
);
96 EHTMLEditor
* e_msg_composer_get_editor (EMsgComposer
*composer
);
97 EFocusTracker
* e_msg_composer_get_focus_tracker
98 (EMsgComposer
*composer
);
99 CamelSession
* e_msg_composer_ref_session (EMsgComposer
*composer
);
100 EShell
* e_msg_composer_get_shell (EMsgComposer
*composer
);
102 void e_msg_composer_send (EMsgComposer
*composer
);
103 void e_msg_composer_save_to_drafts (EMsgComposer
*composer
);
104 void e_msg_composer_save_to_outbox (EMsgComposer
*composer
);
105 void e_msg_composer_print (EMsgComposer
*composer
,
106 GtkPrintOperationAction print_action
);
108 void e_msg_composer_set_body_text (EMsgComposer
*composer
,
110 gboolean update_signature
);
111 void e_msg_composer_set_body (EMsgComposer
*composer
,
113 const gchar
*mime_type
);
114 void e_msg_composer_add_header (EMsgComposer
*composer
,
117 void e_msg_composer_set_header (EMsgComposer
*composer
,
120 void e_msg_composer_remove_header (EMsgComposer
*composer
,
122 void e_msg_composer_set_draft_headers
123 (EMsgComposer
*composer
,
124 const gchar
*folder_uri
,
125 const gchar
*message_uid
);
126 void e_msg_composer_set_source_headers
127 (EMsgComposer
*composer
,
128 const gchar
*folder_uri
,
129 const gchar
*message_uid
,
130 CamelMessageFlags flags
);
131 void e_msg_composer_attach (EMsgComposer
*composer
,
132 CamelMimePart
*mime_part
);
133 void e_msg_composer_get_message (EMsgComposer
*composer
,
135 GCancellable
*cancellable
,
136 GAsyncReadyCallback callback
,
139 e_msg_composer_get_message_finish
140 (EMsgComposer
*composer
,
141 GAsyncResult
*result
,
143 void e_msg_composer_get_message_print
144 (EMsgComposer
*composer
,
146 GCancellable
*cancellable
,
147 GAsyncReadyCallback callback
,
150 e_msg_composer_get_message_print_finish
151 (EMsgComposer
*composer
,
152 GAsyncResult
*result
,
154 void e_msg_composer_get_message_draft
155 (EMsgComposer
*composer
,
157 GCancellable
*cancellable
,
158 GAsyncReadyCallback callback
,
161 e_msg_composer_get_message_draft_finish
162 (EMsgComposer
*composer
,
163 GAsyncResult
*result
,
166 CamelInternetAddress
*
167 e_msg_composer_get_from (EMsgComposer
*composer
);
168 CamelInternetAddress
*
169 e_msg_composer_get_reply_to (EMsgComposer
*composer
);
171 void e_msg_composer_add_message_attachments
172 (EMsgComposer
*composer
,
173 CamelMimeMessage
*message
,
174 gboolean just_inlines
);
176 void e_msg_composer_request_close (EMsgComposer
*composer
);
177 gboolean
e_msg_composer_can_close (EMsgComposer
*composer
,
178 gboolean can_save_draft
);
180 EComposerHeaderTable
*
181 e_msg_composer_get_header_table (EMsgComposer
*composer
);
183 e_msg_composer_get_attachment_view
184 (EMsgComposer
*composer
);
185 GByteArray
* e_msg_composer_get_raw_message_text_without_signature
186 (EMsgComposer
*composer
);
187 GByteArray
* e_msg_composer_get_raw_message_text
188 (EMsgComposer
*composer
);
190 gboolean
e_msg_composer_is_exiting (EMsgComposer
*composer
);
192 void e_save_spell_languages (const GList
*spell_languages
);
193 void e_msg_composer_is_from_new_message
194 (EMsgComposer
*composer
,
195 gboolean is_from_new_message
);
196 void e_msg_composer_save_focused_widget
197 (EMsgComposer
*composer
);
198 void e_msg_composer_restore_focus_on_composer
199 (EMsgComposer
*composer
);
200 gboolean
e_msg_composer_is_busy (EMsgComposer
*composer
);
203 #endif /* E_MSG_COMPOSER_H */