/*
 * 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 "sipAPIQtWidgets.h"

#line 38 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtWidgets/qitemeditorfactory.sip"
#include <qitemeditorfactory.h>
#line 29 "/build/pyqt5/src/PyQt5-5.15.7/build/QtWidgets/sipQtWidgetsQItemEditorFactory.cpp"

#line 26 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtWidgets/qitemeditorfactory.sip"
#include <qitemeditorfactory.h>
#line 33 "/build/pyqt5/src/PyQt5-5.15.7/build/QtWidgets/sipQtWidgetsQItemEditorFactory.cpp"
#line 30 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtCore/qbytearray.sip"
#include <qbytearray.h>
#line 36 "/build/pyqt5/src/PyQt5-5.15.7/build/QtWidgets/sipQtWidgetsQItemEditorFactory.cpp"
#line 28 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtWidgets/qwidget.sip"
#include <qwidget.h>
#line 39 "/build/pyqt5/src/PyQt5-5.15.7/build/QtWidgets/sipQtWidgetsQItemEditorFactory.cpp"


class sipQItemEditorFactory : public  ::QItemEditorFactory
{
public:
    sipQItemEditorFactory();
    sipQItemEditorFactory(const  ::QItemEditorFactory&);
    virtual ~sipQItemEditorFactory();

    /*
     * There is a protected method for every virtual method visible from
     * this class.
     */
protected:
     ::QByteArray valuePropertyName(int) const SIP_OVERRIDE;
     ::QWidget* createEditor(int, ::QWidget*) const SIP_OVERRIDE;

public:
    sipSimpleWrapper *sipPySelf;

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

    char sipPyMethods[2];
};

sipQItemEditorFactory::sipQItemEditorFactory():  ::QItemEditorFactory(), sipPySelf(SIP_NULLPTR)
{
    memset(sipPyMethods, 0, sizeof (sipPyMethods));
}

sipQItemEditorFactory::sipQItemEditorFactory(const  ::QItemEditorFactory& a0):  ::QItemEditorFactory(a0), sipPySelf(SIP_NULLPTR)
{
    memset(sipPyMethods, 0, sizeof (sipPyMethods));
}

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

 ::QByteArray sipQItemEditorFactory::valuePropertyName(int a0) const
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, const_cast<char *>(&sipPyMethods[0]), const_cast<sipSimpleWrapper **>(&sipPySelf), SIP_NULLPTR, sipName_valuePropertyName);

    if (!sipMeth)
        return  ::QItemEditorFactory::valuePropertyName(a0);

    extern  ::QByteArray sipVH_QtWidgets_174(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, int);

    return sipVH_QtWidgets_174(sipGILState, sipImportedVirtErrorHandlers_QtWidgets_QtCore[0].iveh_handler, sipPySelf, sipMeth, a0);
}

 ::QWidget* sipQItemEditorFactory::createEditor(int a0, ::QWidget*a1) const
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState, const_cast<char *>(&sipPyMethods[1]), const_cast<sipSimpleWrapper **>(&sipPySelf), SIP_NULLPTR, sipName_createEditor);

    if (!sipMeth)
        return  ::QItemEditorFactory::createEditor(a0,a1);

    extern  ::QWidget* sipVH_QtWidgets_173(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, int, ::QWidget*);

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


PyDoc_STRVAR(doc_QItemEditorFactory_createEditor, "createEditor(self, int, QWidget) -> QWidget");

extern "C" {static PyObject *meth_QItemEditorFactory_createEditor(PyObject *, PyObject *);}
static PyObject *meth_QItemEditorFactory_createEditor(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = SIP_NULLPTR;
    bool sipSelfWasArg = (!sipSelf || sipIsDerivedClass((sipSimpleWrapper *)sipSelf));

    {
        int a0;
         ::QWidget* a1;
        sipWrapper *sipOwner = SIP_NULLPTR;
        const  ::QItemEditorFactory *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "BiJH", &sipSelf, sipType_QItemEditorFactory, &sipCpp, &a0, sipType_QWidget, &a1, &sipOwner))
        {
             ::QWidget*sipRes;

            sipRes = (sipSelfWasArg ? sipCpp-> ::QItemEditorFactory::createEditor(a0,a1) : sipCpp->createEditor(a0,a1));

            if (sipOwner)
                sipTransferTo(sipSelf, (PyObject *)sipOwner);
            else
                sipTransferBack(sipSelf);

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

    sipNoMethod(sipParseErr, sipName_QItemEditorFactory, sipName_createEditor, doc_QItemEditorFactory_createEditor);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QItemEditorFactory_valuePropertyName, "valuePropertyName(self, int) -> QByteArray");

