/*
 * Interface wrapper code.
 *
 * Generated by SIP 6.6.2
 *
 * Copyright (c) 2022 Riverbank Computing Limited <info@riverbankcomputing.com>
 * 
 * This file is part of PyQt5.
 * 
 * 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.
 */

#include "sipAPIQtGui.h"

#line 224 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtGui/qtextobject.sip"
#include <qtextobject.h>
#line 29 "/build/pyqt5/src/PyQt5-5.15.7/build/QtGui/sipQtGuiQTextFragment.cpp"

#line 38 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtCore/qpycore_qlist.sip"
#include <qlist.h>
#line 33 "/build/pyqt5/src/PyQt5-5.15.7/build/QtGui/sipQtGuiQTextFragment.cpp"
#line 28 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtGui/qglyphrun.sip"
#include <qglyphrun.h>
#line 36 "/build/pyqt5/src/PyQt5-5.15.7/build/QtGui/sipQtGuiQTextFragment.cpp"
#line 27 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtCore/qstring.sip"
#include <qstring.h>
#line 39 "/build/pyqt5/src/PyQt5-5.15.7/build/QtGui/sipQtGuiQTextFragment.cpp"
#line 318 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtGui/qtextformat.sip"
#include <qtextformat.h>
#line 42 "/build/pyqt5/src/PyQt5-5.15.7/build/QtGui/sipQtGuiQTextFragment.cpp"


PyDoc_STRVAR(doc_QTextFragment_isValid, "isValid(self) -> bool");

extern "C" {static PyObject *meth_QTextFragment_isValid(PyObject *, PyObject *);}
static PyObject *meth_QTextFragment_isValid(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = SIP_NULLPTR;

    {
        const  ::QTextFragment *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_QTextFragment, &sipCpp))
        {
            bool sipRes;

            sipRes = sipCpp->isValid();

            return PyBool_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_QTextFragment, sipName_isValid, doc_QTextFragment_isValid);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QTextFragment_position, "position(self) -> int");

extern "C" {static PyObject *meth_QTextFragment_position(PyObject *, PyObject *);}
static PyObject *meth_QTextFragment_position(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = SIP_NULLPTR;

    {
        const  ::QTextFragment *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_QTextFragment, &sipCpp))
        {
            int sipRes;

            sipRes = sipCpp->position();

            return PyLong_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_QTextFragment, sipName_position, doc_QTextFragment_position);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QTextFragment_length, "length(self) -> int");

extern "C" {static PyObject *meth_QTextFragment_length(PyObject *, PyObject *);}
static PyObject *meth_QTextFragment_length(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = SIP_NULLPTR;

    {
        const  ::QTextFragment *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_QTextFragment, &sipCpp))
        {
            int sipRes;

            sipRes = sipCpp->length();

            return PyLong_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_QTextFragment, sipName_length, doc_QTextFragment_length);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QTextFragment_contains, "contains(self, int) -> bool");

extern "C" {static PyObject *meth_QTextFragment_contains(PyObject *, PyObject *);}
static PyObject *meth_QTextFragment_contains(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = SIP_NULLPTR;

    {
        int a0;
        const  ::QTextFragment *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "Bi", &sipSelf, sipType_QTextFragment, &sipCpp, &a0))
        {
            bool sipRes;

            sipRes = sipCpp->contains(a0);

            return PyBool_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_QTextFragment, sipName_contains, doc_QTextFragment_contains);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QTextFragment_charFormat, "charFormat(self) -> QTextCharFormat");

extern "C" {static PyObject *meth_QTextFragment_charFormat(PyObject *, PyObject *);}
static PyObject *meth_QTextFragment_charFormat(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = SIP_NULLPTR;

    {
        const  ::QTextFragment *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_QTextFragment, &sipCpp))
        {
             ::QTextCharFormat*sipRes;

            sipRes = new  ::QTextCharFormat(sipCpp->charFormat());

            return sipConvertFromNewType(sipRes,sipType_QTextCharFormat,SIP_NULLPTR);
        }
    }

    sipNoMethod(sipParseErr, sipName_QTextFragment, sipName_charFormat, doc_QTextFragment_charFormat);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QTextFragment_charFormatIndex, "charFormatIndex(self) -> int");

