/*
 * Interface wrapper code.
 *
 * Generated by SIP 6.14.0
 *
 * Copyright (c) 2024 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 26 "/build/pyqt5/src/PyQt5-5.15.11/sip/QtGui/qtextobject.sip"
#include <qtextobject.h>
#line 29 "/build/pyqt5/src/PyQt5-5.15.11/build/QtGui/sipQtGuiQTextObject.cpp"

#line 36 "/build/pyqt5/src/PyQt5-5.15.11/sip/QtGui/qtextdocument.sip"
#include <qtextdocument.h>
#line 33 "/build/pyqt5/src/PyQt5-5.15.11/build/QtGui/sipQtGuiQTextObject.cpp"
#line 59 "/build/pyqt5/src/PyQt5-5.15.11/sip/QtGui/qtextformat.sip"
#include <qtextformat.h>
#line 36 "/build/pyqt5/src/PyQt5-5.15.11/build/QtGui/sipQtGuiQTextObject.cpp"
#line 26 "/build/pyqt5/src/PyQt5-5.15.11/sip/QtCore/qobjectdefs.sip"
#include <qobjectdefs.h>
#line 146 "/build/pyqt5/src/PyQt5-5.15.11/sip/QtCore/qobjectdefs.sip"
#include <qobjectdefs.h>
#line 41 "/build/pyqt5/src/PyQt5-5.15.11/build/QtGui/sipQtGuiQTextObject.cpp"
#line 26 "/build/pyqt5/src/PyQt5-5.15.11/sip/QtCore/qmetaobject.sip"
#include <qmetaobject.h>
#line 44 "/build/pyqt5/src/PyQt5-5.15.11/build/QtGui/sipQtGuiQTextObject.cpp"
#line 26 "/build/pyqt5/src/PyQt5-5.15.11/sip/QtCore/qcoreevent.sip"
#include <qcoreevent.h>
#line 47 "/build/pyqt5/src/PyQt5-5.15.11/build/QtGui/sipQtGuiQTextObject.cpp"
#line 252 "/build/pyqt5/src/PyQt5-5.15.11/sip/QtCore/qcoreevent.sip"
#include <qcoreevent.h>
#line 50 "/build/pyqt5/src/PyQt5-5.15.11/build/QtGui/sipQtGuiQTextObject.cpp"
#line 240 "/build/pyqt5/src/PyQt5-5.15.11/sip/QtCore/qcoreevent.sip"
#include <qcoreevent.h>
#line 53 "/build/pyqt5/src/PyQt5-5.15.11/build/QtGui/sipQtGuiQTextObject.cpp"
#line 28 "/build/pyqt5/src/PyQt5-5.15.11/sip/QtCore/qobject.sip"
#include <qobject.h>
#line 56 "/build/pyqt5/src/PyQt5-5.15.11/build/QtGui/sipQtGuiQTextObject.cpp"
#line 27 "/build/pyqt5/src/PyQt5-5.15.11/sip/QtCore/qstring.sip"
#include <qstring.h>
#line 59 "/build/pyqt5/src/PyQt5-5.15.11/build/QtGui/sipQtGuiQTextObject.cpp"
#line 26 "/build/pyqt5/src/PyQt5-5.15.11/sip/QtCore/qvariant.sip"
#include <qvariant.h>
#line 62 "/build/pyqt5/src/PyQt5-5.15.11/build/QtGui/sipQtGuiQTextObject.cpp"
#line 38 "/build/pyqt5/src/PyQt5-5.15.11/sip/QtCore/qpycore_qlist.sip"
#include <qlist.h>
#line 65 "/build/pyqt5/src/PyQt5-5.15.11/build/QtGui/sipQtGuiQTextObject.cpp"
#line 30 "/build/pyqt5/src/PyQt5-5.15.11/sip/QtCore/qbytearray.sip"
#include <qbytearray.h>
#line 68 "/build/pyqt5/src/PyQt5-5.15.11/build/QtGui/sipQtGuiQTextObject.cpp"
#line 149 "/build/pyqt5/src/PyQt5-5.15.11/sip/QtCore/qpycore_qlist.sip"
#include <qlist.h>
#line 71 "/build/pyqt5/src/PyQt5-5.15.11/build/QtGui/sipQtGuiQTextObject.cpp"
#line 26 "/build/pyqt5/src/PyQt5-5.15.11/sip/QtCore/qnamespace.sip"
#include <qnamespace.h>
#line 74 "/build/pyqt5/src/PyQt5-5.15.11/build/QtGui/sipQtGuiQTextObject.cpp"
#line 26 "/build/pyqt5/src/PyQt5-5.15.11/sip/QtCore/qthread.sip"
#include <qthread.h>
#line 77 "/build/pyqt5/src/PyQt5-5.15.11/build/QtGui/sipQtGuiQTextObject.cpp"
#line 26 "/build/pyqt5/src/PyQt5-5.15.11/sip/QtCore/qnamespace.sip"
#include <qnamespace.h>
#line 80 "/build/pyqt5/src/PyQt5-5.15.11/build/QtGui/sipQtGuiQTextObject.cpp"
#line 26 "/build/pyqt5/src/PyQt5-5.15.11/sip/QtCore/qregexp.sip"
#include <qregexp.h>
#line 83 "/build/pyqt5/src/PyQt5-5.15.11/build/QtGui/sipQtGuiQTextObject.cpp"
#line 26 "/build/pyqt5/src/PyQt5-5.15.11/sip/QtCore/qregularexpression.sip"
#include <qregularexpression.h>
#line 86 "/build/pyqt5/src/PyQt5-5.15.11/build/QtGui/sipQtGuiQTextObject.cpp"
#line 26 "/build/pyqt5/src/PyQt5-5.15.11/sip/QtCore/qobjectdefs.sip"
#include <qobjectdefs.h>
#line 89 "/build/pyqt5/src/PyQt5-5.15.11/build/QtGui/sipQtGuiQTextObject.cpp"


class sipQTextObject : public ::QTextObject
{
public:
    sipQTextObject(::QTextDocument*);
    virtual ~sipQTextObject();

    int qt_metacall(QMetaObject::Call, int, void **) SIP_OVERRIDE;
    void *qt_metacast(const char *) SIP_OVERRIDE;
    const QMetaObject *metaObject() const SIP_OVERRIDE;

    /*
     * There is a protected method for every virtual method visible from
     * this class.
     */
