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#ifndef QLOCALE_H
41#define QLOCALE_H
42
43#include <QtCore/qvariant.h>
44#include <QtCore/qstring.h>
45#include <QtCore/qobjectdefs.h>
46#include <QtCore/qshareddata.h>
47
48QT_BEGIN_NAMESPACE
49
50class QCalendar;
51class QDataStream;
52class QDate;
53class QDateTime;
54class QLocale;
55class QTime;
56class QVariant;
57class QTextStream;
58class QTextStreamPrivate;
59
60class QLocalePrivate;
61
62Q_CORE_EXPORT size_t qHash(const QLocale &key, size_t seed = 0) noexcept;
63
64class Q_CORE_EXPORT QLocale
65{
66 Q_GADGET
67 friend class QString;
68 friend class QByteArray;
69 friend class QIntValidator;
70 friend class QDoubleValidatorPrivate;
71 friend class QTextStream;
72 friend class QTextStreamPrivate;
73
74public:
75// see qlocale_data_p.h for more info on generated data
76// GENERATED PART STARTS HERE
77 enum Language : ushort {
78 AnyLanguage = 0,
79 C = 1,
80 Abkhazian = 2,
81 Oromo = 3,
82 Afar = 4,
83 Afrikaans = 5,
84 Albanian = 6,
85 Amharic = 7,
86 Arabic = 8,
87 Armenian = 9,
88 Assamese = 10,
89 Aymara = 11,
90 Azerbaijani = 12,
91 Bashkir = 13,
92 Basque = 14,
93 Bengali = 15,
94 Dzongkha = 16,
95 Bihari = 17,
96 Bislama = 18,
97 Breton = 19,
98 Bulgarian = 20,
99 Burmese = 21,
100 Belarusian = 22,
101 Khmer = 23,
102 Catalan = 24,
103 Chinese = 25,
104 Corsican = 26,
105 Croatian = 27,
106 Czech = 28,
107 Danish = 29,
108 Dutch = 30,
109 English = 31,
110 Esperanto = 32,
111 Estonian = 33,
112 Faroese = 34,
113 Fijian = 35,
114 Finnish = 36,
115 French = 37,
116 WesternFrisian = 38,
117 Gaelic = 39,
118 Galician = 40,
119 Georgian = 41,
120 German = 42,
121 Greek = 43,
122 Greenlandic = 44,
123 Guarani = 45,
124 Gujarati = 46,
125 Hausa = 47,
126 Hebrew = 48,
127 Hindi = 49,
128 Hungarian = 50,
129 Icelandic = 51,
130 Indonesian = 52,
131 Interlingua = 53,
132 Interlingue = 54,
133 Inuktitut = 55,
134 Inupiak = 56,
135 Irish = 57,
136 Italian = 58,
137 Japanese = 59,
138 Javanese = 60,
139 Kannada = 61,
140 Kashmiri = 62,
141 Kazakh = 63,
142 Kinyarwanda = 64,
143 Kirghiz = 65,
144 Korean = 66,
145 Kurdish = 67,
146 Rundi = 68,
147 Lao = 69,
148 Latin = 70,
149 Latvian = 71,
150 Lingala = 72,
151 Lithuanian = 73,
152 Macedonian = 74,
153 Malagasy = 75,
154 Malay = 76,
155 Malayalam = 77,
156 Maltese = 78,
157 Maori = 79,
158 Marathi = 80,
159 Marshallese = 81,
160 Mongolian = 82,
161 NauruLanguage = 83,
162 Nepali = 84,
163 NorwegianBokmal = 85,
164 Occitan = 86,
165 Oriya = 87,
166 Pashto = 88,
167 Persian = 89,
168 Polish = 90,
169 Portuguese = 91,
170 Punjabi = 92,
171 Quechua = 93,
172 Romansh = 94,
173 Romanian = 95,
174 Russian = 96,
175 Samoan = 97,
176 Sango = 98,
177 Sanskrit = 99,
178 Serbian = 100,
179 Ossetic = 101,
180 SouthernSotho = 102,
181 Tswana = 103,
182 Shona = 104,
183 Sindhi = 105,
184 Sinhala = 106,
185 Swati = 107,
186 Slovak = 108,
187 Slovenian = 109,
188 Somali = 110,
189 Spanish = 111,
190 Sundanese = 112,
191 Swahili = 113,
192 Swedish = 114,
193 Sardinian = 115,
194 Tajik = 116,
195 Tamil = 117,
196 Tatar = 118,
197 Telugu = 119,
198 Thai = 120,
199 Tibetan = 121,
200 Tigrinya = 122,
201 Tongan = 123,
202 Tsonga = 124,
203 Turkish = 125,
204 Turkmen = 126,
205 Tahitian = 127,
206 Uighur = 128,
207 Ukrainian = 129,
208 Urdu = 130,
209 Uzbek = 131,
210 Vietnamese = 132,
211 Volapuk = 133,
212 Welsh = 134,
213 Wolof = 135,
214 Xhosa = 136,
215 Yiddish = 137,
216 Yoruba = 138,
217 Zhuang = 139,
218 Zulu = 140,
219 NorwegianNynorsk = 141,
220 Bosnian = 142,
221 Divehi = 143,
222 Manx = 144,
223 Cornish = 145,
224 Akan = 146,
225 Konkani = 147,
226 Ga = 148,
227 Igbo = 149,
228 Kamba = 150,
229 Syriac = 151,
230 Blin = 152,
231 Geez = 153,
232 Koro = 154,
233 Sidamo = 155,
234 Atsam = 156,
235 Tigre = 157,
236 Jju = 158,
237 Friulian = 159,
238 Venda = 160,
239 Ewe = 161,
240 Walamo = 162,
241 Hawaiian = 163,
242 Tyap = 164,
243 Nyanja = 165,
244 Filipino = 166,
245 SwissGerman = 167,
246 SichuanYi = 168,
247 Kpelle = 169,
248 LowGerman = 170,
249 SouthNdebele = 171,
250 NorthernSotho = 172,
251 NorthernSami = 173,
252 Taroko = 174,
253 Gusii = 175,
254 Taita = 176,
255 Fulah = 177,
256 Kikuyu = 178,
257 Samburu = 179,
258 Sena = 180,
259 NorthNdebele = 181,
260 Rombo = 182,
261 Tachelhit = 183,
262 Kabyle = 184,
263 Nyankole = 185,
264 Bena = 186,
265 Vunjo = 187,
266 Bambara = 188,
267 Embu = 189,
268 Cherokee = 190,
269 Morisyen = 191,
270 Makonde = 192,
271 Langi = 193,
272 Ganda = 194,
273 Bemba = 195,
274 Kabuverdianu = 196,
275 Meru = 197,
276 Kalenjin = 198,
277 Nama = 199,
278 Machame = 200,
279 Colognian = 201,
280 Masai = 202,
281 Soga = 203,
282 Luyia = 204,
283 Asu = 205,
284 Teso = 206,
285 Saho = 207,
286 KoyraChiini = 208,
287 Rwa = 209,
288 Luo = 210,
289 Chiga = 211,
290 CentralMoroccoTamazight = 212,
291 KoyraboroSenni = 213,
292 Shambala = 214,
293 Bodo = 215,
294 Avaric = 216,
295 Chamorro = 217,
296 Chechen = 218,
297 Church = 219,
298 Chuvash = 220,
299 Cree = 221,
300 Haitian = 222,
301 Herero = 223,
302 HiriMotu = 224,
303 Kanuri = 225,
304 Komi = 226,
305 Kongo = 227,
306 Kwanyama = 228,
307 Limburgish = 229,
308 LubaKatanga = 230,
309 Luxembourgish = 231,
310 Navaho = 232,
311 Ndonga = 233,
312 Ojibwa = 234,
313 Pali = 235,
314 Walloon = 236,
315 Aghem = 237,
316 Basaa = 238,
317 Zarma = 239,
318 Duala = 240,
319 JolaFonyi = 241,
320 Ewondo = 242,
321 Bafia = 243,
322 MakhuwaMeetto = 244,
323 Mundang = 245,
324 Kwasio = 246,
325 Nuer = 247,
326 Sakha = 248,
327 Sangu = 249,
328 CongoSwahili = 250,
329 Tasawaq = 251,
330 Vai = 252,
331 Walser = 253,
332 Yangben = 254,
333 Avestan = 255,
334 Asturian = 256,
335 Ngomba = 257,
336 Kako = 258,
337 Meta = 259,
338 Ngiemboon = 260,
339 Aragonese = 261,
340 Akkadian = 262,
341 AncientEgyptian = 263,
342 AncientGreek = 264,
343 Aramaic = 265,
344 Balinese = 266,
345 Bamun = 267,
346 BatakToba = 268,
347 Buginese = 269,
348 Buhid = 270,
349 Carian = 271,
350 Chakma = 272,
351 ClassicalMandaic = 273,
352 Coptic = 274,
353 Dogri = 275,
354 EasternCham = 276,
355 EasternKayah = 277,
356 Etruscan = 278,
357 Gothic = 279,
358 Hanunoo = 280,
359 Ingush = 281,
360 LargeFloweryMiao = 282,
361 Lepcha = 283,
362 Limbu = 284,
363 Lisu = 285,
364 Lu = 286,
365 Lycian = 287,
366 Lydian = 288,
367 Mandingo = 289,
368 Manipuri = 290,
369 Meroitic = 291,
370 NorthernThai = 292,
371 OldIrish = 293,
372 OldNorse = 294,
373 OldPersian = 295,
374 OldTurkish = 296,
375 Pahlavi = 297,
376 Parthian = 298,
377 Phoenician = 299,
378 PrakritLanguage = 300,
379 Rejang = 301,
380 Sabaean = 302,
381 Samaritan = 303,
382 Santali = 304,
383 Saurashtra = 305,
384 Sora = 306,
385 Sylheti = 307,
386 Tagbanwa = 308,
387 TaiDam = 309,
388 TaiNua = 310,
389 Ugaritic = 311,
390 Akoose = 312,
391 Lakota = 313,
392 StandardMoroccanTamazight = 314,
393 Mapuche = 315,
394 CentralKurdish = 316,
395 LowerSorbian = 317,
396 UpperSorbian = 318,
397 Kenyang = 319,
398 Mohawk = 320,
399 Nko = 321,
400 Prussian = 322,
401 Kiche = 323,
402 SouthernSami = 324,
403 LuleSami = 325,
404 InariSami = 326,
405 SkoltSami = 327,
406 Warlpiri = 328,
407 ManichaeanMiddlePersian = 329,
408 Mende = 330,
409 AncientNorthArabian = 331,
410 LinearA = 332,
411 HmongNjua = 333,
412 Ho = 334,
413 Lezghian = 335,
414 Bassa = 336,
415 Mono = 337,
416 TedimChin = 338,
417 Maithili = 339,
418 Ahom = 340,
419 AmericanSignLanguage = 341,
420 ArdhamagadhiPrakrit = 342,
421 Bhojpuri = 343,
422 HieroglyphicLuwian = 344,
423 LiteraryChinese = 345,
424 Mazanderani = 346,
425 Mru = 347,
426 Newari = 348,
427 NorthernLuri = 349,
428 Palauan = 350,
429 Papiamento = 351,
430 Saraiki = 352,
431 TokelauLanguage = 353,
432 TokPisin = 354,
433 TuvaluLanguage = 355,
434 UncodedLanguages = 356,
435 Cantonese = 357,
436 Osage = 358,
437 Tangut = 359,
438 Ido = 360,
439 Lojban = 361,
440 Sicilian = 362,
441 SouthernKurdish = 363,
442 WesternBalochi = 364,
443 Cebuano = 365,
444 Erzya = 366,
445 Chickasaw = 367,
446 Muscogee = 368,
447 Silesian = 369,
448
449 Afan = Oromo,
450 Bhutani = Dzongkha,
451 Byelorussian = Belarusian,
452 Cambodian = Khmer,
453 Chewa = Nyanja,
454 Frisian = WesternFrisian,
455 Kurundi = Rundi,
456 Moldavian = Romanian,
457 Norwegian = NorwegianBokmal,
458 RhaetoRomance = Romansh,
459 SerboCroatian = Serbian,
460 Tagalog = Filipino,
461 Twi = Akan,
462 Uigur = Uighur,
463
464 LastLanguage = Silesian
465 };
466
467 enum Script : ushort {
468 AnyScript = 0,
469 ArabicScript = 1,
470 CyrillicScript = 2,
471 DeseretScript = 3,
472 GurmukhiScript = 4,
473 SimplifiedHanScript = 5,
474 TraditionalHanScript = 6,
475 LatinScript = 7,
476 MongolianScript = 8,
477 TifinaghScript = 9,
478 ArmenianScript = 10,
479 BengaliScript = 11,
480 CherokeeScript = 12,
481 DevanagariScript = 13,
482 EthiopicScript = 14,
483 GeorgianScript = 15,
484 GreekScript = 16,
485 GujaratiScript = 17,
486 HebrewScript = 18,
487 JapaneseScript = 19,
488 KhmerScript = 20,
489 KannadaScript = 21,
490 KoreanScript = 22,
491 LaoScript = 23,
492 MalayalamScript = 24,
493 MyanmarScript = 25,
494 OriyaScript = 26,
495 TamilScript = 27,
496 TeluguScript = 28,
497 ThaanaScript = 29,
498 ThaiScript = 30,
499 TibetanScript = 31,
500 SinhalaScript = 32,
501 SyriacScript = 33,
502 YiScript = 34,
503 VaiScript = 35,
504 AvestanScript = 36,
505 BalineseScript = 37,
506 BamumScript = 38,
507 BatakScript = 39,
508 BopomofoScript = 40,
509 BrahmiScript = 41,
510 BugineseScript = 42,
511 BuhidScript = 43,
512 CanadianAboriginalScript = 44,
513 CarianScript = 45,
514 ChakmaScript = 46,
515 ChamScript = 47,
516 CopticScript = 48,
517 CypriotScript = 49,
518 EgyptianHieroglyphsScript = 50,
519 FraserScript = 51,
520 GlagoliticScript = 52,
521 GothicScript = 53,
522 HanScript = 54,
523 HangulScript = 55,
524 HanunooScript = 56,
525 ImperialAramaicScript = 57,
526 InscriptionalPahlaviScript = 58,
527 InscriptionalParthianScript = 59,
528 JavaneseScript = 60,
529 KaithiScript = 61,
530 KatakanaScript = 62,
531 KayahLiScript = 63,
532 KharoshthiScript = 64,
533 LannaScript = 65,
534 LepchaScript = 66,
535 LimbuScript = 67,
536 LinearBScript = 68,
537 LycianScript = 69,
538 LydianScript = 70,
539 MandaeanScript = 71,
540 MeiteiMayekScript = 72,
541 MeroiticScript = 73,
542 MeroiticCursiveScript = 74,
543 NkoScript = 75,
544 NewTaiLueScript = 76,
545 OghamScript = 77,
546 OlChikiScript = 78,
547 OldItalicScript = 79,
548 OldPersianScript = 80,
549 OldSouthArabianScript = 81,
550 OrkhonScript = 82,
551 OsmanyaScript = 83,
552 PhagsPaScript = 84,
553 PhoenicianScript = 85,
554 PollardPhoneticScript = 86,
555 RejangScript = 87,
556 RunicScript = 88,
557 SamaritanScript = 89,
558 SaurashtraScript = 90,
559 SharadaScript = 91,
560 ShavianScript = 92,
561 SoraSompengScript = 93,
562 CuneiformScript = 94,
563 SundaneseScript = 95,
564 SylotiNagriScript = 96,
565 TagalogScript = 97,
566 TagbanwaScript = 98,
567 TaiLeScript = 99,
568 TaiVietScript = 100,
569 TakriScript = 101,
570 UgariticScript = 102,
571 BrailleScript = 103,
572 HiraganaScript = 104,
573 CaucasianAlbanianScript = 105,
574 BassaVahScript = 106,
575 DuployanScript = 107,
576 ElbasanScript = 108,
577 GranthaScript = 109,
578 PahawhHmongScript = 110,
579 KhojkiScript = 111,
580 LinearAScript = 112,
581 MahajaniScript = 113,
582 ManichaeanScript = 114,
583 MendeKikakuiScript = 115,
584 ModiScript = 116,
585 MroScript = 117,
586 OldNorthArabianScript = 118,
587 NabataeanScript = 119,
588 PalmyreneScript = 120,
589 PauCinHauScript = 121,
590 OldPermicScript = 122,
591 PsalterPahlaviScript = 123,
592 SiddhamScript = 124,
593 KhudawadiScript = 125,
594 TirhutaScript = 126,
595 VarangKshitiScript = 127,
596 AhomScript = 128,
597 AnatolianHieroglyphsScript = 129,
598 HatranScript = 130,
599 MultaniScript = 131,
600 OldHungarianScript = 132,
601 SignWritingScript = 133,
602 AdlamScript = 134,
603 BhaiksukiScript = 135,
604 MarchenScript = 136,
605 NewaScript = 137,
606 OsageScript = 138,
607 TangutScript = 139,
608 HanWithBopomofoScript = 140,
609 JamoScript = 141,
610
611 SimplifiedChineseScript = SimplifiedHanScript,
612 TraditionalChineseScript = TraditionalHanScript,
613
614 LastScript = JamoScript
615 };
616
617 enum Country : ushort {
618 AnyCountry = 0,
619 Afghanistan = 1,
620 Albania = 2,
621 Algeria = 3,
622 AmericanSamoa = 4,
623 Andorra = 5,
624 Angola = 6,
625 Anguilla = 7,
626 Antarctica = 8,
627 AntiguaAndBarbuda = 9,
628 Argentina = 10,
629 Armenia = 11,
630 Aruba = 12,
631 Australia = 13,
632 Austria = 14,
633 Azerbaijan = 15,
634 Bahamas = 16,
635 Bahrain = 17,
636 Bangladesh = 18,
637 Barbados = 19,
638 Belarus = 20,
639 Belgium = 21,
640 Belize = 22,
641 Benin = 23,
642 Bermuda = 24,
643 Bhutan = 25,
644 Bolivia = 26,
645 BosniaAndHerzegowina = 27,
646 Botswana = 28,
647 BouvetIsland = 29,
648 Brazil = 30,
649 BritishIndianOceanTerritory = 31,
650 Brunei = 32,
651 Bulgaria = 33,
652 BurkinaFaso = 34,
653 Burundi = 35,
654 Cambodia = 36,
655 Cameroon = 37,
656 Canada = 38,
657 CapeVerde = 39,
658 CaymanIslands = 40,
659 CentralAfricanRepublic = 41,
660 Chad = 42,
661 Chile = 43,
662 China = 44,
663 ChristmasIsland = 45,
664 CocosIslands = 46,
665 Colombia = 47,
666 Comoros = 48,
667 CongoKinshasa = 49,
668 CongoBrazzaville = 50,
669 CookIslands = 51,
670 CostaRica = 52,
671 IvoryCoast = 53,
672 Croatia = 54,
673 Cuba = 55,
674 Cyprus = 56,
675 CzechRepublic = 57,
676 Denmark = 58,
677 Djibouti = 59,
678 Dominica = 60,
679 DominicanRepublic = 61,
680 EastTimor = 62,
681 Ecuador = 63,
682 Egypt = 64,
683 ElSalvador = 65,
684 EquatorialGuinea = 66,
685 Eritrea = 67,
686 Estonia = 68,
687 Ethiopia = 69,
688 FalklandIslands = 70,
689 FaroeIslands = 71,
690 Fiji = 72,
691 Finland = 73,
692 France = 74,
693 Guernsey = 75,
694 FrenchGuiana = 76,
695 FrenchPolynesia = 77,
696 FrenchSouthernTerritories = 78,
697 Gabon = 79,
698 Gambia = 80,
699 Georgia = 81,
700 Germany = 82,
701 Ghana = 83,
702 Gibraltar = 84,
703 Greece = 85,
704 Greenland = 86,
705 Grenada = 87,
706 Guadeloupe = 88,
707 Guam = 89,
708 Guatemala = 90,
709 Guinea = 91,
710 GuineaBissau = 92,
711 Guyana = 93,
712 Haiti = 94,
713 HeardAndMcDonaldIslands = 95,
714 Honduras = 96,
715 HongKong = 97,
716 Hungary = 98,
717 Iceland = 99,
718 India = 100,
719 Indonesia = 101,
720 Iran = 102,
721 Iraq = 103,
722 Ireland = 104,
723 Israel = 105,
724 Italy = 106,
725 Jamaica = 107,
726 Japan = 108,
727 Jordan = 109,
728 Kazakhstan = 110,
729 Kenya = 111,
730 Kiribati = 112,
731 NorthKorea = 113,
732 SouthKorea = 114,
733 Kuwait = 115,
734 Kyrgyzstan = 116,
735 Laos = 117,
736 Latvia = 118,
737 Lebanon = 119,
738 Lesotho = 120,
739 Liberia = 121,
740 Libya = 122,
741 Liechtenstein = 123,
742 Lithuania = 124,
743 Luxembourg = 125,
744 Macau = 126,
745 Macedonia = 127,
746 Madagascar = 128,
747 Malawi = 129,
748 Malaysia = 130,
749 Maldives = 131,
750 Mali = 132,
751 Malta = 133,
752 MarshallIslands = 134,
753 Martinique = 135,
754 Mauritania = 136,
755 Mauritius = 137,
756 Mayotte = 138,
757 Mexico = 139,
758 Micronesia = 140,
759 Moldova = 141,
760 Monaco = 142,
761 Mongolia = 143,
762 Montserrat = 144,
763 Morocco = 145,
764 Mozambique = 146,
765 Myanmar = 147,
766 Namibia = 148,
767 NauruCountry = 149,
768 Nepal = 150,
769 Netherlands = 151,
770 CuraSao = 152,
771 NewCaledonia = 153,
772 NewZealand = 154,
773 Nicaragua = 155,
774 Niger = 156,
775 Nigeria = 157,
776 Niue = 158,
777 NorfolkIsland = 159,
778 NorthernMarianaIslands = 160,
779 Norway = 161,
780 Oman = 162,
781 Pakistan = 163,
782 Palau = 164,
783 PalestinianTerritories = 165,
784 Panama = 166,
785 PapuaNewGuinea = 167,
786 Paraguay = 168,
787 Peru = 169,
788 Philippines = 170,
789 Pitcairn = 171,
790 Poland = 172,
791 Portugal = 173,
792 PuertoRico = 174,
793 Qatar = 175,
794 Reunion = 176,
795 Romania = 177,
796 Russia = 178,
797 Rwanda = 179,
798 SaintKittsAndNevis = 180,
799 SaintLucia = 181,
800 SaintVincentAndTheGrenadines = 182,
801 Samoa = 183,
802 SanMarino = 184,
803 SaoTomeAndPrincipe = 185,
804 SaudiArabia = 186,
805 Senegal = 187,
806 Seychelles = 188,
807 SierraLeone = 189,
808 Singapore = 190,
809 Slovakia = 191,
810 Slovenia = 192,
811 SolomonIslands = 193,
812 Somalia = 194,
813 SouthAfrica = 195,
814 SouthGeorgiaAndTheSouthSandwichIslands = 196,
815 Spain = 197,
816 SriLanka = 198,
817 SaintHelena = 199,
818 SaintPierreAndMiquelon = 200,
819 Sudan = 201,
820 Suriname = 202,
821 SvalbardAndJanMayenIslands = 203,
822 Swaziland = 204,
823 Sweden = 205,
824 Switzerland = 206,
825 Syria = 207,
826 Taiwan = 208,
827 Tajikistan = 209,
828 Tanzania = 210,
829 Thailand = 211,
830 Togo = 212,
831 TokelauCountry = 213,
832 Tonga = 214,
833 TrinidadAndTobago = 215,
834 Tunisia = 216,
835 Turkey = 217,
836 Turkmenistan = 218,
837 TurksAndCaicosIslands = 219,
838 TuvaluCountry = 220,
839 Uganda = 221,
840 Ukraine = 222,
841 UnitedArabEmirates = 223,
842 UnitedKingdom = 224,
843 UnitedStates = 225,
844 UnitedStatesMinorOutlyingIslands = 226,
845 Uruguay = 227,
846 Uzbekistan = 228,
847 Vanuatu = 229,
848 VaticanCityState = 230,
849 Venezuela = 231,
850 Vietnam = 232,
851 BritishVirginIslands = 233,
852 UnitedStatesVirginIslands = 234,
853 WallisAndFutunaIslands = 235,
854 WesternSahara = 236,
855 Yemen = 237,
856 CanaryIslands = 238,
857 Zambia = 239,
858 Zimbabwe = 240,
859 ClippertonIsland = 241,
860 Montenegro = 242,
861 Serbia = 243,
862 SaintBarthelemy = 244,
863 SaintMartin = 245,
864 LatinAmerica = 246,
865 AscensionIsland = 247,
866 AlandIslands = 248,
867 DiegoGarcia = 249,
868 CeutaAndMelilla = 250,
869 IsleOfMan = 251,
870 Jersey = 252,
871 TristanDaCunha = 253,
872 SouthSudan = 254,
873 Bonaire = 255,
874 SintMaarten = 256,
875 Kosovo = 257,
876 EuropeanUnion = 258,
877 OutlyingOceania = 259,
878 World = 260,
879 Europe = 261,
880
881 DemocraticRepublicOfCongo = CongoKinshasa,
882 DemocraticRepublicOfKorea = NorthKorea,
883 LatinAmericaAndTheCaribbean = LatinAmerica,
884 PeoplesRepublicOfCongo = CongoBrazzaville,
885 RepublicOfKorea = SouthKorea,
886 RussianFederation = Russia,
887 SyrianArabRepublic = Syria,
888 Tokelau = TokelauCountry,
889 Tuvalu = TuvaluCountry,
890
891 LastCountry = Europe
892 };
893// GENERATED PART ENDS HERE
894
895 Q_ENUM(Language)
896 Q_ENUM(Country)
897 Q_ENUM(Script)
898
899 enum MeasurementSystem {
900 MetricSystem,
901 ImperialUSSystem,
902 ImperialUKSystem,
903 ImperialSystem = ImperialUSSystem // Qt 4 compatibility
904 };
905 Q_ENUM(MeasurementSystem)
906
907 enum FormatType { LongFormat, ShortFormat, NarrowFormat };
908 enum NumberOption {
909 DefaultNumberOptions = 0x0,
910 OmitGroupSeparator = 0x01,
911 RejectGroupSeparator = 0x02,
912 OmitLeadingZeroInExponent = 0x04,
913 RejectLeadingZeroInExponent = 0x08,
914 IncludeTrailingZeroesAfterDot = 0x10,
915 RejectTrailingZeroesAfterDot = 0x20
916 };
917 Q_DECLARE_FLAGS(NumberOptions, NumberOption)
918
919 enum FloatingPointPrecisionOption {
920 FloatingPointShortest = -128
921 };
922
923 enum CurrencySymbolFormat {
924 CurrencyIsoCode,
925 CurrencySymbol,
926 CurrencyDisplayName
927 };
928
929 enum DataSizeFormat {
930 // Single-bit values, for internal use.
931 DataSizeBase1000 = 1, // use factors of 1000 instead of IEC's 1024;
932 DataSizeSIQuantifiers = 2, // use SI quantifiers instead of IEC ones.
933
934 // Flags values for use in API:
935 DataSizeIecFormat = 0, // base 1024, KiB, MiB, GiB, ...
936 DataSizeTraditionalFormat = DataSizeSIQuantifiers, // base 1024, kB, MB, GB, ...
937 DataSizeSIFormat = DataSizeBase1000 | DataSizeSIQuantifiers // base 1000, kB, MB, GB, ...
938 };
939 Q_DECLARE_FLAGS(DataSizeFormats, DataSizeFormat)
940 Q_FLAG(DataSizeFormats)
941
942 QLocale();
943 explicit QLocale(const QString &name);
944 QLocale(Language language, Country country = AnyCountry);
945 QLocale(Language language, Script script, Country country);
946 QLocale(const QLocale &other);
947 QT_MOVE_ASSIGNMENT_OPERATOR_IMPL_VIA_PURE_SWAP(QLocale)
948 QLocale &operator=(const QLocale &other);
949 ~QLocale();
950
951 void swap(QLocale &other) noexcept { qSwap(d, other.d); }
952
953 Language language() const;
954 Script script() const;
955 Country country() const;
956 QString name() const;
957
958 QString bcp47Name() const;
959 QString nativeLanguageName() const;
960 QString nativeCountryName() const;
961
962#if QT_STRINGVIEW_LEVEL < 2
963 short toShort(const QString &s, bool *ok = nullptr) const;
964 ushort toUShort(const QString &s, bool *ok = nullptr) const;
965 int toInt(const QString &s, bool *ok = nullptr) const;
966 uint toUInt(const QString &s, bool *ok = nullptr) const;
967 long toLong(const QString &s, bool *ok = nullptr) const;
968 ulong toULong(const QString &s, bool *ok = nullptr) const;
969 qlonglong toLongLong(const QString &s, bool *ok = nullptr) const;
970 qulonglong toULongLong(const QString &s, bool *ok = nullptr) const;
971 float toFloat(const QString &s, bool *ok = nullptr) const;
972 double toDouble(const QString &s, bool *ok = nullptr) const;
973#endif
974
975 short toShort(QStringView s, bool *ok = nullptr) const;
976 ushort toUShort(QStringView s, bool *ok = nullptr) const;
977 int toInt(QStringView s, bool *ok = nullptr) const;
978 uint toUInt(QStringView s, bool *ok = nullptr) const;
979 long toLong(QStringView s, bool *ok = nullptr) const;
980 ulong toULong(QStringView s, bool *ok = nullptr) const;
981 qlonglong toLongLong(QStringView s, bool *ok = nullptr) const;
982 qulonglong toULongLong(QStringView s, bool *ok = nullptr) const;
983 float toFloat(QStringView s, bool *ok = nullptr) const;
984 double toDouble(QStringView s, bool *ok = nullptr) const;
985
986 QString toString(qlonglong i) const;
987 QString toString(qulonglong i) const;
988 QString toString(long i) const { return toString(qlonglong(i)); }
989 QString toString(ulong i) const { return toString(qulonglong(i)); }
990 QString toString(short i) const { return toString(qlonglong(i)); }
991 QString toString(ushort i) const { return toString(qulonglong(i)); }
992 QString toString(int i) const { return toString(qlonglong(i)); }
993 QString toString(uint i) const { return toString(qulonglong(i)); }
994 QString toString(double i, char f = 'g', int prec = 6) const;
995 QString toString(float i, char f = 'g', int prec = 6) const
996 { return toString(double(i), f, prec); }
997
998#if QT_STRINGVIEW_LEVEL < 2
999 QString toString(QDate date, const QString &formatStr) const;
1000 QString toString(QTime time, const QString &formatStr) const;
1001 QString toString(const QDateTime &dateTime, const QString &format) const;
1002#endif
1003 QString toString(QDate date, QStringView formatStr) const;
1004 QString toString(QTime time, QStringView formatStr) const;
1005 QString toString(const QDateTime &dateTime, QStringView format) const;
1006 QString toString(QDate date, FormatType format = LongFormat) const;
1007 QString toString(QTime time, FormatType format = LongFormat) const;
1008 QString toString(const QDateTime &dateTime, FormatType format = LongFormat) const;
1009 /* Removing default value for `format' is done intentionally,
1010 * after all tests we will remove non-calendar-aware version of these functions,
1011 * and add a default value for both calendar instance, and format
1012 */
1013 QString toString(QDate date, QStringView formatStr, QCalendar cal) const;
1014 QString toString(QDate date, FormatType format, QCalendar cal) const;
1015 QString toString(const QDateTime &dateTime, FormatType format, QCalendar cal) const;
1016 QString toString(const QDateTime &dateTime, QStringView formatStr, QCalendar cal) const;
1017
1018 QString dateFormat(FormatType format = LongFormat) const;
1019 QString timeFormat(FormatType format = LongFormat) const;
1020 QString dateTimeFormat(FormatType format = LongFormat) const;
1021#if QT_CONFIG(datestring)
1022 QDate toDate(const QString &string, FormatType = LongFormat) const;
1023 QTime toTime(const QString &string, FormatType = LongFormat) const;
1024 QDateTime toDateTime(const QString &string, FormatType format = LongFormat) const;
1025 QDate toDate(const QString &string, const QString &format) const;
1026 QTime toTime(const QString &string, const QString &format) const;
1027 QDateTime toDateTime(const QString &string, const QString &format) const;
1028 // Calendar-aware API
1029 QDate toDate(const QString &string, FormatType format, QCalendar cal) const;
1030 QDateTime toDateTime(const QString &string, FormatType format, QCalendar cal) const;
1031 QDate toDate(const QString &string, const QString &format, QCalendar cal) const;
1032 QDateTime toDateTime(const QString &string, const QString &format, QCalendar cal) const;
1033#endif
1034
1035 QString decimalPoint() const;
1036 QString groupSeparator() const;
1037 QString percent() const;
1038 QString zeroDigit() const;
1039 QString negativeSign() const;
1040 QString positiveSign() const;
1041 QString exponential() const;
1042
1043 QString monthName(int, FormatType format = LongFormat) const;
1044 QString standaloneMonthName(int, FormatType format = LongFormat) const;
1045 QString dayName(int, FormatType format = LongFormat) const;
1046 QString standaloneDayName(int, FormatType format = LongFormat) const;
1047
1048 Qt::DayOfWeek firstDayOfWeek() const;
1049 QList<Qt::DayOfWeek> weekdays() const;
1050
1051 QString amText() const;
1052 QString pmText() const;
1053
1054 MeasurementSystem measurementSystem() const;
1055 QLocale collation() const;
1056 Qt::LayoutDirection textDirection() const;
1057
1058 QString toUpper(const QString &str) const;
1059 QString toLower(const QString &str) const;
1060
1061 QString currencySymbol(CurrencySymbolFormat = CurrencySymbol) const;
1062 QString toCurrencyString(qlonglong, const QString &symbol = QString()) const;
1063 QString toCurrencyString(qulonglong, const QString &symbol = QString()) const;
1064 QString toCurrencyString(short i, const QString &symbol = QString()) const
1065 { return toCurrencyString(qlonglong(i), symbol); }
1066 QString toCurrencyString(ushort i, const QString &symbol = QString()) const
1067 { return toCurrencyString(qulonglong(i), symbol); }
1068 QString toCurrencyString(int i, const QString &symbol = QString()) const
1069 { return toCurrencyString(qlonglong(i), symbol); }
1070 QString toCurrencyString(uint i, const QString &symbol = QString()) const
1071 { return toCurrencyString(qulonglong(i), symbol); }
1072 QString toCurrencyString(double, const QString &symbol = QString(), int precision = -1) const;
1073 QString toCurrencyString(float i, const QString &symbol = QString(), int precision = -1) const
1074 { return toCurrencyString(double(i), symbol, precision); }
1075
1076 QString formattedDataSize(qint64 bytes, int precision = 2, DataSizeFormats format = DataSizeIecFormat) const;
1077
1078 QStringList uiLanguages() const;
1079
1080 bool operator==(const QLocale &other) const;
1081 bool operator!=(const QLocale &other) const;
1082
1083 static QString languageToString(Language language);
1084 static QString countryToString(Country country);
1085 static QString scriptToString(Script script);
1086 static void setDefault(const QLocale &locale);
1087
1088 static QLocale c() { return QLocale(C); }
1089 static QLocale system();
1090
1091 static QList<QLocale> matchingLocales(QLocale::Language language, QLocale::Script script, QLocale::Country country);
1092 static QList<Country> countriesForLanguage(Language lang);
1093
1094 void setNumberOptions(NumberOptions options);
1095 NumberOptions numberOptions() const;
1096
1097 enum QuotationStyle { StandardQuotation, AlternateQuotation };
1098 QString quoteString(const QString &str, QuotationStyle style = StandardQuotation) const
1099 { return quoteString(QStringView(str), style); }
1100 QString quoteString(QStringView str, QuotationStyle style = StandardQuotation) const;
1101
1102 QString createSeparatedList(const QStringList &strl) const;
1103
1104private:
1105 QLocale(QLocalePrivate &dd);
1106 friend class QLocalePrivate;
1107 friend class QSystemLocale;
1108 friend class QCalendarBackend;
1109 friend class QGregorianCalendar;
1110 friend Q_CORE_EXPORT size_t qHash(const QLocale &key, size_t seed) noexcept;
1111
1112 QSharedDataPointer<QLocalePrivate> d;
1113};
1114Q_DECLARE_SHARED(QLocale)
1115Q_DECLARE_OPERATORS_FOR_FLAGS(QLocale::NumberOptions)
1116
1117#ifndef QT_NO_DATASTREAM
1118Q_CORE_EXPORT QDataStream &operator<<(QDataStream &, const QLocale &);
1119Q_CORE_EXPORT QDataStream &operator>>(QDataStream &, QLocale &);
1120#endif
1121
1122#ifndef QT_NO_DEBUG_STREAM
1123Q_CORE_EXPORT QDebug operator<<(QDebug, const QLocale &);
1124#endif
1125
1126QT_END_NAMESPACE
1127
1128#endif // QLOCALE_H
1129