1 #ifndef _OUTPUT_H_INCLUDED_
2 #define _OUTPUT_H_INCLUDED_
3 
4 /*=============================================================================
5    GNU UnRTF, a command-line program to convert RTF documents to other formats.
6    Copyright (C) 2000,2001,2004 by Zachary Smith
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, write to the Free Software
20    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
21 
22    The maintainer is reachable by electronic mail at daved@physiol.usyd.edu.au
23 =============================================================================*/
24 
25 
26 /*----------------------------------------------------------------------
27  * Module name:    output
28  * Author name:    Zachary Smith
29  * Create date:    18 Sep 01
30  * Purpose:        Definitions for the generalized output module
31  *----------------------------------------------------------------------
32  * Changes:
33  * 29 Mar 05, daved@physiol.usyd.edu.au: changes requested by ZT Smith
34  * 16 Dec 07, daved@physiol.usyd.edu.au: updated to GPL v3
35  * 09 Nov 08, arkadiusz.firus@gmail.com: use iconv
36  * 07 Oct 11, jf@dockes.org: added _OUTPUT_H_INCLUDED_, argument changes
37  *	for op_translate_char etc. consistent with convert.c and output.c
38  *--------------------------------------------------------------------*/
39 
40 #include "attr.h"
41 #include "my_iconv.h"
42 
43 typedef Collection Aliases;
44 
45 typedef struct
46 {
47 	char *comment_begin;
48 	char *comment_end;
49 
50 	char *document_begin;
51 	char *document_end;
52 
53 	char *header_begin;
54 	char *header_end;
55 
56 	char *document_title_begin;
57 	char *document_title_end;
58 
59 	char *document_keywords_begin;
60 	char *document_keywords_end;
61 
62 	char *document_author_begin;
63 	char *document_author_end;
64 
65 	char *document_changedate_begin;
66 	char *document_changedate_end;
67 
68 	char *body_begin;
69 	char *body_end;
70 
71 	char *word_begin;
72 	char *word_end;
73 
74 	char *paragraph_begin;
75 	char *paragraph_end;
76 
77 	char *center_begin;
78 	char *center_end;
79 
80 	char *align_left_begin;
81 	char *align_left_end;
82 
83 	char *align_right_begin;
84 	char *align_right_end;
85 
86 	char *justify_begin;
87 	char *justify_end;
88 
89 	char *forced_space;
90 	char *line_break;
91 	char *page_break;
92 
93 	char *hyperlink_begin;
94 	char *hyperlink_end;
95 
96 	char *imagelink_begin;
97 	char *imagelink_end;
98 
99 	char *table_begin;
100 	char *table_end;
101 
102 	char *table_row_begin;
103 	char *table_row_end;
104 
105 	char *table_cell_begin;
106 	char *table_cell_end;
107 
108 	/* Character attributes */
109 	char *font_begin;
110 	char *font_end;
111 
112 	char *fontsize_begin;
113 	char *fontsize_end;
114 
115 	/* standard font sizes are optional */
116 	char *fontsize8_begin;
117 	char *fontsize8_end;
118 
119 	char *fontsize10_begin;
120 	char *fontsize10_end;
121 
122 	char *fontsize12_begin;
123 	char *fontsize12_end;
124 
125 	char *fontsize14_begin;
126 	char *fontsize14_end;
127 
128 	char *fontsize18_begin;
129 	char *fontsize18_end;
130 
131 	char *fontsize24_begin;
132 	char *fontsize24_end;
133 
134 	char *fontsize36_begin;
135 	char *fontsize36_end;
136 
137 	char *fontsize48_begin;
138 	char *fontsize48_end;
139 
140 	char *smaller_begin;
141 	char *smaller_end;
142 
143 	char *bigger_begin;
144 	char *bigger_end;
145 
146 	char *foreground_begin;
147 	char *foreground_end;
148 
149 	char *background_begin;
150 	char *background_end;
151 
152 	char *bold_begin;
153 	char *bold_end;
154 
155 	char *italic_begin;
156 	char *italic_end;
157 
158 	char *underline_begin;
159 	char *underline_end;
160 
161 	char *dbl_underline_begin;
162 	char *dbl_underline_end;
163 
164 	char *superscript_begin;
165 	char *superscript_end;
166 
167 	char *subscript_begin;
168 	char *subscript_end;
169 
170 	char *strikethru_begin;
171 	char *strikethru_end;
172 
173 	char *dbl_strikethru_begin;
174 	char *dbl_strikethru_end;
175 
176 	char *emboss_begin;
177 	char *emboss_end;
178 
179 	char *engrave_begin;
180 	char *engrave_end;
181 
182 	char *shadow_begin;
183 	char *shadow_end;
184 
185 	char *outline_begin;
186 	char *outline_end;
187 
188 	char *all_caps_begin;
189 	char *all_caps_end;
190 
191 	char *small_caps_begin;
192 	char *small_caps_end;
193 
194 	char *pointlist_begin;
195 	char *pointlist_end;
196 
197 	char *pointlist_item_begin;
198 	char *pointlist_item_end;
199 
200 	char *numericlist_begin;
201 	char *numericlist_end;
202 
203 	char *numericlist_item_begin;
204 	char *numericlist_item_end;
205 
206 	char *expand_begin;
207 	char *expand_end;
208 
209 	char *toc_entry_begin;
210 	char *toc_entry_end;
211 
212 	char *index_entry_begin;
213 	char *index_entry_end;
214 
215 	char *fonttable_begin;
216 	char *fonttable_end;
217 	char *fonttable_fontnr;
218 	char *fonttable_fontname;
219 
220 	/* XX These should really be replaced by references
221 	 * to one of the charsets.
222 	 */
223 	struct
224 	{
225 		char *bullet;
226 		char *left_quote;
227 		char *right_quote;
228 		char *left_dbl_quote;
229 		char *right_dbl_quote;
230 		char *nonbreaking_space;
231 		char *emdash;
232 		char *endash;
233 		char *lessthan;
234 		char *greaterthan;
235 		char *amp;
236 		char *copyright;
237 		char *trademark;
238 		char *nonbreaking_hyphen;
239 		char *optional_hyphen;
240 	} chars;
241 
242 	int simulate_small_caps : 1;
243 	int simulate_all_caps : 1;
244 	int simulate_word_underline : 1;
245 	char *unisymbol_print;
246 	char *utf8_encoding;
247 	Aliases *aliases;
248 }
249 OutputPersonality;
250 
251 
252 extern OutputPersonality *op_create(void);
253 extern void op_free(OutputPersonality *);
254 extern const char *op_translate_char(OutputPersonality *op, char *encoding, int ch);
255 extern char *op_translate_buffer(OutputPersonality *op, char *buffer,
256                                  int bytescnt);
257 
258 extern void op_begin_std_fontsize(OutputPersonality *, int);
259 extern void op_end_std_fontsize(OutputPersonality *, int);
260 
261 void add_alias(OutputPersonality *op, int nr, char *text);
262 const char *get_alias(OutputPersonality *op, int nr);
263 
264 
265 #endif /* _OUTPUT_H_INCLUDED_ */
266