add gtkspell source files from stuphead + GtkText compatibility header
[claws.git] / src / html.h
1 /*
2  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
3  * Copyright (C) 1999,2000 Hiroyuki Yamamoto
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18  */
19
20 #ifndef __HTML_H__
21 #define __HTML_H__
22
23 #include <glib.h>
24 #include <stdio.h>
25
26 #include "codeconv.h"
27
28 typedef enum
29 {
30         HTML_NORMAL,
31         HTML_PAR,
32         HTML_BR,
33         HTML_HR,
34         HTML_HREF,
35         HTML_IMG,
36         HTML_FONT,
37         HTML_PRE,
38         HTML_UNKNOWN,
39         HTML_ERR,
40         HTML_EOF
41 } HTMLState;
42
43 typedef struct _HTMLParser      HTMLParser;
44
45 struct _HTMLParser
46 {
47         FILE *fp;
48         CodeConverter *conv;
49
50         GHashTable *symbol_table;
51
52         GString *str;
53         GString *buf;
54
55         gchar *bufp;
56
57         HTMLState state;
58
59         gboolean newline;
60         gboolean empty_line;
61         gboolean space;
62         gboolean pre;
63 };
64
65 HTMLParser *html_parser_new     (FILE           *fp,
66                                  CodeConverter  *conv);
67 void html_parser_destroy        (HTMLParser     *parser);
68 gchar *html_parse               (HTMLParser     *parser);
69
70 #endif /* __HTML_H__ */