i Implemented rendering of diacriticals.
[WebKit-https.git] / WebCore / kwq / WebCoreUnicode.h
1 /*
2  * Copyright (C) 2002 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_Dask = Punctuation_Dash, // oops
62         Punctuation_Open,         //   Ps
63         Punctuation_Close,        //   Pe
64         Punctuation_InitialQuote, //   Pi
65         Punctuation_FinalQuote,   //   Pf
66         Punctuation_Other,        //   Po
67
68         Symbol_Math,              //   Sm
69         Symbol_Currency,          //   Sc
70         Symbol_Modifier,          //   Sk
71         Symbol_Other              //   So
72     } WebCoreUnicodeCategory;
73
74     typedef enum
75     {
76         DirectionL,     // Left Letter 
77         DirectionR,     // Right Letter
78         DirectionEN,    // European Number
79         DirectionES,    // European Separator
80         DirectionET,    // European Terminator (post/prefix e.g. $ and %)
81         DirectionAN,    // Arabic Number
82         DirectionCS,    // Common Separator 
83         DirectionB,     // Paragraph Separator (aka as PS)
84         DirectionS,     // Segment Separator (TAB)
85         DirectionWS,    // White space
86         DirectionON,    // Other Neutral
87
88         // types for explicit controls
89         DirectionLRE, 
90         DirectionLRO, 
91
92         DirectionAL,    // Arabic Letter (Right-to-left)
93
94         DirectionRLE, 
95         DirectionRLO, 
96         DirectionPDF, 
97
98         DirectionNSM,   // Non-spacing Mark
99         DirectionBN     // Boundary neutral (type of RLE etc after explicit levels)
100     } WebCoreUnicodeDirection;
101
102     typedef enum 
103     {
104         DecompositionSingle,
105         DecompositionCanonical,
106         DecompositionFont,
107         DecompositionNoBreak,
108         DecompositionInitial,
109         DecompositionMedial,
110         DecompositionFinal,
111         DecompositionIsolated,
112         DecompositionCircle,
113         DecompositionSuper,
114         DecompositionSub,
115         DecompositionVertical,
116         DecompositionWide,
117         DecompositionNarrow,
118         DecompositionSmall,
119         DecompositionSquare,
120         DecompositionCompat,
121         DecompositionFraction
122     } WebCoreUnicodeDecomposition;
123
124     typedef enum
125     {
126         JoiningOther,
127         JoiningDual,
128         JoiningRight,
129         JoiningCausing
130     } WebCoreUnicodeJoining;
131
132     typedef enum
133     {
134         Combining_BelowLeftAttached       = 200,
135         Combining_BelowAttached           = 202,
136         Combining_BelowRightAttached      = 204,
137         Combining_LeftAttached            = 208,
138         Combining_RightAttached           = 210,
139         Combining_AboveLeftAttached       = 212,
140         Combining_AboveAttached           = 214,
141         Combining_AboveRightAttached      = 216,
142
143         Combining_BelowLeft               = 218,
144         Combining_Below                   = 220,
145         Combining_BelowRight              = 222,
146         Combining_Left                    = 224,
147         Combining_Right                   = 226,
148         Combining_AboveLeft               = 228,
149         Combining_Above                   = 230,
150         Combining_AboveRight              = 232,
151
152         Combining_DoubleBelow             = 233,
153         Combining_DoubleAbove             = 234,
154         Combining_IotaSubscript           = 240
155     } WebCoreUnicodeCombiningClass;
156
157     extern int (*WebCoreUnicodeDigitValueFunction)(UniChar c);
158     extern WebCoreUnicodeCategory (*WebCoreUnicodeCategoryFunction)(UniChar c);
159     extern WebCoreUnicodeDirection (*WebCoreUnicodeDirectionFunction)(UniChar c);
160     extern WebCoreUnicodeJoining (*WebCoreUnicodeJoiningFunction)(UniChar c);
161     extern WebCoreUnicodeDecomposition (*WebCoreUnicodeDecompositionTagFunction)(UniChar c);
162     extern bool (*WebCoreUnicodeMirroredFunction)(UniChar c);
163     extern UniChar (*WebCoreUnicodeMirroredCharFunction)(UniChar c);
164     extern WebCoreUnicodeCombiningClass (*WebCoreUnicodeCombiningClassFunction)(UniChar c);
165     extern UniChar (*WebCoreUnicodeLowerFunction)(UniChar c);
166     extern UniChar (*WebCoreUnicodeUpperFunction)(UniChar c);
167
168 #ifdef __cplusplus
169 }
170 #endif