protected:
    bool event(::QEvent*) SIP_OVERRIDE;
    bool eventFilter(::QObject*, ::QEvent*) SIP_OVERRIDE;
    void timerEvent(::QTimerEvent*) SIP_OVERRIDE;
    void childEvent(::QChildEvent*) SIP_OVERRIDE;
    void customEvent(::QEvent*) SIP_OVERRIDE;
    void connectNotify(const ::QMetaMethod&) SIP_OVERRIDE;
    void disconnectNotify(const ::QMetaMethod&) SIP_OVERRIDE;

public:
    sipSimpleWrapper *sipPySelf;

private:
    sipQTextObject(const sipQTextObject &);
    sipQTextObject &operator = (const sipQTextObject &);

    char sipPyMethods[7];
};

sipQTextObject::sipQTextObject(::QTextDocument*a0): ::QTextObject(a0), sipPySelf(SIP_NULLPTR)
{
    memset(sipPyMethods, 0, sizeof (sipPyMethods));
}

sipQTextObject::~sipQTextObject()
{
    sipInstanceDestroyedEx(&sipPySelf);
}

const QMetaObject *sipQTextObject::metaObject() const
{
    if (sipGetInterpreter())
        return QObject::d_ptr->metaObject ? QObject::d_ptr->dynamicMetaObject() : sip_QtGui_qt_metaobject(sipPySelf, sipType_QTextObject);

    return ::QTextObject::metaObject();
}

int sipQTextObject::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = ::QTextObject::qt_metacall(_c, _id, _a);

    if (_id >= 0)
    {
        SIP_BLOCK_THREADS
        _id = sip_QtGui_qt_metacall(sipPySelf, sipType_QTextObject, _c, _id, _a);
        SIP_UNBLOCK_THREADS
    }

    return _id;
}

void *sipQTextObject::qt_metacast(const char *_clname)
{
    void *sipCpp;

    return (sip_QtGui_qt_metacast(sipPySelf, sipType_QTextObject, _clname, &sipCpp) ? sipCpp : ::QTextObject::qt_metacast(_clname));
}

bool sipQTextObject::event(::QEvent*a0)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, &sipPyMethods[0], &sipPySelf, SIP_NULLPTR, sipName_event);

    if (!sipMeth)
        return ::QTextObject::event(a0);

    extern bool sipVH_QtGui_5(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, ::QEvent*);

    return sipVH_QtGui_5(sipGILState, sipImportedVirtErrorHandlers_QtGui_QtCore[0].iveh_handler, sipPySelf, sipMeth, a0);
}

