// qlocale.sip generated by MetaSIP on Fri Apr 16 11:32:08 2010
//
// This file is part of the QtCore Python extension module.
//
// Copyright (c) 2010 Riverbank Computing Limited <info@riverbankcomputing.com>
// 
// This file is part of PyQt.
// 
// This file may be used under the terms of the GNU General Public
// License versions 2.0 or 3.0 as published by the Free Software
// Foundation and appearing in the files LICENSE.GPL2 and LICENSE.GPL3
// included in the packaging of this file.  Alternatively you may (at
// your option) use any later version of the GNU General Public
// License if such license has been publicly approved by Riverbank
// Computing Limited (or its successors, if any) and the KDE Free Qt
// Foundation. In addition, as a special exception, Riverbank gives you
// certain additional rights. These rights are described in the Riverbank
// GPL Exception version 1.1, which can be found in the file
// GPL_EXCEPTION.txt in this package.
// 
// Please review the following information to ensure GNU General
// Public Licensing requirements will be met:
// http://trolltech.com/products/qt/licenses/licensing/opensource/. If
// you are unsure which license is appropriate for your use, please
// review the following information:
// http://trolltech.com/products/qt/licenses/licensing/licensingoverview
// or contact the sales department at sales@riverbankcomputing.com.
// 
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.


%ModuleCode
#include <qlocale.h>
%End

class QLocale
{

%TypeHeaderCode
#include <qlocale.h>
%End

public:
    enum Language
    {
        C,
        Abkhazian,
        Afan,
        Afar,
        Afrikaans,
        Albanian,
        Amharic,
        Arabic,
        Armenian,
        Assamese,
        Aymara,
        Azerbaijani,
        Bashkir,
        Basque,
        Bengali,
        Bhutani,
        Bihari,
        Bislama,
        Breton,
        Bulgarian,
        Burmese,
        Byelorussian,
        Cambodian,
        Catalan,
        Chinese,
        Corsican,
        Croatian,
        Czech,
        Danish,
        Dutch,
        English,
        Esperanto,
        Estonian,
        Faroese,
        FijiLanguage,
        Finnish,
        French,
        Frisian,
        Gaelic,
        Galician,
        Georgian,
        German,
        Greek,
        Greenlandic,
        Guarani,
        Gujarati,
        Hausa,
        Hebrew,
        Hindi,
        Hungarian,
        Icelandic,
        Indonesian,
        Interlingua,
        Interlingue,
        Inuktitut,
        Inupiak,
        Irish,
        Italian,
        Japanese,
        Javanese,
        Kannada,
        Kashmiri,
        Kazakh,
        Kinyarwanda,
        Kirghiz,
        Korean,
        Kurdish,
        Kurundi,
        Laothian,
        Latin,
        Latvian,
        Lingala,
        Lithuanian,
        Macedonian,
        Malagasy,
        Malay,
        Malayalam,
        Maltese,
        Maori,
        Marathi,
        Moldavian,
        Mongolian,
        NauruLanguage,
        Nepali,
        Norwegian,
        Occitan,
        Oriya,
        Pashto,
        Persian,
        Polish,
        Portuguese,
        Punjabi,
        Quechua,
        RhaetoRomance,
        Romanian,
        Russian,
        Samoan,
        Sangho,
        Sanskrit,
        Serbian,
        SerboCroatian,
        Sesotho,
        Setswana,
        Shona,
        Sindhi,
        Singhalese,
        Siswati,
        Slovak,
        Slovenian,
        Somali,
        Spanish,
        Sundanese,
        Swahili,
        Swedish,
        Tagalog,
        Tajik,
        Tamil,
        Tatar,
        Telugu,
        Thai,
        Tibetan,
        Tigrinya,
        TongaLanguage,
        Tsonga,
        Turkish,
        Turkmen,
        Twi,
        Uigur,
        Ukrainian,
        Urdu,
        Uzbek,
        Vietnamese,
        Volapuk,
        Welsh,
        Wolof,
        Xhosa,
        Yiddish,
        Yoruba,
        Zhuang,
        Zulu,
        Nynorsk,
        Bosnian,
        Divehi,
        Manx,
        Cornish,
        LastLanguage,
%If (Qt_4_3_0 -)
        NorwegianBokmal,
%End
%If (Qt_4_3_0 -)
        NorwegianNynorsk,
%End
%If (Qt_4_3_0 -)
        Akan,
%End
%If (Qt_4_3_0 -)
        Konkani,
%End
%If (Qt_4_3_0 -)
        Ga,
%End
%If (Qt_4_3_0 -)
        Igbo,
%End
%If (Qt_4_3_0 -)
        Kamba,
%End
%If (Qt_4_3_0 -)
        Syriac,
%End
%If (Qt_4_3_0 -)
        Blin,
%End
%If (Qt_4_3_0 -)
        Geez,
%End
%If (Qt_4_3_0 -)
        Koro,
%End
%If (Qt_4_3_0 -)
        Sidamo,
%End
%If (Qt_4_3_0 -)
        Atsam,
%End
%If (Qt_4_3_0 -)
        Tigre,
%End
%If (Qt_4_3_0 -)
        Jju,
%End
%If (Qt_4_3_0 -)
        Friulian,
%End
%If (Qt_4_3_0 -)
        Venda,
%End
%If (Qt_4_3_0 -)
        Ewe,
%End
%If (Qt_4_3_0 -)
        Walamo,
%End
%If (Qt_4_3_0 -)
        Hawaiian,
%End
%If (Qt_4_3_0 -)
        Tyap,
%End
%If (Qt_4_3_0 -)
        Chewa,
%End
    };