extern "C" {static PyObject *meth_QTextFragment_charFormatIndex(PyObject *, PyObject *);}
static PyObject *meth_QTextFragment_charFormatIndex(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = SIP_NULLPTR;

    {
        const  ::QTextFragment *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_QTextFragment, &sipCpp))
        {
            int sipRes;

            sipRes = sipCpp->charFormatIndex();

            return PyLong_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_QTextFragment, sipName_charFormatIndex, doc_QTextFragment_charFormatIndex);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QTextFragment_text, "text(self) -> str");

extern "C" {static PyObject *meth_QTextFragment_text(PyObject *, PyObject *);}
static PyObject *meth_QTextFragment_text(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = SIP_NULLPTR;

    {
        const  ::QTextFragment *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_QTextFragment, &sipCpp))
        {
             ::QString*sipRes;

            sipRes = new  ::QString(sipCpp->text());

            return sipConvertFromNewType(sipRes,sipType_QString,SIP_NULLPTR);
        }
    }

    sipNoMethod(sipParseErr, sipName_QTextFragment, sipName_text, doc_QTextFragment_text);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QTextFragment_glyphRuns, "glyphRuns(self, from_: int = -1, length: int = -1) -> List[QGlyphRun]");

extern "C" {static PyObject *meth_QTextFragment_glyphRuns(PyObject *, PyObject *, PyObject *);}
static PyObject *meth_QTextFragment_glyphRuns(PyObject *sipSelf, PyObject *sipArgs, PyObject *sipKwds)
{
    PyObject *sipParseErr = SIP_NULLPTR;

    {
        int a0 = -1;
        int a1 = -1;
        const  ::QTextFragment *sipCpp;

        static const char *sipKwdList[] = {
            sipName_from,
            sipName_length,
        };

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "B|ii", &sipSelf, sipType_QTextFragment, &sipCpp, &a0, &a1))
        {
            QList< ::QGlyphRun>*sipRes;

            sipRes = new QList< ::QGlyphRun>(sipCpp->glyphRuns(a0,a1));

            return sipConvertFromNewType(sipRes,sipType_QList_0100QGlyphRun,SIP_NULLPTR);
        }
    }

    sipNoMethod(sipParseErr, sipName_QTextFragment, sipName_glyphRuns, doc_QTextFragment_glyphRuns);

    return SIP_NULLPTR;
}


extern "C" {static PyObject *slot_QTextFragment___ge__(PyObject *,PyObject *);}
static PyObject *slot_QTextFragment___ge__(PyObject *sipSelf,PyObject *sipArg)
{
     ::QTextFragment *sipCpp = reinterpret_cast< ::QTextFragment *>(sipGetCppPtr((sipSimpleWrapper *)sipSelf,sipType_QTextFragment));

    if (!sipCpp)
        return SIP_NULLPTR;

    PyObject *sipParseErr = SIP_NULLPTR;

    {
        const  ::QTextFragment* a0;

        if (sipParseArgs(&sipParseErr, sipArg, "1J9", sipType_QTextFragment, &a0))
        {
            bool sipRes;

            sipRes = !sipCpp-> ::QTextFragment::operator<(*a0);

            return PyBool_FromLong(sipRes);
        }
    }

    Py_XDECREF(sipParseErr);

    if (sipParseErr == Py_None)
        return SIP_NULLPTR;

    return sipPySlotExtend(&sipModuleAPI_QtGui, ge_slot, sipType_QTextFragment, sipSelf, sipArg);
}