bool sipQTextObject::eventFilter(::QObject*a0, ::QEvent*a1)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, &sipPyMethods[1], &sipPySelf, SIP_NULLPTR, sipName_eventFilter);

    if (!sipMeth)
        return ::QTextObject::eventFilter(a0, a1);

    extern bool sipVH_QtGui_4(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, ::QObject*, ::QEvent*);

    return sipVH_QtGui_4(sipGILState, sipImportedVirtErrorHandlers_QtGui_QtCore[0].iveh_handler, sipPySelf, sipMeth, a0, a1);
}

void sipQTextObject::timerEvent(::QTimerEvent*a0)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, &sipPyMethods[2], &sipPySelf, SIP_NULLPTR, sipName_timerEvent);

    if (!sipMeth)
    {
        ::QTextObject::timerEvent(a0);
        return;
    }

    extern void sipVH_QtGui_3(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, ::QTimerEvent*);

    sipVH_QtGui_3(sipGILState, sipImportedVirtErrorHandlers_QtGui_QtCore[0].iveh_handler, sipPySelf, sipMeth, a0);
}

void sipQTextObject::childEvent(::QChildEvent*a0)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, &sipPyMethods[3], &sipPySelf, SIP_NULLPTR, sipName_childEvent);

    if (!sipMeth)
    {
        ::QTextObject::childEvent(a0);
        return;
    }

    extern void sipVH_QtGui_2(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, ::QChildEvent*);

    sipVH_QtGui_2(sipGILState, sipImportedVirtErrorHandlers_QtGui_QtCore[0].iveh_handler, sipPySelf, sipMeth, a0);
}

void sipQTextObject::customEvent(::QEvent*a0)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, &sipPyMethods[4], &sipPySelf, SIP_NULLPTR, sipName_customEvent);

    if (!sipMeth)
    {
        ::QTextObject::customEvent(a0);
        return;
    }

    extern void sipVH_QtGui_1(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, ::QEvent*);

    sipVH_QtGui_1(sipGILState, sipImportedVirtErrorHandlers_QtGui_QtCore[0].iveh_handler, sipPySelf, sipMeth, a0);
}

void sipQTextObject::connectNotify(const ::QMetaMethod& a0)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, &sipPyMethods[5], &sipPySelf, SIP_NULLPTR, sipName_connectNotify);

    if (!sipMeth)
    {
        ::QTextObject::connectNotify(a0);
        return;
    }

    extern void sipVH_QtGui_0(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, const ::QMetaMethod&);

    sipVH_QtGui_0(sipGILState, sipImportedVirtErrorHandlers_QtGui_QtCore[0].iveh_handler, sipPySelf, sipMeth, a0);
}

void sipQTextObject::disconnectNotify(const ::QMetaMethod& a0)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, &sipPyMethods[6], &sipPySelf, SIP_NULLPTR, sipName_disconnectNotify);

    if (!sipMeth)
    {
        ::QTextObject::disconnectNotify(a0);
        return;
    }

    extern void sipVH_QtGui_0(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, const ::QMetaMethod&);

    sipVH_QtGui_0(sipGILState, sipImportedVirtErrorHandlers_QtGui_QtCore[0].iveh_handler, sipPySelf, sipMeth, a0);
}


PyDoc_STRVAR(doc_QTextObject_setFormat, "setFormat(self, format: QTextFormat)");

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

    {
        const ::QTextFormat* a0;
        ::QTextObject *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "pJ9", &sipSelf, sipType_QTextObject, &sipCpp, sipType_QTextFormat, &a0))
        {
            sipCpp->setFormat(*a0);

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_QTextObject, sipName_setFormat, doc_QTextObject_setFormat);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QTextObject_format, "format(self) -> QTextFormat");

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

    {
        const ::QTextObject *sipCpp;

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

            sipRes = new ::QTextFormat(sipCpp->format());

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

    sipNoMethod(sipParseErr, sipName_QTextObject, sipName_format, doc_QTextObject_format);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QTextObject_formatIndex, "formatIndex(self) -> int");

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

    {
        const ::QTextObject *sipCpp;

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

            sipRes = sipCpp->formatIndex();

            return PyLong_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_QTextObject, sipName_formatIndex, doc_QTextObject_formatIndex);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QTextObject_document, "document(self) -> Optional[QTextDocument]");

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

    {
        const ::QTextObject *sipCpp;

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

            sipRes = sipCpp->document();

            return sipConvertFromType(sipRes, sipType_QTextDocument, SIP_NULLPTR);
        }
    }

    sipNoMethod(sipParseErr, sipName_QTextObject, sipName_document, doc_QTextObject_document);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QTextObject_objectIndex, "objectIndex(self) -> int");

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

    {
        const ::QTextObject *sipCpp;

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

            sipRes = sipCpp->objectIndex();

            return PyLong_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_QTextObject, sipName_objectIndex, doc_QTextObject_objectIndex);

    return SIP_NULLPTR;
}


