/*
 * 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 26 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtWidgets/qundostack.sip"
#include <qundostack.h>
#line 29 "/build/pyqt5/src/PyQt5-5.15.7/build/QtWidgets/sipQtWidgetsQUndoCommand.cpp"

#line 27 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtCore/qstring.sip"
#include <qstring.h>
#line 33 "/build/pyqt5/src/PyQt5-5.15.7/build/QtWidgets/sipQtWidgetsQUndoCommand.cpp"


class sipQUndoCommand : public  ::QUndoCommand
{
public:
    sipQUndoCommand( ::QUndoCommand*);
    sipQUndoCommand(const  ::QString&, ::QUndoCommand*);
    virtual ~sipQUndoCommand();

    /*
     * There is a protected method for every virtual method visible from
     * this class.
     */
protected:
    void undo() SIP_OVERRIDE;
    void redo() SIP_OVERRIDE;
    bool mergeWith(const  ::QUndoCommand*) SIP_OVERRIDE;
    int id() const SIP_OVERRIDE;

public:
    sipSimpleWrapper *sipPySelf;

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

    char sipPyMethods[4];
};

sipQUndoCommand::sipQUndoCommand( ::QUndoCommand*a0):  ::QUndoCommand(a0), sipPySelf(SIP_NULLPTR)
{
    memset(sipPyMethods, 0, sizeof (sipPyMethods));
}

sipQUndoCommand::sipQUndoCommand(const  ::QString& a0, ::QUndoCommand*a1):  ::QUndoCommand(a0,a1), sipPySelf(SIP_NULLPTR)
{
    memset(sipPyMethods, 0, sizeof (sipPyMethods));
}

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

void sipQUndoCommand::undo()
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

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

    if (!sipMeth)
    {
         ::QUndoCommand::undo();
        return;
    }

    extern void sipVH_QtWidgets_37(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *);

    sipVH_QtWidgets_37(sipGILState, sipImportedVirtErrorHandlers_QtWidgets_QtCore[0].iveh_handler, sipPySelf, sipMeth);
}

void sipQUndoCommand::redo()
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

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

    if (!sipMeth)
    {
         ::QUndoCommand::redo();
        return;
    }

    extern void sipVH_QtWidgets_37(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *);

    sipVH_QtWidgets_37(sipGILState, sipImportedVirtErrorHandlers_QtWidgets_QtCore[0].iveh_handler, sipPySelf, sipMeth);
}

bool sipQUndoCommand::mergeWith(const  ::QUndoCommand*a0)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

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

    if (!sipMeth)
        return  ::QUndoCommand::mergeWith(a0);

    extern bool sipVH_QtWidgets_215(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, const  ::QUndoCommand*);

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

int sipQUndoCommand::id() const
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

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

    if (!sipMeth)
        return  ::QUndoCommand::id();

    extern int sipVH_QtWidgets_8(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *);

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


