1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ |
---|
2 | /* This file is part of the GtkHTML library. |
---|
3 | |
---|
4 | Copyright (C) 2000 Helix Code, Inc. |
---|
5 | |
---|
6 | This library is free software; you can redistribute it and/or |
---|
7 | modify it under the terms of the GNU Library General Public |
---|
8 | License as published by the Free Software Foundation; either |
---|
9 | version 2 of the License, or (at your option) any later version. |
---|
10 | |
---|
11 | This library is distributed in the hope that it will be useful, |
---|
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
---|
14 | Library General Public License for more details. |
---|
15 | |
---|
16 | You should have received a copy of the GNU Library General Public License |
---|
17 | along with this library; see the file COPYING.LIB. If not, write to |
---|
18 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
---|
19 | Boston, MA 02111-1307, USA. |
---|
20 | |
---|
21 | Author: Ettore Perazzoli <ettore@helixcode.com> |
---|
22 | */ |
---|
23 | |
---|
24 | #ifndef _HTMLENGINE_SAVE_H |
---|
25 | #define _HTMLENGINE_SAVE_H |
---|
26 | |
---|
27 | #include "gtkhtml-enums.h" |
---|
28 | #include "htmltypes.h" |
---|
29 | |
---|
30 | |
---|
31 | struct _HTMLEngineSaveState { |
---|
32 | HTMLEngine *engine; |
---|
33 | HTMLEngineSaveReceiverFn receiver; |
---|
34 | guint br_count; |
---|
35 | const gchar *save_data_class_name; |
---|
36 | HTMLObject *save_data_object; |
---|
37 | GSList *data_to_remove; |
---|
38 | |
---|
39 | guint error : 1; |
---|
40 | guint inline_frames : 1; |
---|
41 | guint last_level; |
---|
42 | |
---|
43 | gpointer user_data; |
---|
44 | }; |
---|
45 | |
---|
46 | |
---|
47 | /* Entity encoding. This is used by the HTML objects to output stuff through |
---|
48 | entity-based encoding. */ |
---|
49 | gboolean html_engine_save_encode (HTMLEngineSaveState *state, |
---|
50 | const gchar *buffer, |
---|
51 | guint length); |
---|
52 | gboolean html_engine_save_encode_string (HTMLEngineSaveState *state, |
---|
53 | const gchar *s); |
---|
54 | |
---|
55 | /* Output function (no encoding). This is used for tags and other things that |
---|
56 | must not be entity-encoded. */ |
---|
57 | gboolean html_engine_save_output_stringv (HTMLEngineSaveState *state, |
---|
58 | const gchar *format, |
---|
59 | va_list ap); |
---|
60 | gboolean html_engine_save_output_string (HTMLEngineSaveState *state, |
---|
61 | const gchar *format, |
---|
62 | ...); |
---|
63 | |
---|
64 | /* Saving a whole tree. */ |
---|
65 | gboolean html_engine_save (HTMLEngine *engine, |
---|
66 | HTMLEngineSaveReceiverFn receiver, |
---|
67 | gpointer user_data); |
---|
68 | gboolean html_engine_save_plain (HTMLEngine *engine, |
---|
69 | HTMLEngineSaveReceiverFn receiver, |
---|
70 | gpointer user_data); |
---|
71 | void html_engine_save_buffer_free (HTMLEngineSaveState *state); |
---|
72 | guchar *html_engine_save_buffer_peek_text (HTMLEngineSaveState *state); |
---|
73 | HTMLEngineSaveState *html_engine_save_buffer_new (HTMLEngine *engine, |
---|
74 | gboolean inline_frames); |
---|
75 | gchar *html_engine_save_get_sample_body (HTMLEngine *e, |
---|
76 | HTMLObject *o); |
---|
77 | const gchar *html_engine_save_get_paragraph_align (GtkHTMLParagraphAlignment align); |
---|
78 | const gchar *html_engine_save_get_paragraph_style (GtkHTMLParagraphStyle style); |
---|
79 | gchar *html_encode_entities (const gchar *input, |
---|
80 | guint len, |
---|
81 | guint *encoded_len_return); |
---|
82 | |
---|
83 | #endif |
---|