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