PyDoc_STRVAR(doc_QUndoCommand_id, "id(self) -> int");

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

    {
        const  ::QUndoCommand *sipCpp;

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

            sipRes = (sipSelfWasArg ? sipCpp-> ::QUndoCommand::id() : sipCpp->id());

            return PyLong_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_QUndoCommand, sipName_id, doc_QUndoCommand_id);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QUndoCommand_mergeWith, "mergeWith(self, QUndoCommand) -> bool");

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

    {
        const  ::QUndoCommand* a0;
         ::QUndoCommand *sipCpp;

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

            sipRes = (sipSelfWasArg ? sipCpp-> ::QUndoCommand::mergeWith(a0) : sipCpp->mergeWith(a0));

            return PyBool_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_QUndoCommand, sipName_mergeWith, doc_QUndoCommand_mergeWith);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QUndoCommand_redo, "redo(self)");

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

    {
         ::QUndoCommand *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_QUndoCommand, &sipCpp))
        {
            (sipSelfWasArg ? sipCpp-> ::QUndoCommand::redo() : sipCpp->redo());

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_QUndoCommand, sipName_redo, doc_QUndoCommand_redo);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QUndoCommand_setText, "setText(self, str)");

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

    {
        const  ::QString* a0;
        int a0State = 0;
         ::QUndoCommand *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "BJ1", &sipSelf, sipType_QUndoCommand, &sipCpp, sipType_QString, &a0, &a0State))
        {
            sipCpp->setText(*a0);
            sipReleaseType(const_cast< ::QString *>(a0), sipType_QString, a0State);

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_QUndoCommand, sipName_setText, doc_QUndoCommand_setText);

    return SIP_NULLPTR;
}


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

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

    {
        const  ::QUndoCommand *sipCpp;

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

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

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

    sipNoMethod(sipParseErr, sipName_QUndoCommand, sipName_text, doc_QUndoCommand_text);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QUndoCommand_undo, "undo(self)");

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

    {
         ::QUndoCommand *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_QUndoCommand, &sipCpp))
        {
            (sipSelfWasArg ? sipCpp-> ::QUndoCommand::undo() : sipCpp->undo());

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_QUndoCommand, sipName_undo, doc_QUndoCommand_undo);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QUndoCommand_childCount, "childCount(self) -> int");

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

    {
        const  ::QUndoCommand *sipCpp;

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

            sipRes = sipCpp->childCount();

            return PyLong_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_QUndoCommand, sipName_childCount, doc_QUndoCommand_childCount);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QUndoCommand_child, "child(self, int) -> QUndoCommand");

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

    {
        int a0;
        const  ::QUndoCommand *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "Bi", &sipSelf, sipType_QUndoCommand, &sipCpp, &a0))
        {
            const  ::QUndoCommand*sipRes;

            sipRes = sipCpp->child(a0);

            return sipConvertFromType(const_cast< ::QUndoCommand *>(sipRes),sipType_QUndoCommand,SIP_NULLPTR);
        }
    }

    sipNoMethod(sipParseErr, sipName_QUndoCommand, sipName_child, doc_QUndoCommand_child);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QUndoCommand_actionText, "actionText(self) -> str");

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

    {
        const  ::QUndoCommand *sipCpp;

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

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

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

    sipNoMethod(sipParseErr, sipName_QUndoCommand, sipName_actionText, doc_QUndoCommand_actionText);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QUndoCommand_isObsolete, "isObsolete(self) -> bool");

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

    {
        const  ::QUndoCommand *sipCpp;

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

            sipRes = sipCpp->isObsolete();

            return PyBool_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_QUndoCommand, sipName_isObsolete, doc_QUndoCommand_isObsolete);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QUndoCommand_setObsolete, "setObsolete(self, bool)");

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

    {
        bool a0;
         ::QUndoCommand *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "Bb", &sipSelf, sipType_QUndoCommand, &sipCpp, &a0))
        {
            sipCpp->setObsolete(a0);

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    sipNoMethod(sipParseErr, sipName_QUndoCommand, sipName_setObsolete, doc_QUndoCommand_setObsolete);

    return SIP_NULLPTR;
}


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


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


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


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

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


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

    {
         ::QUndoCommand* a0 = 0;

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

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "|JH", sipType_QUndoCommand, &a0, sipOwner))
        {
            sipCpp = new sipQUndoCommand(a0);

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    {
        const  ::QString* a0;
        int a0State = 0;
         ::QUndoCommand* a1 = 0;

        static const char *sipKwdList[] = {
            SIP_NULLPTR,
            sipName_parent,
        };

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, sipKwdList, sipUnused, "J1|JH", sipType_QString, &a0, &a0State, sipType_QUndoCommand, &a1, sipOwner))
        {
            sipCpp = new sipQUndoCommand(*a0,a1);
            sipReleaseType(const_cast< ::QString *>(a0), sipType_QString, a0State);

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


static PyMethodDef methods_QUndoCommand[] = {
    {sipName_actionText, meth_QUndoCommand_actionText, METH_VARARGS, doc_QUndoCommand_actionText},
    {sipName_child, meth_QUndoCommand_child, METH_VARARGS, doc_QUndoCommand_child},
    {sipName_childCount, meth_QUndoCommand_childCount, METH_VARARGS, doc_QUndoCommand_childCount},
    {sipName_id, meth_QUndoCommand_id, METH_VARARGS, doc_QUndoCommand_id},
    {sipName_isObsolete, meth_QUndoCommand_isObsolete, METH_VARARGS, doc_QUndoCommand_isObsolete},
    {sipName_mergeWith, meth_QUndoCommand_mergeWith, METH_VARARGS, doc_QUndoCommand_mergeWith},
    {sipName_redo, meth_QUndoCommand_redo, METH_VARARGS, doc_QUndoCommand_redo},
    {sipName_setObsolete, meth_QUndoCommand_setObsolete, METH_VARARGS, doc_QUndoCommand_setObsolete},
    {sipName_setText, meth_QUndoCommand_setText, METH_VARARGS, doc_QUndoCommand_setText},
    {sipName_text, meth_QUndoCommand_text, METH_VARARGS, doc_QUndoCommand_text},
    {sipName_undo, meth_QUndoCommand_undo, METH_VARARGS, doc_QUndoCommand_undo}
};

PyDoc_STRVAR(doc_QUndoCommand, "\1QUndoCommand(parent: QUndoCommand = None)\n"
"QUndoCommand(str, parent: QUndoCommand = None)");


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


sipClassTypeDef sipTypeDef_QtWidgets_QUndoCommand = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_SUPER_INIT|SIP_TYPE_LIMITED_API|SIP_TYPE_CLASS,
        sipNameNr_QUndoCommand,
        SIP_NULLPTR,
        &plugin_QUndoCommand
    },
    {
        sipNameNr_QUndoCommand,
        {0, 0, 1},
        11, methods_QUndoCommand,
        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_QUndoCommand,
    -1,
    -1,
    SIP_NULLPTR,
    SIP_NULLPTR,
    init_type_QUndoCommand,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    dealloc_QUndoCommand,
    SIP_NULLPTR,
    array_QUndoCommand,
    SIP_NULLPTR,
    release_QUndoCommand,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    array_delete_QUndoCommand,
    sizeof ( ::QUndoCommand),
};