extern "C" {static PyObject *slot_QTextFragment___lt__(PyObject *,PyObject *);}
static PyObject *slot_QTextFragment___lt__(PyObject *sipSelf,PyObject *sipArg)
{
     ::QTextFragment *sipCpp = reinterpret_cast< ::QTextFragment *>(sipGetCppPtr((sipSimpleWrapper *)sipSelf,sipType_QTextFragment));

    if (!sipCpp)
        return SIP_NULLPTR;

    PyObject *sipParseErr = SIP_NULLPTR;

    {
        const  ::QTextFragment* a0;

        if (sipParseArgs(&sipParseErr, sipArg, "1J9", sipType_QTextFragment, &a0))
        {
            bool sipRes;

            sipRes = sipCpp-> ::QTextFragment::operator<(*a0);

            return PyBool_FromLong(sipRes);
        }
    }

    Py_XDECREF(sipParseErr);

    if (sipParseErr == Py_None)
        return SIP_NULLPTR;

    return sipPySlotExtend(&sipModuleAPI_QtGui, lt_slot, sipType_QTextFragment, sipSelf, sipArg);
}


extern "C" {static PyObject *slot_QTextFragment___ne__(PyObject *,PyObject *);}
static PyObject *slot_QTextFragment___ne__(PyObject *sipSelf,PyObject *sipArg)
{
     ::QTextFragment *sipCpp = reinterpret_cast< ::QTextFragment *>(sipGetCppPtr((sipSimpleWrapper *)sipSelf,sipType_QTextFragment));

    if (!sipCpp)
        return SIP_NULLPTR;

    PyObject *sipParseErr = SIP_NULLPTR;

    {
        const  ::QTextFragment* a0;

        if (sipParseArgs(&sipParseErr, sipArg, "1J9", sipType_QTextFragment, &a0))
        {
            bool sipRes;

            sipRes = sipCpp-> ::QTextFragment::operator!=(*a0);

            return PyBool_FromLong(sipRes);
        }
    }

    Py_XDECREF(sipParseErr);

    if (sipParseErr == Py_None)
        return SIP_NULLPTR;

    return sipPySlotExtend(&sipModuleAPI_QtGui, ne_slot, sipType_QTextFragment, sipSelf, sipArg);
}


extern "C" {static PyObject *slot_QTextFragment___eq__(PyObject *,PyObject *);}
static PyObject *slot_QTextFragment___eq__(PyObject *sipSelf,PyObject *sipArg)
{
     ::QTextFragment *sipCpp = reinterpret_cast< ::QTextFragment *>(sipGetCppPtr((sipSimpleWrapper *)sipSelf,sipType_QTextFragment));

    if (!sipCpp)
        return SIP_NULLPTR;

    PyObject *sipParseErr = SIP_NULLPTR;

    {
        const  ::QTextFragment* a0;

        if (sipParseArgs(&sipParseErr, sipArg, "1J9", sipType_QTextFragment, &a0))
        {
            bool sipRes;

            sipRes = sipCpp-> ::QTextFragment::operator==(*a0);

            return PyBool_FromLong(sipRes);
        }
    }

    Py_XDECREF(sipParseErr);

    if (sipParseErr == Py_None)
        return SIP_NULLPTR;

    return sipPySlotExtend(&sipModuleAPI_QtGui, eq_slot, sipType_QTextFragment, sipSelf, sipArg);
}


/* Call the instance's destructor. */
extern "C" {static void release_QTextFragment(void *, int);}
static void release_QTextFragment(void *sipCppV, int)
{
    delete reinterpret_cast< ::QTextFragment *>(sipCppV);
}


extern "C" {static void *array_QTextFragment(Py_ssize_t);}
static void *array_QTextFragment(Py_ssize_t sipNrElem)
{
    return new  ::QTextFragment[sipNrElem];
}


extern "C" {static void array_delete_QTextFragment(void *);}
static void array_delete_QTextFragment(void *sipCpp)
{
    delete[] reinterpret_cast< ::QTextFragment *>(sipCpp);
}


extern "C" {static void assign_QTextFragment(void *, Py_ssize_t, void *);}
static void assign_QTextFragment(void *sipDst, Py_ssize_t sipDstIdx, void *sipSrc)
{
    reinterpret_cast< ::QTextFragment *>(sipDst)[sipDstIdx] = *reinterpret_cast< ::QTextFragment *>(sipSrc);
}


