1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: htmltokn.h,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
34 #include "svtools/svtdllapi.h"
35 #include <sal/types.h>
37 #include <tools/solar.h>
42 // suche das Char zu dem CharNamen
43 sal_Unicode
GetHTMLCharName( const String
& rName
);
45 // suche die TokenID zu dem Token
46 SVT_DLLPUBLIC
int GetHTMLToken( const String
& rName
);
48 // suche die TokenId zu einemm Attribut-Token
49 int GetHTMLOption( const String
& rName
);
51 // suche die 24-bit-Farbe zu einem Farbnamen (nicht gefunden = ULONG_MAX)
52 SVT_DLLPUBLIC ULONG
GetHTMLColor( const String
& rName
);
54 // beginnen immer ab 256, groesser als ein char
55 const int HTML_TOKEN_START
= 0x100;
56 const int HTML_TOKEN_ONOFF
= 0x200;
57 const int HTML_TOKEN_MICROSOFT
= 0x1000;
61 HTML_TEXTTOKEN
= HTML_TOKEN_START
,
68 // diese werden nur eingeschaltet
69 HTML_AREA
, // Netscape 2.0
70 HTML_BASE
, // HTML 3.0
73 HTML_EMBED
, // Netscape 2.0 </EMBED> ignorieren
74 HTML_FIGUREOVERLAY
, // HTML 3.0
75 HTML_HORZRULE
, // </HR> ignorieren
76 HTML_HORZTAB
, // HTML 3.0
77 HTML_IMAGE
, // </IMG> ignorieren
78 HTML_INPUT
, // </INPUT> ignorieren
79 HTML_ISINDEX
, // HTML 3.0
80 HTML_LINEBREAK
, // </BR> -> <BR>
81 HTML_LINK
, // HTML 3.0
82 HTML_META
, // HTML 3.0 </META> ignorieren
83 HTML_NEXTID
, // HTML 3.0
85 HTML_OPTION
, // </OPTION> ignorieren
86 HTML_PARAM
, // HotJava
87 HTML_RANGE
, // HTML 3.0
88 HTML_SPACER
, // Netscape 3.0b5 // </SPACER> ignorieren
91 // Tokens, die ueber HTML-Charakter erkannt werden
95 // diese werden wieder abgeschaltet,
96 // der off-Wert liegt immer dahinter (+1) !!
97 HTML_ABBREVIATION_ON
= HTML_TOKEN_ONOFF
, // HTML 3.0
98 HTML_ABBREVIATION_OFF
, // HTML 3.0
99 HTML_ABOVE_ON
, // HTML 3.0
100 HTML_ABOVE_OFF
, // HTML 3.0
101 HTML_ACRONYM_ON
, // HTML 3.0
102 HTML_ACRONYM_OFF
, // HTML 3.0
107 HTML_APPLET_ON
, // HotJava
108 HTML_APPLET_OFF
, // HotJava
109 HTML_ARRAY_ON
, // HTML 3.0
110 HTML_ARRAY_OFF
, // HTML 3.0
111 HTML_AUTHOR_ON
, // HTML 3.0
112 HTML_AUTHOR_OFF
, // HTML 3.0
113 HTML_BANNER_ON
, // HTML 3.0
114 HTML_BANNER_OFF
, // HTML 3.0
115 HTML_BAR_ON
, // HTML 3.0
116 HTML_BAR_OFF
, // HTML 3.0
117 HTML_BASEFONT_ON
, // Netscape
118 HTML_BASEFONT_OFF
, // Netscape
119 HTML_BELOW_ON
, // HTML 3.0
120 HTML_BELOW_OFF
, // HTML 3.0
121 HTML_BIGPRINT_ON
, // HTML 3.0
122 HTML_BIGPRINT_OFF
, // HTML 3.0
123 HTML_BLINK_ON
, // Netscape
124 HTML_BLINK_OFF
, // Netscape
125 HTML_BLOCKQUOTE30_ON
, // HTML 3.0
126 HTML_BLOCKQUOTE30_OFF
, // HTML 3.0
131 HTML_BOLDTEXT_ON
, // HTML 3.0
132 HTML_BOLDTEXT_OFF
, // HTML 3.0
135 HTML_BOX_ON
, // HTML 3.0
136 HTML_BOX_OFF
, // HTML 3.0
137 HTML_CAPTION_ON
, // HTML 3.0
138 HTML_CAPTION_OFF
, // HTML 3.0
139 HTML_CENTER_ON
, // Netscape
140 HTML_CENTER_OFF
, // Netscape
145 HTML_COL_ON
, // HTML3 Table Model Draft
146 HTML_COL_OFF
, // HTML3 Table Model Draft
147 HTML_COLGROUP_ON
, // HTML3 Table Model Draft
148 HTML_COLGROUP_OFF
, // HTML3 Table Model Draft
149 HTML_CREDIT_ON
, // HTML 3.0
150 HTML_CREDIT_OFF
, // HTML 3.0
155 HTML_DELETEDTEXT_ON
, // HTML 3.0
156 HTML_DELETEDTEXT_OFF
, // HTML 3.0
159 HTML_DIVISION_ON
, // HTML 3.0
160 HTML_DIVISION_OFF
, // HTML 3.0
161 HTML_DOT_ON
, // HTML 3.0
162 HTML_DOT_OFF
, // HTML 3.0
163 HTML_DOUBLEDOT_ON
, // HTML 3.0
164 HTML_DOUBLEDOT_OFF
, // HTML 3.0
169 HTML_FIGURE_ON
, // HTML 3.0
170 HTML_FIGURE_OFF
, // HTML 3.0
171 HTML_FONT_ON
, // Netscape
172 HTML_FONT_OFF
, // Netscape
173 HTML_FOOTNOTE_ON
, // HTML 3.0
174 HTML_FOOTNOTE_OFF
, // HTML 3.0
177 HTML_FRAME_ON
, // Netscape 2.0
178 HTML_FRAME_OFF
, // Netscape 2.0
179 HTML_FRAMESET_ON
, // Netscape 2.0
180 HTML_FRAMESET_OFF
, // Netscape 2.0
181 HTML_HAT_ON
, // HTML 3.0
182 HTML_HAT_OFF
, // HTML 3.0
199 HTML_IFRAME_ON
, // IE 3.0b2
200 HTML_IFRAME_OFF
, // IE 3.0b2
203 HTML_INSERTEDTEXT_ON
, // HTML 3.0
204 HTML_INSERTEDTEXT_OFF
, // HTML 3.0
207 HTML_ITEM_ON
, // HTML 3.0
208 HTML_ITEM_OFF
, // HTML 3.0
213 HTML_LANGUAGE_ON
, // HTML 3.0
214 HTML_LANGUAGE_OFF
, // HTML 3.0
215 HTML_LISTHEADER_ON
, // HTML 3.0
216 HTML_LISTHEADER_OFF
, // HTML 3.0
219 HTML_MAP_ON
, // Netscape 2.0
220 HTML_MAP_OFF
, // Netscape 2.0
221 HTML_MATH_ON
, // HTML 3.0
222 HTML_MATH_OFF
, // HTML 3.0
225 HTML_MULTICOL_ON
, // Netscape 3.0b5
226 HTML_MULTICOL_OFF
, // Netscape 3.0b5
227 HTML_NOBR_ON
, // Netscape
228 HTML_NOBR_OFF
, // Netscape
229 HTML_NOEMBED_ON
, // Netscape 2.0
230 HTML_NOEMBED_OFF
, // Netscape 2.0
231 HTML_NOFRAMES_ON
, // Netscape 2.0
232 HTML_NOFRAMES_OFF
, // Netscape 2.0
233 HTML_NOSCRIPT_ON
, // Netscape 2.0
234 HTML_NOSCRIPT_OFF
, // Netscape 3.0
235 HTML_NOTE_ON
, // HTML 3.0
236 HTML_NOTE_OFF
, // HTML 3.0
237 HTML_OBJECT_ON
, // HotJava
238 HTML_OBJECT_OFF
, // HotJava
243 HTML_PERSON_ON
, // HTML 3.0
244 HTML_PERSON_OFF
, // HTML 3.0
245 HTML_PLAINTEXT_ON
, // HTML 3.0
246 HTML_PLAINTEXT_OFF
, // HTML 3.0
249 HTML_ROOT_ON
, // HTML 3.0
250 HTML_ROOT_OFF
, // HTML 3.0
251 HTML_ROW_ON
, // HTML 3.0
252 HTML_ROW_OFF
, // HTML 3.0
255 HTML_SCRIPT_ON
, // HTML 3.2
256 HTML_SCRIPT_OFF
, // HTML 3.2
259 HTML_SHORTQUOTE_ON
, // HTML 3.0
260 HTML_SHORTQUOTE_OFF
, // HTML 3.0
261 HTML_SMALLPRINT_ON
, // HTML 3.0
262 HTML_SMALLPRINT_OFF
, // HTML 3.0
263 HTML_SPAN_ON
, // Style Sheets
264 HTML_SPAN_OFF
, // Style Sheets
265 HTML_SQUAREROOT_ON
, // HTML 3.0
266 HTML_SQUAREROOT_OFF
, // HTML 3.0
267 HTML_STRIKETHROUGH_ON
, // HTML 3.0
268 HTML_STRIKETHROUGH_OFF
, // HTML 3.0
271 HTML_STYLE_ON
, // HTML 3.0
272 HTML_STYLE_OFF
, // HTML 3.0
273 HTML_SUBSCRIPT_ON
, // HTML 3.0
274 HTML_SUBSCRIPT_OFF
, // HTML 3.0
275 HTML_SUPERSCRIPT_ON
, // HTML 3.0
276 HTML_SUPERSCRIPT_OFF
, // HTML 3.0
277 HTML_TABLE_ON
, // HTML 3.0
278 HTML_TABLE_OFF
, // HTML 3.0
279 HTML_TABLEDATA_ON
, // HTML 3.0
280 HTML_TABLEDATA_OFF
, // HTML 3.0
281 HTML_TABLEHEADER_ON
, // HTML 3.0
282 HTML_TABLEHEADER_OFF
, // HTML 3.0
283 HTML_TABLEROW_ON
, // HTML 3.0
284 HTML_TABLEROW_OFF
, // HTML 3.0
285 HTML_TBODY_ON
, // HTML3 Table Model Draft
286 HTML_TBODY_OFF
, // HTML3 Table Model Draft
291 HTML_TEXTFLOW_ON
, // HTML 3.2
292 HTML_TEXTFLOW_OFF
, // HTML 3.2
293 HTML_TEXT_ON
, // HTML 3.0
294 HTML_TEXT_OFF
, // HTML 3.0
295 HTML_TFOOT_ON
, // HTML3 Table Model Draft
296 HTML_TFOOT_OFF
, // HTML3 Table Model Draft
297 HTML_THEAD_ON
, // HTML3 Table Model Draft
298 HTML_THEAD_OFF
, // HTML3 Table Model Draft
299 HTML_TILDE_ON
, // HTML 3.0
300 HTML_TILDE_OFF
, // HTML 3.0
306 HTML_UNORDERLIST_OFF
,
309 HTML_VECTOR_ON
, // HTML 3.0
310 HTML_VECTOR_OFF
, // HTML 3.0
320 HTML_DEFINSTANCE_OFF
,
324 HTML_UNKNOWNCONTROL_ON
,
325 HTML_UNKNOWNCONTROL_OFF
,
327 HTML_BGSOUND
= HTML_TOKEN_MICROSOFT
|HTML_TOKEN_START
,
329 HTML_COMMENT2_ON
= HTML_TOKEN_MICROSOFT
|HTML_TOKEN_ONOFF
, // HTML 2.0 ?
330 HTML_COMMENT2_OFF
, // HTML 2.0 ?
333 HTML_PLAINTEXT2_ON
, // HTML 2.0 ?
334 HTML_PLAINTEXT2_OFF
, // HTML 2.0 ?
340 // HTML Attribut-Token (=Optionen)
342 // beginnen immer ab 256, groesser als ein char
343 const int HTML_OPTION_START
= 0x100;
347 HTML_OPTION_BOOL_START
= HTML_OPTION_START
,
349 // Attribute ohne Wert
350 HTML_O_BOX
= HTML_OPTION_BOOL_START
,
354 HTML_O_CONTROLS
, // IExplorer 2.0
355 HTML_O_DECLARE
, // IExplorer 3.0b5
357 HTML_O_FOLDED
, // Netscape internal
359 HTML_O_MAYSCRIPT
, // Netcape 3.0
362 HTML_O_NOHREF
, // Netscape
363 HTML_O_NORESIZE
, // Netscape 2.0
364 HTML_O_NOSHADE
, // Netscape
369 HTML_O_SHAPES
, // IExplorer 3.0b5
370 HTML_OPTION_BOOL_END
,
372 // Attribute mit einem String als Wert
373 HTML_OPTION_STRING_START
= HTML_OPTION_BOOL_END
,
374 HTML_O_ABOVE
= HTML_OPTION_STRING_START
,
377 HTML_O_ADD_DATE
, // Netscape internal
382 HTML_O_CHAR
, // HTML3 Table Model Draft
385 HTML_O_CODE
, // HotJava
389 HTML_O_COORDS
, // Netscape 2.0
393 HTML_O_FACE
, // IExplorer 2.0
394 HTML_O_FRAMEBORDER
, // IExplorer 3.0
396 HTML_O_LANGUAGE
, // JavaScript
397 HTML_O_LAST_MODIFIED
, // Netscape internal
398 HTML_O_LAST_VISIT
, // Netscape internal
406 HTML_O_STYLE
, // Style Sheets
409 HTML_O_SDVAL
, // StarDiv NumberValue
410 HTML_O_SDNUM
, // StarDiv NumberFormat
413 HTML_OPTION_STRING_END
,
415 // Attribute mit einem SGML-Identifier als Wert
416 HTML_OPTION_SGMLID_START
= HTML_OPTION_STRING_END
,
417 HTML_O_FROM
= HTML_OPTION_SGMLID_START
,
419 HTML_O_TARGET
, // Netscape 2.0
422 HTML_OPTION_SGMLID_END
,
424 // Attribute mit einem URI als Wert
425 HTML_OPTION_URI_START
= HTML_OPTION_SGMLID_END
,
426 HTML_O_ACTION
= HTML_OPTION_URI_START
,
430 HTML_O_CODEBASE
, // HotJava
432 HTML_O_DYNSRC
, // IExplorer 3.0
433 HTML_O_DYNSYNC
, // IExplorer 2.0
436 HTML_O_LOWSRC
, // Netscape 3.0
439 HTML_O_USEMAP
, // Netscape 2.0
442 // Attribute mit Entity-Namen als Wert
443 HTML_OPTION_ENTITY_START
= HTML_OPTION_URI_END
,
444 HTML_O_DINGBAT
= HTML_OPTION_ENTITY_START
,
446 HTML_OPTION_ENTITY_END
,
448 // Attribute mit einer Farbe als Wert (alle Netscape)
449 HTML_OPTION_COLOR_START
= HTML_OPTION_ENTITY_END
,
450 HTML_O_ALINK
= HTML_OPTION_COLOR_START
,
452 HTML_O_BORDERCOLOR
, // IExplorer 2.0
453 HTML_O_BORDERCOLORLIGHT
, // IExplorer 2.0
454 HTML_O_BORDERCOLORDARK
, // IExplorer 2.0
459 HTML_OPTION_COLOR_END
,
461 // Attribute mit einem numerischen Wert
462 HTML_OPTION_NUMBER_START
= HTML_OPTION_COLOR_END
,
463 HTML_O_BORDER
= HTML_OPTION_NUMBER_START
,
464 HTML_O_CELLSPACING
, // HTML3 Table Model Draft
465 HTML_O_CELLPADDING
, // HTML3 Table Model Draft
466 HTML_O_CHAROFF
, // HTML3 Table Model Draft
468 HTML_O_FRAMESPACING
, // IExplorer 3.0
469 HTML_O_GUTTER
, // Netscape 3.0b5
472 HTML_O_HSPACE
, // Netscape
474 HTML_O_LEFTMARGIN
, // IExplorer 2.0
475 HTML_O_LOOP
, // IExplorer 2.0
476 HTML_O_MARGINWIDTH
, // Netscape 2.0
477 HTML_O_MARGINHEIGHT
, // Netscape 2.0
485 HTML_O_SCROLLAMOUNT
, // IExplorer 2.0
486 HTML_O_SCROLLDELAY
, // IExplorer 2.0
489 HTML_O_SPAN
, // HTML3 Table Model Draft
492 HTML_O_TOPMARGIN
, // IExplorer 2.0
493 HTML_O_VSPACE
, // Netscape
499 HTML_OPTION_NUMBER_END
,
501 // Attribute mit Enum-Werten
502 HTML_OPTION_ENUM_START
= HTML_OPTION_NUMBER_END
,
503 HTML_O_BEHAVIOR
= HTML_OPTION_ENUM_START
, // IExplorer 2.0
504 HTML_O_BGPROPERTIES
, // IExplorer 2.0
507 HTML_O_DIRECTION
, // IExplorer 2.0
509 HTML_O_FRAME
, // HTML3 Table Model Draft
515 HTML_O_RULES
, // HTML3 Table Model Draft
516 HTML_O_SCROLLING
, // Netscape 2.0
524 HTML_OPTION_ENUM_END
,
526 // Attribute mit Script-Code als Wert
527 HTML_OPTION_SCRIPT_START
= HTML_OPTION_ENUM_END
,
528 HTML_O_ONABORT
= HTML_OPTION_SCRIPT_START
, // JavaScaript
529 HTML_O_ONBLUR
, // JavaScript
530 HTML_O_ONCHANGE
, // JavaScript
531 HTML_O_ONCLICK
, // JavaScript
532 HTML_O_ONERROR
, // JavaScript
533 HTML_O_ONFOCUS
, // JavaScript
534 HTML_O_ONLOAD
, // JavaScript
535 HTML_O_ONMOUSEOUT
, // JavaScript
536 HTML_O_ONMOUSEOVER
, // JavaScript
537 HTML_O_ONRESET
, // JavaScript
538 HTML_O_ONSELECT
, // JavaScript
539 HTML_O_ONSUBMIT
, // JavaScript
540 HTML_O_ONUNLOAD
, // JavaScript
542 HTML_O_SDONABORT
, // StarBasic
543 HTML_O_SDONBLUR
, // StarBasic
544 HTML_O_SDONCHANGE
, // StarBasic
545 HTML_O_SDONCLICK
, // StarBasic
546 HTML_O_SDONERROR
, // StarBasic
547 HTML_O_SDONFOCUS
, // StarBasic
548 HTML_O_SDONLOAD
, // StarBasic
549 HTML_O_SDONMOUSEOUT
, // StarBasic
550 HTML_O_SDONMOUSEOVER
, // StarBasic
551 HTML_O_SDONRESET
, // StarBasic
552 HTML_O_SDONSELECT
, // StarBasic
553 HTML_O_SDONSUBMIT
, // StarBasic
554 HTML_O_SDONUNLOAD
, // StarBasic
555 HTML_OPTION_SCRIPT_END
,
557 // Attribute mit Kontext-abhaengigen Werten
558 HTML_OPTION_CONTEXT_START
= HTML_OPTION_SCRIPT_END
,
559 HTML_O_ALIGN
= HTML_OPTION_CONTEXT_START
,
560 HTML_O_COLS
, // Netscape 2.0 vs HTML 2.0
561 HTML_O_ROWS
, // Netscape 2.0 vs HTML 2.0
565 HTML_OPTION_CONTEXT_END
,
567 // eine unbekannte Option
568 HTML_O_UNKNOWN
= HTML_OPTION_CONTEXT_END
,
572 #endif // _HTMLTOKN_H