| 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_Extended_Pictographic, |
| 122 | |
| 123 | NumGraphemeBreakClasses |
| 124 | }; |
| 125 | |
| 126 | enum WordBreakClass { |
| 127 | WordBreak_Any, |
| 128 | WordBreak_CR, |
| 129 | WordBreak_LF, |
| 130 | WordBreak_Newline, |
| 131 | WordBreak_Extend, |
| 132 | WordBreak_ZWJ, |
| 133 | WordBreak_Format, |
| 134 | WordBreak_RegionalIndicator, |
| 135 | WordBreak_Katakana, |
| 136 | WordBreak_HebrewLetter, |
| 137 | WordBreak_ALetter, |
| 138 | WordBreak_SingleQuote, |
| 139 | WordBreak_DoubleQuote, |
| 140 | WordBreak_MidNumLet, |
| 141 | WordBreak_MidLetter, |
| 142 | WordBreak_MidNum, |
| 143 | WordBreak_Numeric, |
| 144 | WordBreak_ExtendNumLet, |
| 145 | WordBreak_E_Base, |
| 146 | WordBreak_E_Modifier, |
| 147 | WordBreak_Glue_After_Zwj, |
| 148 | WordBreak_E_Base_GAZ, |
| 149 | WordBreak_WSegSpace, |
| 150 | |
| 151 | NumWordBreakClasses |
| 152 | }; |
| 153 | |
| 154 | enum SentenceBreakClass { |
| 155 | SentenceBreak_Any, |
| 156 | SentenceBreak_CR, |
| 157 | SentenceBreak_LF, |
| 158 | SentenceBreak_Sep, |
| 159 | SentenceBreak_Extend, |
| 160 | SentenceBreak_Sp, |
| 161 | SentenceBreak_Lower, |
| 162 | SentenceBreak_Upper, |
| 163 | SentenceBreak_OLetter, |
| 164 | SentenceBreak_Numeric, |
| 165 | SentenceBreak_ATerm, |
| 166 | SentenceBreak_SContinue, |
| 167 | SentenceBreak_STerm, |
| 168 | SentenceBreak_Close, |
| 169 | |
| 170 | NumSentenceBreakClasses |
| 171 | }; |
| 172 | |
| 173 | // see http://www.unicode.org/reports/tr14/tr14-30.html |
| 174 | // we don't use the XX and AI classes and map them to AL instead. |
| 175 | enum LineBreakClass { |
| 176 | LineBreak_OP, LineBreak_CL, LineBreak_CP, LineBreak_QU, LineBreak_GL, |
| 177 | LineBreak_NS, LineBreak_EX, LineBreak_SY, LineBreak_IS, LineBreak_PR, |
| 178 | LineBreak_PO, LineBreak_NU, LineBreak_AL, LineBreak_HL, LineBreak_ID, |
| 179 | LineBreak_IN, LineBreak_HY, LineBreak_BA, LineBreak_BB, LineBreak_B2, |
| 180 | LineBreak_ZW, LineBreak_CM, LineBreak_WJ, LineBreak_H2, LineBreak_H3, |
| 181 | LineBreak_JL, LineBreak_JV, LineBreak_JT, LineBreak_RI, LineBreak_CB, |
| 182 | LineBreak_EB, LineBreak_EM, LineBreak_ZWJ, |
| 183 | LineBreak_SA, LineBreak_SG, LineBreak_SP, |
| 184 | LineBreak_CR, LineBreak_LF, LineBreak_BK, |
| 185 | |
| 186 | NumLineBreakClasses |
| 187 | }; |
| 188 | |
| 189 | Q_CORE_EXPORT GraphemeBreakClass QT_FASTCALL graphemeBreakClass(uint ucs4) noexcept; |
| 190 | inline GraphemeBreakClass graphemeBreakClass(QChar ch) noexcept |
| 191 | { return graphemeBreakClass(ucs4: ch.unicode()); } |
| 192 | |
| 193 | Q_CORE_EXPORT WordBreakClass QT_FASTCALL wordBreakClass(uint ucs4) noexcept; |
| 194 | inline WordBreakClass wordBreakClass(QChar ch) noexcept |
| 195 | { return wordBreakClass(ucs4: ch.unicode()); } |
| 196 | |
| 197 | Q_CORE_EXPORT SentenceBreakClass QT_FASTCALL sentenceBreakClass(uint ucs4) noexcept; |
| 198 | inline SentenceBreakClass sentenceBreakClass(QChar ch) noexcept |
| 199 | { return sentenceBreakClass(ucs4: ch.unicode()); } |
| 200 | |
| 201 | Q_CORE_EXPORT LineBreakClass QT_FASTCALL lineBreakClass(uint ucs4) noexcept; |
| 202 | inline LineBreakClass lineBreakClass(QChar ch) noexcept |
| 203 | { return lineBreakClass(ucs4: ch.unicode()); } |
| 204 | |
| 205 | } // namespace QUnicodeTables |
| 206 | |
| 207 | QT_END_NAMESPACE |
| 208 | |
| 209 | #endif // QUNICODETABLES_P_H |
| 210 | |