extern "C" {static void *copy_QTextFragment(const void *, Py_ssize_t);}
static void *copy_QTextFragment(const void *sipSrc, Py_ssize_t sipSrcIdx)
{
    return new  ::QTextFragment(reinterpret_cast<const  ::QTextFragment *>(sipSrc)[sipSrcIdx]);
}


extern "C" {static void dealloc_QTextFragment(sipSimpleWrapper *);}
static void dealloc_QTextFragment(sipSimpleWrapper *sipSelf)
{
    if (sipIsOwnedByPython(sipSelf))
    {
        release_QTextFragment(sipGetAddress(sipSelf), 0);
    }
}


extern "C" {static void *init_type_QTextFragment(sipSimpleWrapper *, PyObject *, PyObject *, PyObject **, PyObject **, PyObject **);}
static void *init_type_QTextFragment(sipSimpleWrapper *, PyObject *sipArgs, PyObject *sipKwds, PyObject **sipUnused, PyObject **, PyObject **sipParseErr)
{
     ::QTextFragment *sipCpp = SIP_NULLPTR;

    {
        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, SIP_NULLPTR, sipUnused, ""))
        {
            sipCpp = new  ::QTextFragment();

            return sipCpp;
        }
    }

    {
        const  ::QTextFragment* a0;

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, SIP_NULLPTR, sipUnused, "J9", sipType_QTextFragment, &a0))
        {
            sipCpp = new  ::QTextFragment(*a0);

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


/* Define this type's Python slots. */
static sipPySlotDef slots_QTextFragment[] = {
    {(void *)slot_QTextFragment___ge__, ge_slot},
    {(void *)slot_QTextFragment___lt__, lt_slot},
    {(void *)slot_QTextFragment___ne__, ne_slot},
    {(void *)slot_QTextFragment___eq__, eq_slot},
    {0, (sipPySlotType)0}
};


static PyMethodDef methods_QTextFragment[] = {
    {sipName_charFormat, meth_QTextFragment_charFormat, METH_VARARGS, doc_QTextFragment_charFormat},
    {sipName_charFormatIndex, meth_QTextFragment_charFormatIndex, METH_VARARGS, doc_QTextFragment_charFormatIndex},
    {sipName_contains, meth_QTextFragment_contains, METH_VARARGS, doc_QTextFragment_contains},
    {sipName_glyphRuns, SIP_MLMETH_CAST(meth_QTextFragment_glyphRuns), METH_VARARGS|METH_KEYWORDS, doc_QTextFragment_glyphRuns},
    {sipName_isValid, meth_QTextFragment_isValid, METH_VARARGS, doc_QTextFragment_isValid},
    {sipName_length, meth_QTextFragment_length, METH_VARARGS, doc_QTextFragment_length},
    {sipName_position, meth_QTextFragment_position, METH_VARARGS, doc_QTextFragment_position},
    {sipName_text, meth_QTextFragment_text, METH_VARARGS, doc_QTextFragment_text}
};

PyDoc_STRVAR(doc_QTextFragment, "\1QTextFragment()\n"
"QTextFragment(QTextFragment)");


static pyqt5ClassPluginDef plugin_QTextFragment = {
    SIP_NULLPTR,
    0,
    SIP_NULLPTR,
    SIP_NULLPTR
};


sipClassTypeDef sipTypeDef_QtGui_QTextFragment = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_SUPER_INIT|SIP_TYPE_LIMITED_API|SIP_TYPE_CLASS,
        sipNameNr_QTextFragment,
        SIP_NULLPTR,
        &plugin_QTextFragment
    },
    {
        sipNameNr_QTextFragment,
        {0, 0, 1},
        8, methods_QTextFragment,
        0, SIP_NULLPTR,
        0, SIP_NULLPTR,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    },
    doc_QTextFragment,
    -1,
    sipNameNr_sip_simplewrapper,
    SIP_NULLPTR,
    slots_QTextFragment,
    init_type_QTextFragment,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    dealloc_QTextFragment,
    assign_QTextFragment,
    array_QTextFragment,
    copy_QTextFragment,
    release_QTextFragment,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    array_delete_QTextFragment,
    sizeof ( ::QTextFragment),
};