    enum Country
    {
        AnyCountry,
        Afghanistan,
        Albania,
        Algeria,
        AmericanSamoa,
        Andorra,
        Angola,
        Anguilla,
        Antarctica,
        AntiguaAndBarbuda,
        Argentina,
        Armenia,
        Aruba,
        Australia,
        Austria,
        Azerbaijan,
        Bahamas,
        Bahrain,
        Bangladesh,
        Barbados,
        Belarus,
        Belgium,
        Belize,
        Benin,
        Bermuda,
        Bhutan,
        Bolivia,
        BosniaAndHerzegowina,
        Botswana,
        BouvetIsland,
        Brazil,
        BritishIndianOceanTerritory,
        BruneiDarussalam,
        Bulgaria,
        BurkinaFaso,
        Burundi,
        Cambodia,
        Cameroon,
        Canada,
        CapeVerde,
        CaymanIslands,
        CentralAfricanRepublic,
        Chad,
        Chile,
        China,
        ChristmasIsland,
        CocosIslands,
        Colombia,
        Comoros,
        DemocraticRepublicOfCongo,
        PeoplesRepublicOfCongo,
        CookIslands,
        CostaRica,
        IvoryCoast,
        Croatia,
        Cuba,
        Cyprus,
        CzechRepublic,
        Denmark,
        Djibouti,
        Dominica,
        DominicanRepublic,
        EastTimor,
        Ecuador,
        Egypt,
        ElSalvador,
        EquatorialGuinea,
        Eritrea,
        Estonia,
        Ethiopia,
        FalklandIslands,
        FaroeIslands,
        FijiCountry,
        Finland,
        France,
        MetropolitanFrance,
        FrenchGuiana,
        FrenchPolynesia,
        FrenchSouthernTerritories,
        Gabon,
        Gambia,
        Georgia,
        Germany,
        Ghana,
        Gibraltar,
        Greece,
        Greenland,
        Grenada,
        Guadeloupe,
        Guam,
        Guatemala,
        Guinea,
        GuineaBissau,
        Guyana,
        Haiti,
        HeardAndMcDonaldIslands,
        Honduras,
        HongKong,
        Hungary,
        Iceland,
        India,
        Indonesia,
        Iran,
        Iraq,
        Ireland,
        Israel,
        Italy,
        Jamaica,
        Japan,
        Jordan,
        Kazakhstan,
        Kenya,
        Kiribati,
        DemocraticRepublicOfKorea,
        RepublicOfKorea,
        Kuwait,
        Kyrgyzstan,
        Lao,
        Latvia,
        Lebanon,
        Lesotho,
        Liberia,
        LibyanArabJamahiriya,
        Liechtenstein,
        Lithuania,
        Luxembourg,
        Macau,
        Macedonia,
        Madagascar,
        Malawi,
        Malaysia,
        Maldives,
        Mali,
        Malta,
        MarshallIslands,
        Martinique,
        Mauritania,
        Mauritius,
        Mayotte,
        Mexico,
        Micronesia,
        Moldova,
        Monaco,
        Mongolia,
        Montserrat,
        Morocco,
        Mozambique,
        Myanmar,
        Namibia,
        NauruCountry,
        Nepal,
        Netherlands,
        NetherlandsAntilles,
        NewCaledonia,
        NewZealand,
        Nicaragua,
        Niger,
        Nigeria,
        Niue,
        NorfolkIsland,
        NorthernMarianaIslands,
        Norway,
        Oman,
        Pakistan,
        Palau,
        PalestinianTerritory,
        Panama,
        PapuaNewGuinea,
        Paraguay,
        Peru,
        Philippines,
        Pitcairn,
        Poland,
        Portugal,
        PuertoRico,
        Qatar,
        Reunion,
        Romania,
        RussianFederation,
        Rwanda,
        SaintKittsAndNevis,
        StLucia,
        StVincentAndTheGrenadines,
        Samoa,
        SanMarino,
        SaoTomeAndPrincipe,
        SaudiArabia,
        Senegal,
        Seychelles,
        SierraLeone,
        Singapore,
        Slovakia,
        Slovenia,
        SolomonIslands,
        Somalia,
        SouthAfrica,
        SouthGeorgiaAndTheSouthSandwichIslands,
        Spain,
        SriLanka,
        StHelena,
        StPierreAndMiquelon,
        Sudan,
        Suriname,
        SvalbardAndJanMayenIslands,
        Swaziland,
        Sweden,
        Switzerland,
        SyrianArabRepublic,
        Taiwan,
        Tajikistan,
        Tanzania,
        Thailand,
        Togo,
        Tokelau,
        TongaCountry,
        TrinidadAndTobago,
        Tunisia,
        Turkey,
        Turkmenistan,
        TurksAndCaicosIslands,
        Tuvalu,
        Uganda,
        Ukraine,
        UnitedArabEmirates,
        UnitedKingdom,
        UnitedStates,
        UnitedStatesMinorOutlyingIslands,
        Uruguay,
        Uzbekistan,
        Vanuatu,
        VaticanCityState,
        Venezuela,
        VietNam,
        BritishVirginIslands,
        USVirginIslands,
        WallisAndFutunaIslands,
        WesternSahara,
        Yemen,
        Yugoslavia,
        Zambia,
        Zimbabwe,
        SerbiaAndMontenegro,
        LastCountry,
    };

%If (Qt_4_2_0 -)