extern "C" {static PyObject *meth_QItemEditorFactory_valuePropertyName(PyObject *, PyObject *);}
static PyObject *meth_QItemEditorFactory_valuePropertyName(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = SIP_NULLPTR;
    bool sipSelfWasArg = (!sipSelf || sipIsDerivedClass((sipSimpleWrapper *)sipSelf));

    {
        int a0;
        const  ::QItemEditorFactory *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "Bi", &sipSelf, sipType_QItemEditorFactory, &sipCpp, &a0))
        {
             ::QByteArray*sipRes;

            sipRes = new  ::QByteArray((sipSelfWasArg ? sipCpp-> ::QItemEditorFactory::valuePropertyName(a0) : sipCpp->valuePropertyName(a0)));

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

    sipNoMethod(sipParseErr, sipName_QItemEditorFactory, sipName_valuePropertyName, doc_QItemEditorFactory_valuePropertyName);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QItemEditorFactory_registerEditor, "registerEditor(self, int, QItemEditorCreatorBase)");

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

    {
        int a0;
         ::QItemEditorCreatorBase* a1;
         ::QItemEditorFactory *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "BiJ:", &sipSelf, sipType_QItemEditorFactory, &sipCpp, &a0, sipType_QItemEditorCreatorBase, &a1))
        {
            sipCpp->registerEditor(a0,a1);

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_QItemEditorFactory, sipName_registerEditor, doc_QItemEditorFactory_registerEditor);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QItemEditorFactory_defaultFactory, "defaultFactory() -> QItemEditorFactory");

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

    {
        if (sipParseArgs(&sipParseErr, sipArgs, ""))
        {
            const  ::QItemEditorFactory*sipRes;

            sipRes =  ::QItemEditorFactory::defaultFactory();

            return sipConvertFromType(const_cast< ::QItemEditorFactory *>(sipRes),sipType_QItemEditorFactory,SIP_NULLPTR);
        }
    }

    sipNoMethod(sipParseErr, sipName_QItemEditorFactory, sipName_defaultFactory, doc_QItemEditorFactory_defaultFactory);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QItemEditorFactory_setDefaultFactory, "setDefaultFactory(QItemEditorFactory)");

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

    {
         ::QItemEditorFactory* a0;

        if (sipParseArgs(&sipParseErr, sipArgs, "J:", sipType_QItemEditorFactory, &a0))
        {
             ::QItemEditorFactory::setDefaultFactory(a0);

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_QItemEditorFactory, sipName_setDefaultFactory, doc_QItemEditorFactory_setDefaultFactory);

    return SIP_NULLPTR;
}


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


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


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


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


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


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

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


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

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    {
        const  ::QItemEditorFactory* a0;

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


static PyMethodDef methods_QItemEditorFactory[] = {
    {sipName_createEditor, meth_QItemEditorFactory_createEditor, METH_VARARGS, doc_QItemEditorFactory_createEditor},
    {sipName_defaultFactory, meth_QItemEditorFactory_defaultFactory, METH_VARARGS, doc_QItemEditorFactory_defaultFactory},
    {sipName_registerEditor, meth_QItemEditorFactory_registerEditor, METH_VARARGS, doc_QItemEditorFactory_registerEditor},
    {sipName_setDefaultFactory, meth_QItemEditorFactory_setDefaultFactory, METH_VARARGS, doc_QItemEditorFactory_setDefaultFactory},
    {sipName_valuePropertyName, meth_QItemEditorFactory_valuePropertyName, METH_VARARGS, doc_QItemEditorFactory_valuePropertyName}
};

PyDoc_STRVAR(doc_QItemEditorFactory, "\1QItemEditorFactory()\n"
"QItemEditorFactory(QItemEditorFactory)");


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


sipClassTypeDef sipTypeDef_QtWidgets_QItemEditorFactory = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_SUPER_INIT|SIP_TYPE_LIMITED_API|SIP_TYPE_CLASS,
        sipNameNr_QItemEditorFactory,
        SIP_NULLPTR,
        &plugin_QItemEditorFactory
    },
    {
        sipNameNr_QItemEditorFactory,
        {0, 0, 1},
        5, methods_QItemEditorFactory,
        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_QItemEditorFactory,
    -1,
    -1,
    SIP_NULLPTR,
    SIP_NULLPTR,
    init_type_QItemEditorFactory,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    dealloc_QItemEditorFactory,
    assign_QItemEditorFactory,
    array_QItemEditorFactory,
    copy_QItemEditorFactory,
    release_QItemEditorFactory,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    array_delete_QItemEditorFactory,
    sizeof ( ::QItemEditorFactory),
};
