1 /****************************************************************************
2 **
3 ** Copyright (C) 2020 The Qt Company Ltd.
4 ** Contact: https://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 https://www.qt.io/terms-conditions. For further
15 ** information use the contact form at https://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 3 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL3 included in the
21 ** packaging of this file. Please review the following information to
22 ** ensure the GNU Lesser General Public License version 3 requirements
23 ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
24 **
25 ** GNU General Public License Usage
26 ** Alternatively, this file may be used under the terms of the GNU
27 ** General Public License version 2.0 or (at your option) the GNU General
28 ** Public license version 3 or any later version approved by the KDE Free
29 ** Qt Foundation. The licenses are as published by the Free Software
30 ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
31 ** included in the packaging of this file. Please review the following
32 ** information to ensure the GNU General Public License requirements will
33 ** be met: https://www.gnu.org/licenses/gpl-2.0.html and
34 ** https://www.gnu.org/licenses/gpl-3.0.html.
35 **
36 ** $QT_END_LICENSE$
37 **
38 ****************************************************************************/
39
40 /* This file is autogenerated from the Unicode 13.0 database. Do not edit */
41
42 //
43 // W A R N I N G
44 // -------------
45 //
46 // This file is not part of the Qt API. It exists for the convenience
47 // of internal files. This header file may change from version to version
48 // without notice, or even be removed.
49 //
50 // We mean it.
51 //
52
53 #ifndef QUNICODETABLES_P_H
54 #define QUNICODETABLES_P_H
55
56 #include <QtCore/private/qglobal_p.h>
57
58 #include <QtCore/qchar.h>
59
60 QT_BEGIN_NAMESPACE
61
62 #define UNICODE_DATA_VERSION QChar::Unicode_13_0
63
64 namespace QUnicodeTables {
65
66 enum Case {
67 LowerCase,
68 UpperCase,
69 TitleCase,
70 CaseFold,
71
72 NumCases
73 };
74
75 struct Properties {
76 ushort category : 8; /* 5 used */
77 ushort direction : 8; /* 5 used */
78 ushort combiningClass : 8;
79 ushort joining : 3;
80 signed short digitValue : 5;
81 signed short mirrorDiff : 16;
82 ushort unicodeVersion : 8; /* 5 used */
83 ushort nfQuickCheck : 8;
84 #ifdef Q_OS_WASM
85 unsigned char : 0; //wasm 64 packing trick
86 #endif
87 struct {
88 ushort special : 1;
89 signed short diff : 15;
90 } cases[NumCases];
91 #ifdef Q_OS_WASM
92 unsigned char : 0; //wasm 64 packing trick
93 #endif
94 ushort graphemeBreakClass : 5; /* 5 used */
95 ushort wordBreakClass : 5; /* 5 used */
96 ushort lineBreakClass : 6; /* 6 used */
97 ushort sentenceBreakClass : 8; /* 4 used */
98 ushort script : 8;
99 };
100
101 Q_CORE_EXPORT const Properties * QT_FASTCALL properties(uint ucs4) noexcept;
102 Q_CORE_EXPORT const Properties * QT_FASTCALL properties(ushort ucs2) noexcept;
103
104 Q_STATIC_ASSERT(sizeof(Properties) == 20);
105
106 enum GraphemeBreakClass {
107 GraphemeBreak_Any,
108 GraphemeBreak_CR,
109 GraphemeBreak_LF,
110 GraphemeBreak_Control,
111 GraphemeBreak_Extend,
112 GraphemeBreak_ZWJ,
113 GraphemeBreak_RegionalIndicator,
114 GraphemeBreak_Prepend,
115 GraphemeBreak_SpacingMark,
116 GraphemeBreak_L,
117 GraphemeBreak_V,
118 GraphemeBreak_T,
119 GraphemeBreak_LV,
120 GraphemeBreak_LVT,
121 Graphemebreak_E_Base,
122 Graphemebreak_E_Modifier,
123 Graphemebreak_Glue_After_Zwj,
124 Graphemebreak_E_Base_GAZ,
125
126 NumGraphemeBreakClasses
127 };
128
129 enum WordBreakClass {
130 WordBreak_Any,
131 WordBreak_CR,
132 WordBreak_LF,
133 WordBreak_Newline,
134 WordBreak_Extend,
135 WordBreak_ZWJ,
136 WordBreak_Format,
137 WordBreak_RegionalIndicator,
138 WordBreak_Katakana,
139 WordBreak_HebrewLetter,
140 WordBreak_ALetter,
141 WordBreak_SingleQuote,
142 WordBreak_DoubleQuote,
143 WordBreak_MidNumLet,
144 WordBreak_MidLetter,
145 WordBreak_MidNum,
146 WordBreak_Numeric,
147 WordBreak_ExtendNumLet,
148 WordBreak_E_Base,
149 WordBreak_E_Modifier,
150 WordBreak_Glue_After_Zwj,
151 WordBreak_E_Base_GAZ,
152 WordBreak_WSegSpace,
153
154 NumWordBreakClasses
155 };
156
157 enum SentenceBreakClass {
158 SentenceBreak_Any,
159 SentenceBreak_CR,
160 SentenceBreak_LF,
161 SentenceBreak_Sep,
162 SentenceBreak_Extend,
163 SentenceBreak_Sp,
164 SentenceBreak_Lower,
165 SentenceBreak_Upper,
166 SentenceBreak_OLetter,
167 SentenceBreak_Numeric,
168 SentenceBreak_ATerm,
169 SentenceBreak_SContinue,
170 SentenceBreak_STerm,
171 SentenceBreak_Close,
172
173 NumSentenceBreakClasses
174 };
175
176 // see http://www.unicode.org/reports/tr14/tr14-30.html
177 // we don't use the XX and AI classes and map them to AL instead.
178 enum LineBreakClass {
179 LineBreak_OP, LineBreak_CL, LineBreak_CP, LineBreak_QU, LineBreak_GL,
180 LineBreak_NS, LineBreak_EX, LineBreak_SY, LineBreak_IS, LineBreak_PR,
181 LineBreak_PO, LineBreak_NU, LineBreak_AL, LineBreak_HL, LineBreak_ID,
182 LineBreak_IN, LineBreak_HY, LineBreak_BA, LineBreak_BB, LineBreak_B2,
183 LineBreak_ZW, LineBreak_CM, LineBreak_WJ, LineBreak_H2, LineBreak_H3,
184 LineBreak_JL, LineBreak_JV, LineBreak_JT, LineBreak_RI, LineBreak_CB,
185 LineBreak_EB, LineBreak_EM, LineBreak_ZWJ,
186 LineBreak_SA, LineBreak_SG, LineBreak_SP,
187 LineBreak_CR, LineBreak_LF, LineBreak_BK,
188
189 NumLineBreakClasses
190 };
191
192 Q_CORE_EXPORT GraphemeBreakClass QT_FASTCALL graphemeBreakClass(uint ucs4) noexcept;
graphemeBreakClass(QChar ch)193 inline GraphemeBreakClass graphemeBreakClass(QChar ch) noexcept
194 { return graphemeBreakClass(ch.unicode()); }
195
196 Q_CORE_EXPORT WordBreakClass QT_FASTCALL wordBreakClass(uint ucs4) noexcept;
wordBreakClass(QChar ch)197 inline WordBreakClass wordBreakClass(QChar ch) noexcept
198 { return wordBreakClass(ch.unicode()); }
199
200 Q_CORE_EXPORT SentenceBreakClass QT_FASTCALL sentenceBreakClass(uint ucs4) noexcept;
sentenceBreakClass(QChar ch)201 inline SentenceBreakClass sentenceBreakClass(QChar ch) noexcept
202 { return sentenceBreakClass(ch.unicode()); }
203
204 Q_CORE_EXPORT LineBreakClass QT_FASTCALL lineBreakClass(uint ucs4) noexcept;
lineBreakClass(QChar ch)205 inline LineBreakClass lineBreakClass(QChar ch) noexcept
206 { return lineBreakClass(ch.unicode()); }
207
208 } // namespace QUnicodeTables
209
210 QT_END_NAMESPACE
211
212 #endif // QUNICODETABLES_P_H
213