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

#line 142 "/build/pyqt5/src/PyQt5-5.15.11/sip/QtCore/qmetaobject.sip"
#include <qmetaobject.h>
#line 29 "/build/pyqt5/src/PyQt5-5.15.11/build/QtCore/sipQtCoreQMetaEnum.cpp"

#line 30 "/build/pyqt5/src/PyQt5-5.15.11/sip/QtCore/qbytearray.sip"
#include <qbytearray.h>
#line 33 "/build/pyqt5/src/PyQt5-5.15.11/build/QtCore/sipQtCoreQMetaEnum.cpp"


PyDoc_STRVAR(doc_QMetaEnum_name, "name(self) -> Optional[str]");

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

    {
        const ::QMetaEnum *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_QMetaEnum, &sipCpp))
        {
            const char*sipRes;

            sipRes = sipCpp->name();

            if (sipRes == SIP_NULLPTR)
            {
                Py_INCREF(Py_None);
                return Py_None;
            }

            return PyUnicode_DecodeASCII(sipRes, strlen(sipRes), SIP_NULLPTR);
        }
    }

    sipNoMethod(sipParseErr, sipName_QMetaEnum, sipName_name, doc_QMetaEnum_name);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QMetaEnum_isFlag, "isFlag(self) -> bool");

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

    {
        const ::QMetaEnum *sipCpp;

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

            sipRes = sipCpp->isFlag();

            return PyBool_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_QMetaEnum, sipName_isFlag, doc_QMetaEnum_isFlag);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QMetaEnum_keyCount, "keyCount(self) -> int");

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

    {
        const ::QMetaEnum *sipCpp;

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

            sipRes = sipCpp->keyCount();

            return PyLong_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_QMetaEnum, sipName_keyCount, doc_QMetaEnum_keyCount);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QMetaEnum_key, "key(self, index: int) -> Optional[str]");

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

    {
        int a0;
        const ::QMetaEnum *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "Bi", &sipSelf, sipType_QMetaEnum, &sipCpp, &a0))
        {
            const char*sipRes;

            sipRes = sipCpp->key(a0);

            if (sipRes == SIP_NULLPTR)
            {
                Py_INCREF(Py_None);
                return Py_None;
            }

            return PyUnicode_DecodeASCII(sipRes, strlen(sipRes), SIP_NULLPTR);
        }
    }

    sipNoMethod(sipParseErr, sipName_QMetaEnum, sipName_key, doc_QMetaEnum_key);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QMetaEnum_value, "value(self, index: int) -> int");

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

    {
        int a0;
        const ::QMetaEnum *sipCpp;

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

            sipRes = sipCpp->value(a0);

            return PyLong_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_QMetaEnum, sipName_value, doc_QMetaEnum_value);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QMetaEnum_scope, "scope(self) -> Optional[str]");

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

    {
        const ::QMetaEnum *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_QMetaEnum, &sipCpp))
        {
            const char*sipRes;

            sipRes = sipCpp->scope();

            if (sipRes == SIP_NULLPTR)
            {
                Py_INCREF(Py_None);
                return Py_None;
            }

            return PyUnicode_DecodeASCII(sipRes, strlen(sipRes), SIP_NULLPTR);
        }
    }

    sipNoMethod(sipParseErr, sipName_QMetaEnum, sipName_scope, doc_QMetaEnum_scope);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QMetaEnum_keyToValue, "keyToValue(self, key: Optional[str]) -> (int, Optional[bool])");

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

    {
        const char* a0;
        PyObject *a0Keep;
        bool a1;
        const ::QMetaEnum *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BAA", &sipSelf, sipType_QMetaEnum, &sipCpp, &a0Keep, &a0))
        {
            int sipRes;

            sipRes = sipCpp->keyToValue(a0, &a1);
            Py_DECREF(a0Keep);

            return sipBuildResult(0, "(ib)", sipRes, a1);
        }
    }

    sipNoMethod(sipParseErr, sipName_QMetaEnum, sipName_keyToValue, doc_QMetaEnum_keyToValue);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QMetaEnum_valueToKey, "valueToKey(self, value: int) -> Optional[str]");

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

    {
        int a0;
        const ::QMetaEnum *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "Bi", &sipSelf, sipType_QMetaEnum, &sipCpp, &a0))
        {
            const char*sipRes;

            sipRes = sipCpp->valueToKey(a0);

            if (sipRes == SIP_NULLPTR)
            {
                Py_INCREF(Py_None);
                return Py_None;
            }

            return PyUnicode_DecodeASCII(sipRes, strlen(sipRes), SIP_NULLPTR);
        }
    }

    sipNoMethod(sipParseErr, sipName_QMetaEnum, sipName_valueToKey, doc_QMetaEnum_valueToKey);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QMetaEnum_keysToValue, "keysToValue(self, keys: Optional[str]) -> (int, Optional[bool])");

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

    {
        const char* a0;
        PyObject *a0Keep;
        bool a1;
        const ::QMetaEnum *sipCpp;

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

        if (sipParseKwdArgs(&sipParseErr, sipArgs, sipKwds, sipKwdList, SIP_NULLPTR, "BAA", &sipSelf, sipType_QMetaEnum, &sipCpp, &a0Keep, &a0))
        {
            int sipRes;

            sipRes = sipCpp->keysToValue(a0, &a1);
            Py_DECREF(a0Keep);

            return sipBuildResult(0, "(ib)", sipRes, a1);
        }
    }

    sipNoMethod(sipParseErr, sipName_QMetaEnum, sipName_keysToValue, doc_QMetaEnum_keysToValue);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QMetaEnum_valueToKeys, "valueToKeys(self, value: int) -> QByteArray");

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

    {
        int a0;
        const ::QMetaEnum *sipCpp;

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

            sipRes = new ::QByteArray(sipCpp->valueToKeys(a0));

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

    sipNoMethod(sipParseErr, sipName_QMetaEnum, sipName_valueToKeys, doc_QMetaEnum_valueToKeys);

    return SIP_NULLPTR;
}


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

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

    {
        const ::QMetaEnum *sipCpp;

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

            sipRes = sipCpp->isValid();

            return PyBool_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_QMetaEnum, sipName_isValid, doc_QMetaEnum_isValid);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QMetaEnum_isScoped, "isScoped(self) -> bool");

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

    {
        const ::QMetaEnum *sipCpp;

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

            sipRes = sipCpp->isScoped();

            return PyBool_FromLong(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_QMetaEnum, sipName_isScoped, doc_QMetaEnum_isScoped);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QMetaEnum_enumName, "enumName(self) -> Optional[str]");

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

    {
        const ::QMetaEnum *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_QMetaEnum, &sipCpp))
        {
            const char*sipRes;

            sipRes = sipCpp->enumName();

            if (sipRes == SIP_NULLPTR)
            {
                Py_INCREF(Py_None);
                return Py_None;
            }

            return PyUnicode_DecodeASCII(sipRes, strlen(sipRes), SIP_NULLPTR);
        }
    }

    sipNoMethod(sipParseErr, sipName_QMetaEnum, sipName_enumName, doc_QMetaEnum_enumName);

    return SIP_NULLPTR;
}


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


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


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


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


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


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


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

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

            return sipCpp;
        }
    }

    {
        const ::QMetaEnum* a0;

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

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


static PyMethodDef methods_QMetaEnum[] = {
    {sipName_enumName, meth_QMetaEnum_enumName, METH_VARARGS, doc_QMetaEnum_enumName},
    {sipName_isFlag, meth_QMetaEnum_isFlag, METH_VARARGS, doc_QMetaEnum_isFlag},
    {sipName_isScoped, meth_QMetaEnum_isScoped, METH_VARARGS, doc_QMetaEnum_isScoped},
    {sipName_isValid, meth_QMetaEnum_isValid, METH_VARARGS, doc_QMetaEnum_isValid},
    {sipName_key, meth_QMetaEnum_key, METH_VARARGS, doc_QMetaEnum_key},
    {sipName_keyCount, meth_QMetaEnum_keyCount, METH_VARARGS, doc_QMetaEnum_keyCount},
    {sipName_keyToValue, SIP_MLMETH_CAST(meth_QMetaEnum_keyToValue), METH_VARARGS|METH_KEYWORDS, doc_QMetaEnum_keyToValue},
    {sipName_keysToValue, SIP_MLMETH_CAST(meth_QMetaEnum_keysToValue), METH_VARARGS|METH_KEYWORDS, doc_QMetaEnum_keysToValue},
    {sipName_name, meth_QMetaEnum_name, METH_VARARGS, doc_QMetaEnum_name},
    {sipName_scope, meth_QMetaEnum_scope, METH_VARARGS, doc_QMetaEnum_scope},
    {sipName_value, meth_QMetaEnum_value, METH_VARARGS, doc_QMetaEnum_value},
    {sipName_valueToKey, meth_QMetaEnum_valueToKey, METH_VARARGS, doc_QMetaEnum_valueToKey},
    {sipName_valueToKeys, meth_QMetaEnum_valueToKeys, METH_VARARGS, doc_QMetaEnum_valueToKeys}
};

PyDoc_STRVAR(doc_QMetaEnum, "\1QMetaEnum()\n"
"QMetaEnum(a0: QMetaEnum)");


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


sipClassTypeDef sipTypeDef_QtCore_QMetaEnum = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_SUPER_INIT|SIP_TYPE_LIMITED_API|SIP_TYPE_CLASS,
        sipNameNr_QMetaEnum,
        SIP_NULLPTR,
        &plugin_QMetaEnum,
    },
    {
        sipNameNr_QMetaEnum,
        {0, 0, 1},
        13, methods_QMetaEnum,
        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_QMetaEnum,
    -1,
    sipNameNr_sip_simplewrapper,
    SIP_NULLPTR,
    SIP_NULLPTR,
    init_type_QMetaEnum,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    dealloc_QMetaEnum,
    assign_QMetaEnum,
    array_QMetaEnum,
    copy_QMetaEnum,
    release_QMetaEnum,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    array_delete_QMetaEnum,
    sizeof (::QMetaEnum),
};
