| 1 | // Copyright (C) 2020 The Qt Company Ltd. |
| 2 | // SPDX-License-Identifier: Unicode-3.0 |
| 3 | |
| 4 | /* This file is autogenerated from the Unicode 16.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 | |
| 24 | QT_BEGIN_NAMESPACE |
| 25 | |
| 26 | #define UNICODE_DATA_VERSION QChar::Unicode_16_0 |
| 27 | |
| 28 | namespace QUnicodeTables { |
| 29 | |
| 30 | enum Case { |
| 31 | LowerCase, |
| 32 | UpperCase, |
| 33 | TitleCase, |
| 34 | CaseFold, |
| 35 | |
| 36 | NumCases |
| 37 | }; |
| 38 | |
| 39 | struct 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 | |
| 67 | Q_CORE_EXPORT const Properties * QT_FASTCALL properties(char32_t ucs4) noexcept; |
| 68 | Q_CORE_EXPORT const Properties * QT_FASTCALL properties(char16_t ucs2) noexcept; |
| 69 | |
| 70 | static_assert(sizeof(Properties) == 20); |
| 71 | |
| 72 | enum class EastAsianWidth : unsigned int { |
| 73 | A, |
| 74 | F, |
| 75 | H, |
| 76 | N, |
| 77 | Na, |
| 78 | W, |
| 79 | }; |
| 80 | |
| 81 | enum 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 | |
| 101 | enum 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 | |
| 125 | enum 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 but map them to AL instead. |
| 146 | // VI and VF classes are mapped to CM. |
| 147 | enum LineBreakClass { |
| 148 | LineBreak_OP, LineBreak_CL, LineBreak_CP, |
| 149 | LineBreak_QU, LineBreak_QU_Pi, LineBreak_QU_Pf, LineBreak_QU_19, |
| 150 | LineBreak_GL, LineBreak_NS, LineBreak_EX, LineBreak_SY, |
| 151 | LineBreak_IS, LineBreak_PR, |
| 152 | LineBreak_PO, LineBreak_NU, LineBreak_AL, LineBreak_HL, LineBreak_ID, |
| 153 | LineBreak_IN, LineBreak_HY, LineBreak_WS_HY, |
| 154 | LineBreak_BA, LineBreak_WS_BA, |
| 155 | LineBreak_HYBA, |
| 156 | LineBreak_BB, LineBreak_B2, |
| 157 | LineBreak_ZW, LineBreak_CM, LineBreak_WJ, LineBreak_H2, LineBreak_H3, |
| 158 | LineBreak_JL, LineBreak_JV, LineBreak_JT, LineBreak_RI, LineBreak_CB, |
| 159 | LineBreak_EB, LineBreak_EM, |
| 160 | |
| 161 | LineBreak_AK, LineBreak_AP, LineBreak_AS, |
| 162 | LineBreak_VI, LineBreak_VF, |
| 163 | |
| 164 | LineBreak_ZWJ, |
| 165 | LineBreak_SA, LineBreak_SG, LineBreak_SP, |
| 166 | LineBreak_CR, LineBreak_LF, LineBreak_BK, |
| 167 | |
| 168 | NumLineBreakClasses |
| 169 | }; |
| 170 | |
| 171 | enum class IdnaStatus : unsigned int { |
| 172 | Disallowed, |
| 173 | Valid, |
| 174 | Ignored, |
| 175 | Mapped, |
| 176 | Deviation |
| 177 | }; |
| 178 | |
| 179 | Q_CORE_EXPORT GraphemeBreakClass QT_FASTCALL graphemeBreakClass(char32_t ucs4) noexcept; |
| 180 | inline GraphemeBreakClass graphemeBreakClass(QChar ch) noexcept |
| 181 | { return graphemeBreakClass(ucs4: ch.unicode()); } |
| 182 | |
| 183 | Q_CORE_EXPORT WordBreakClass QT_FASTCALL wordBreakClass(char32_t ucs4) noexcept; |
| 184 | inline WordBreakClass wordBreakClass(QChar ch) noexcept |
| 185 | { return wordBreakClass(ucs4: ch.unicode()); } |
| 186 | |
| 187 | Q_CORE_EXPORT SentenceBreakClass QT_FASTCALL sentenceBreakClass(char32_t ucs4) noexcept; |
| 188 | inline SentenceBreakClass sentenceBreakClass(QChar ch) noexcept |
| 189 | { return sentenceBreakClass(ucs4: ch.unicode()); } |
| 190 | |
| 191 | Q_CORE_EXPORT LineBreakClass QT_FASTCALL lineBreakClass(char32_t ucs4) noexcept; |
| 192 | inline LineBreakClass lineBreakClass(QChar ch) noexcept |
| 193 | { return lineBreakClass(ucs4: ch.unicode()); } |
| 194 | |
| 195 | Q_CORE_EXPORT IdnaStatus QT_FASTCALL idnaStatus(char32_t ucs4) noexcept; |
| 196 | inline IdnaStatus idnaStatus(QChar ch) noexcept |
| 197 | { return idnaStatus(ucs4: ch.unicode()); } |
| 198 | |
| 199 | Q_CORE_EXPORT QStringView QT_FASTCALL idnaMapping(char32_t usc4) noexcept; |
| 200 | inline QStringView idnaMapping(QChar ch) noexcept |
| 201 | { return idnaMapping(usc4: ch.unicode()); } |
| 202 | |
| 203 | Q_CORE_EXPORT EastAsianWidth QT_FASTCALL eastAsianWidth(char32_t ucs4) noexcept; |
| 204 | inline EastAsianWidth eastAsianWidth(QChar ch) noexcept |
| 205 | { return eastAsianWidth(ucs4: ch.unicode()); } |
| 206 | |
| 207 | } // namespace QUnicodeTables |
| 208 | |
| 209 | QT_END_NAMESPACE |
| 210 | |
| 211 | #endif // QUNICODETABLES_P_H |
| 212 | |