Source code: com/port80/html/tidy/Dict.java
1 /*
2 * @(#)Dict.java 1.11 2000/08/16
3 *
4 */
5
6 package com.port80.html.tidy;
7
8 /**
9 *
10 * Tag dictionary node
11 *
12 * (c) 1998-2000 (W3C) MIT, INRIA, Keio University
13 * See Tidy.java for the copyright notice.
14 * Derived from <a href="http://www.w3.org/People/Raggett/tidy">
15 * HTML Tidy Release 4 Aug 2000</a>
16 *
17 * @author Dave Raggett <dsr@w3.org>
18 * @author Andy Quick <ac.quick@sympatico.ca> (translation to Java)
19 * @version 1.0, 1999/05/22
20 * @version 1.0.1, 1999/05/29
21 * @version 1.1, 1999/06/18 Java Bean
22 * @version 1.2, 1999/07/10 Tidy Release 7 Jul 1999
23 * @version 1.3, 1999/07/30 Tidy Release 26 Jul 1999
24 * @version 1.4, 1999/09/04 DOM support
25 * @version 1.5, 1999/10/23 Tidy Release 27 Sep 1999
26 * @version 1.6, 1999/11/01 Tidy Release 22 Oct 1999
27 * @version 1.7, 1999/12/06 Tidy Release 30 Nov 1999
28 * @version 1.8, 2000/01/22 Tidy Release 13 Jan 2000
29 * @version 1.9, 2000/06/03 Tidy Release 30 Apr 2000
30 * @version 1.10, 2000/07/22 Tidy Release 8 Jul 2000
31 * @version 1.11, 2000/08/16 Tidy Release 4 Aug 2000
32 */
33
34 public class Dict {
35
36 ////////////////////////////////////////////////////////////////////////////////////
37
38 /* content model shortcut encoding */
39
40 public static final int CM_UNKNOWN = 0;
41 public static final int CM_EMPTY = (1 << 0);
42 public static final int CM_HTML = (1 << 1);
43 public static final int CM_HEAD = (1 << 2);
44 public static final int CM_BLOCK = (1 << 3);
45 public static final int CM_INLINE = (1 << 4);
46 public static final int CM_LIST = (1 << 5);
47 public static final int CM_DEFLIST = (1 << 6);
48 public static final int CM_TABLE = (1 << 7);
49 public static final int CM_ROWGRP = (1 << 8);
50 public static final int CM_ROW = (1 << 9);
51 public static final int CM_FIELD = (1 << 10);
52 public static final int CM_OBJECT = (1 << 11);
53 public static final int CM_PARAM = (1 << 12);
54 public static final int CM_FRAMES = (1 << 13);
55 public static final int CM_HEADING = (1 << 14);
56 public static final int CM_OPT = (1 << 15);
57 public static final int CM_IMG = (1 << 16);
58 public static final int CM_MIXED = (1 << 17);
59 public static final int CM_OBSOLETE = (1 << 18);
60 public static final int CM_NEW = (1 << 18);
61 public static final int CM_OMITST = (1 << 20);
62 //
63 // These flags are used for formatting, and not related to the HTML DTD content model.
64 /** Force line break before and after an empty tag (eg. img) if not in CompactFormat. */
65 public static final int FM_SOFT_BREAK = (1 << 22);
66 /** Force line break before and after an empty tag regardless. */
67 public static final int FM_HARD_BREAK= (1 << 23);
68 /** With smart indent, block (eg li, td) is indent only if it contains BLOCK/BREAK elements. */
69 public static final int FM_SMART_INDENT = (1 << 24);
70
71 /*
72 If the document uses just HTML 2.0 tags and attributes described it as HTML 2.0
73 Similarly for HTML 3.2 and the 3 flavors of HTML 4.0. If there are proprietary
74 tags and attributes then describe it as HTML Proprietary. If it includes the
75 xml-lang or xmlns attributes but is otherwise HTML 2.0, 3.2 or 4.0 then describe
76 it as one of the flavors of Voyager (strict, loose or frameset).
77 */
78
79 public static final short VERS_UNKNOWN = 0;
80
81 public static final short VERS_HTML20 = 1;
82 public static final short VERS_HTML32 = 2;
83 public static final short VERS_HTML40_STRICT = 4;
84 public static final short VERS_HTML40_LOOSE = 8;
85 public static final short VERS_FRAMES = 16;
86 public static final short VERS_XML = 32;
87
88 public static final short VERS_NETSCAPE = 64;
89 public static final short VERS_MICROSOFT = 128;
90 public static final short VERS_SUN = 256;
91
92 public static final short VERS_MALFORMED = 512;
93
94 public static final short VERS_ALL =
95 (VERS_HTML20 | VERS_HTML32 | VERS_HTML40_STRICT | VERS_HTML40_LOOSE | VERS_FRAMES);
96 public static final short VERS_HTML40 = (VERS_HTML40_STRICT | VERS_HTML40_LOOSE | VERS_FRAMES);
97 public static final short VERS_LOOSE = (VERS_HTML32 | VERS_HTML40_LOOSE | VERS_FRAMES);
98 public static final short VERS_IFRAMES = (VERS_HTML40_LOOSE | VERS_FRAMES);
99 public static final short VERS_FROM32 = (VERS_HTML40_STRICT | VERS_LOOSE);
100 public static final short VERS_PROPRIETARY = (VERS_NETSCAPE | VERS_MICROSOFT | VERS_SUN);
101
102 public static final short VERS_EVERYTHING = (VERS_ALL | VERS_PROPRIETARY);
103
104 ////////////////////////////////////////////////////////////////////////////////////
105
106 public String name;
107 public short versions;
108 public int model;
109 public Parser parser;
110 public CheckAttribs chkattrs;
111
112 ////////////////////////////////////////////////////////////////////////////////////
113
114 public Dict(String name, short versions, int model, Parser parser, CheckAttribs chkattrs) {
115 this.name = name;
116 this.versions = versions;
117 this.model = model;
118 this.parser = parser;
119 this.chkattrs = chkattrs;
120 }
121
122 ////////////////////////////////////////////////////////////////////////////////////
123
124 }