1// qlocale.sip generated by MetaSIP
2//
3// This file is part of the QtCore Python extension module.
4//
5// Copyright (c) 2021 Riverbank Computing Limited <info@riverbankcomputing.com>
6//
7// This file is part of PyQt5.
8//
9// This file may be used under the terms of the GNU General Public License
10// version 3.0 as published by the Free Software Foundation and appearing in
11// the file LICENSE included in the packaging of this file.  Please review the
12// following information to ensure the GNU General Public License version 3.0
13// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
14//
15// If you do not wish to use this file under the terms of the GPL version 3.0
16// then you may purchase a commercial license.  For more information contact
17// info@riverbankcomputing.com.
18//
19// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
20// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
21
22
23class QLocale
24{
25%TypeHeaderCode
26#include <qlocale.h>
27%End
28
29public:
30    enum Language
31    {
32        C,
33        Abkhazian,
34        Afan,
35        Afar,
36        Afrikaans,
37        Albanian,
38        Amharic,
39        Arabic,
40        Armenian,
41        Assamese,
42        Aymara,
43        Azerbaijani,
44        Bashkir,
45        Basque,
46        Bengali,
47        Bhutani,
48        Bihari,
49        Bislama,
50        Breton,
51        Bulgarian,
52        Burmese,
53        Byelorussian,
54        Cambodian,
55        Catalan,
56        Chinese,
57        Corsican,
58        Croatian,
59        Czech,
60        Danish,
61        Dutch,
62        English,
63        Esperanto,
64        Estonian,
65        Faroese,
66        Finnish,
67        French,
68        Frisian,
69        Gaelic,
70        Galician,
71        Georgian,
72        German,
73        Greek,
74        Greenlandic,
75        Guarani,
76        Gujarati,
77        Hausa,
78        Hebrew,
79        Hindi,
80        Hungarian,
81        Icelandic,
82        Indonesian,
83        Interlingua,
84        Interlingue,
85        Inuktitut,
86        Inupiak,
87        Irish,
88        Italian,
89        Japanese,
90        Javanese,
91        Kannada,
92        Kashmiri,
93        Kazakh,
94        Kinyarwanda,
95        Kirghiz,
96        Korean,
97        Kurdish,
98        Kurundi,
99        Latin,
100        Latvian,
101        Lingala,
102        Lithuanian,
103        Macedonian,
104        Malagasy,
105        Malay,
106        Malayalam,
107        Maltese,
108        Maori,
109        Marathi,
110        Moldavian,
111        Mongolian,
112        NauruLanguage,
113        Nepali,
114        Norwegian,
115        Occitan,
116        Oriya,
117        Pashto,
118        Persian,
119        Polish,
120        Portuguese,
121        Punjabi,
122        Quechua,
123        RhaetoRomance,
124        Romanian,
125        Russian,
126        Samoan,
127        Sanskrit,
128        Serbian,
129        SerboCroatian,
130        Shona,
131        Sindhi,
132        Slovak,
133        Slovenian,
134        Somali,
135        Spanish,
136        Sundanese,
137        Swahili,
138        Swedish,
139        Tagalog,
140        Tajik,
141        Tamil,
142        Tatar,
143        Telugu,
144        Thai,
145        Tibetan,
146        Tigrinya,
147        Tsonga,
148        Turkish,
149        Turkmen,
150        Twi,
151        Uigur,
152        Ukrainian,
153        Urdu,
154        Uzbek,
155        Vietnamese,
156        Volapuk,
157        Welsh,
158        Wolof,
159        Xhosa,
160        Yiddish,
161        Yoruba,
162        Zhuang,
163        Zulu,
164        Bosnian,
165        Divehi,
166        Manx,
167        Cornish,
168        LastLanguage,
169        NorwegianBokmal,
170        NorwegianNynorsk,
171        Akan,
172        Konkani,
173        Ga,
174        Igbo,
175        Kamba,
176        Syriac,
177        Blin,
178        Geez,
179        Koro,
180        Sidamo,
181        Atsam,
182        Tigre,
183        Jju,
184        Friulian,
185        Venda,
186        Ewe,
187        Walamo,
188        Hawaiian,
189        Tyap,
190        Chewa,
191        Filipino,
192        SwissGerman,
193        SichuanYi,
194        Kpelle,
195        LowGerman,
196        SouthNdebele,
197        NorthernSotho,
198        NorthernSami,
199        Taroko,
200        Gusii,
201        Taita,
202        Fulah,
203        Kikuyu,
204        Samburu,
205        Sena,
206        NorthNdebele,
207        Rombo,
208        Tachelhit,
209        Kabyle,
210        Nyankole,
211        Bena,
212        Vunjo,
213        Bambara,
214        Embu,
215        Cherokee,
216        Morisyen,
217        Makonde,
218        Langi,
219        Ganda,
220        Bemba,
221        Kabuverdianu,
222        Meru,
223        Kalenjin,
224        Nama,
225        Machame,
226        Colognian,
227        Masai,
228        Soga,
229        Luyia,
230        Asu,
231        Teso,
232        Saho,
233        KoyraChiini,
234        Rwa,
235        Luo,
236        Chiga,
237        CentralMoroccoTamazight,
238        KoyraboroSenni,
239        Shambala,
240        AnyLanguage,
241        Rundi,
242        Bodo,
243        Aghem,
244        Basaa,
245        Zarma,
246        Duala,
247        JolaFonyi,
248        Ewondo,
249        Bafia,
250        LubaKatanga,
251        MakhuwaMeetto,
252        Mundang,
253        Kwasio,
254        Nuer,
255        Sakha,
256        Sangu,
257        CongoSwahili,
258        Tasawaq,
259        Vai,
260        Walser,
261        Yangben,
262        Oromo,
263        Dzongkha,
264        Belarusian,
265        Khmer,
266        Fijian,
267        WesternFrisian,
268        Lao,
269        Marshallese,
270        Romansh,
271        Sango,
272        Ossetic,
273        SouthernSotho,
274        Tswana,
275        Sinhala,
276        Swati,
277        Sardinian,
278        Tongan,
279        Tahitian,
280        Nyanja,
281        Avaric,
282        Chamorro,
283        Chechen,
284        Church,
285        Chuvash,
286        Cree,
287        Haitian,
288        Herero,
289        HiriMotu,
290        Kanuri,
291        Komi,
292        Kongo,
293        Kwanyama,
294        Limburgish,
295        Luxembourgish,
296        Navaho,
297        Ndonga,
298        Ojibwa,
299        Pali,
300        Walloon,
301        Avestan,
302        Asturian,
303        Ngomba,
304        Kako,
305        Meta,
306        Ngiemboon,
307%If (Qt_5_1_0 -)
308        Uighur,
309%End
310%If (Qt_5_1_0 -)
311        Aragonese,
312%End
313%If (Qt_5_1_0 -)
314        Akkadian,
315%End
316%If (Qt_5_1_0 -)
317        AncientEgyptian,
318%End
319%If (Qt_5_1_0 -)
320        AncientGreek,
321%End
322%If (Qt_5_1_0 -)
323        Aramaic,
324%End
325%If (Qt_5_1_0 -)
326        Balinese,
327%End
328%If (Qt_5_1_0 -)
329        Bamun,
330%End
331%If (Qt_5_1_0 -)
332        BatakToba,
333%End
334%If (Qt_5_1_0 -)
335        Buginese,
336%End
337%If (Qt_5_1_0 -)
338        Buhid,
339%End
340%If (Qt_5_1_0 -)
341        Carian,
342%End
343%If (Qt_5_1_0 -)
344        Chakma,
345%End
346%If (Qt_5_1_0 -)
347        ClassicalMandaic,
348%End
349%If (Qt_5_1_0 -)
350        Coptic,
351%End
352%If (Qt_5_1_0 -)
353        Dogri,
354%End
355%If (Qt_5_1_0 -)
356        EasternCham,
357%End
358%If (Qt_5_1_0 -)
359        EasternKayah,
360%End
361%If (Qt_5_1_0 -)
362        Etruscan,
363%End
364%If (Qt_5_1_0 -)
365        Gothic,
366%End
367%If (Qt_5_1_0 -)
368        Hanunoo,
369%End
370%If (Qt_5_1_0 -)
371        Ingush,
372%End
373%If (Qt_5_1_0 -)
374        LargeFloweryMiao,
375%End
376%If (Qt_5_1_0 -)
377        Lepcha,
378%End
379%If (Qt_5_1_0 -)
380        Limbu,
381%End
382%If (Qt_5_1_0 -)
383        Lisu,
384%End
385%If (Qt_5_1_0 -)
386        Lu,
387%End
388%If (Qt_5_1_0 -)
389        Lycian,
390%End
391%If (Qt_5_1_0 -)
392        Lydian,
393%End
394%If (Qt_5_1_0 -)
395        Mandingo,
396%End
397%If (Qt_5_1_0 -)
398        Manipuri,
399%End
400%If (Qt_5_1_0 -)
401        Meroitic,
402%End
403%If (Qt_5_1_0 -)
404        NorthernThai,
405%End
406%If (Qt_5_1_0 -)
407        OldIrish,
408%End
409%If (Qt_5_1_0 -)
410        OldNorse,
411%End
412%If (Qt_5_1_0 -)
413        OldPersian,
414%End
415%If (Qt_5_1_0 -)
416        OldTurkish,
417%End
418%If (Qt_5_1_0 -)
419        Pahlavi,
420%End
421%If (Qt_5_1_0 -)
422        Parthian,
423%End
424%If (Qt_5_1_0 -)
425        Phoenician,
426%End
427%If (Qt_5_1_0 -)
428        PrakritLanguage,
429%End
430%If (Qt_5_1_0 -)
431        Rejang,
432%End
433%If (Qt_5_1_0 -)
434        Sabaean,
435%End
436%If (Qt_5_1_0 -)
437        Samaritan,
438%End
439%If (Qt_5_1_0 -)
440        Santali,
441%End
442%If (Qt_5_1_0 -)
443        Saurashtra,
444%End
445%If (Qt_5_1_0 -)
446        Sora,
447%End
448%If (Qt_5_1_0 -)
449        Sylheti,
450%End
451%If (Qt_5_1_0 -)
452        Tagbanwa,
453%End
454%If (Qt_5_1_0 -)
455        TaiDam,
456%End
457%If (Qt_5_1_0 -)
458        TaiNua,
459%End
460%If (Qt_5_1_0 -)
461        Ugaritic,
462%End
463%If (Qt_5_3_0 -)
464        Akoose,
465%End
466%If (Qt_5_3_0 -)
467        Lakota,
468%End
469%If (Qt_5_3_0 -)
470        StandardMoroccanTamazight,
471%End
472%If (Qt_5_5_0 -)
473        Mapuche,
474%End
475%If (Qt_5_5_0 -)
476        CentralKurdish,
477%End
478%If (Qt_5_5_0 -)
479        LowerSorbian,
480%End
481%If (Qt_5_5_0 -)
482        UpperSorbian,
483%End
484%If (Qt_5_5_0 -)
485        Kenyang,
486%End
487%If (Qt_5_5_0 -)
488        Mohawk,
489%End
490%If (Qt_5_5_0 -)
491        Nko,
492%End
493%If (Qt_5_5_0 -)
494        Prussian,
495%End
496%If (Qt_5_5_0 -)
497        Kiche,
498%End
499%If (Qt_5_5_0 -)
500        SouthernSami,
501%End
502%If (Qt_5_5_0 -)
503        LuleSami,
504%End
505%If (Qt_5_5_0 -)
506        InariSami,
507%End
508%If (Qt_5_5_0 -)
509        SkoltSami,
510%End
511%If (Qt_5_5_0 -)
512        Warlpiri,
513%End
514%If (Qt_5_5_0 -)
515        ManichaeanMiddlePersian,
516%End
517%If (Qt_5_5_0 -)
518        Mende,
519%End
520%If (Qt_5_5_0 -)
521        AncientNorthArabian,
522%End
523%If (Qt_5_5_0 -)
524        LinearA,
525%End
526%If (Qt_5_5_0 -)
527        HmongNjua,
528%End
529%If (Qt_5_5_0 -)
530        Ho,
531%End
532%If (Qt_5_5_0 -)
533        Lezghian,
534%End
535%If (Qt_5_5_0 -)
536        Bassa,
537%End
538%If (Qt_5_5_0 -)
539        Mono,
540%End
541%If (Qt_5_5_0 -)
542        TedimChin,
543%End
544%If (Qt_5_5_0 -)
545        Maithili,
546%End
547%If (Qt_5_7_0 -)
548        Ahom,
549%End
550%If (Qt_5_7_0 -)
551        AmericanSignLanguage,
552%End
553%If (Qt_5_7_0 -)
554        ArdhamagadhiPrakrit,
555%End
556%If (Qt_5_7_0 -)
557        Bhojpuri,
558%End
559%If (Qt_5_7_0 -)
560        HieroglyphicLuwian,
561%End
562%If (Qt_5_7_0 -)
563        LiteraryChinese,
564%End
565%If (Qt_5_7_0 -)
566        Mazanderani,
567%End
568%If (Qt_5_7_0 -)
569        Mru,
570%End
571%If (Qt_5_7_0 -)
572        Newari,
573%End
574%If (Qt_5_7_0 -)
575        NorthernLuri,
576%End
577%If (Qt_5_7_0 -)
578        Palauan,
579%End
580%If (Qt_5_7_0 -)
581        Papiamento,
582%End
583%If (Qt_5_7_0 -)
584        Saraiki,
585%End
586%If (Qt_5_7_0 -)
587        TokelauLanguage,
588%End
589%If (Qt_5_7_0 -)
590        TokPisin,
591%End
592%If (Qt_5_7_0 -)
593        TuvaluLanguage,
594%End
595%If (Qt_5_7_0 -)
596        UncodedLanguages,
597%End
598%If (Qt_5_7_0 -)
599        Cantonese,
600%End
601%If (Qt_5_7_0 -)
602        Osage,
603%End
604%If (Qt_5_7_0 -)
605        Tangut,
606%End
607%If (Qt_5_13_0 -)
608        Ido,
609%End
610%If (Qt_5_13_0 -)
611        Lojban,
612%End
613%If (Qt_5_13_0 -)
614        Sicilian,
615%End
616%If (Qt_5_13_0 -)
617        SouthernKurdish,
618%End
619%If (Qt_5_13_0 -)
620        WesternBalochi,
621%End
622%If (Qt_5_14_0 -)
623        Cebuano,
624%End
625%If (Qt_5_14_0 -)
626        Erzya,
627%End
628%If (Qt_5_14_0 -)
629        Chickasaw,
630%End
631%If (Qt_5_14_0 -)
632        Muscogee,
633%End
634%If (Qt_5_14_0 -)
635        Silesian,
636%End
637    };
638
639    enum Country
640    {
641        AnyCountry,
642        Afghanistan,
643        Albania,
644        Algeria,
645        AmericanSamoa,
646        Andorra,
647        Angola,
648        Anguilla,
649        Antarctica,
650        AntiguaAndBarbuda,
651        Argentina,
652        Armenia,
653        Aruba,
654        Australia,
655        Austria,
656        Azerbaijan,
657        Bahamas,
658        Bahrain,
659        Bangladesh,
660        Barbados,
661        Belarus,
662        Belgium,
663        Belize,
664        Benin,
665        Bermuda,
666        Bhutan,
667        Bolivia,
668        BosniaAndHerzegowina,
669        Botswana,
670        BouvetIsland,
671        Brazil,
672        BritishIndianOceanTerritory,
673        Bulgaria,
674        BurkinaFaso,
675        Burundi,
676        Cambodia,
677        Cameroon,
678        Canada,
679        CapeVerde,
680        CaymanIslands,
681        CentralAfricanRepublic,
682        Chad,
683        Chile,
684        China,
685        ChristmasIsland,
686        CocosIslands,
687        Colombia,
688        Comoros,
689        DemocraticRepublicOfCongo,
690        PeoplesRepublicOfCongo,
691        CookIslands,
692        CostaRica,
693        IvoryCoast,
694        Croatia,
695        Cuba,
696        Cyprus,
697        CzechRepublic,
698        Denmark,
699        Djibouti,
700        Dominica,
701        DominicanRepublic,
702        EastTimor,
703        Ecuador,
704        Egypt,
705        ElSalvador,
706        EquatorialGuinea,
707        Eritrea,
708        Estonia,
709        Ethiopia,
710        FalklandIslands,
711        FaroeIslands,
712        Finland,
713        France,
714        FrenchGuiana,
715        FrenchPolynesia,
716        FrenchSouthernTerritories,
717        Gabon,
718        Gambia,
719        Georgia,
720        Germany,
721        Ghana,
722        Gibraltar,
723        Greece,
724        Greenland,
725        Grenada,
726        Guadeloupe,
727        Guam,
728        Guatemala,
729        Guinea,
730        GuineaBissau,
731        Guyana,
732        Haiti,
733        HeardAndMcDonaldIslands,
734        Honduras,
735        HongKong,
736        Hungary,
737        Iceland,
738        India,
739        Indonesia,
740        Iran,
741        Iraq,
742        Ireland,
743        Israel,
744        Italy,
745        Jamaica,
746        Japan,
747        Jordan,
748        Kazakhstan,
749        Kenya,
750        Kiribati,
751        DemocraticRepublicOfKorea,
752        RepublicOfKorea,
753        Kuwait,
754        Kyrgyzstan,
755        Latvia,
756        Lebanon,
757        Lesotho,
758        Liberia,
759        Liechtenstein,
760        Lithuania,
761        Luxembourg,
762        Macau,
763        Macedonia,
764        Madagascar,
765        Malawi,
766        Malaysia,
767        Maldives,
768        Mali,
769        Malta,
770        MarshallIslands,
771        Martinique,
772        Mauritania,
773        Mauritius,
774        Mayotte,
775        Mexico,
776        Micronesia,
777        Moldova,
778        Monaco,
779        Mongolia,
780        Montserrat,
781        Morocco,
782        Mozambique,
783        Myanmar,
784        Namibia,
785        NauruCountry,
786        Nepal,
787        Netherlands,
788        NewCaledonia,
789        NewZealand,
790        Nicaragua,
791        Niger,
792        Nigeria,
793        Niue,
794        NorfolkIsland,
795        NorthernMarianaIslands,
796        Norway,
797        Oman,
798        Pakistan,
799        Palau,
800        Panama,
801        PapuaNewGuinea,
802        Paraguay,
803        Peru,
804        Philippines,
805        Pitcairn,
806        Poland,
807        Portugal,
808        PuertoRico,
809        Qatar,
810        Reunion,
811        Romania,
812        RussianFederation,
813        Rwanda,
814        SaintKittsAndNevis,
815        Samoa,
816        SanMarino,
817        SaoTomeAndPrincipe,
818        SaudiArabia,
819        Senegal,
820        Seychelles,
821        SierraLeone,
822        Singapore,
823        Slovakia,
824        Slovenia,
825        SolomonIslands,
826        Somalia,
827        SouthAfrica,
828        SouthGeorgiaAndTheSouthSandwichIslands,
829        Spain,
830        SriLanka,
831        Sudan,
832        Suriname,
833        SvalbardAndJanMayenIslands,
834        Swaziland,
835        Sweden,
836        Switzerland,
837        SyrianArabRepublic,
838        Taiwan,
839        Tajikistan,
840        Tanzania,
841        Thailand,
842        Togo,
843        Tokelau,
844        TrinidadAndTobago,
845        Tunisia,
846        Turkey,
847        Turkmenistan,
848        TurksAndCaicosIslands,
849        Tuvalu,
850        Uganda,
851        Ukraine,
852        UnitedArabEmirates,
853        UnitedKingdom,
854        UnitedStates,
855        UnitedStatesMinorOutlyingIslands,
856        Uruguay,
857        Uzbekistan,
858        Vanuatu,
859        VaticanCityState,
860        Venezuela,
861        BritishVirginIslands,
862        WallisAndFutunaIslands,
863        WesternSahara,
864        Yemen,
865        Zambia,
866        Zimbabwe,
867        Montenegro,
868        Serbia,
869        SaintBarthelemy,
870        SaintMartin,
871        LatinAmericaAndTheCaribbean,
872        LastCountry,
873        Brunei,
874        CongoKinshasa,
875        CongoBrazzaville,
876        Fiji,
877        Guernsey,
878        NorthKorea,
879        SouthKorea,
880        Laos,
881        Libya,
882        CuraSao,
883        PalestinianTerritories,
884        Russia,
885        SaintLucia,
886        SaintVincentAndTheGrenadines,
887        SaintHelena,
888        SaintPierreAndMiquelon,
889        Syria,
890        Tonga,
891        Vietnam,
892        UnitedStatesVirginIslands,
893        CanaryIslands,
894        ClippertonIsland,
895        AscensionIsland,
896        AlandIslands,
897        DiegoGarcia,
898        CeutaAndMelilla,
899        IsleOfMan,
900        Jersey,
901        TristanDaCunha,
902        SouthSudan,
903        Bonaire,
904        SintMaarten,
905%If (Qt_5_2_0 -)
906        Kosovo,
907%End
908%If (Qt_5_7_0 -)
909        TokelauCountry,
910%End
911%If (Qt_5_7_0 -)
912        TuvaluCountry,
913%End
914%If (Qt_5_7_0 -)
915        EuropeanUnion,
916%End
917%If (Qt_5_7_0 -)
918        OutlyingOceania,
919%End
920%If (Qt_5_12_0 -)
921        LatinAmerica,
922%End
923%If (Qt_5_12_0 -)
924        World,
925%End
926%If (Qt_5_12_0 -)
927        Europe,
928%End
929    };
930
931    enum NumberOption
932    {
933        OmitGroupSeparator,
934        RejectGroupSeparator,
935%If (Qt_5_7_0 -)
936        DefaultNumberOptions,
937%End
938%If (Qt_5_7_0 -)
939        OmitLeadingZeroInExponent,
940%End
941%If (Qt_5_7_0 -)
942        RejectLeadingZeroInExponent,
943%End
944%If (Qt_5_9_0 -)
945        IncludeTrailingZeroesAfterDot,
946%End
947%If (Qt_5_9_0 -)
948        RejectTrailingZeroesAfterDot,
949%End
950    };
951
952    typedef QFlags<QLocale::NumberOption> NumberOptions;
953    QLocale();
954    QLocale(const QString &name);
955    QLocale(QLocale::Language language, QLocale::Country country = QLocale::AnyCountry);
956    QLocale(const QLocale &other);
957    ~QLocale();
958    QLocale::Language language() const;
959    QLocale::Country country() const;
960    QString name() const;
961    short toShort(const QString &s, bool *ok = 0) const;
962    ushort toUShort(const QString &s, bool *ok = 0) const;
963    int toInt(const QString &s, bool *ok = 0) const;
964    uint toUInt(const QString &s, bool *ok = 0) const;
965    qlonglong toLongLong(const QString &s, bool *ok = 0) const;
966    qulonglong toULongLong(const QString &s, bool *ok = 0) const;
967    float toFloat(const QString &s, bool *ok = 0) const;
968    double toDouble(const QString &s, bool *ok = 0) const;
969    QString toString(double i /Constrained/, char format = 'g', int precision = 6) const;
970    bool operator==(const QLocale &other) const;
971    bool operator!=(const QLocale &other) const;
972    static QString languageToString(QLocale::Language language);
973    static QString countryToString(QLocale::Country country);
974    static void setDefault(const QLocale &locale);
975    static QLocale c();
976    static QLocale system();
977
978    enum FormatType
979    {
980        LongFormat,
981        ShortFormat,
982        NarrowFormat,
983    };
984
985    QString toString(const QDateTime &dateTime, const QString &format) const;
986%If (Qt_5_14_0 -)
987    QString toString(const QDateTime &dateTime, const QString &formatStr, QCalendar cal) const;
988%MethodCode
989        // QStringView has issues being implemented as a mapped type.
990        sipRes = new QString(sipCpp->toString(*a0, QStringView(*a1), *a2));
991%End
992
993%End
994    QString toString(const QDateTime &dateTime, QLocale::FormatType format = QLocale::LongFormat) const;
995%If (Qt_5_14_0 -)
996    QString toString(const QDateTime &dateTime, QLocale::FormatType format, QCalendar cal) const;
997%End
998    QString toString(const QDate &date, const QString &formatStr) const;
999%If (Qt_5_14_0 -)
1000    QString toString(const QDate &date, const QString &formatStr, QCalendar cal) const;
1001%MethodCode
1002        // QStringView has issues being implemented as a mapped type.
1003        sipRes = new QString(sipCpp->toString(*a0, QStringView(*a1), *a2));
1004%End
1005
1006%End
1007    QString toString(const QDate &date, QLocale::FormatType format = QLocale::LongFormat) const;
1008%If (Qt_5_14_0 -)
1009    QString toString(const QDate &date, QLocale::FormatType format, QCalendar cal) const;
1010%End
1011    QString toString(const QTime &time, const QString &formatStr) const;
1012    QString toString(const QTime &time, QLocale::FormatType format = QLocale::LongFormat) const;
1013    QString dateFormat(QLocale::FormatType format = QLocale::LongFormat) const;
1014    QString timeFormat(QLocale::FormatType format = QLocale::LongFormat) const;
1015    QString dateTimeFormat(QLocale::FormatType format = QLocale::LongFormat) const;
1016    QDate toDate(const QString &string, QLocale::FormatType format = QLocale::LongFormat) const;
1017    QDate toDate(const QString &string, const QString &format) const;
1018    QTime toTime(const QString &string, QLocale::FormatType format = QLocale::LongFormat) const;
1019    QTime toTime(const QString &string, const QString &format) const;
1020    QDateTime toDateTime(const QString &string, QLocale::FormatType format = QLocale::LongFormat) const;
1021    QDateTime toDateTime(const QString &string, const QString &format) const;
1022    QChar decimalPoint() const;
1023    QChar groupSeparator() const;
1024    QChar percent() const;
1025    QChar zeroDigit() const;
1026    QChar negativeSign() const;
1027    QChar exponential() const;
1028    QString monthName(int, QLocale::FormatType format = QLocale::LongFormat) const;
1029    QString dayName(int, QLocale::FormatType format = QLocale::LongFormat) const;
1030    void setNumberOptions(QLocale::NumberOptions options);
1031    QLocale::NumberOptions numberOptions() const;
1032
1033    enum MeasurementSystem
1034    {
1035        MetricSystem,
1036        ImperialSystem,
1037        ImperialUSSystem,
1038        ImperialUKSystem,
1039    };
1040
1041    QLocale::MeasurementSystem measurementSystem() const;
1042    QChar positiveSign() const;
1043    QString standaloneMonthName(int, QLocale::FormatType format = QLocale::LongFormat) const;
1044    QString standaloneDayName(int, QLocale::FormatType format = QLocale::LongFormat) const;
1045    QString amText() const;
1046    QString pmText() const;
1047    Qt::LayoutDirection textDirection() const;
1048
1049    enum Script
1050    {
1051        AnyScript,
1052        ArabicScript,
1053        CyrillicScript,
1054        DeseretScript,
1055        GurmukhiScript,
1056        SimplifiedHanScript,
1057        TraditionalHanScript,
1058        LatinScript,
1059        MongolianScript,
1060        TifinaghScript,
1061        SimplifiedChineseScript,
1062        TraditionalChineseScript,
1063        ArmenianScript,
1064        BengaliScript,
1065        CherokeeScript,
1066        DevanagariScript,
1067        EthiopicScript,
1068        GeorgianScript,
1069        GreekScript,
1070        GujaratiScript,
1071        HebrewScript,
1072        JapaneseScript,
1073        KhmerScript,
1074        KannadaScript,
1075        KoreanScript,
1076        LaoScript,
1077        MalayalamScript,
1078        MyanmarScript,
1079        OriyaScript,
1080        TamilScript,
1081        TeluguScript,
1082        ThaanaScript,
1083        ThaiScript,
1084        TibetanScript,
1085        SinhalaScript,
1086        SyriacScript,
1087        YiScript,
1088        VaiScript,
1089%If (Qt_5_1_0 -)
1090        AvestanScript,
1091%End
1092%If (Qt_5_1_0 -)
1093        BalineseScript,
1094%End
1095%If (Qt_5_1_0 -)
1096        BamumScript,
1097%End
1098%If (Qt_5_1_0 -)
1099        BatakScript,
1100%End
1101%If (Qt_5_1_0 -)
1102        BopomofoScript,
1103%End
1104%If (Qt_5_1_0 -)
1105        BrahmiScript,
1106%End
1107%If (Qt_5_1_0 -)
1108        BugineseScript,
1109%End
1110%If (Qt_5_1_0 -)
1111        BuhidScript,
1112%End
1113%If (Qt_5_1_0 -)
1114        CanadianAboriginalScript,
1115%End
1116%If (Qt_5_1_0 -)
1117        CarianScript,
1118%End
1119%If (Qt_5_1_0 -)
1120        ChakmaScript,
1121%End
1122%If (Qt_5_1_0 -)
1123        ChamScript,
1124%End
1125%If (Qt_5_1_0 -)
1126        CopticScript,
1127%End
1128%If (Qt_5_1_0 -)
1129        CypriotScript,
1130%End
1131%If (Qt_5_1_0 -)
1132        EgyptianHieroglyphsScript,
1133%End
1134%If (Qt_5_1_0 -)
1135        FraserScript,
1136%End
1137%If (Qt_5_1_0 -)
1138        GlagoliticScript,
1139%End
1140%If (Qt_5_1_0 -)
1141        GothicScript,
1142%End
1143%If (Qt_5_1_0 -)
1144        HanScript,
1145%End
1146%If (Qt_5_1_0 -)
1147        HangulScript,
1148%End
1149%If (Qt_5_1_0 -)
1150        HanunooScript,
1151%End
1152%If (Qt_5_1_0 -)
1153        ImperialAramaicScript,
1154%End
1155%If (Qt_5_1_0 -)
1156        InscriptionalPahlaviScript,
1157%End
1158%If (Qt_5_1_0 -)
1159        InscriptionalParthianScript,
1160%End
1161%If (Qt_5_1_0 -)
1162        JavaneseScript,
1163%End
1164%If (Qt_5_1_0 -)
1165        KaithiScript,
1166%End
1167%If (Qt_5_1_0 -)
1168        KatakanaScript,
1169%End
1170%If (Qt_5_1_0 -)
1171        KayahLiScript,
1172%End
1173%If (Qt_5_1_0 -)
1174        KharoshthiScript,
1175%End
1176%If (Qt_5_1_0 -)
1177        LannaScript,
1178%End
1179%If (Qt_5_1_0 -)
1180        LepchaScript,
1181%End
1182%If (Qt_5_1_0 -)
1183        LimbuScript,
1184%End
1185%If (Qt_5_1_0 -)
1186        LinearBScript,
1187%End
1188%If (Qt_5_1_0 -)
1189        LycianScript,
1190%End
1191%If (Qt_5_1_0 -)
1192        LydianScript,
1193%End
1194%If (Qt_5_1_0 -)
1195        MandaeanScript,
1196%End
1197%If (Qt_5_1_0 -)
1198        MeiteiMayekScript,
1199%End
1200%If (Qt_5_1_0 -)
1201        MeroiticScript,
1202%End
1203%If (Qt_5_1_0 -)
1204        MeroiticCursiveScript,
1205%End
1206%If (Qt_5_1_0 -)
1207        NkoScript,
1208%End
1209%If (Qt_5_1_0 -)
1210        NewTaiLueScript,
1211%End
1212%If (Qt_5_1_0 -)
1213        OghamScript,
1214%End
1215%If (Qt_5_1_0 -)
1216        OlChikiScript,
1217%End
1218%If (Qt_5_1_0 -)
1219        OldItalicScript,
1220%End
1221%If (Qt_5_1_0 -)
1222        OldPersianScript,
1223%End
1224%If (Qt_5_1_0 -)
1225        OldSouthArabianScript,
1226%End
1227%If (Qt_5_1_0 -)
1228        OrkhonScript,
1229%End
1230%If (Qt_5_1_0 -)
1231        OsmanyaScript,
1232%End
1233%If (Qt_5_1_0 -)
1234        PhagsPaScript,
1235%End
1236%If (Qt_5_1_0 -)
1237        PhoenicianScript,
1238%End
1239%If (Qt_5_1_0 -)
1240        PollardPhoneticScript,
1241%End
1242%If (Qt_5_1_0 -)
1243        RejangScript,
1244%End
1245%If (Qt_5_1_0 -)
1246        RunicScript,
1247%End
1248%If (Qt_5_1_0 -)
1249        SamaritanScript,
1250%End
1251%If (Qt_5_1_0 -)
1252        SaurashtraScript,
1253%End
1254%If (Qt_5_1_0 -)
1255        SharadaScript,
1256%End
1257%If (Qt_5_1_0 -)
1258        ShavianScript,
1259%End
1260%If (Qt_5_1_0 -)
1261        SoraSompengScript,
1262%End
1263%If (Qt_5_1_0 -)
1264        CuneiformScript,
1265%End
1266%If (Qt_5_1_0 -)
1267        SundaneseScript,
1268%End
1269%If (Qt_5_1_0 -)
1270        SylotiNagriScript,
1271%End
1272%If (Qt_5_1_0 -)
1273        TagalogScript,
1274%End
1275%If (Qt_5_1_0 -)
1276        TagbanwaScript,
1277%End
1278%If (Qt_5_1_0 -)
1279        TaiLeScript,
1280%End
1281%If (Qt_5_1_0 -)
1282        TaiVietScript,
1283%End
1284%If (Qt_5_1_0 -)
1285        TakriScript,
1286%End
1287%If (Qt_5_1_0 -)
1288        UgariticScript,
1289%End
1290%If (Qt_5_1_0 -)
1291        BrailleScript,
1292%End
1293%If (Qt_5_1_0 -)
1294        HiraganaScript,
1295%End
1296%If (Qt_5_5_0 -)
1297        CaucasianAlbanianScript,
1298%End
1299%If (Qt_5_5_0 -)
1300        BassaVahScript,
1301%End
1302%If (Qt_5_5_0 -)
1303        DuployanScript,
1304%End
1305%If (Qt_5_5_0 -)
1306        ElbasanScript,
1307%End
1308%If (Qt_5_5_0 -)
1309        GranthaScript,
1310%End
1311%If (Qt_5_5_0 -)
1312        PahawhHmongScript,
1313%End
1314%If (Qt_5_5_0 -)
1315        KhojkiScript,
1316%End
1317%If (Qt_5_5_0 -)
1318        LinearAScript,
1319%End
1320%If (Qt_5_5_0 -)
1321        MahajaniScript,
1322%End
1323%If (Qt_5_5_0 -)
1324        ManichaeanScript,
1325%End
1326%If (Qt_5_5_0 -)
1327        MendeKikakuiScript,
1328%End
1329%If (Qt_5_5_0 -)
1330        ModiScript,
1331%End
1332%If (Qt_5_5_0 -)
1333        MroScript,
1334%End
1335%If (Qt_5_5_0 -)
1336        OldNorthArabianScript,
1337%End
1338%If (Qt_5_5_0 -)
1339        NabataeanScript,
1340%End
1341%If (Qt_5_5_0 -)
1342        PalmyreneScript,
1343%End
1344%If (Qt_5_5_0 -)
1345        PauCinHauScript,
1346%End
1347%If (Qt_5_5_0 -)
1348        OldPermicScript,
1349%End
1350%If (Qt_5_5_0 -)
1351        PsalterPahlaviScript,
1352%End
1353%If (Qt_5_5_0 -)
1354        SiddhamScript,
1355%End
1356%If (Qt_5_5_0 -)
1357        KhudawadiScript,
1358%End
1359%If (Qt_5_5_0 -)
1360        TirhutaScript,
1361%End
1362%If (Qt_5_5_0 -)
1363        VarangKshitiScript,
1364%End
1365%If (Qt_5_7_0 -)
1366        AhomScript,
1367%End
1368%If (Qt_5_7_0 -)
1369        AnatolianHieroglyphsScript,
1370%End
1371%If (Qt_5_7_0 -)
1372        HatranScript,
1373%End
1374%If (Qt_5_7_0 -)
1375        MultaniScript,
1376%End
1377%If (Qt_5_7_0 -)
1378        OldHungarianScript,
1379%End
1380%If (Qt_5_7_0 -)
1381        SignWritingScript,
1382%End
1383%If (Qt_5_7_0 -)
1384        AdlamScript,
1385%End
1386%If (Qt_5_7_0 -)
1387        BhaiksukiScript,
1388%End
1389%If (Qt_5_7_0 -)
1390        MarchenScript,
1391%End
1392%If (Qt_5_7_0 -)
1393        NewaScript,
1394%End
1395%If (Qt_5_7_0 -)
1396        OsageScript,
1397%End
1398%If (Qt_5_7_0 -)
1399        TangutScript,
1400%End
1401%If (Qt_5_7_0 -)
1402        HanWithBopomofoScript,
1403%End
1404%If (Qt_5_7_0 -)
1405        JamoScript,
1406%End
1407    };
1408
1409    enum CurrencySymbolFormat
1410    {
1411        CurrencyIsoCode,
1412        CurrencySymbol,
1413        CurrencyDisplayName,
1414    };
1415
1416    QLocale(QLocale::Language language, QLocale::Script script, QLocale::Country country);
1417    QLocale::Script script() const;
1418    QString bcp47Name() const;
1419    QString nativeLanguageName() const;
1420    QString nativeCountryName() const;
1421    Qt::DayOfWeek firstDayOfWeek() const;
1422    QList<Qt::DayOfWeek> weekdays() const;
1423    QString toUpper(const QString &str) const;
1424    QString toLower(const QString &str) const;
1425    QString currencySymbol(QLocale::CurrencySymbolFormat format = QLocale::CurrencySymbol) const;
1426    QString toCurrencyString(double value /Constrained/, const QString &symbol = QString()) const;
1427%If (Qt_5_7_0 -)
1428    QString toCurrencyString(double value /Constrained/, const QString &symbol, int precision) const;
1429%End
1430    QStringList uiLanguages() const;
1431    static QString scriptToString(QLocale::Script script);
1432    static QList<QLocale> matchingLocales(QLocale::Language language, QLocale::Script script, QLocale::Country country);
1433
1434    enum QuotationStyle
1435    {
1436        StandardQuotation,
1437        AlternateQuotation,
1438    };
1439
1440    QString quoteString(const QString &str, QLocale::QuotationStyle style = QLocale::StandardQuotation) const;
1441    QString createSeparatedList(const QStringList &list) const;
1442%If (Qt_5_6_0 -)
1443    long __hash__() const;
1444%MethodCode
1445        sipRes = qHash(*sipCpp);
1446%End
1447
1448%End
1449%If (Qt_5_7_0 -)
1450
1451    enum FloatingPointPrecisionOption
1452    {
1453        FloatingPointShortest,
1454    };
1455
1456%End
1457%If (Qt_5_7_0 -)
1458    void swap(QLocale &other /Constrained/);
1459%End
1460    QString toString(SIP_PYOBJECT i /TypeHint="int"/) const;
1461%MethodCode
1462        // Convert a Python int avoiding overflow as much as possible.
1463
1464        static PyObject *zero = 0;
1465        if (!zero)
1466            zero = PyLong_FromLong(0);
1467
1468        int rc = PyObject_RichCompareBool(a0, zero, Py_LT);
1469
1470        PyErr_Clear();
1471
1472        if (rc < 0)
1473        {
1474            sipError = sipBadCallableArg(0, a0);
1475        }
1476        else if (rc)
1477        {
1478        #if defined(HAVE_LONG_LONG)
1479            PY_LONG_LONG value = PyLong_AsLongLong(a0);
1480        #else
1481            long value = PyLong_AsLong(a0);
1482        #endif
1483
1484            if (PyErr_Occurred() && !PyErr_ExceptionMatches(PyExc_OverflowError))
1485            {
1486                sipError = sipBadCallableArg(0, a0);
1487            }
1488            else
1489            {
1490                sipRes = new QString(sipCpp->toString(value));
1491            }
1492        }
1493        else
1494        {
1495        #if PY_MAJOR_VERSION >= 3
1496        #if defined(HAVE_LONG_LONG)
1497            unsigned PY_LONG_LONG value = PyLong_AsUnsignedLongLongMask(a0);
1498        #else
1499            unsigned long value = PyLong_AsUnsignedLongMask(a0);
1500        #endif
1501        #else
1502        #if defined(HAVE_LONG_LONG)
1503            unsigned PY_LONG_LONG value = PyInt_AsUnsignedLongLongMask(a0);
1504        #else
1505            unsigned long value = PyInt_AsUnsignedLongMask(a0);
1506        #endif
1507        #endif
1508
1509            if (PyErr_Occurred() && !PyErr_ExceptionMatches(PyExc_OverflowError))
1510            {
1511                sipError = sipBadCallableArg(0, a0);
1512            }
1513            else
1514            {
1515                sipRes = new QString(sipCpp->toString(value));
1516            }
1517        }
1518%End
1519
1520    QString toCurrencyString(SIP_PYOBJECT value /TypeHint="int"/, const QString &symbol = QString()) const;
1521%MethodCode
1522        // Convert a Python int avoiding overflow as much as possible.
1523
1524        static PyObject *zero = 0;
1525        if (!zero)
1526            zero = PyLong_FromLong(0);
1527
1528        int rc = PyObject_RichCompareBool(a0, zero, Py_LT);
1529
1530        PyErr_Clear();
1531
1532        if (rc < 0)
1533        {
1534            sipError = sipBadCallableArg(0, a0);
1535        }
1536        else if (rc)
1537        {
1538        #if defined(HAVE_LONG_LONG)
1539            PY_LONG_LONG value = PyLong_AsLongLong(a0);
1540        #else
1541            long value = PyLong_AsLong(a0);
1542        #endif
1543
1544            if (PyErr_Occurred() && !PyErr_ExceptionMatches(PyExc_OverflowError))
1545            {
1546                sipError = sipBadCallableArg(0, a0);
1547            }
1548            else
1549            {
1550                sipRes = new QString(sipCpp->toCurrencyString(value, *a1));
1551            }
1552        }
1553        else
1554        {
1555        #if defined(HAVE_LONG_LONG)
1556            unsigned PY_LONG_LONG value = PyLong_AsUnsignedLongLongMask(a0);
1557        #else
1558            unsigned long value = PyLong_AsUnsignedLongMask(a0);
1559        #endif
1560
1561            if (PyErr_Occurred() && !PyErr_ExceptionMatches(PyExc_OverflowError))
1562            {
1563                sipError = sipBadCallableArg(0, a0);
1564            }
1565            else
1566            {
1567                sipRes = new QString(sipCpp->toCurrencyString(value, *a1));
1568            }
1569        }
1570%End
1571
1572%If (Qt_5_10_0 -)
1573
1574    enum DataSizeFormat
1575    {
1576        DataSizeIecFormat,
1577        DataSizeTraditionalFormat,
1578        DataSizeSIFormat,
1579    };
1580
1581%End
1582%If (Qt_5_10_0 -)
1583    typedef QFlags<QLocale::DataSizeFormat> DataSizeFormats;
1584%End
1585%If (Qt_5_10_0 -)
1586    QString formattedDataSize(qint64 bytes, int precision = 2, QLocale::DataSizeFormats format = QLocale::DataSizeIecFormat);
1587%End
1588%If (Qt_5_13_0 -)
1589    long toLong(const QString &s, bool *ok = 0) const;
1590%End
1591%If (Qt_5_13_0 -)
1592    ulong toULong(const QString &s, bool *ok = 0) const;
1593%End
1594%If (Qt_5_14_0 -)
1595    QDate toDate(const QString &string, QLocale::FormatType format, QCalendar cal) const;
1596%End
1597%If (Qt_5_14_0 -)
1598    QTime toTime(const QString &string, QLocale::FormatType format, QCalendar cal) const;
1599%End
1600%If (Qt_5_14_0 -)
1601    QDateTime toDateTime(const QString &string, QLocale::FormatType format, QCalendar cal) const;
1602%End
1603%If (Qt_5_14_0 -)
1604    QDate toDate(const QString &string, const QString &format, QCalendar cal) const;
1605%End
1606%If (Qt_5_14_0 -)
1607    QTime toTime(const QString &string, const QString &format, QCalendar cal) const;
1608%End
1609%If (Qt_5_14_0 -)
1610    QDateTime toDateTime(const QString &string, const QString &format, QCalendar cal) const;
1611%End
1612%If (Qt_5_14_0 -)
1613    QLocale collation() const;
1614%End
1615};
1616
1617QDataStream &operator<<(QDataStream &, const QLocale & /Constrained/) /ReleaseGIL/;
1618QDataStream &operator>>(QDataStream &, QLocale & /Constrained/) /ReleaseGIL/;
1619QFlags<QLocale::NumberOption> operator|(QLocale::NumberOption f1, QFlags<QLocale::NumberOption> f2);
1620