    enum NumberOption
    {
        OmitGroupSeparator,
        RejectGroupSeparator,
    };

%End
%If (Qt_4_2_0 -)
    typedef QFlags<QLocale::NumberOption> NumberOptions;
%End
    QLocale();
    QLocale(const QString &);
    QLocale(QLocale::Language, QLocale::Country country = QLocale::AnyCountry);
    QLocale(const QLocale &);
    QLocale::Language language() const;
    QLocale::Country country() const;
    QString name() const;
    short toShort(const QString &, bool *ok = 0, int base = 0) const;
    ushort toUShort(const QString &, bool *ok = 0, int base = 0) const;
    int toInt(const QString &, bool *ok = 0, int base = 0) const;
    uint toUInt(const QString &, bool *ok = 0, int base = 0) const;
    qlonglong toLongLong(const QString &, bool *ok = 0, int base = 0) const;
    qlonglong toULongLong(const QString &, bool *ok = 0, int base = 0) const;
    float toFloat(const QString &, bool *ok = 0) const;
    double toDouble(const QString &, bool *ok = 0) const;
    QString toString(int /Constrained/) const;
    QString toString(double /Constrained/, char format = 'g', int precision = 6) const;
    QString toString(qlonglong) const;
    QString toString(qulonglong) const;
    bool operator==(const QLocale &) const;
    bool operator!=(const QLocale &) const;
    static QString languageToString(QLocale::Language);
    static QString countryToString(QLocale::Country);
    static void setDefault(const QLocale &);
    static QLocale c();
    static QLocale system();

