1 /****************************************************************************
2 **
3 ** Copyright (C) 2015 The Qt Company Ltd.
4 ** Contact: http://www.qt.io/licensing/
5 **
6 ** This file is part of the QtCore module of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** Commercial License Usage
10 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** accordance with the commercial license agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and The Qt Company. For licensing terms
14 ** and conditions see http://www.qt.io/terms-conditions. For further
15 ** information use the contact form at http://www.qt.io/contact-us.
16 **
17 ** GNU Lesser General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 or version 3 as published by the Free
20 ** Software Foundation and appearing in the file LICENSE.LGPLv21 and
21 ** LICENSE.LGPLv3 included in the packaging of this file. Please review the
22 ** following information to ensure the GNU Lesser General Public License
23 ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
24 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
25 **
26 ** As a special exception, The Qt Company gives you certain additional
27 ** rights. These rights are described in The Qt Company LGPL Exception
28 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
29 **
30 ** GNU General Public License Usage
31 ** Alternatively, this file may be used under the terms of the GNU
32 ** General Public License version 3.0 as published by the Free Software
33 ** Foundation and appearing in the file LICENSE.GPL included in the
34 ** packaging of this file.  Please review the following information to
35 ** ensure the GNU General Public License version 3.0 requirements will be
36 ** met: http://www.gnu.org/copyleft/gpl.html.
37 **
38 ** $QT_END_LICENSE$
39 **
40 ****************************************************************************/
41 
42 /* This file is autogenerated from the Unicode 5.0 database. Do not edit */
43 
44 //
45 //  W A R N I N G
46 //  -------------
47 //
48 // This file is not part of the Qt API.  It exists for the convenience
49 // of internal files.  This header file may change from version to version
50 // without notice, or even be removed.
51 //
52 // We mean it.
53 //
54 
55 #ifndef QUNICODETABLES_P_H
56 #define QUNICODETABLES_P_H
57 
58 #include <QtCore/qchar.h>
59 
60 QT_BEGIN_NAMESPACE
61 
62 #define UNICODE_DATA_VERSION QChar::Unicode_5_0
63 
64 #define UNICODE_LAST_CODEPOINT 0x10ffff
65 
66 namespace QUnicodeTables {
67 
68     struct Properties {
69         ushort category         : 8; /* 5 needed */
70         ushort line_break_class : 8; /* 6 needed */
71         ushort direction        : 8; /* 5 needed */
72         ushort combiningClass   : 8;
73         ushort joining          : 2;
74         signed short digitValue : 6; /* 5 needed */
75         ushort unicodeVersion   : 4;
76         ushort lowerCaseSpecial : 1;
77         ushort upperCaseSpecial : 1;
78         ushort titleCaseSpecial : 1;
79         ushort caseFoldSpecial  : 1; /* currently unused */
80         signed short mirrorDiff    : 16;
81         signed short lowerCaseDiff : 16;
82         signed short upperCaseDiff : 16;
83         signed short titleCaseDiff : 16;
84         signed short caseFoldDiff  : 16;
85         ushort graphemeBreak    : 8; /* 4 needed */
86         ushort wordBreak        : 8; /* 4 needed */
87         ushort sentenceBreak    : 8; /* 4 needed */
88     };
89     Q_CORE_EXPORT const Properties * QT_FASTCALL properties(uint ucs4);
90     Q_CORE_EXPORT const Properties * QT_FASTCALL properties(ushort ucs2);
91 
92     // See http://www.unicode.org/reports/tr24/tr24-5.html
93     enum Script {
94         Common,
95         Greek,
96         Cyrillic,
97         Armenian,
98         Hebrew,
99         Arabic,
100         Syriac,
101         Thaana,
102         Devanagari,
103         Bengali,
104         Gurmukhi,
105         Gujarati,
106         Oriya,
107         Tamil,
108         Telugu,
109         Kannada,
110         Malayalam,
111         Sinhala,
112         Thai,
113         Lao,
114         Tibetan,
115         Myanmar,
116         Georgian,
117         Hangul,
118         Ogham,
119         Runic,
120         Khmer,
121         Nko,
122         Inherited,
123         ScriptCount = Inherited,
124         Latin = Common,
125         Ethiopic = Common,
126         Cherokee = Common,
127         CanadianAboriginal = Common,
128         Mongolian = Common,
129         Hiragana = Common,
130         Katakana = Common,
131         Bopomofo = Common,
132         Han = Common,
133         Yi = Common,
134         OldItalic = Common,
135         Gothic = Common,
136         Deseret = Common,
137         Tagalog = Common,
138         Hanunoo = Common,
139         Buhid = Common,
140         Tagbanwa = Common,
141         Limbu = Common,
142         TaiLe = Common,
143         LinearB = Common,
144         Ugaritic = Common,
145         Shavian = Common,
146         Osmanya = Common,
147         Cypriot = Common,
148         Braille = Common,
149         Buginese = Common,
150         Coptic = Common,
151         NewTaiLue = Common,
152         Glagolitic = Common,
153         Tifinagh = Common,
154         SylotiNagri = Common,
155         OldPersian = Common,
156         Kharoshthi = Common,
157         Balinese = Common,
158         Cuneiform = Common,
159         Phoenician = Common,
160         PhagsPa = Common
161     };
162     enum { ScriptSentinel = 32 };
163 
164 
165     enum GraphemeBreak {
166         GraphemeBreakOther,
167         GraphemeBreakCR,
168         GraphemeBreakLF,
169         GraphemeBreakControl,
170         GraphemeBreakExtend,
171         GraphemeBreakL,
172         GraphemeBreakV,
173         GraphemeBreakT,
174         GraphemeBreakLV,
175         GraphemeBreakLVT
176     };
177 
178 
179     enum WordBreak {
180         WordBreakOther,
181         WordBreakFormat,
182         WordBreakKatakana,
183         WordBreakALetter,
184         WordBreakMidLetter,
185         WordBreakMidNum,
186         WordBreakNumeric,
187         WordBreakExtendNumLet
188     };
189 
190 
191     enum SentenceBreak {
192         SentenceBreakOther,
193         SentenceBreakSep,
194         SentenceBreakFormat,
195         SentenceBreakSp,
196         SentenceBreakLower,
197         SentenceBreakUpper,
198         SentenceBreakOLetter,
199         SentenceBreakNumeric,
200         SentenceBreakATerm,
201         SentenceBreakSTerm,
202         SentenceBreakClose
203     };
204 
205 
206     // see http://www.unicode.org/reports/tr14/tr14-19.html
207     // we don't use the XX, AI and CB properties and map them to AL instead.
208     // as we don't support any EBDIC based OS'es, NL is ignored and mapped to AL as well.
209     enum LineBreakClass {
210         LineBreak_OP, LineBreak_CL, LineBreak_QU, LineBreak_GL, LineBreak_NS,
211         LineBreak_EX, LineBreak_SY, LineBreak_IS, LineBreak_PR, LineBreak_PO,
212         LineBreak_NU, LineBreak_AL, LineBreak_ID, LineBreak_IN, LineBreak_HY,
213         LineBreak_BA, LineBreak_BB, LineBreak_B2, LineBreak_ZW, LineBreak_CM,
214         LineBreak_WJ, LineBreak_H2, LineBreak_H3, LineBreak_JL, LineBreak_JV,
215         LineBreak_JT, LineBreak_SA, LineBreak_SG,
216         LineBreak_SP, LineBreak_CR, LineBreak_LF, LineBreak_BK
217     };
218 
219 
220     Q_CORE_EXPORT QUnicodeTables::LineBreakClass QT_FASTCALL lineBreakClass(uint ucs4);
lineBreakClass(const QChar & ch)221     inline int lineBreakClass(const QChar &ch)
222     { return lineBreakClass(ch.unicode()); }
223 
224     Q_CORE_EXPORT int QT_FASTCALL script(uint ucs4);
script(const QChar & ch)225     inline int script(const QChar &ch)
226     { return script(ch.unicode()); }
227 
228 } // namespace QUnicodeTables
229 
230 QT_END_NAMESPACE
231 
232 #endif // QUNICODETABLES_P_H
233