1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ |
---|
2 | |
---|
3 | #ifndef _MAIL_DISPLAY_H_ |
---|
4 | #define _MAIL_DISPLAY_H_ |
---|
5 | |
---|
6 | #include <gtk/gtkvbox.h> |
---|
7 | #include <gtkhtml/gtkhtml.h> |
---|
8 | #include <gtkhtml/gtkhtml-stream.h> |
---|
9 | |
---|
10 | #include <gal/widgets/e-scroll-frame.h> |
---|
11 | |
---|
12 | #include <camel/camel-stream.h> |
---|
13 | #include <camel/camel-mime-message.h> |
---|
14 | #include <camel/camel-medium.h> |
---|
15 | |
---|
16 | #include "mail-types.h" |
---|
17 | #include "mail-config.h" /*display_style*/ |
---|
18 | |
---|
19 | #define MAIL_DISPLAY_TYPE (mail_display_get_type ()) |
---|
20 | #define MAIL_DISPLAY(o) (GTK_CHECK_CAST ((o), MAIL_DISPLAY_TYPE, MailDisplay)) |
---|
21 | #define MAIL_DISPLAY_CLASS(k) (GTK_CHECK_CLASS_CAST((k), MAIL_DISPLAY_TYPE, MailDisplayClass)) |
---|
22 | #define IS_MAIL_DISPLAY(o) (GTK_CHECK_TYPE ((o), MAIL_DISPLAY_TYPE)) |
---|
23 | #define IS_MAIL_DISPLAY_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), MAIL_DISPLAY_TYPE)) |
---|
24 | |
---|
25 | struct _MailDisplay { |
---|
26 | GtkVBox parent; |
---|
27 | |
---|
28 | EScrollFrame *scroll; |
---|
29 | GtkHTML *html; |
---|
30 | GtkHTMLStream *stream; |
---|
31 | gint redisplay_counter; |
---|
32 | gpointer last_active; |
---|
33 | guint idle_id; |
---|
34 | |
---|
35 | char *charset; |
---|
36 | |
---|
37 | char *selection; |
---|
38 | |
---|
39 | CamelMimeMessage *current_message; |
---|
40 | GData **data; |
---|
41 | |
---|
42 | /* Sigh. This shouldn't be needed. I haven't figured out why it is |
---|
43 | though. */ |
---|
44 | GtkWidget *invisible; |
---|
45 | |
---|
46 | MailConfigDisplayStyle display_style; |
---|
47 | }; |
---|
48 | |
---|
49 | typedef struct { |
---|
50 | GtkVBoxClass parent_class; |
---|
51 | } MailDisplayClass; |
---|
52 | |
---|
53 | GtkType mail_display_get_type (void); |
---|
54 | GtkWidget * mail_display_new (void); |
---|
55 | |
---|
56 | void mail_display_queue_redisplay (MailDisplay *mail_display); |
---|
57 | void mail_display_redisplay (MailDisplay *mail_display, gboolean unscroll); |
---|
58 | void mail_display_redisplay_when_loaded (MailDisplay *md, |
---|
59 | gconstpointer key, |
---|
60 | void (*callback)(MailDisplay *, gpointer), |
---|
61 | gpointer data); |
---|
62 | void mail_display_stream_write_when_loaded (MailDisplay *md, |
---|
63 | gconstpointer key, |
---|
64 | const gchar *url, |
---|
65 | void (*callback)(MailDisplay *, gpointer), |
---|
66 | GtkHTMLStream *handle, |
---|
67 | gpointer data); |
---|
68 | |
---|
69 | void mail_display_set_message (MailDisplay *mail_display, |
---|
70 | CamelMedium *medium); |
---|
71 | |
---|
72 | void mail_display_set_charset (MailDisplay *mail_display, |
---|
73 | const char *charset); |
---|
74 | |
---|
75 | void mail_display_load_images (MailDisplay *mail_display); |
---|
76 | |
---|
77 | |
---|
78 | #define mail_html_write(html, stream, string) gtk_html_write (html, stream, string, strlen (string)) |
---|
79 | |
---|
80 | void mail_text_write (GtkHTML *html, |
---|
81 | GtkHTMLStream *stream, |
---|
82 | const char *text); |
---|
83 | void mail_error_printf (GtkHTML *html, |
---|
84 | GtkHTMLStream *stream, |
---|
85 | const char *format, ...); |
---|
86 | |
---|
87 | #endif /* _MAIL_DISPLAY_H_ */ |
---|