b153d915d715eacfac9ee75e89259fa3b6c467c4
[WebKit-https.git] / WebCore / kwq / WebCoreUnicode.h
1 /*
2  * Copyright (C) 2003 Apple Computer, Inc.  All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  * 1. Redistributions of source code must retain the above copyright
8  *    notice, this list of conditions and the following disclaimer.
9  * 2. Redistributions in binary form must reproduce the above copyright
10  *    notice, this list of conditions and the following disclaimer in the
11  *    documentation and/or other materials provided with the distribution.
12  *
13  * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
14  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE COMPUTER, INC. OR
17  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21  * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
24  */
25 #include <CoreFoundation/CoreFoundation.h>
26
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30
31     typedef enum
32     {
33         NoCategory,
34
35         Mark_NonSpacing,          //   Mn
36         Mark_SpacingCombining,    //   Mc
37         Mark_Enclosing,           //   Me
38
39         Number_DecimalDigit,      //   Nd
40         Number_Letter,            //   Nl
41         Number_Other,             //   No
42
43         Separator_Space,          //   Zs
44         Separator_Line,           //   Zl
45         Separator_Paragraph,      //   Zp
46
47         Other_Control,            //   Cc
48         Other_Format,             //   Cf
49         Other_Surrogate,          //   Cs
50         Other_PrivateUse,         //   Co
51         Other_NotAssigned,        //   Cn
52
53         Letter_Uppercase,         //   Lu
54         Letter_Lowercase,         //   Ll
55         Letter_Titlecase,         //   Lt
56         Letter_Modifier,          //   Lm
57         Letter_Other,             //   Lo
58
59         Punctuation_Connector,    //   Pc
60         Punctuation_Dash,         //   Pd
61         Punctuation_Open,         //   Ps
62         Punctuation_Close,        //   Pe
63         Punctuation_InitialQuote, //   Pi
64         Punctuation_FinalQuote,   //   Pf
65         Punctuation_Other,        //   Po
66
67         Symbol_Math,              //   Sm
68         Symbol_Currency,          //   Sc
69         Symbol_Modifier,          //   Sk
70         Symbol_Other              //   So
71     } WebCoreUnicodeCategory;
72
73     typedef enum
74     {
75         DirectionL = 0,         // Left Letter 
76         DirectionR,     // Right Letter
77         DirectionEN,    // European Number
78         DirectionES,    // European Separator
79         DirectionET,    // European Terminator (post/prefix e.g. $ and %)
80         DirectionAN,    // Arabic Number
81         DirectionCS,    // Common Separator 
82         DirectionB,     // Paragraph Separator (aka as PS)
83         DirectionS,     // Segment Separator (TAB)
84         DirectionWS,    // White space
85         DirectionON,    // Other Neutral
86
87         // types for explicit controls
88         DirectionLRE, 
89         DirectionLRO, 
90
91         DirectionAL,    // Arabic Letter (Right-to-left)
92
93         DirectionRLE, 
94         DirectionRLO, 
95         DirectionPDF, 
96
97         DirectionNSM,   // Non-spacing Mark
98         DirectionBN     // Boundary neutral (type of RLE etc after explicit levels)
99     } WebCoreUnicodeDirection;
100
101     typedef enum 
102     {
103         DecompositionSingle,
104         DecompositionCanonical,
105         DecompositionFont,
106         DecompositionNoBreak,
107         DecompositionInitial,
108         DecompositionMedial,
109         DecompositionFinal,
110         DecompositionIsolated,
111         DecompositionCircle,
112         DecompositionSuper,
113         DecompositionSub,
114         DecompositionVertical,
115         DecompositionWide,
116         DecompositionNarrow,
117         DecompositionSmall,
118         DecompositionSquare,
119         DecompositionCompat,
120         DecompositionFraction
121     } WebCoreUnicodeDecomposition;
122
123     typedef enum
124     {
125         JoiningOther,
126         JoiningDual,
127         JoiningRight,
128         JoiningCausing
129     } WebCoreUnicodeJoining;
130
131     typedef enum
132     {
133         Combining_BelowLeftAttached       = 200,
134         Combining_BelowAttached           = 202,
135         Combining_BelowRightAttached      = 204,
136         Combining_LeftAttached            = 208,
137         Combining_RightAttached           = 210,
138         Combining_AboveLeftAttached       = 212,
139         Combining_AboveAttached           = 214,
140         Combining_AboveRightAttached      = 216,
141
142         Combining_BelowLeft               = 218,
143         Combining_Below                   = 220,
144         Combining_BelowRight              = 222,
145         Combining_Left                    = 224,
146         Combining_Right                   = 226,
147         Combining_AboveLeft               = 228,
148         Combining_Above                   = 230,
149         Combining_AboveRight              = 232,
150
151         Combining_DoubleBelow             = 233,
152         Combining_DoubleAbove             = 234,
153         Combining_IotaSubscript           = 240
154     } WebCoreUnicodeCombiningClass;
155
156     extern int (*WebCoreUnicodeDigitValueFunction)(UniChar c);
157     extern WebCoreUnicodeCategory (*WebCoreUnicodeCategoryFunction)(UniChar c);
158     extern WebCoreUnicodeDirection (*WebCoreUnicodeDirectionFunction)(UniChar c);
159     extern WebCoreUnicodeJoining (*WebCoreUnicodeJoiningFunction)(UniChar c);
160     extern WebCoreUnicodeDecomposition (*WebCoreUnicodeDecompositionTagFunction)(UniChar c);
161     extern bool (*WebCoreUnicodeMirroredFunction)(UniChar c);
162     extern UniChar (*WebCoreUnicodeMirroredCharFunction)(UniChar c);
163     extern WebCoreUnicodeCombiningClass (*WebCoreUnicodeCombiningClassFunction)(UniChar c);
164     extern UniChar (*WebCoreUnicodeLowerFunction)(UniChar c);
165     extern UniChar (*WebCoreUnicodeUpperFunction)(UniChar c);
166     extern const unsigned char * const *WebCoreDirectionInfo;
167
168 #ifdef __cplusplus
169 }
170 #endif