b8ad268b29dc8d5be38a7ec1cb6cac87771d1d93
[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         void (*mailto_clicked) (GtkWidget *widget, gpointer user_data);
35 };
36
37
38 /**
39  * modest_tny_msg_view_get_type
40  *
41  * get the GType for the this class
42  *
43  * Returns: the GType for this class
44  */
45 GType        modest_tny_msg_view_get_type    (void) G_GNUC_CONST;
46
47
48 /**
49  * modest_tny_msg_view_new 
50  * @tny_msg: a TnyMsgIface instance, or NULL
51  *
52  * create a new ModestTnyMsgView widget (a GtkScrolledWindow subclass),
53  * and display the @tny_msg e-mail message in it. If @tny_msg is NULL,
54  * then a blank page will be displayed
55  *  
56  * Returns: a new ModestTnyMsgView widget, or NULL if there's an error
57  */
58 GtkWidget*   modest_tny_msg_view_new          (TnyMsgIface *tny_msg, gboolean show_attachments_inline);
59
60
61 /**
62  * modest_tny_msg_view_set_message
63  * @self: a ModestTnyMsgView instance
64  * @tny_msg: a TnyMsgIface instance, or NULL
65  *
66  * display the @tny_msg e-mail message. If @tny_msg is NULL,
67  * then a blank page will be displayed
68  *  */
69 void         modest_tny_msg_view_set_message  (ModestTnyMsgView *self,
70                                                 TnyMsgIface *tny_msg);
71
72 /**
73  * modest_tny_msg_view_redraw
74  * @self: a ModestTnyMsgView instance
75  *
76  * re-display the current e-mail message.
77  */
78 void         modest_tny_msg_view_redraw  (ModestTnyMsgView *self);
79
80
81 /**
82  * modest_tny_msg_view_get_selected_text:
83  * @self: a ModestTnyMsgView instance
84  * 
85  * get the user selected part of the message
86  * 
87  * Returns: a newly allocated string of the user's selection or NULL if nothing is selected
88  */
89 gchar *      modest_tny_msg_view_get_selected_text (ModestTnyMsgView *self);
90
91 gboolean modest_tny_msg_view_get_show_attachments_inline_flag (ModestTnyMsgView *self);
92
93 gboolean modest_tny_msg_view_set_show_attachments_inline_flag (ModestTnyMsgView *self, gboolean flag);
94
95 G_END_DECLS
96
97 #endif /* __MODEST_TNY_MSG_VIEW_H__ */