* started work on modest-viewer-window
[modest] / src / gtk-glade / modest-ui-message-viewer.c
1 #include <gtk/gtk.h>
2 #include <glade/glade.h>
3 #include <glib/gi18n.h>
4 #include <string.h>
5
6 #ifdef HAVE_CONFIG_H
7 #include <config.h>
8 #endif /*HAVE_CONFIG_H*/
9
10 /* TODO: put in auto* */
11 #include <tny-text-buffer-stream.h>
12 #include <tny-msg-folder.h>
13
14 #include "../modest-ui.h"
15 #include "../modest-window-mgr.h"
16 #include "../modest-account-mgr.h"
17 #include "../modest-account-mgr.h"
18 #include "../modest-identity-mgr.h"
19
20 #include "../modest-tny-account-store.h"
21 #include "../modest-tny-folder-tree-view.h"
22 #include "../modest-tny-header-tree-view.h"
23 #include "../modest-tny-msg-view.h"
24 #include "../modest-tny-transport-actions.h"
25 #include "../modest-tny-store-actions.h"
26
27 #include "../modest-text-utils.h"
28 #include "../modest-tny-msg-actions.h"
29
30 #include "../modest-viewer-window.h"
31
32 #include "modest-ui-glade.h"
33 #include "modest-ui-wizard.h"
34
35
36 typedef struct {
37         ModestUI *modest_ui;
38         ModestViewerWindow *viewer_win;
39         GladeXML *glade_xml;
40 } ViewerWinData;
41
42
43 GtkContainer
44 *modest_ui_new_viewer_window (ModestUI *modest_ui, gpointer *user_data)
45 {
46         GtkWidget       *top_container;
47         GladeXML        *glade_xml;
48         ViewerWinData   *win_data;
49
50         glade_xml = glade_xml_new(MODEST_GLADE, "viewer_top_container", NULL);
51         if (!glade_xml)
52                 return NULL;
53
54         win_data = g_malloc(sizeof(ViewerWinData));
55         win_data->modest_ui = modest_ui;
56         win_data->glade_xml = glade_xml;
57
58         *user_data = win_data;
59
60         top_container = glade_xml_get_widget(glade_xml, "viewer_top_container");
61         if (!top_container) {
62                 g_object_unref(G_OBJECT(glade_xml));
63                 return NULL;
64         }
65
66         return GTK_CONTAINER(top_container);
67 }
68