// qchar.sip generated by MetaSIP
//
// This file is part of the QtCore Python extension module.
//
// Copyright (c) 2026 Riverbank Computing Limited <info@riverbankcomputing.com>
// 
// This file is part of PyQt6.
// 
// This file may be used under the terms of the GNU General Public License
// version 3.0 as published by the Free Software Foundation and appearing in
// the file LICENSE included in the packaging of this file.  Please review the
// following information to ensure the GNU General Public License version 3.0
// requirements will be met: http://www.gnu.org/copyleft/gpl.html.
// 
// If you do not wish to use this file under the terms of the GPL version 3.0
// then you may purchase a commercial license.  For more information contact
// info@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.


class QChar /TypeHint="str"/
{
%TypeHeaderCode
#include <qchar.h>
%End

%ConvertToTypeCode
if (sipIsErr == NULL)
    return PyUnicode_Check(sipPy);

// TODO: review replacing with something more efficient.
QString qs = qpycore_PyObject_AsQString(sipPy);

if (qs.size() != 1)
{
    PyErr_SetString(PyExc_ValueError, "string of length 1 expected");
    *sipIsErr = 1;
    return 0;
}

*sipCppPtr = new QChar(qs.at(0));

return sipGetState(sipTransferObj);
%End

%ConvertFromTypeCode
// TODO: replace with...
// return PyUnicode_FromKindAndData(PyUnicode_2BYTE_KIND, sipCpp, 1);
return qpycore_PyObject_FromQString(QString(*sipCpp));
%End

public:
    enum Script
    {
        Script_Unknown,
        Script_Inherited,
        Script_Common,
        Script_Latin,
        Script_Greek,
        Script_Cyrillic,
        Script_Armenian,
        Script_Hebrew,
        Script_Arabic,
        Script_Syriac,
        Script_Thaana,
        Script_Devanagari,
        Script_Bengali,
        Script_Gurmukhi,
        Script_Gujarati,
        Script_Oriya,
        Script_Tamil,
        Script_Telugu,
        Script_Kannada,
        Script_Malayalam,
        Script_Sinhala,
        Script_Thai,
        Script_Lao,
        Script_Tibetan,
        Script_Myanmar,
        Script_Georgian,
        Script_Hangul,
        Script_Ethiopic,
        Script_Cherokee,
        Script_CanadianAboriginal,
        Script_Ogham,
        Script_Runic,
        Script_Khmer,
        Script_Mongolian,
        Script_Hiragana,
        Script_Katakana,
        Script_Bopomofo,
        Script_Han,
        Script_Yi,
        Script_OldItalic,
        Script_Gothic,
        Script_Deseret,
        Script_Tagalog,
        Script_Hanunoo,
        Script_Buhid,
        Script_Tagbanwa,
        Script_Coptic,
        Script_Limbu,
        Script_TaiLe,
        Script_LinearB,
        Script_Ugaritic,
        Script_Shavian,
        Script_Osmanya,
        Script_Cypriot,
        Script_Braille,
        Script_Buginese,
        Script_NewTaiLue,
        Script_Glagolitic,
        Script_Tifinagh,
        Script_SylotiNagri,
        Script_OldPersian,
        Script_Kharoshthi,
        Script_Balinese,
        Script_Cuneiform,
        Script_Phoenician,
        Script_PhagsPa,
        Script_Nko,
        Script_Sundanese,
        Script_Lepcha,
        Script_OlChiki,
        Script_Vai,
        Script_Saurashtra,
        Script_KayahLi,
        Script_Rejang,
        Script_Lycian,
        Script_Carian,
        Script_Lydian,
        Script_Cham,
        Script_TaiTham,
        Script_TaiViet,
        Script_Avestan,
        Script_EgyptianHieroglyphs,
        Script_Samaritan,
        Script_Lisu,
        Script_Bamum,
        Script_Javanese,
        Script_MeeteiMayek,
        Script_ImperialAramaic,
        Script_OldSouthArabian,
        Script_InscriptionalParthian,
        Script_InscriptionalPahlavi,
        Script_OldTurkic,
        Script_Kaithi,
        Script_Batak,
        Script_Brahmi,
        Script_Mandaic,
        Script_Chakma,
        Script_MeroiticCursive,
        Script_MeroiticHieroglyphs,
        Script_Miao,
        Script_Sharada,
        Script_SoraSompeng,
        Script_Takri,
        Script_CaucasianAlbanian,
        Script_BassaVah,
        Script_Duployan,
        Script_Elbasan,
        Script_Grantha,
        Script_PahawhHmong,
        Script_Khojki,
        Script_LinearA,
        Script_Mahajani,
        Script_Manichaean,
        Script_MendeKikakui,
        Script_Modi,
        Script_Mro,
        Script_OldNorthArabian,
        Script_Nabataean,
        Script_Palmyrene,
        Script_PauCinHau,
        Script_OldPermic,
        Script_PsalterPahlavi,
        Script_Siddham,
        Script_Khudawadi,
        Script_Tirhuta,
        Script_WarangCiti,
        Script_Ahom,
        Script_AnatolianHieroglyphs,
        Script_Hatran,
        Script_Multani,
        Script_OldHungarian,
        Script_SignWriting,
        Script_Adlam,
        Script_Bhaiksuki,
        Script_Marchen,
        Script_Newa,
        Script_Osage,
        Script_Tangut,
        Script_MasaramGondi,
        Script_Nushu,
        Script_Soyombo,
        Script_ZanabazarSquare,
        Script_Dogra,
        Script_GunjalaGondi,
        Script_HanifiRohingya,
        Script_Makasar,
        Script_Medefaidrin,
        Script_OldSogdian,
        Script_Sogdian,
        Script_Elymaic,
        Script_Nandinagari,
        Script_NyiakengPuachueHmong,
        Script_Wancho,
        Script_Chorasmian,
        Script_DivesAkuru,
        Script_KhitanSmallScript,
        Script_Yezidi,
%If (Qt_6_3_0 -)
        Script_CyproMinoan,
%End
%If (Qt_6_3_0 -)
        Script_NagMundari,
%End
%If (Qt_6_3_0 -)
        Script_OldUyghur,
%End
%If (Qt_6_3_0 -)
        Script_Tangsa,
%End
%If (Qt_6_3_0 -)
        Script_Toto,
%End
%If (Qt_6_3_0 -)
        Script_Vithkuqi,
%End
%If (Qt_6_5_0 -)
        Script_Kawi,
%End
%If (Qt_6_9_0 -)
        Script_Garay,
%End
%If (Qt_6_9_0 -)
        Script_GurungKhema,
%End
%If (Qt_6_9_0 -)
        Script_KiratRai,
%End
%If (Qt_6_9_0 -)
        Script_OlOnal,
%End
%If (Qt_6_9_0 -)
        Script_Sunuwar,
%End
%If (Qt_6_9_0 -)
        Script_Todhri,
%End
%If (Qt_6_9_0 -)
        Script_TuluTigalari,
%End
%If (Qt_6_11_0 -)
        Script_Sidetic,
%End
%If (Qt_6_11_0 -)
        Script_TaiYo,
%End
%If (Qt_6_11_0 -)
        Script_TolongSiki,
%End
%If (Qt_6_11_0 -)
        Script_BeriaErfe,
%End
    };
};

bool operator>=(const QChar &lhs, const QChar &rhs);
bool operator<=(const QChar &lhs, const QChar &rhs);
bool operator>(const QChar &lhs, const QChar &rhs);
bool operator<(const QChar &lhs, const QChar &rhs);
bool operator!=(const QChar &lhs, const QChar &rhs);
bool operator==(const QChar &lhs, const QChar &rhs);
%If (- Qt_6_10_0)
QDataStream &operator>>(QDataStream &, QChar & /Constrained/) /ReleaseGIL/;
%End
%If (- Qt_6_10_0)
QDataStream &operator<<(QDataStream &, QChar) /ReleaseGIL/;
%End