    enum FormatType
    {
        LongFormat,
        ShortFormat,
%If (Qt_4_5_0 -)
        NarrowFormat,
%End
    };

    QString toString(const QDate &, const QString &) const;
    QString toString(const QDate &, QLocale::FormatType format = QLocale::LongFormat) const;
    QString toString(const QTime &, const QString &) const;
    QString toString(const QTime &, QLocale::FormatType format = QLocale::LongFormat) const;
%If (Qt_4_4_0 -)
    QString toString(const QDateTime &, QLocale::FormatType format = QLocale::LongFormat) const;
%End
%If (Qt_4_4_0 -)
    QString toString(const QDateTime &, const QString &) const;
%End
    QString dateFormat(QLocale::FormatType format = QLocale::LongFormat) const;
    QString timeFormat(QLocale::FormatType format = QLocale::LongFormat) const;
%If (Qt_4_4_0 -)
    QString dateTimeFormat(QLocale::FormatType format = QLocale::LongFormat) const;
%End
%If (Qt_4_4_0 -)
    QDate toDate(const QString &, QLocale::FormatType format = QLocale::LongFormat) const;
%End
%If (Qt_4_4_0 -)
    QDate toDate(const QString &, const QString &) const;
%End
%If (Qt_4_4_0 -)
    QTime toTime(const QString &, QLocale::FormatType format = QLocale::LongFormat) const;
%End
%If (Qt_4_4_0 -)
    QTime toTime(const QString &, const QString &) const;
%End
%If (Qt_4_4_0 -)
    QDateTime toDateTime(const QString &, QLocale::FormatType format = QLocale::LongFormat) const;
%End
%If (Qt_4_4_0 -)
    QDateTime toDateTime(const QString &, const QString &) const;
%End
    QChar decimalPoint() const;
    QChar groupSeparator() const;
    QChar percent() const;
    QChar zeroDigit() const;
    QChar negativeSign() const;
    QChar exponential() const;
%If (Qt_4_2_0 -)
    QString monthName(int, QLocale::FormatType format = QLocale::LongFormat) const;
%End
%If (Qt_4_2_0 -)
    QString dayName(int, QLocale::FormatType format = QLocale::LongFormat) const;
%End
%If (Qt_4_2_0 -)
    void setNumberOptions(QFlags<QLocale::NumberOption>);
%End
%If (Qt_4_2_0 -)
    QFlags<QLocale::NumberOption> numberOptions() const;
%End
%If (Qt_4_3_0 -)
    static QList<QLocale::Country> countriesForLanguage(QLocale::Language);
%End
%If (Qt_4_4_0 -)

