80b5dae4a3720c1a6bf6b8cbbfd757d52f81174e
[modest] / src / modest-tny-msg-view.h
1 /* modest-tny-msg-view.h */
2 /* insert (c)/licensing information) */
3
4 #ifndef __MODEST_TNY_MSG_VIEW_H__
5 #define __MODEST_TNY_MSG_VIEW_H__
6
7
8 #include <gtk/gtk.h>
9 #include <tny-stream-iface.h>
10 #include <tny-msg-iface.h>
11 #include <tny-msg-mime-part-iface.h>
12
13 #include "modest-conf.h"
14
15 G_BEGIN_DECLS
16
17 /* convenience macros */
18 #define MODEST_TYPE_TNY_MSG_VIEW             (modest_tny_msg_view_get_type())
19 #define MODEST_TNY_MSG_VIEW(obj)             (G_TYPE_CHECK_INSTANCE_CAST((obj),MODEST_TYPE_TNY_MSG_VIEW,ModestTnyMsgView))
20 #define MODEST_TNY_MSG_VIEW_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST((klass),MODEST_TYPE_TNY_MSG_VIEW,ModestTnyMsgViewClass))
21 #define MODEST_IS_TNY_MSG_VIEW(obj)          (G_TYPE_CHECK_INSTANCE_TYPE((obj),MODEST_TYPE_TNY_MSG_VIEW))
22 #define MODEST_IS_TNY_MSG_VIEW_CLASS(klass)  (G_TYPE_CHECK_CLASS_TYPE((klass),MODEST_TYPE_TNY_MSG_VIEW))
23 #define MODEST_TNY_MSG_VIEW_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS((obj),MODEST_TYPE_TNY_MSG_VIEW,ModestTnyMsgViewClass))
24
25 typedef struct _ModestTnyMsgView      ModestTnyMsgView;
26 typedef struct _ModestTnyMsgViewClass ModestTnyMsgViewClass;
27
28 struct _ModestTnyMsgView {
29         GtkScrolledWindow parent;
30 };
31
32 struct _ModestTnyMsgViewClass {
33         GtkScrolledWindowClass parent_class;
34 };
35
36
37 /**
38  * modest_tny_msg_view_get_type
39  *
40  * get the GType for the this class
41  *
42  * Returns: the GType for this class
43  */
44 GType        modest_tny_msg_view_get_type    (void) G_GNUC_CONST;
45
46
47 /**
48  * modest_tny_msg_view_new 
49  * @tny_msg: a TnyMsgIface instance, or NULL
50  *
51  * create a new ModestTnyMsgView widget (a GtkScrolledWindow subclass),
52  * and display the @tny_msg e-mail message in it. If @tny_msg is NULL,
53  * then a blank page will be displayed
54  *  
55  * Returns: a new ModestTnyMsgView widget, or NULL if there's an error
56  */
57 GtkWidget*   modest_tny_msg_view_new          (TnyMsgIface *tny_msg, gboolean show_attachments_inline);
58
59
60 /**
61  * modest_tny_msg_view_set_message
62  * @self: a ModestTnyMsgView instance
63  * @tny_msg: a TnyMsgIface instance, or NULL
64  *
65  * display the @tny_msg e-mail message. If @tny_msg is NULL,
66  * then a blank page will be displayed
67  *  */
68 void         modest_tny_msg_view_set_message  (ModestTnyMsgView *self,
69                                                 TnyMsgIface *tny_msg);
70
71 /**
72  * modest_tny_msg_view_redraw
73  * @self: a ModestTnyMsgView instance
74  *
75  * re-display the current e-mail message.
76  */
77 void         modest_tny_msg_view_redraw  (ModestTnyMsgView *self);
78
79
80 /**
81  * modest_tny_msg_view_get_selected_text:
82  * @self: a ModestTnyMsgView instance
83  * 
84  * get the user selected part of the message
85  * 
86  * Returns: a newly allocated string of the user's selection or NULL if nothing is selected
87  */
88 gchar *      modest_tny_msg_view_get_selected_text (ModestTnyMsgView *self);
89
90 gboolean modest_tny_msg_view_get_show_attachments_inline_flag (ModestTnyMsgView *self);
91
92 gboolean modest_tny_msg_view_set_show_attachments_inline_flag (ModestTnyMsgView *self, gboolean flag);
93
94 G_END_DECLS
95
96 #endif /* __MODEST_TNY_MSG_VIEW_H__ */