aboutsummaryrefslogtreecommitdiffstats
path: root/mail/mail-display.h
blob: d839978371dc2f86e0d1fa1a9dcacc16f5ca9aeb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */

#ifndef _MAIL_DISPLAY_H_
#define _MAIL_DISPLAY_H_

#include <gtk/gtkvbox.h>
#include <gtkhtml/gtkhtml.h>

#include "widgets/misc/e-scroll-frame.h"

#include "camel/camel-stream.h"
#include "camel/camel-mime-message.h"
#include "folder-browser.h"


#define MAIL_DISPLAY_TYPE        (mail_display_get_type ())
#define MAIL_DISPLAY(o)          (GTK_CHECK_CAST ((o), MAIL_DISPLAY_TYPE, MailDisplay))
#define MAIL_DISPLAY_CLASS(k)    (GTK_CHECK_CLASS_CAST((k), MAIL_DISPLAY_TYPE, MailDisplayClass))
#define IS_MAIL_DISPLAY(o)       (GTK_CHECK_TYPE ((o), MAIL_DISPLAY_TYPE))
#define IS_MAIL_DISPLAY_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), MAIL_DISPLAY_TYPE))

struct _MailDisplay {
    GtkVBox parent;

    EScrollFrame *scroll;
    GtkHTML *html;

    FolderBrowser *parent_folder_browser;
    CamelMimeMessage *current_message;
};

typedef struct {
    GtkVBoxClass parent_class;
} MailDisplayClass;

GtkType        mail_display_get_type    (void);
GtkWidget *    mail_display_new         (FolderBrowser *parent_folder_browser);

void           mail_display_set_message (MailDisplay *mail_display, 
                     CamelMedium *medium);


#define HTML_HEADER "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 TRANSITIONAL//EN\">\n<HTML>\n<HEAD>\n<META NAME=\"GENERATOR\" CONTENT=\"Evolution Mail Component\">\n</HEAD>\n"

void           mail_html_write          (GtkHTML *html,
                     GtkHTMLStream *stream,
                     const char *format, ...);
void           mail_text_write          (GtkHTML *html,
                     GtkHTMLStream *stream,
                     const char *format, ...);
void           mail_error_write         (GtkHTML *html,
                     GtkHTMLStream *stream,
                     const char *format, ...);

#endif /* _MAIL_DISPLAY_H_ */