1// Copyright (C) 2020 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4/* This file is autogenerated from the Unicode 14.0 database. Do not edit */
5
6//
7// W A R N I N G
8// -------------
9//
10// This file is not part of the Qt API. It exists for the convenience
11// of internal files. This header file may change from version to version
12// without notice, or even be removed.
13//
14// We mean it.
15//
16
17#ifndef QUNICODETABLES_P_H
18#define QUNICODETABLES_P_H
19
20#include <QtCore/private/qglobal_p.h>
21
22#include <QtCore/qchar.h>
23
24QT_BEGIN_NAMESPACE
25
26#define UNICODE_DATA_VERSION QChar::Unicode_14_0
27
28namespace QUnicodeTables {
29
30enum Case {
31 LowerCase,
32 UpperCase,
33 TitleCase,
34 CaseFold,
35
36 NumCases
37};
38
39struct Properties {
40 ushort category : 8; /* 5 used */
41 ushort direction : 8; /* 5 used */
42 ushort combiningClass : 8;
43 ushort joining : 3;
44 signed short digitValue : 5;
45 signed short mirrorDiff : 16;
46 ushort unicodeVersion : 5; /* 5 used */
47 ushort eastAsianWidth : 3; /* 3 used */
48 ushort nfQuickCheck : 8;
49#ifdef Q_OS_WASM
50 unsigned char : 0; //wasm 64 packing trick
51#endif
52 struct {
53 ushort special : 1;
54 signed short diff : 15;
55 } cases[NumCases];
56#ifdef Q_OS_WASM
57 unsigned char : 0; //wasm 64 packing trick
58#endif
59 ushort graphemeBreakClass : 5; /* 5 used */
60 ushort wordBreakClass : 5; /* 5 used */
61 ushort lineBreakClass : 6; /* 6 used */
62 ushort sentenceBreakClass : 4; /* 4 used */
63 ushort idnaStatus : 4; /* 3 used */
64 ushort script : 8;
65};
66
67Q_CORE_EXPORT const Properties * QT_FASTCALL properties(char32_t ucs4) noexcept;
68Q_CORE_EXPORT const Properties * QT_FASTCALL properties(char16_t ucs2) noexcept;
69
70static_assert(sizeof(Properties) == 20);
71
72enum class EastAsianWidth : unsigned int {
73 A,
74 F,
75 H,
76 N,
77 Na,
78 W,
79};
80
81enum GraphemeBreakClass {
82 GraphemeBreak_Any,
83 GraphemeBreak_CR,
84 GraphemeBreak_LF,
85 GraphemeBreak_Control,
86 GraphemeBreak_Extend,
87 GraphemeBreak_ZWJ,
88 GraphemeBreak_RegionalIndicator,
89 GraphemeBreak_Prepend,
90 GraphemeBreak_SpacingMark,
91 GraphemeBreak_L,
92 GraphemeBreak_V,
93 GraphemeBreak_T,
94 GraphemeBreak_LV,
95 GraphemeBreak_LVT,
96 GraphemeBreak_Extended_Pictographic,
97
98 NumGraphemeBreakClasses
99};
100
101enum WordBreakClass {
102 WordBreak_Any,
103 WordBreak_CR,
104 WordBreak_LF,
105 WordBreak_Newline,
106 WordBreak_Extend,
107 WordBreak_ZWJ,
108 WordBreak_Format,
109 WordBreak_RegionalIndicator,
110 WordBreak_Katakana,
111 WordBreak_HebrewLetter,
112 WordBreak_ALetter,
113 WordBreak_SingleQuote,
114 WordBreak_DoubleQuote,
115 WordBreak_MidNumLet,
116 WordBreak_MidLetter,
117 WordBreak_MidNum,
118 WordBreak_Numeric,
119 WordBreak_ExtendNumLet,
120 WordBreak_WSegSpace,
121
122 NumWordBreakClasses
123};
124
125enum SentenceBreakClass {
126 SentenceBreak_Any,
127 SentenceBreak_CR,
128 SentenceBreak_LF,
129 SentenceBreak_Sep,
130 SentenceBreak_Extend,
131 SentenceBreak_Sp,
132 SentenceBreak_Lower,
133 SentenceBreak_Upper,
134 SentenceBreak_OLetter,
135 SentenceBreak_Numeric,
136 SentenceBreak_ATerm,
137 SentenceBreak_SContinue,
138 SentenceBreak_STerm,
139 SentenceBreak_Close,
140
141 NumSentenceBreakClasses
142};
143
144// see http://www.unicode.org/reports/tr14/tr14-30.html
145// we don't use the XX and AI classes and map them to AL instead.
146enum LineBreakClass {
147 LineBreak_OP, LineBreak_CL, LineBreak_CP, LineBreak_QU, LineBreak_GL,
148 LineBreak_NS, LineBreak_EX, LineBreak_SY, LineBreak_IS, LineBreak_PR,
149 LineBreak_PO, LineBreak_NU, LineBreak_AL, LineBreak_HL, LineBreak_ID,
150 LineBreak_IN, LineBreak_HY, LineBreak_BA, LineBreak_BB, LineBreak_B2,
151 LineBreak_ZW, LineBreak_CM, LineBreak_WJ, LineBreak_H2, LineBreak_H3,
152 LineBreak_JL, LineBreak_JV, LineBreak_JT, LineBreak_RI, LineBreak_CB,
153 LineBreak_EB, LineBreak_EM, LineBreak_ZWJ,
154 LineBreak_SA, LineBreak_SG, LineBreak_SP,
155 LineBreak_CR, LineBreak_LF, LineBreak_BK,
156
157 NumLineBreakClasses
158};
159
160enum class IdnaStatus : unsigned int {
161 Disallowed,
162 Valid,
163 Ignored,
164 Mapped,
165 Deviation
166};
167
168Q_CORE_EXPORT GraphemeBreakClass QT_FASTCALL graphemeBreakClass(char32_t ucs4) noexcept;
169inline GraphemeBreakClass graphemeBreakClass(QChar ch) noexcept
170{ return graphemeBreakClass(ucs4: ch.unicode()); }
171
172Q_CORE_EXPORT WordBreakClass QT_FASTCALL wordBreakClass(char32_t ucs4) noexcept;
173inline WordBreakClass wordBreakClass(QChar ch) noexcept
174{ return wordBreakClass(ucs4: ch.unicode()); }
175
176Q_CORE_EXPORT SentenceBreakClass QT_FASTCALL sentenceBreakClass(char32_t ucs4) noexcept;
177inline SentenceBreakClass sentenceBreakClass(QChar ch) noexcept
178{ return sentenceBreakClass(ucs4: ch.unicode()); }
179
180Q_CORE_EXPORT LineBreakClass QT_FASTCALL lineBreakClass(char32_t ucs4) noexcept;
181inline LineBreakClass lineBreakClass(QChar ch) noexcept
182{ return lineBreakClass(ucs4: ch.unicode()); }
183
184Q_CORE_EXPORT IdnaStatus QT_FASTCALL idnaStatus(char32_t ucs4) noexcept;
185inline IdnaStatus idnaStatus(QChar ch) noexcept
186{ return idnaStatus(ucs4: ch.unicode()); }
187
188Q_CORE_EXPORT QStringView QT_FASTCALL idnaMapping(char32_t usc4) noexcept;
189inline QStringView idnaMapping(QChar ch) noexcept
190{ return idnaMapping(usc4: ch.unicode()); }
191
192Q_CORE_EXPORT EastAsianWidth QT_FASTCALL eastAsianWidth(char32_t ucs4) noexcept;
193inline EastAsianWidth eastAsianWidth(QChar ch) noexcept
194{ return eastAsianWidth(ucs4: ch.unicode()); }
195
196} // namespace QUnicodeTables
197
198QT_END_NAMESPACE
199
200#endif // QUNICODETABLES_P_H
201

source code of qtbase/src/corelib/text/qunicodetables_p.h