    enum MeasurementSystem
    {
        MetricSystem,
        ImperialSystem,
    };

%End
%If (Qt_4_4_0 -)
    QLocale::MeasurementSystem measurementSystem() const;
%End
%If (Qt_4_5_0 -)
    QChar positiveSign() const;
%End
%If (Qt_4_5_0 -)
    QString standaloneMonthName(int, QLocale::FormatType format = QLocale::LongFormat) const;
%End
%If (Qt_4_5_0 -)
    QString standaloneDayName(int, QLocale::FormatType format = QLocale::LongFormat) const;
%End
%If (Qt_4_5_0 -)
    QString amText() const;
%End
%If (Qt_4_5_0 -)
    QString pmText() const;
%End
};

QDataStream &operator<<(QDataStream &, const QLocale & /Constrained/);
QDataStream &operator>>(QDataStream &, QLocale & /Constrained/);
%If (Qt_4_2_0 -)
QFlags<QLocale::NumberOption> operator|(QLocale::NumberOption, QFlags<QLocale::NumberOption>);
%End
%If (Qt_4_2_0 -)

class QSystemLocale
{

%TypeHeaderCode
#include <qlocale.h>
%End

public:
    QSystemLocale();
    virtual ~QSystemLocale();

    enum QueryType
    {
        LanguageId,
        CountryId,
        DecimalPoint,
        GroupSeparator,
        ZeroDigit,
        NegativeSign,
        DateFormatLong,
        DateFormatShort,
        TimeFormatLong,
        TimeFormatShort,
        DayNameLong,
        DayNameShort,
        MonthNameLong,
        MonthNameShort,
        DateToStringLong,
        DateToStringShort,
        TimeToStringLong,
        TimeToStringShort,
%If (Qt_4_4_0 -)
        DateTimeFormatLong,
%End
%If (Qt_4_4_0 -)
        DateTimeFormatShort,
%End
%If (Qt_4_4_0 -)
        DateTimeToStringLong,
%End
%If (Qt_4_4_0 -)
        DateTimeToStringShort,
%End
%If (Qt_4_4_0 -)
        MeasurementSystem,
%End
%If (Qt_4_5_0 -)
        PositiveSign,
%End
%If (Qt_4_5_0 -)
        AMText,
%End
%If (Qt_4_5_0 -)
        PMText,
%End
    };

    virtual QVariant query(QSystemLocale::QueryType, QVariant) const;
    virtual QLocale fallbackLocale() const;
};

%End
%If (Qt_4_3_0 -)
// Mapped type for QList<QLocale::Country>.
%MappedType QList<QLocale::Country> /DocType="list-of-QLocale.Country"/
{
%TypeHeaderCode
#include <qlocale.h>
%End

%ConvertFromTypeCode
    // Create the list.
    PyObject *l;

    if ((l = PyList_New(sipCpp->size())) == NULL)
        return NULL;

    // Set the list elements.
    for (int i = 0; i < sipCpp->size(); ++i)
    {
        QLocale::Country e = sipCpp->at(i);
        PyObject *eobj;

        if ((eobj = sipConvertFromEnum(e, sipType_QLocale_Country)) == NULL)
        {
            Py_DECREF(l);

            return NULL;
        }

        PyList_SET_ITEM(l, i, eobj);
    }

    return l;
%End

%ConvertToTypeCode
    // Check the type if that is all that is required.
    if (sipIsErr == NULL)
    {
        if (!PyList_Check(sipPy))
            return 0;

        for (SIP_SSIZE_T i = 0; i < PyList_GET_SIZE(sipPy); ++i)
            if (PyObject_TypeCheck(PyList_GET_ITEM(sipPy, i), sipTypeAsPyTypeObject(sipType_QLocale_Country)))
                return 0;

        return 1;
    }

    QList<QLocale::Country> *ql = new QList<QLocale::Country>;
 
    for (SIP_SSIZE_T i = 0; i < PyList_GET_SIZE(sipPy); ++i)
    {
        long l = SIPLong_AsLong(PyList_GET_ITEM(sipPy, i));
        ql->append(static_cast<QLocale::Country>(l));
    }
 
    *sipCppPtr = ql;
 
    return sipGetState(sipTransferObj);
%End
};
%End
