// qchar.sip generated by MetaSIP on Fri Feb 10 10:37:52 2012 // // This file is part of the QtCore Python extension module. // // Copyright (c) 2011 Riverbank Computing Limited // // 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. // // If you are unsure which license is appropriate for your use, please // 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 %End struct QLatin1Char /API=QString: - 2/ { %TypeHeaderCode #include %End %PickleCode char ch = sipCpp->toLatin1(); sipRes = Py_BuildValue((char *)"(s#)", &ch, 1); %End explicit QLatin1Char(char c /Encoding="Latin-1"/); SIP_PYOBJECT __repr__() const /DocType="str"/; %MethodCode char ch = sipCpp->toLatin1(); PyObject *str = SIPBytes_FromStringAndSize(&ch, 1); if (str) { #if PY_MAJOR_VERSION >= 3 sipRes = PyUnicode_FromFormat("PyQt4.QtCore.QLatin1Char(%R)", str); #else sipRes = PyString_FromString("PyQt4.QtCore.QLatin1Char("); PyString_ConcatAndDel(&sipRes, PyObject_Repr(str)); PyString_ConcatAndDel(&sipRes, PyString_FromString(")")); #endif Py_DECREF(str); } %End const char toLatin1() const /Encoding="None"/; const ushort unicode() const; }; // class QChar /API=QString:2 - ,DocType="str"/ %MappedType QChar /API=QString:2 -,DocType="str"/ { %TypeHeaderCode #include %End %ConvertToTypeCode if (sipIsErr == NULL) #if PY_MAJOR_VERSION < 3 return (PyString_Check(sipPy) || PyUnicode_Check(sipPy)); #else return PyUnicode_Check(sipPy); #endif #if PY_MAJOR_VERSION < 3 if (PyString_Check(sipPy)) { if (PyString_GET_SIZE(sipPy) != 1) { PyErr_SetString(PyExc_ValueError, "string of length 1 expected"); *sipIsErr = 1; return 0; } *sipCppPtr = new QChar(*PyString_AS_STRING(sipPy)); return sipGetState(sipTransferObj); } #endif 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 return qpycore_PyObject_FromQString(QString(*sipCpp)); %End }; class QChar /API=QString: - 2/ { %TypeHeaderCode #include %End %TypeCode // This is needed by __hash__(). #include %End %PickleCode sipRes = Py_BuildValue((char *)"(H)", sipCpp->unicode()); %End public: QChar(); QChar(char c /Encoding="Latin-1"/); QChar(QLatin1Char ch); QChar(uchar c, uchar r); QChar(int rc); QChar(QChar::SpecialCharacter s /Constrained/); SIP_PYOBJECT __repr__() const /DocType="str"/; %MethodCode sipRes = #if PY_MAJOR_VERSION >= 3 PyUnicode_FromFormat #else PyString_FromFormat #endif ("PyQt4.QtCore.QChar(0x%04x)", sipCpp->unicode()); %End long __hash__() const; %MethodCode sipRes = qHash(*sipCpp); %End enum SpecialCharacter { Null, Nbsp, ReplacementCharacter, ObjectReplacementCharacter, ByteOrderMark, ByteOrderSwapped, ParagraphSeparator, LineSeparator, }; enum Category { NoCategory, Mark_NonSpacing, Mark_SpacingCombining, Mark_Enclosing, Number_DecimalDigit, Number_Letter, Number_Other, Separator_Space, Separator_Line, Separator_Paragraph, Other_Control, Other_Format, Other_Surrogate, Other_PrivateUse, Other_NotAssigned, Letter_Uppercase, Letter_Lowercase, Letter_Titlecase, Letter_Modifier, Letter_Other, Punctuation_Connector, Punctuation_Dash, Punctuation_Open, Punctuation_Close, Punctuation_InitialQuote, Punctuation_FinalQuote, Punctuation_Other, Symbol_Math, Symbol_Currency, Symbol_Modifier, Symbol_Other, Punctuation_Dask, }; enum Direction { DirL, DirR, DirEN, DirES, DirET, DirAN, DirCS, DirB, DirS, DirWS, DirON, DirLRE, DirLRO, DirAL, DirRLE, DirRLO, DirPDF, DirNSM, DirBN, }; enum Decomposition { NoDecomposition, Canonical, Font, NoBreak, Initial, Medial, Final, Isolated, Circle, Super, Sub, Vertical, Wide, Narrow, Small, Square, Compat, Fraction, }; enum Joining { OtherJoining, Dual, Right, Center, }; enum CombiningClass { Combining_BelowLeftAttached, Combining_BelowAttached, Combining_BelowRightAttached, Combining_LeftAttached, Combining_RightAttached, Combining_AboveLeftAttached, Combining_AboveAttached, Combining_AboveRightAttached, Combining_BelowLeft, Combining_Below, Combining_BelowRight, Combining_Left, Combining_Right, Combining_AboveLeft, Combining_Above, Combining_AboveRight, Combining_DoubleBelow, Combining_DoubleAbove, Combining_IotaSubscript, }; enum UnicodeVersion { Unicode_Unassigned, Unicode_1_1, Unicode_2_0, Unicode_2_1_2, Unicode_3_0, Unicode_3_1, Unicode_3_2, Unicode_4_0, %If (Qt_4_3_0 -) Unicode_4_1, %End %If (Qt_4_3_0 -) Unicode_5_0, %End }; int digitValue() const; QChar toLower() const; QChar toUpper() const; QChar::Category category() const; QChar::Direction direction() const; QChar::Joining joining() const; bool hasMirrored() const; bool isLower() const; bool isUpper() const; QChar mirroredChar() const; QString decomposition() const; QChar::Decomposition decompositionTag() const; unsigned char combiningClass() const; QChar::UnicodeVersion unicodeVersion() const; const char toAscii() const /Encoding="None"/; const ushort unicode() const; static QChar fromAscii(char c /Encoding="ASCII"/); bool isNull() const; bool isPrint() const; bool isPunct() const; bool isSpace() const; bool isMark() const; bool isLetter() const; bool isNumber() const; bool isLetterOrNumber() const; bool isDigit() const; bool isSymbol() const; uchar cell() const; uchar row() const; const char toLatin1() const /Encoding="None"/; static QChar fromLatin1(char c /Encoding="Latin-1"/); void setCell(uchar acell); void setRow(uchar arow); %If (Qt_4_3_0 -) QChar toTitleCase() const; %End %If (Qt_4_3_0 -) QChar toCaseFolded() const; %End %If (Qt_4_3_0 -) bool isTitleCase() const; %End %If (Qt_4_3_0 -) bool isHighSurrogate() const; %End %If (Qt_4_3_0 -) bool isLowSurrogate() const; %End %If (Qt_4_3_0 -) static uint surrogateToUcs4(ushort high, ushort low); %End %If (Qt_4_3_0 -) static uint surrogateToUcs4(QChar high, QChar low); %End %If (Qt_4_3_0 -) static ushort highSurrogate(uint ucs4); %End %If (Qt_4_3_0 -) static ushort lowSurrogate(uint ucs4); %End %If (Qt_4_3_0 -) static QChar::Category category(uint ucs4); %End %If (Qt_4_3_0 -) static QChar::Direction direction(uint ucs4); %End %If (Qt_4_3_0 -) static QChar::Joining joining(uint ucs4); %End %If (Qt_4_3_0 -) static unsigned char combiningClass(uint ucs4); %End %If (Qt_4_3_0 -) static uint mirroredChar(uint ucs4); %End %If (Qt_4_3_0 -) static QChar::Decomposition decompositionTag(uint ucs4); %End %If (Qt_4_3_0 -) static int digitValue(uint ucs4); %End %If (Qt_4_3_0 -) static uint toLower(uint ucs4); %End %If (Qt_4_3_0 -) static uint toUpper(uint ucs4); %End %If (Qt_4_3_0 -) static uint toTitleCase(uint ucs4); %End %If (Qt_4_3_0 -) static uint toCaseFolded(uint ucs4); %End %If (Qt_4_3_0 -) static QChar::UnicodeVersion unicodeVersion(uint ucs4); %End %If (Qt_4_3_0 -) static QString decomposition(uint ucs4); %End %If (Qt_4_7_0 -) static bool isHighSurrogate(uint ucs4); %End %If (Qt_4_7_0 -) static bool isLowSurrogate(uint ucs4); %End %If (Qt_4_7_0 -) static bool requiresSurrogates(uint ucs4); %End %If (Qt_4_8_0 -) static QChar::UnicodeVersion currentUnicodeVersion(); %End }; bool operator==(QChar c1, QChar c2); bool operator!=(QChar c1, QChar c2); bool operator<=(QChar c1, QChar c2); bool operator>=(QChar c1, QChar c2); bool operator<(QChar c1, QChar c2); bool operator>(QChar c1, QChar c2); QDataStream &operator<<(QDataStream &, const QChar & /Constrained/); QDataStream &operator>>(QDataStream &, QChar & /Constrained/);