1 /* DO NOT EDIT! GENERATED AUTOMATICALLY! */
2
3 #line 1 "html-styled-ostream.oo.h"
4 /* Output stream for CSS styled text, producing HTML output.
5 Copyright (C) 2006, 2020 Free Software Foundation, Inc.
6 Written by Bruno Haible <bruno@clisp.org>, 2006.
7
8 This program is free software: you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 3 of the License, or
11 (at your option) any later version.
12
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <https://www.gnu.org/licenses/>. */
20
21 #ifndef _HTML_STYLED_OSTREAM_H
22 #define _HTML_STYLED_OSTREAM_H
23
24 #include <stdbool.h>
25
26 #include "styled-ostream.h"
27 #include "html-ostream.h"
28
29
30 #line 31 "html-styled-ostream.h"
31 struct html_styled_ostream_representation;
32 /* html_styled_ostream_t is defined as a pointer to struct html_styled_ostream_representation.
33 In C++ mode, we use a smart pointer class.
34 In C mode, we have no other choice than a typedef to the root class type. */
35 #if IS_CPLUSPLUS
36 struct html_styled_ostream_t
37 {
38 private:
39 struct html_styled_ostream_representation *_pointer;
40 public:
41 html_styled_ostream_t () : _pointer (NULL) {}
42 html_styled_ostream_t (struct html_styled_ostream_representation *pointer) : _pointer (pointer) {}
43 struct html_styled_ostream_representation * operator -> () { return _pointer; }
44 operator struct html_styled_ostream_representation * () { return _pointer; }
45 operator struct any_ostream_representation * () { return (struct any_ostream_representation *) _pointer; }
46 operator struct styled_ostream_representation * () { return (struct styled_ostream_representation *) _pointer; }
47 operator void * () { return _pointer; }
48 bool operator == (const void *p) { return _pointer == p; }
49 bool operator != (const void *p) { return _pointer != p; }
50 operator ostream_t () { return (ostream_t) (struct any_ostream_representation *) _pointer; }
51 explicit html_styled_ostream_t (ostream_t x) : _pointer ((struct html_styled_ostream_representation *) (void *) x) {}
52 operator styled_ostream_t () { return (styled_ostream_t) (struct styled_ostream_representation *) _pointer; }
53 explicit html_styled_ostream_t (styled_ostream_t x) : _pointer ((struct html_styled_ostream_representation *) (void *) x) {}
54 };
55 #else
56 typedef styled_ostream_t html_styled_ostream_t;
57 #endif
58
59 /* Functions that invoke the methods. */
60 #ifdef __cplusplus
61 extern "C" {
62 #endif
63 extern void html_styled_ostream_write_mem (html_styled_ostream_t first_arg, const void *data, size_t len);
64 extern void html_styled_ostream_flush (html_styled_ostream_t first_arg, ostream_flush_scope_t scope);
65 extern void html_styled_ostream_free (html_styled_ostream_t first_arg);
66 extern void html_styled_ostream_begin_use_class (html_styled_ostream_t first_arg, const char *classname);
67 extern void html_styled_ostream_end_use_class (html_styled_ostream_t first_arg, const char *classname);
68 extern const char * html_styled_ostream_get_hyperlink_ref (html_styled_ostream_t first_arg);
69 extern const char * html_styled_ostream_get_hyperlink_id (html_styled_ostream_t first_arg);
70 extern void html_styled_ostream_set_hyperlink (html_styled_ostream_t first_arg, const char *ref, const char *id);
71 extern void html_styled_ostream_flush_to_current_style (html_styled_ostream_t first_arg);
72 extern ostream_t html_styled_ostream_get_destination (html_styled_ostream_t first_arg);
73 extern html_ostream_t html_styled_ostream_get_html_destination (html_styled_ostream_t first_arg);
74 extern const char * html_styled_ostream_get_css_filename (html_styled_ostream_t first_arg);
75 #ifdef __cplusplus
76 }
77 #endif
78
79 /* Type representing an implementation of html_styled_ostream_t. */
80 struct html_styled_ostream_implementation
81 {
82 const typeinfo_t * const *superclasses;
83 size_t superclasses_length;
84 size_t instance_size;
85 #define THIS_ARG html_styled_ostream_t first_arg
86 #include "html_styled_ostream.vt.h"
87 #undef THIS_ARG
88 };
89
90 /* Public portion of the object pointed to by a html_styled_ostream_t. */
91 struct html_styled_ostream_representation_header
92 {
93 const struct html_styled_ostream_implementation *vtable;
94 };
95
96 #if HAVE_INLINE
97
98 /* Define the functions that invoke the methods as inline accesses to
99 the html_styled_ostream_implementation.
100 Use #define to avoid a warning because of extern vs. static. */
101
102 # define html_styled_ostream_write_mem html_styled_ostream_write_mem_inline
103 static inline void
104 html_styled_ostream_write_mem (html_styled_ostream_t first_arg, const void *data, size_t len)
105 {
106 const struct html_styled_ostream_implementation *vtable =
107 ((struct html_styled_ostream_representation_header *) (struct html_styled_ostream_representation *) first_arg)->vtable;
108 vtable->write_mem (first_arg,data,len);
109 }
110
111 # define html_styled_ostream_flush html_styled_ostream_flush_inline
112 static inline void
113 html_styled_ostream_flush (html_styled_ostream_t first_arg, ostream_flush_scope_t scope)
114 {
115 const struct html_styled_ostream_implementation *vtable =
116 ((struct html_styled_ostream_representation_header *) (struct html_styled_ostream_representation *) first_arg)->vtable;
117 vtable->flush (first_arg,scope);
118 }
119
120 # define html_styled_ostream_free html_styled_ostream_free_inline
121 static inline void
122 html_styled_ostream_free (html_styled_ostream_t first_arg)
123 {
124 const struct html_styled_ostream_implementation *vtable =
125 ((struct html_styled_ostream_representation_header *) (struct html_styled_ostream_representation *) first_arg)->vtable;
126 vtable->free (first_arg);
127 }
128
129 # define html_styled_ostream_begin_use_class html_styled_ostream_begin_use_class_inline
130 static inline void
131 html_styled_ostream_begin_use_class (html_styled_ostream_t first_arg, const char *classname)
132 {
133 const struct html_styled_ostream_implementation *vtable =
134 ((struct html_styled_ostream_representation_header *) (struct html_styled_ostream_representation *) first_arg)->vtable;
135 vtable->begin_use_class (first_arg,classname);
136 }
137
138 # define html_styled_ostream_end_use_class html_styled_ostream_end_use_class_inline
139 static inline void
140 html_styled_ostream_end_use_class (html_styled_ostream_t first_arg, const char *classname)
141 {
142 const struct html_styled_ostream_implementation *vtable =
143 ((struct html_styled_ostream_representation_header *) (struct html_styled_ostream_representation *) first_arg)->vtable;
144 vtable->end_use_class (first_arg,classname);
145 }
146
147 # define html_styled_ostream_get_hyperlink_ref html_styled_ostream_get_hyperlink_ref_inline
148 static inline const char *
149 html_styled_ostream_get_hyperlink_ref (html_styled_ostream_t first_arg)
150 {
151 const struct html_styled_ostream_implementation *vtable =
152 ((struct html_styled_ostream_representation_header *) (struct html_styled_ostream_representation *) first_arg)->vtable;
153 return vtable->get_hyperlink_ref (first_arg);
154 }
155
156 # define html_styled_ostream_get_hyperlink_id html_styled_ostream_get_hyperlink_id_inline
157 static inline const char *
158 html_styled_ostream_get_hyperlink_id (html_styled_ostream_t first_arg)
159 {
160 const struct html_styled_ostream_implementation *vtable =
161 ((struct html_styled_ostream_representation_header *) (struct html_styled_ostream_representation *) first_arg)->vtable;
162 return vtable->get_hyperlink_id (first_arg);
163 }
164
165 # define html_styled_ostream_set_hyperlink html_styled_ostream_set_hyperlink_inline
166 static inline void
167 html_styled_ostream_set_hyperlink (html_styled_ostream_t first_arg, const char *ref, const char *id)
168 {
169 const struct html_styled_ostream_implementation *vtable =
170 ((struct html_styled_ostream_representation_header *) (struct html_styled_ostream_representation *) first_arg)->vtable;
171 vtable->set_hyperlink (first_arg,ref,id);
172 }
173
174 # define html_styled_ostream_flush_to_current_style html_styled_ostream_flush_to_current_style_inline
175 static inline void
176 html_styled_ostream_flush_to_current_style (html_styled_ostream_t first_arg)
177 {
178 const struct html_styled_ostream_implementation *vtable =
179 ((struct html_styled_ostream_representation_header *) (struct html_styled_ostream_representation *) first_arg)->vtable;
180 vtable->flush_to_current_style (first_arg);
181 }
182
183 # define html_styled_ostream_get_destination html_styled_ostream_get_destination_inline
184 static inline ostream_t
185 html_styled_ostream_get_destination (html_styled_ostream_t first_arg)
186 {
187 const struct html_styled_ostream_implementation *vtable =
188 ((struct html_styled_ostream_representation_header *) (struct html_styled_ostream_representation *) first_arg)->vtable;
189 return vtable->get_destination (first_arg);
190 }
191
192 # define html_styled_ostream_get_html_destination html_styled_ostream_get_html_destination_inline
193 static inline html_ostream_t
194 html_styled_ostream_get_html_destination (html_styled_ostream_t first_arg)
195 {
196 const struct html_styled_ostream_implementation *vtable =
197 ((struct html_styled_ostream_representation_header *) (struct html_styled_ostream_representation *) first_arg)->vtable;
198 return vtable->get_html_destination (first_arg);
199 }
200
201 # define html_styled_ostream_get_css_filename html_styled_ostream_get_css_filename_inline
202 static inline const char *
203 html_styled_ostream_get_css_filename (html_styled_ostream_t first_arg)
204 {
205 const struct html_styled_ostream_implementation *vtable =
206 ((struct html_styled_ostream_representation_header *) (struct html_styled_ostream_representation *) first_arg)->vtable;
207 return vtable->get_css_filename (first_arg);
208 }
209
210 #endif
211
212 extern const typeinfo_t html_styled_ostream_typeinfo;
213 #define html_styled_ostream_SUPERCLASSES &html_styled_ostream_typeinfo, styled_ostream_SUPERCLASSES
214 #define html_styled_ostream_SUPERCLASSES_LENGTH (1 + styled_ostream_SUPERCLASSES_LENGTH)
215
216 extern const struct html_styled_ostream_implementation html_styled_ostream_vtable;
217
218 #line 35 "html-styled-ostream.oo.h"
219
220
221 #ifdef __cplusplus
222 extern "C" {
223 #endif
224
225
226 /* Create an output stream that takes input in the UTF-8 encoding and
227 writes it in HTML form on DESTINATION, styled with the file CSS_FILENAME.
228 Note that the resulting stream must be closed before DESTINATION can be
229 closed. */
230 extern html_styled_ostream_t
231 html_styled_ostream_create (ostream_t destination,
232 const char *css_filename);
233
234
235 /* Test whether a given output stream is a html_styled_ostream. */
236 extern bool is_instance_of_html_styled_ostream (ostream_t stream);
237
238
239 #ifdef __cplusplus
240 }
241 #endif
242
243 #endif /* _HTML_STYLED_OSTREAM_H */