/* Cast a pointer to a type somewhere in its inheritance hierarchy. */
extern "C" {static void *cast_QTextObject(void *, const sipTypeDef *);}
static void *cast_QTextObject(void *sipCppV, const sipTypeDef *targetType)
{
    ::QTextObject *sipCpp = reinterpret_cast< ::QTextObject *>(sipCppV);

    if (targetType == sipType_QTextObject)
        return sipCppV;

    if (targetType == sipType_QObject)
        return static_cast< ::QObject *>(sipCpp);

    return SIP_NULLPTR;
}


/* Call the instance's destructor. */
extern "C" {static void release_QTextObject(void *, int);}
static void release_QTextObject(void *sipCppV, int sipState)
{
    if (sipState & SIP_DERIVED_CLASS)
        delete reinterpret_cast<sipQTextObject *>(sipCppV);
}


extern "C" {static void dealloc_QTextObject(sipSimpleWrapper *);}
static void dealloc_QTextObject(sipSimpleWrapper *sipSelf)
{
    if (sipIsDerivedClass(sipSelf))
        reinterpret_cast<sipQTextObject *>(sipGetAddress(sipSelf))->sipPySelf = SIP_NULLPTR;

    if (sipIsOwnedByPython(sipSelf))
    {
        release_QTextObject(sipGetAddress(sipSelf), sipIsDerivedClass(sipSelf));
    }
}


extern "C" {static void *init_type_QTextObject(sipSimpleWrapper *, PyObject *, PyObject *, PyObject **, PyObject **, PyObject **);}
static void *init_type_QTextObject(sipSimpleWrapper *sipSelf, PyObject *sipArgs, PyObject *sipKwds, PyObject **sipUnused, PyObject **, PyObject **sipParseErr)
{
    sipQTextObject *sipCpp = SIP_NULLPTR;

    {
        ::QTextDocument* a0;

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, SIP_NULLPTR, sipUnused, "J8", sipType_QTextDocument, &a0))
        {
            sipCpp = new sipQTextObject(a0);

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


/* Define this type's super-types. */
static sipEncodedTypeDef supers_QTextObject[] = {{25, 0, 1}};


static PyMethodDef methods_QTextObject[] = {
    {sipName_document, meth_QTextObject_document, METH_VARARGS, doc_QTextObject_document},
    {sipName_format, meth_QTextObject_format, METH_VARARGS, doc_QTextObject_format},
    {sipName_formatIndex, meth_QTextObject_formatIndex, METH_VARARGS, doc_QTextObject_formatIndex},
    {sipName_objectIndex, meth_QTextObject_objectIndex, METH_VARARGS, doc_QTextObject_objectIndex},
    {sipName_setFormat, meth_QTextObject_setFormat, METH_VARARGS, doc_QTextObject_setFormat}
};

PyDoc_STRVAR(doc_QTextObject, "\1QTextObject(doc: Optional[QTextDocument])");


static pyqt5ClassPluginDef plugin_QTextObject = {
    &::QTextObject::staticMetaObject,
    0,
    SIP_NULLPTR,
    SIP_NULLPTR
};


sipClassTypeDef sipTypeDef_QtGui_QTextObject = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_SCC|SIP_TYPE_SUPER_INIT|SIP_TYPE_LIMITED_API|SIP_TYPE_CLASS,
        sipNameNr_QTextObject,
        SIP_NULLPTR,
        &plugin_QTextObject,
    },
    {
        sipNameNr_QTextObject,
        {0, 0, 1},
        5, methods_QTextObject,
        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_QTextObject,
    -1,
    -1,
    supers_QTextObject,
    SIP_NULLPTR,
    init_type_QTextObject,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    dealloc_QTextObject,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    release_QTextObject,
    cast_QTextObject,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    sizeof (::QTextObject),
};
