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 | ...) G_GNUC_PRINTF (2, 3); |
---|
63 | gboolean html_engine_save_output_buffer (HTMLEngineSaveState *state, |
---|
64 | const gchar *buffer, |
---|
65 | int len); |
---|
66 | |
---|
67 | /* Saving a whole tree. */ |
---|
68 | gboolean html_engine_save (HTMLEngine *engine, |
---|
69 | HTMLEngineSaveReceiverFn receiver, |
---|
70 | gpointer user_data); |
---|
71 | gboolean html_engine_save_plain (HTMLEngine *engine, |
---|
72 | HTMLEngineSaveReceiverFn receiver, |
---|
73 | gpointer user_data); |
---|
74 | void html_engine_save_buffer_free (HTMLEngineSaveState *state); |
---|
75 | guchar *html_engine_save_buffer_peek_text (HTMLEngineSaveState *state); |
---|
76 | int html_engine_save_buffer_peek_text_bytes (HTMLEngineSaveState *state); |
---|
77 | void html_engine_save_buffer_clear_line_breaks (HTMLEngineSaveState *state, |
---|
78 | PangoLogAttr *attrs); |
---|
79 | HTMLEngineSaveState *html_engine_save_buffer_new (HTMLEngine *engine, |
---|
80 | gboolean inline_frames); |
---|
81 | gchar *html_engine_save_get_sample_body (HTMLEngine *e, |
---|
82 | HTMLObject *o); |
---|
83 | const gchar *html_engine_save_get_paragraph_align (GtkHTMLParagraphAlignment align); |
---|
84 | const gchar *html_engine_save_get_paragraph_style (GtkHTMLParagraphStyle style); |
---|
85 | gchar *html_encode_entities (const gchar *input, |
---|
86 | guint len, |
---|
87 | guint *encoded_len_return); |
---|
88 | gint html_engine_save_string_append_nonbsp (GString *out, |
---|
89 | const guchar *s, |
---|
90 | guint length); |
---|
91 | #endif |
---|