1788690e3946a060e928720a57f4d8a329642357
[modest] / src / gnome / modest-msg-edit-window.c
1 /* Copyright (c) 2006, Nokia Corporation
2  * All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions are
6  * met:
7  *
8  * * Redistributions of source code must retain the above copyright
9  *   notice, this list of conditions and the following disclaimer.
10  * * Redistributions in binary form must reproduce the above copyright
11  *   notice, this list of conditions and the following disclaimer in the
12  *   documentation and/or other materials provided with the distribution.
13  * * Neither the name of the Nokia Corporation nor the names of its
14  *   contributors may be used to endorse or promote products derived from
15  *   this software without specific prior written permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
18  * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
19  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
20  * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
21  * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
22  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
23  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
24  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
25  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
26  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
27  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28  */
29 #include <glib/gi18n.h>
30 #include <string.h>
31 #include <tny-account-store.h>
32 #include <tny-simple-list.h>
33 #include <modest-conf.h>
34 #include <modest-runtime.h>
35 #include <modest-tny-msg.h>
36
37 #include <widgets/modest-window-priv.h>
38 #include <widgets/modest-msg-edit-window.h>
39 #include <widgets/modest-msg-edit-window-ui.h>
40 #include <widgets/modest-combo-box.h>
41
42 #include <modest-widget-memory.h>
43 #include <modest-account-mgr-helpers.h>
44
45 static void  modest_msg_edit_window_class_init   (ModestMsgEditWindowClass *klass);
46 static void  modest_msg_edit_window_init         (ModestMsgEditWindow *obj);
47 static void  modest_msg_edit_window_finalize     (GObject *obj);
48
49 /* list my signals */
50 enum {
51         /* MY_SIGNAL_1, */
52         /* MY_SIGNAL_2, */
53         LAST_SIGNAL
54 };
55
56 typedef struct _ModestMsgEditWindowPrivate ModestMsgEditWindowPrivate;
57 struct _ModestMsgEditWindowPrivate {
58
59         GtkWidget   *toolbar;
60         GtkWidget   *menubar;
61
62         GtkWidget   *msg_body;
63         
64         ModestProtoList *from_field_protos;
65         GtkWidget   *from_field;
66         
67         GtkWidget   *to_field;
68         GtkWidget   *cc_field;
69         GtkWidget   *bcc_field;
70         GtkWidget   *subject_field;
71 };
72
73 #define MODEST_MSG_EDIT_WINDOW_GET_PRIVATE(o)      (G_TYPE_INSTANCE_GET_PRIVATE((o), \
74                                                     MODEST_TYPE_MSG_EDIT_WINDOW, \
75                                                     ModestMsgEditWindowPrivate))
76 /* globals */
77 static GtkWindowClass *parent_class = NULL;
78
79 /* uncomment the following if you have defined any signals */
80 /* static guint signals[LAST_SIGNAL] = {0}; */
81
82 GType
83 modest_msg_edit_window_get_type (void)
84 {
85         static GType my_type = 0;
86         if (!my_type) {
87                 static const GTypeInfo my_info = {
88                         sizeof(ModestMsgEditWindowClass),
89                         NULL,           /* base init */
90                         NULL,           /* base finalize */
91                         (GClassInitFunc) modest_msg_edit_window_class_init,
92                         NULL,           /* class finalize */
93                         NULL,           /* class data */
94                         sizeof(ModestMsgEditWindow),
95                         1,              /* n_preallocs */
96                         (GInstanceInitFunc) modest_msg_edit_window_init,
97                         NULL
98                 };
99                 my_type = g_type_register_static (MODEST_TYPE_WINDOW,
100                                                   "ModestMsgEditWindow",
101                                                   &my_info, 0);
102         }
103         return my_type;
104 }
105
106
107 static void
108 save_state (ModestWindow *self)
109 {
110         modest_widget_memory_save (modest_runtime_get_conf (),
111                                     G_OBJECT(self), "modest-edit-msg-window");
112 }
113
114
115 static void
116 restore_settings (ModestMsgEditWindow *self)
117 {
118         modest_widget_memory_restore (modest_runtime_get_conf (),
119                                       G_OBJECT(self), "modest-edit-msg-window");
120 }
121
122 static void
123 modest_msg_edit_window_class_init (ModestMsgEditWindowClass *klass)
124 {
125         GObjectClass *gobject_class;
126         ModestWindowClass *modest_window_class;
127         
128         gobject_class = (GObjectClass*) klass;
129         modest_window_class = (ModestWindowClass*) klass;
130
131         parent_class            = g_type_class_peek_parent (klass);
132         gobject_class->finalize = modest_msg_edit_window_finalize;
133
134         g_type_class_add_private (gobject_class, sizeof(ModestMsgEditWindowPrivate));
135
136         modest_window_class->save_state_func = save_state;
137 }
138
139 static void
140 modest_msg_edit_window_init (ModestMsgEditWindow *obj)
141 {
142         ModestMsgEditWindowPrivate *priv;
143         priv = MODEST_MSG_EDIT_WINDOW_GET_PRIVATE(obj);
144
145         priv->toolbar       = NULL;
146         priv->menubar       = NULL;
147         priv->msg_body      = NULL;
148         priv->from_field    = NULL;
149         priv->to_field      = NULL;
150         priv->cc_field      = NULL;
151         priv->bcc_field     = NULL;
152         priv->subject_field = NULL;
153 }
154
155 /** 
156  * @result: A ModestPairList, which must be freed with modest_pair_list_free().
157  */
158 static ModestPairList*
159 get_transports (void)
160 {
161         ModestAccountMgr *account_mgr;
162         GSList *transports = NULL;
163         GSList *cursor, *accounts;
164         
165         account_mgr = modest_runtime_get_account_mgr();
166         cursor = accounts = modest_account_mgr_account_names (account_mgr, TRUE);
167         while (cursor) {
168                 gchar *account_name = cursor->data ? g_strdup((gchar*)cursor->data) : NULL;
169                 gchar *from_string  = modest_account_mgr_get_from_string (account_mgr,
170                                                                           account_name);
171                 if (!from_string)  {
172                         /* something went wrong: ignore this one */
173                         g_free (account_name);
174                         cursor->data = NULL;
175                 } else {
176                         ModestPair *pair;
177                         pair = modest_pair_new ((gpointer) account_name,
178                                                 (gpointer) from_string , TRUE);
179                         transports = g_slist_prepend (transports, pair);
180                 } /* don't free account name; it's freed when the transports list is freed */
181                 cursor = cursor->next;
182         }
183         g_slist_free (accounts);
184         return transports;
185 }
186
187
188 static void
189 on_from_combo_changed (ModestComboBox *combo, ModestWindow *win)
190 {
191         modest_window_set_active_account (
192                 win, modest_combo_box_get_active_id(combo));
193 }
194
195
196
197 static void
198 init_window (ModestMsgEditWindow *obj, const gchar* account)
199 {
200         GtkWidget *to_button, *cc_button, *bcc_button; 
201         GtkWidget *header_table;
202         GtkWidget *main_vbox;
203         ModestMsgEditWindowPrivate *priv;
204         ModestWindowPrivate *parent_priv;
205         
206         priv = MODEST_MSG_EDIT_WINDOW_GET_PRIVATE(obj);
207         parent_priv = MODEST_WINDOW_GET_PRIVATE(obj);
208
209         to_button     = gtk_button_new_with_label (_("To..."));
210         cc_button     = gtk_button_new_with_label (_("Cc..."));
211         bcc_button    = gtk_button_new_with_label (_("Bcc..."));
212         
213         /* Note: This ModestPairList* must exist for as long as the combo
214          * that uses it, because the ModestComboBox uses the ID opaquely, 
215          * so it can't know how to manage its memory. */ 
216         priv->from_field_protos = get_transports ();
217         priv->from_field    = modest_combo_box_new (priv->from_field_protos, g_str_equal);
218         
219         if (account) {
220                 modest_combo_box_set_active_id (MODEST_COMBO_BOX(priv->from_field),
221                                                 (gpointer)account);
222                 modest_window_set_active_account (MODEST_WINDOW(obj), account);
223         }
224         /* auto-update the active account */
225         g_signal_connect (G_OBJECT(priv->from_field), "changed", G_CALLBACK(on_from_combo_changed), obj);
226         
227         priv->to_field      = gtk_entry_new_with_max_length (80);
228         priv->cc_field      = gtk_entry_new_with_max_length (80);
229         priv->bcc_field     = gtk_entry_new_with_max_length (80);
230         priv->subject_field = gtk_entry_new_with_max_length (80);
231         
232         header_table = gtk_table_new (5,2, FALSE);
233         
234         gtk_table_attach (GTK_TABLE(header_table), gtk_label_new (_("From:")),
235                           0,1,0,1, GTK_SHRINK, 0, 0, 0);
236         gtk_table_attach (GTK_TABLE(header_table), to_button,     0,1,1,2, GTK_SHRINK, 0, 0, 0);
237         gtk_table_attach (GTK_TABLE(header_table), cc_button,     0,1,2,3, GTK_SHRINK, 0, 0, 0);
238         gtk_table_attach (GTK_TABLE(header_table), bcc_button,    0,1,3,4, GTK_SHRINK, 0, 0, 0);
239         gtk_table_attach (GTK_TABLE(header_table), gtk_label_new (_("Subject:")),
240                           0,1,4,5, GTK_SHRINK, 0, 0, 0);
241
242         gtk_table_attach_defaults (GTK_TABLE(header_table), priv->from_field,   1,2,0,1);
243         gtk_table_attach_defaults (GTK_TABLE(header_table), priv->to_field,     1,2,1,2);
244         gtk_table_attach_defaults (GTK_TABLE(header_table), priv->cc_field,     1,2,2,3);
245         gtk_table_attach_defaults (GTK_TABLE(header_table), priv->bcc_field,    1,2,3,4);
246         gtk_table_attach_defaults (GTK_TABLE(header_table), priv->subject_field,1,2,4,5);
247
248         priv->msg_body = gtk_text_view_new ();
249         
250         main_vbox = gtk_vbox_new  (FALSE, 6);
251
252         gtk_box_pack_start (GTK_BOX(main_vbox), priv->menubar, FALSE, FALSE, 0);
253         gtk_box_pack_start (GTK_BOX(main_vbox), priv->toolbar, FALSE, FALSE, 0);
254         gtk_box_pack_start (GTK_BOX(main_vbox), header_table, FALSE, FALSE, 6);
255         gtk_box_pack_start (GTK_BOX(main_vbox), priv->msg_body, TRUE, TRUE, 6);
256
257         gtk_widget_show_all (GTK_WIDGET(main_vbox));
258         gtk_container_add (GTK_CONTAINER(obj), main_vbox);
259 }
260
261
262 static void
263 modest_msg_edit_window_finalize (GObject *obj)
264 {
265         ModestMsgEditWindowPrivate *priv = MODEST_MSG_EDIT_WINDOW_GET_PRIVATE(obj);
266         
267         /* These had to stay alive for as long as the comboboxes that used them: */
268         modest_pair_list_free (priv->from_field_protos);
269         
270         G_OBJECT_CLASS(parent_class)->finalize (obj);
271 }
272
273
274
275 static gboolean
276 on_delete_event (GtkWidget *widget, GdkEvent *event, ModestMsgEditWindow *self)
277 {
278         modest_window_save_state (MODEST_WINDOW(self));
279         return FALSE;
280 }
281
282
283 static void
284 set_msg (ModestMsgEditWindow *self, TnyMsg *msg)
285 {
286         TnyHeader *header;
287         GtkTextBuffer *buf;
288         const gchar *to, *cc, *bcc, *subject;
289         ModestMsgEditWindowPrivate *priv;
290         gchar *body;
291         
292         g_return_if_fail (MODEST_IS_MSG_EDIT_WINDOW (self));
293         g_return_if_fail (TNY_IS_MSG (msg));
294
295         priv = MODEST_MSG_EDIT_WINDOW_GET_PRIVATE (self);
296
297         header  = tny_msg_get_header (msg);
298         to      = tny_header_get_to (header);
299         cc      = tny_header_get_cc (header);
300         bcc     = tny_header_get_bcc (header);
301         subject = tny_header_get_subject (header);
302
303         if (to)
304                 gtk_entry_set_text (GTK_ENTRY(priv->to_field), to);
305         if (cc)
306                 gtk_entry_set_text (GTK_ENTRY(priv->cc_field), cc);
307         if (bcc)
308                 gtk_entry_set_text (GTK_ENTRY(priv->bcc_field),  bcc);
309         if (subject)
310                 gtk_entry_set_text (GTK_ENTRY(priv->subject_field), subject);
311
312         
313         buf  = gtk_text_view_get_buffer (GTK_TEXT_VIEW(priv->msg_body));
314         body = modest_tny_msg_get_body (msg, FALSE);
315         if (body) 
316                 gtk_text_buffer_set_text (buf, body, -1);
317         g_free (body);
318 }
319
320
321 ModestWindow *
322 modest_msg_edit_window_new (TnyMsg *msg, const gchar *account)
323 {
324         ModestMsgEditWindow *self;
325         ModestMsgEditWindowPrivate *priv;
326         ModestWindowPrivate *parent_priv;
327         GtkActionGroup *action_group;
328         GError *error = NULL;
329
330         g_return_val_if_fail (msg, NULL);
331         
332         self = MODEST_MSG_EDIT_WINDOW(g_object_new(MODEST_TYPE_MSG_EDIT_WINDOW, NULL));
333         priv = MODEST_MSG_EDIT_WINDOW_GET_PRIVATE(self);
334         parent_priv = MODEST_WINDOW_GET_PRIVATE(self);
335         
336         parent_priv->ui_manager = gtk_ui_manager_new();
337         action_group = gtk_action_group_new ("ModestMsgEditWindowActions");
338
339         /* Add common actions */
340         gtk_action_group_add_actions (action_group,
341                                       modest_msg_edit_action_entries,
342                                       G_N_ELEMENTS (modest_msg_edit_action_entries),
343                                       self);
344         gtk_action_group_add_toggle_actions (action_group,
345                                              modest_msg_edit_toggle_action_entries,
346                                              G_N_ELEMENTS (modest_msg_edit_toggle_action_entries),
347                                              self);
348         gtk_ui_manager_insert_action_group (parent_priv->ui_manager, action_group, 0);
349         g_object_unref (action_group);
350
351         /* Load the UI definition */
352         gtk_ui_manager_add_ui_from_file (parent_priv->ui_manager,
353                                          MODEST_UIDIR "modest-msg-edit-window-ui.xml",
354                                          &error);
355         if (error) {
356                 g_printerr ("modest: could not merge modest-msg-edit-window-ui.xml: %s\n", error->message);
357                 g_error_free (error);
358                 error = NULL;
359         }
360         /* ****** */
361
362         /* Add accelerators */
363         gtk_window_add_accel_group (GTK_WINDOW (self), 
364                                     gtk_ui_manager_get_accel_group (parent_priv->ui_manager));
365
366         /* Toolbar / Menubar */
367         priv->toolbar = gtk_ui_manager_get_widget (parent_priv->ui_manager, "/ToolBar");
368         priv->menubar = gtk_ui_manager_get_widget (parent_priv->ui_manager, "/MenuBar");
369
370         gtk_toolbar_set_tooltips (GTK_TOOLBAR (priv->toolbar), TRUE);
371
372         /* Init window */
373         init_window (MODEST_MSG_EDIT_WINDOW(self), account);
374
375         restore_settings (MODEST_MSG_EDIT_WINDOW(self));
376         
377         gtk_window_set_title (GTK_WINDOW(self), "Modest");
378         gtk_window_set_icon_from_file (GTK_WINDOW(self), MODEST_APP_ICON, NULL);
379
380         g_signal_connect (G_OBJECT(self), "delete-event",
381                           G_CALLBACK(on_delete_event), self);
382         
383         set_msg (self, msg);
384         
385         return MODEST_WINDOW(self);
386 }
387
388
389 MsgData * 
390 modest_msg_edit_window_get_msg_data (ModestMsgEditWindow *edit_window)
391 {
392         MsgData *data;
393         
394         const gchar *account_name;
395         gchar *from_string = NULL;
396         ModestMsgEditWindowPrivate *priv;
397         
398         g_return_val_if_fail (MODEST_IS_MSG_EDIT_WINDOW (edit_window), NULL);
399
400         priv = MODEST_MSG_EDIT_WINDOW_GET_PRIVATE (edit_window);
401         
402         account_name = (gchar*)modest_combo_box_get_active_id (MODEST_COMBO_BOX (priv->from_field));
403         if (account_name) 
404                 from_string = modest_account_mgr_get_from_string (
405                         modest_runtime_get_account_mgr(), account_name);
406         if (!from_string) {
407                 g_printerr ("modest: cannot get from string\n");
408                 return NULL;
409         }
410         
411         
412         
413         data = g_slice_new0 (MsgData);
414         data->from    =  from_string; /* will be freed when data is freed */
415         data->to      =  g_strdup (gtk_entry_get_text (GTK_ENTRY(priv->to_field)));
416         data->cc      =  g_strdup ( gtk_entry_get_text (GTK_ENTRY(priv->cc_field)));
417         data->bcc     =  g_strdup ( gtk_entry_get_text (GTK_ENTRY(priv->bcc_field)));
418         data->subject =  g_strdup ( gtk_entry_get_text (GTK_ENTRY(priv->subject_field)));
419         data->msg_id = NULL;
420
421         GtkTextBuffer *buf = gtk_text_view_get_buffer (GTK_TEXT_VIEW (priv->msg_body));
422         GtkTextIter b, e;
423         gtk_text_buffer_get_bounds (buf, &b, &e);
424         data->plain_body =  gtk_text_buffer_get_text (buf, &b, &e, FALSE); /* Returns a copy. */
425
426         /* No rich supported yet, then html body is NULL */
427         data->html_body = NULL;
428
429         return data;
430 }
431
432 void 
433 modest_msg_edit_window_free_msg_data (ModestMsgEditWindow *edit_window,
434                                       MsgData *data)
435 {
436         g_return_if_fail (MODEST_IS_MSG_EDIT_WINDOW (edit_window));
437
438         if (!data)
439                 return;
440
441         g_free (data->to);
442         g_free (data->cc);
443         g_free (data->bcc);
444         g_free (data->subject);
445         g_free (data->plain_body);
446         g_free (data->html_body);
447
448         /* TODO: Free data->attachments? */
449
450         g_slice_free (MsgData, data);
451 }
452
453 /* Rich formatting API functions */
454 ModestMsgEditFormat
455 modest_msg_edit_window_get_format (ModestMsgEditWindow *self)
456 {
457         return MODEST_MSG_EDIT_FORMAT_TEXT;
458 }
459
460 void
461 modest_msg_edit_window_set_format (ModestMsgEditWindow *self,
462                                    ModestMsgEditFormat format)
463 {
464         switch (format) {
465         case MODEST_MSG_EDIT_FORMAT_TEXT:
466                 break;
467         case MODEST_MSG_EDIT_FORMAT_HTML:
468                 g_message ("HTML format not supported in Gnome ModestMsgEditWindow");
469                 break;
470         default:
471                 break;
472         }
473 }
474
475 ModestMsgEditFormatState *
476 modest_msg_edit_window_get_format_state (ModestMsgEditWindow *self)
477 {
478         ModestMsgEditFormatState *format_state;
479
480         g_return_val_if_fail (MODEST_IS_MSG_EDIT_WINDOW (self), NULL);
481
482         format_state = g_new0 (ModestMsgEditFormatState, 1);
483
484         return format_state;
485 }
486
487 void
488 modest_msg_edit_window_set_format_state (ModestMsgEditWindow *self, 
489                                          const ModestMsgEditFormatState *format_state)
490 {
491         g_return_if_fail (MODEST_MSG_EDIT_WINDOW (self));
492
493         /* Ends silently as set_format_state should do nothing when edit window format
494            is not HTML */
495         return;
496 }
497
498 void
499 modest_msg_edit_window_select_color (ModestMsgEditWindow *window)
500 {
501         g_return_if_fail (MODEST_MSG_EDIT_WINDOW (window));
502
503         g_message ("Select color operation is not supported");
504 }
505
506 void
507 modest_msg_edit_window_select_file_format (ModestMsgEditWindow *window,
508                                            gint file_format)
509 {
510         g_return_if_fail (MODEST_MSG_EDIT_WINDOW (window));
511
512         g_message ("Select file format operation is not supported");
513 }
514
515 void
516 modest_msg_edit_window_select_font (ModestMsgEditWindow *window)
517 {
518         g_return_if_fail (MODEST_MSG_EDIT_WINDOW (window));
519
520         g_message ("Select font operation is not supported");
521 }
522
523 void
524 modest_msg_edit_window_select_background_color (ModestMsgEditWindow *window)
525 {
526         g_return_if_fail (MODEST_MSG_EDIT_WINDOW (window));
527
528         g_message ("Select background color operation is not supported");
529 }
530
531 void
532 modest_msg_edit_window_insert_image (ModestMsgEditWindow *window)
533 {
534         g_return_if_fail (MODEST_MSG_EDIT_WINDOW (window));
535
536         g_message ("Insert image operation is not supported");
537 }
538
539 void
540 modest_msg_edit_window_attach_file (ModestMsgEditWindow *window)
541 {
542         g_return_if_fail (MODEST_MSG_EDIT_WINDOW (window));
543
544         g_message ("Attach file operation is not supported");
545 }
546
547 void
548 modest_msg_edit_window_remove_attachments (ModestMsgEditWindow *window,
549                                            GList *att_list)
550 {
551         g_return_if_fail (MODEST_MSG_EDIT_WINDOW (window));
552
553         g_message ("Remove attachments operation is not supported");
554 }
555
556 void
557 modest_msg_edit_window_show_cc (ModestMsgEditWindow *window, 
558                                 gboolean show)
559 {
560         g_return_if_fail (MODEST_IS_MSG_EDIT_WINDOW (window));
561
562         g_message ("not implemented yet %s", __FUNCTION__);
563 }
564 void
565 modest_msg_edit_window_show_bcc (ModestMsgEditWindow *window, 
566                                 gboolean show)
567 {
568         g_return_if_fail (MODEST_IS_MSG_EDIT_WINDOW (window));
569
570         g_message ("not implemented yet %s", __FUNCTION__);
571 }
572 void
573 modest_msg_edit_window_undo (ModestMsgEditWindow *window)
574 {
575         g_return_if_fail (MODEST_IS_MSG_EDIT_WINDOW (window));
576       
577         g_message ("not implemented yet %s", __FUNCTION__);
578 }
579 void
580 modest_msg_edit_window_toggle_fullscreen (ModestMsgEditWindow *window)
581 {
582         g_return_if_fail (MODEST_IS_MSG_EDIT_WINDOW (window));
583       
584         g_message ("not implemented yet %s", __FUNCTION__);
585 }
586 void
587 modest_msg_edit_window_set_priority_flags (ModestMsgEditWindow *window,
588                                            TnyHeaderFlags priority_flags)
589 {
590         g_return_if_fail (MODEST_IS_MSG_EDIT_WINDOW (window));
591       
592         g_message ("not implemented yet %s", __FUNCTION__);
593 }
594
595
596 void
597 modest_msg_edit_window_select_contacts (ModestMsgEditWindow *window)
598 {
599         g_return_if_fail (MODEST_IS_MSG_EDIT_WINDOW (window));
600
601         g_message ("not implemented yet %s", __FUNCTION__);
602 }
603
604 gboolean
605 modest_msg_edit_window_check_names (ModestMsgEditWindow *window)
606 {
607         g_return_val_if_fail (MODEST_IS_MSG_EDIT_WINDOW (window), FALSE);
608
609         g_message ("not implemented yet %s", __FUNCTION__);
610         return TRUE;
611 }
612
613 void
614 modest_msg_edit_window_set_file_format (ModestMsgEditWindow *window,
615                                         gint file_format)
616 {
617         g_return_if_fail (MODEST_IS_MSG_EDIT_WINDOW (window));
618
619         g_message ("not implemented yet %s", __FUNCTION__);
620 }