Branch libreoffice-5-0-4
[LibreOffice.git] / include / svtools / htmltokn.h
blob6e13eb594666033573635eebec62b94222c73d30
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_SVTOOLS_HTMLTOKN_H
21 #define INCLUDED_SVTOOLS_HTMLTOKN_H
23 #include <svtools/svtdllapi.h>
24 #include <sal/types.h>
26 namespace rtl {
27 class OUString;
30 // suche das Char zu dem CharNamen
31 sal_Unicode GetHTMLCharName( const rtl::OUString& rName );
33 // suche die TokenID zu dem Token
34 SVT_DLLPUBLIC int GetHTMLToken( const rtl::OUString& rName );
36 // suche die TokenId zu einemm Attribut-Token
37 int GetHTMLOption( const rtl::OUString& rName );
39 // suche die 24-bit-Farbe zu einem Farbnamen (nicht gefunden = ULONG_MAX)
40 SVT_DLLPUBLIC sal_uInt32 GetHTMLColor( const rtl::OUString& rName );
42 // beginnen immer ab 256, groesser als ein char
43 const int HTML_TOKEN_START = 0x100;
44 const int HTML_TOKEN_ONOFF = 0x200;
45 const int HTML_TOKEN_MICROSOFT = 0x1000;
47 enum HTML_TOKEN_IDS
49 HTML_TEXTTOKEN = HTML_TOKEN_START,
50 HTML_SINGLECHAR,
51 HTML_NEWPARA,
52 HTML_TABCHAR,
53 HTML_RAWDATA,
54 HTML_LINEFEEDCHAR,
56 // diese werden nur eingeschaltet
57 HTML_AREA, // Netscape 2.0
58 HTML_BASE, // HTML 3.0
59 HTML_COMMENT,
60 HTML_DOCTYPE,
61 HTML_EMBED, // Netscape 2.0 </EMBED> ignorieren
62 HTML_HORZRULE, // </HR> ignorieren
63 HTML_IMAGE, // </IMG> ignorieren
64 HTML_INPUT, // </INPUT> ignorieren
65 HTML_LINEBREAK, // </BR> -> <BR>
66 HTML_LINK, // HTML 3.0
67 HTML_META, // HTML 3.0 </META> ignorieren
68 HTML_OPTION, // </OPTION> ignorieren
69 HTML_PARAM, // HotJava
70 HTML_SPACER, // Netscape 3.0b5 // </SPACER> ignorieren
72 // Tokens, die ueber HTML-Charakter erkannt werden
73 HTML_NONBREAKSPACE,
74 HTML_SOFTHYPH,
76 // diese werden wieder abgeschaltet,
77 // der off-Wert liegt immer dahinter (+1) !!
78 HTML_ABBREVIATION_ON = HTML_TOKEN_ONOFF, // HTML 3.0
79 HTML_ABBREVIATION_OFF, // HTML 3.0
80 HTML_ACRONYM_ON, // HTML 3.0
81 HTML_ACRONYM_OFF, // HTML 3.0
82 HTML_ADDRESS_ON,
83 HTML_ADDRESS_OFF,
84 HTML_ANCHOR_ON,
85 HTML_ANCHOR_OFF,
86 HTML_APPLET_ON, // HotJava
87 HTML_APPLET_OFF, // HotJava
88 HTML_AUTHOR_ON, // HTML 3.0
89 HTML_AUTHOR_OFF, // HTML 3.0
90 HTML_BANNER_ON, // HTML 3.0
91 HTML_BANNER_OFF, // HTML 3.0
92 HTML_BASEFONT_ON, // Netscape
93 HTML_BASEFONT_OFF, // Netscape
94 HTML_BIGPRINT_ON, // HTML 3.0
95 HTML_BIGPRINT_OFF, // HTML 3.0
96 HTML_BLINK_ON, // Netscape
97 HTML_BLINK_OFF, // Netscape
98 HTML_BLOCKQUOTE30_ON, // HTML 3.0
99 HTML_BLOCKQUOTE30_OFF, // HTML 3.0
100 HTML_BLOCKQUOTE_ON,
101 HTML_BLOCKQUOTE_OFF,
102 HTML_BODY_ON,
103 HTML_BODY_OFF,
104 HTML_BOLD_ON,
105 HTML_BOLD_OFF,
106 HTML_CAPTION_ON, // HTML 3.0
107 HTML_CAPTION_OFF, // HTML 3.0
108 HTML_CENTER_ON, // Netscape
109 HTML_CENTER_OFF, // Netscape
110 HTML_CITIATION_ON,
111 HTML_CITIATION_OFF,
112 HTML_CODE_ON,
113 HTML_CODE_OFF,
114 HTML_COL_ON, // HTML3 Table Model Draft
115 HTML_COL_OFF, // HTML3 Table Model Draft
116 HTML_COLGROUP_ON, // HTML3 Table Model Draft
117 HTML_COLGROUP_OFF, // HTML3 Table Model Draft
118 HTML_CREDIT_ON, // HTML 3.0
119 HTML_CREDIT_OFF, // HTML 3.0
120 HTML_DD_ON,
121 HTML_DD_OFF,
122 HTML_DEFLIST_ON,
123 HTML_DEFLIST_OFF,
124 HTML_DELETEDTEXT_ON, // HTML 3.0
125 HTML_DELETEDTEXT_OFF, // HTML 3.0
126 HTML_DIRLIST_ON,
127 HTML_DIRLIST_OFF,
128 HTML_DIVISION_ON, // HTML 3.0
129 HTML_DIVISION_OFF, // HTML 3.0
130 HTML_DT_ON,
131 HTML_DT_OFF,
132 HTML_EMPHASIS_ON,
133 HTML_EMPHASIS_OFF,
134 HTML_FIGURE_ON, // HTML 3.0
135 HTML_FIGURE_OFF, // HTML 3.0
136 HTML_FONT_ON, // Netscape
137 HTML_FONT_OFF, // Netscape
138 HTML_FOOTNOTE_ON, // HTML 3.0
139 HTML_FOOTNOTE_OFF, // HTML 3.0
140 HTML_FORM_ON,
141 HTML_FORM_OFF,
142 HTML_FRAME_ON, // Netscape 2.0
143 HTML_FRAME_OFF, // Netscape 2.0
144 HTML_FRAMESET_ON, // Netscape 2.0
145 HTML_FRAMESET_OFF, // Netscape 2.0
146 HTML_HEAD1_ON,
147 HTML_HEAD1_OFF,
148 HTML_HEAD2_ON,
149 HTML_HEAD2_OFF,
150 HTML_HEAD3_ON,
151 HTML_HEAD3_OFF,
152 HTML_HEAD4_ON,
153 HTML_HEAD4_OFF,
154 HTML_HEAD5_ON,
155 HTML_HEAD5_OFF,
156 HTML_HEAD6_ON,
157 HTML_HEAD6_OFF,
158 HTML_HEAD_ON,
159 HTML_HEAD_OFF,
160 HTML_HTML_ON,
161 HTML_HTML_OFF,
162 HTML_IFRAME_ON, // IE 3.0b2
163 HTML_IFRAME_OFF, // IE 3.0b2
164 HTML_INSERTEDTEXT_ON, // HTML 3.0
165 HTML_INSERTEDTEXT_OFF, // HTML 3.0
166 HTML_ITALIC_ON,
167 HTML_ITALIC_OFF,
168 HTML_KEYBOARD_ON,
169 HTML_KEYBOARD_OFF,
170 HTML_LANGUAGE_ON, // HTML 3.0
171 HTML_LANGUAGE_OFF, // HTML 3.0
172 HTML_LISTHEADER_ON, // HTML 3.0
173 HTML_LISTHEADER_OFF, // HTML 3.0
174 HTML_LI_ON,
175 HTML_LI_OFF,
176 HTML_MAP_ON, // Netscape 2.0
177 HTML_MAP_OFF, // Netscape 2.0
178 HTML_MENULIST_ON,
179 HTML_MENULIST_OFF,
180 HTML_MULTICOL_ON, // Netscape 3.0b5
181 HTML_MULTICOL_OFF, // Netscape 3.0b5
182 HTML_NOBR_ON, // Netscape
183 HTML_NOBR_OFF, // Netscape
184 HTML_NOEMBED_ON, // Netscape 2.0
185 HTML_NOEMBED_OFF, // Netscape 2.0
186 HTML_NOFRAMES_ON, // Netscape 2.0
187 HTML_NOFRAMES_OFF, // Netscape 2.0
188 HTML_NOSCRIPT_ON, // Netscape 2.0
189 HTML_NOSCRIPT_OFF, // Netscape 3.0
190 HTML_NOTE_ON, // HTML 3.0
191 HTML_NOTE_OFF, // HTML 3.0
192 HTML_OBJECT_ON, // HotJava
193 HTML_OBJECT_OFF, // HotJava
194 HTML_ORDERLIST_ON,
195 HTML_ORDERLIST_OFF,
196 HTML_PARABREAK_ON,
197 HTML_PARABREAK_OFF,
198 HTML_PERSON_ON, // HTML 3.0
199 HTML_PERSON_OFF, // HTML 3.0
200 HTML_PLAINTEXT_ON, // HTML 3.0
201 HTML_PLAINTEXT_OFF, // HTML 3.0
202 HTML_PREFORMTXT_ON,
203 HTML_PREFORMTXT_OFF,
204 HTML_SAMPLE_ON,
205 HTML_SAMPLE_OFF,
206 HTML_SCRIPT_ON, // HTML 3.2
207 HTML_SCRIPT_OFF, // HTML 3.2
208 HTML_SELECT_ON,
209 HTML_SELECT_OFF,
210 HTML_SHORTQUOTE_ON, // HTML 3.0
211 HTML_SHORTQUOTE_OFF, // HTML 3.0
212 HTML_SMALLPRINT_ON, // HTML 3.0
213 HTML_SMALLPRINT_OFF, // HTML 3.0
214 HTML_SPAN_ON, // Style Sheets
215 HTML_SPAN_OFF, // Style Sheets
216 HTML_STRIKETHROUGH_ON, // HTML 3.0
217 HTML_STRIKETHROUGH_OFF, // HTML 3.0
218 HTML_STRONG_ON,
219 HTML_STRONG_OFF,
220 HTML_STYLE_ON, // HTML 3.0
221 HTML_STYLE_OFF, // HTML 3.0
222 HTML_SUBSCRIPT_ON, // HTML 3.0
223 HTML_SUBSCRIPT_OFF, // HTML 3.0
224 HTML_SUPERSCRIPT_ON, // HTML 3.0
225 HTML_SUPERSCRIPT_OFF, // HTML 3.0
226 HTML_TABLE_ON, // HTML 3.0
227 HTML_TABLE_OFF, // HTML 3.0
228 HTML_TABLEDATA_ON, // HTML 3.0
229 HTML_TABLEDATA_OFF, // HTML 3.0
230 HTML_TABLEHEADER_ON, // HTML 3.0
231 HTML_TABLEHEADER_OFF, // HTML 3.0
232 HTML_TABLEROW_ON, // HTML 3.0
233 HTML_TABLEROW_OFF, // HTML 3.0
234 HTML_TBODY_ON, // HTML3 Table Model Draft
235 HTML_TBODY_OFF, // HTML3 Table Model Draft
236 HTML_TELETYPE_ON,
237 HTML_TELETYPE_OFF,
238 HTML_TEXTAREA_ON,
239 HTML_TEXTAREA_OFF,
240 HTML_TFOOT_ON, // HTML3 Table Model Draft
241 HTML_TFOOT_OFF, // HTML3 Table Model Draft
242 HTML_THEAD_ON, // HTML3 Table Model Draft
243 HTML_THEAD_OFF, // HTML3 Table Model Draft
244 HTML_TITLE_ON,
245 HTML_TITLE_OFF,
246 HTML_UNDERLINE_ON,
247 HTML_UNDERLINE_OFF,
248 HTML_UNORDERLIST_ON,
249 HTML_UNORDERLIST_OFF,
250 HTML_VARIABLE_ON,
251 HTML_VARIABLE_OFF,
253 // obsolete features
254 HTML_XMP_ON,
255 HTML_XMP_OFF,
256 HTML_LISTING_ON,
257 HTML_LISTING_OFF,
259 // proposed features
260 HTML_DEFINSTANCE_ON,
261 HTML_DEFINSTANCE_OFF,
262 HTML_STRIKE_ON,
263 HTML_STRIKE_OFF,
265 HTML_UNKNOWNCONTROL_ON,
266 HTML_UNKNOWNCONTROL_OFF,
268 HTML_COMMENT2_ON = HTML_TOKEN_MICROSOFT|HTML_TOKEN_ONOFF, // HTML 2.0 ?
269 HTML_COMMENT2_OFF, // HTML 2.0 ?
270 HTML_MARQUEE_ON,
271 HTML_MARQUEE_OFF,
272 HTML_PLAINTEXT2_ON, // HTML 2.0 ?
273 HTML_PLAINTEXT2_OFF, // HTML 2.0 ?
275 HTML_SDFIELD_ON,
276 HTML_SDFIELD_OFF
279 // HTML Attribut-Token (=Optionen)
281 // beginnen immer ab 256, groesser als ein char
282 const int HTML_OPTION_START = 0x100;
284 enum HTML_OPTION_IDS
286 HTML_OPTION_BOOL_START = HTML_OPTION_START,
288 // Attribute ohne Wert
289 HTML_O_CHECKED = HTML_OPTION_BOOL_START,
290 HTML_O_COMPACT,
291 HTML_O_DECLARE, // IExplorer 3.0b5
292 HTML_O_DISABLED,
293 HTML_O_ISMAP,
294 HTML_O_MAYSCRIPT, // Netcape 3.0
295 HTML_O_MULTIPLE,
296 HTML_O_NOHREF, // Netscape
297 HTML_O_NORESIZE, // Netscape 2.0
298 HTML_O_NOSHADE, // Netscape
299 HTML_O_NOWRAP,
300 HTML_O_SDFIXED,
301 HTML_O_SELECTED,
302 HTML_OPTION_BOOL_END,
304 // Attribute mit einem String als Wert
305 HTML_OPTION_STRING_START = HTML_OPTION_BOOL_END,
306 HTML_O_ACCEPT = HTML_OPTION_STRING_START,
307 HTML_O_ACCESSKEY,
308 HTML_O_ALT,
309 HTML_O_AXIS,
310 HTML_O_CHAR, // HTML3 Table Model Draft
311 HTML_O_CLASS,
312 HTML_O_CODE, // HotJava
313 HTML_O_CODETYPE,
314 HTML_O_CONTENT,
315 HTML_O_COORDS, // Netscape 2.0
316 HTML_O_ENCTYPE,
317 HTML_O_FACE, // IExplorer 2.0
318 HTML_O_FRAMEBORDER, // IExplorer 3.0
319 HTML_O_HTTPEQUIV,
320 HTML_O_LANGUAGE, // JavaScript
321 HTML_O_NAME,
322 HTML_O_PROMPT,
323 HTML_O_SHAPE,
324 HTML_O_STANDBY,
325 HTML_O_STYLE, // Style Sheets
326 HTML_O_TITLE,
327 HTML_O_VALUE,
328 HTML_O_SDVAL, // StarDiv NumberValue
329 HTML_O_SDNUM, // StarDiv NumberFormat
330 HTML_O_SDLIBRARY,
331 HTML_O_SDMODULE,
332 HTML_OPTION_STRING_END,
334 // Attribute mit einem SGML-Identifier als Wert
335 HTML_OPTION_SGMLID_START = HTML_OPTION_STRING_END,
336 HTML_O_ID = HTML_OPTION_SGMLID_START,
337 HTML_O_TARGET, // Netscape 2.0
338 HTML_O_TO,
339 HTML_OPTION_SGMLID_END,
341 // Attribute mit einem URI als Wert
342 HTML_OPTION_URI_START = HTML_OPTION_SGMLID_END,
343 HTML_O_ACTION = HTML_OPTION_URI_START,
344 HTML_O_ARCHIVE,
345 HTML_O_BACKGROUND,
346 HTML_O_CLASSID,
347 HTML_O_CODEBASE, // HotJava
348 HTML_O_DATA,
349 HTML_O_HREF,
350 HTML_O_SCRIPT,
351 HTML_O_SRC,
352 HTML_O_USEMAP, // Netscape 2.0
353 HTML_OPTION_URI_END,
355 // Attribute mit einer Farbe als Wert (alle Netscape)
356 HTML_OPTION_COLOR_START = HTML_OPTION_URI_END,
357 HTML_O_ALINK = HTML_OPTION_COLOR_START,
358 HTML_O_BGCOLOR,
359 HTML_O_BORDERCOLOR, // IExplorer 2.0
360 HTML_O_BORDERCOLORLIGHT, // IExplorer 2.0
361 HTML_O_BORDERCOLORDARK, // IExplorer 2.0
362 HTML_O_COLOR,
363 HTML_O_LINK,
364 HTML_O_TEXT,
365 HTML_O_VLINK,
366 HTML_OPTION_COLOR_END,
368 // Attribute mit einem numerischen Wert
369 HTML_OPTION_NUMBER_START = HTML_OPTION_COLOR_END,
370 HTML_O_BORDER = HTML_OPTION_NUMBER_START,
371 HTML_O_CELLSPACING, // HTML3 Table Model Draft
372 HTML_O_CELLPADDING, // HTML3 Table Model Draft
373 HTML_O_CHAROFF, // HTML3 Table Model Draft
374 HTML_O_COLSPAN,
375 HTML_O_FRAMESPACING, // IExplorer 3.0
376 HTML_O_GUTTER, // Netscape 3.0b5
377 HTML_O_HEIGHT,
378 HTML_O_HSPACE, // Netscape
379 HTML_O_LEFT,
380 HTML_O_LOOP, // IExplorer 2.0
381 HTML_O_MARGINWIDTH, // Netscape 2.0
382 HTML_O_MARGINHEIGHT, // Netscape 2.0
383 HTML_O_MAXLENGTH,
384 HTML_O_ROWSPAN,
385 HTML_O_SCROLLAMOUNT, // IExplorer 2.0
386 HTML_O_SCROLLDELAY, // IExplorer 2.0
387 HTML_O_SPAN, // HTML3 Table Model Draft
388 HTML_O_TABINDEX,
389 HTML_O_VSPACE, // Netscape
390 HTML_O_WIDTH,
391 HTML_O_ZINDEX,
392 HTML_OPTION_NUMBER_END,
394 // Attribute mit Enum-Werten
395 HTML_OPTION_ENUM_START = HTML_OPTION_NUMBER_END,
396 HTML_O_BEHAVIOR = HTML_OPTION_ENUM_START, // IExplorer 2.0
397 HTML_O_CLEAR,
398 HTML_O_DIR,
399 HTML_O_DIRECTION, // IExplorer 2.0
400 HTML_O_FORMAT,
401 HTML_O_FRAME, // HTML3 Table Model Draft
402 HTML_O_LANG,
403 HTML_O_METHOD,
404 HTML_O_REL,
405 HTML_O_REV,
406 HTML_O_RULES, // HTML3 Table Model Draft
407 HTML_O_SCROLLING, // Netscape 2.0
408 HTML_O_SDREADONLY,
409 HTML_O_SUBTYPE,
410 HTML_O_TYPE,
411 HTML_O_VALIGN,
412 HTML_O_VALUETYPE,
413 HTML_O_WRAP,
414 HTML_OPTION_ENUM_END,
416 // Attribute mit Script-Code als Wert
417 HTML_OPTION_SCRIPT_START = HTML_OPTION_ENUM_END,
418 HTML_O_ONABORT = HTML_OPTION_SCRIPT_START, // JavaScript
419 HTML_O_ONBLUR, // JavaScript
420 HTML_O_ONCHANGE, // JavaScript
421 HTML_O_ONCLICK, // JavaScript
422 HTML_O_ONERROR, // JavaScript
423 HTML_O_ONFOCUS, // JavaScript
424 HTML_O_ONLOAD, // JavaScript
425 HTML_O_ONMOUSEOUT, // JavaScript
426 HTML_O_ONMOUSEOVER, // JavaScript
427 HTML_O_ONRESET, // JavaScript
428 HTML_O_ONSELECT, // JavaScript
429 HTML_O_ONSUBMIT, // JavaScript
430 HTML_O_ONUNLOAD, // JavaScript
432 HTML_O_SDONABORT, // StarBasic
433 HTML_O_SDONBLUR, // StarBasic
434 HTML_O_SDONCHANGE, // StarBasic
435 HTML_O_SDONCLICK, // StarBasic
436 HTML_O_SDONERROR, // StarBasic
437 HTML_O_SDONFOCUS, // StarBasic
438 HTML_O_SDONLOAD, // StarBasic
439 HTML_O_SDONMOUSEOUT, // StarBasic
440 HTML_O_SDONMOUSEOVER, // StarBasic
441 HTML_O_SDONRESET, // StarBasic
442 HTML_O_SDONSELECT, // StarBasic
443 HTML_O_SDONSUBMIT, // StarBasic
444 HTML_O_SDONUNLOAD, // StarBasic
445 HTML_OPTION_SCRIPT_END,
447 // Attribute mit Kontext-abhaengigen Werten
448 HTML_OPTION_CONTEXT_START = HTML_OPTION_SCRIPT_END,
449 HTML_O_ALIGN = HTML_OPTION_CONTEXT_START,
450 HTML_O_COLS, // Netscape 2.0 vs HTML 2.0
451 HTML_O_ROWS, // Netscape 2.0 vs HTML 2.0
452 HTML_O_SIZE,
453 HTML_O_START,
454 HTML_OPTION_CONTEXT_END,
456 // eine unbekannte Option
457 HTML_O_UNKNOWN = HTML_OPTION_CONTEXT_END,
458 HTML_OPTION_END
461 #endif // INCLUDED_SVTOOLS_HTMLTOKN_H
463 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */