/*
 * 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 509 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtGui/qevent.sip"
#include <qevent.h>
#line 525 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtGui/qevent.sip"
#include <qevent.h>
#line 31 "/build/pyqt5/src/PyQt5-5.15.7/build/QtGui/sipQtGuiQInputMethodEventAttribute.cpp"

#line 509 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtGui/qevent.sip"
#include <qevent.h>
#line 35 "/build/pyqt5/src/PyQt5-5.15.7/build/QtGui/sipQtGuiQInputMethodEventAttribute.cpp"
#line 26 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtCore/qvariant.sip"
#include <qvariant.h>
#line 38 "/build/pyqt5/src/PyQt5-5.15.7/build/QtGui/sipQtGuiQInputMethodEventAttribute.cpp"


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


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


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


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


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

    {
         ::QInputMethodEvent::AttributeType a0;
        int a1;
        int a2;
         ::QVariant* a3;
        int a3State = 0;

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, SIP_NULLPTR, sipUnused, "EiiJ1", sipType_QInputMethodEvent_AttributeType, &a0, &a1, &a2, sipType_QVariant, &a3, &a3State))
        {
            sipCpp = new  ::QInputMethodEvent::Attribute(a0,a1,a2,*a3);
            sipReleaseType(a3, sipType_QVariant, a3State);

            return sipCpp;
        }
    }

    {
         ::QInputMethodEvent::AttributeType a0;
        int a1;
        int a2;

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, SIP_NULLPTR, sipUnused, "Eii", sipType_QInputMethodEvent_AttributeType, &a0, &a1, &a2))
        {
            sipCpp = new  ::QInputMethodEvent::Attribute(a0,a1,a2);

            return sipCpp;
        }
    }

    {
        const  ::QInputMethodEvent::Attribute* a0;

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

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


extern "C" {static PyObject *varget_QInputMethodEvent_Attribute_length(void *, PyObject *, PyObject *);}
static PyObject *varget_QInputMethodEvent_Attribute_length(void *sipSelf, PyObject *, PyObject *)
{
    int sipVal;
     ::QInputMethodEvent::Attribute *sipCpp = reinterpret_cast< ::QInputMethodEvent::Attribute *>(sipSelf);

    sipVal = sipCpp->length;

    return PyLong_FromLong(sipVal);
}


extern "C" {static int varset_QInputMethodEvent_Attribute_length(void *, PyObject *, PyObject *);}
static int varset_QInputMethodEvent_Attribute_length(void *sipSelf, PyObject *sipPy, PyObject *)
{
    int sipVal;
     ::QInputMethodEvent::Attribute *sipCpp = reinterpret_cast< ::QInputMethodEvent::Attribute *>(sipSelf);

    sipVal = sipLong_AsInt(sipPy);

    if (PyErr_Occurred() != SIP_NULLPTR)
        return -1;

    sipCpp->length = sipVal;

    return 0;
}


extern "C" {static PyObject *varget_QInputMethodEvent_Attribute_start(void *, PyObject *, PyObject *);}
static PyObject *varget_QInputMethodEvent_Attribute_start(void *sipSelf, PyObject *, PyObject *)
{
    int sipVal;
     ::QInputMethodEvent::Attribute *sipCpp = reinterpret_cast< ::QInputMethodEvent::Attribute *>(sipSelf);

    sipVal = sipCpp->start;

    return PyLong_FromLong(sipVal);
}


extern "C" {static int varset_QInputMethodEvent_Attribute_start(void *, PyObject *, PyObject *);}
static int varset_QInputMethodEvent_Attribute_start(void *sipSelf, PyObject *sipPy, PyObject *)
{
    int sipVal;
     ::QInputMethodEvent::Attribute *sipCpp = reinterpret_cast< ::QInputMethodEvent::Attribute *>(sipSelf);

    sipVal = sipLong_AsInt(sipPy);

    if (PyErr_Occurred() != SIP_NULLPTR)
        return -1;

    sipCpp->start = sipVal;

    return 0;
}


extern "C" {static PyObject *varget_QInputMethodEvent_Attribute_type(void *, PyObject *, PyObject *);}
static PyObject *varget_QInputMethodEvent_Attribute_type(void *sipSelf, PyObject *, PyObject *)
{
     ::QInputMethodEvent::AttributeType sipVal;
     ::QInputMethodEvent::Attribute *sipCpp = reinterpret_cast< ::QInputMethodEvent::Attribute *>(sipSelf);

    sipVal = sipCpp->type;

    return sipConvertFromEnum(static_cast<int>(sipVal), sipType_QInputMethodEvent_AttributeType);
}


extern "C" {static int varset_QInputMethodEvent_Attribute_type(void *, PyObject *, PyObject *);}
static int varset_QInputMethodEvent_Attribute_type(void *sipSelf, PyObject *sipPy, PyObject *)
{
     ::QInputMethodEvent::AttributeType sipVal;
     ::QInputMethodEvent::Attribute *sipCpp = reinterpret_cast< ::QInputMethodEvent::Attribute *>(sipSelf);

    sipVal = ( ::QInputMethodEvent::AttributeType)sipConvertToEnum(sipPy, sipType_QInputMethodEvent_AttributeType);

    if (PyErr_Occurred() != SIP_NULLPTR)
        return -1;

    sipCpp->type = sipVal;

    return 0;
}


extern "C" {static PyObject *varget_QInputMethodEvent_Attribute_value(void *, PyObject *, PyObject *);}
static PyObject *varget_QInputMethodEvent_Attribute_value(void *sipSelf, PyObject *sipPySelf, PyObject *)
{
    PyObject *sipPy;
     ::QVariant*sipVal;
     ::QInputMethodEvent::Attribute *sipCpp = reinterpret_cast< ::QInputMethodEvent::Attribute *>(sipSelf);

    sipPy = sipGetReference(sipPySelf, -10);

    if (sipPy)
        return sipPy;

    sipVal = &sipCpp->value;

    sipPy = sipConvertFromType(sipVal, sipType_QVariant, SIP_NULLPTR);

    if (sipPy)
    {
        sipKeepReference(sipPy, -15, sipPySelf);
        sipKeepReference(sipPySelf, -10, sipPy);
    }

    return sipPy;
}


extern "C" {static int varset_QInputMethodEvent_Attribute_value(void *, PyObject *, PyObject *);}
static int varset_QInputMethodEvent_Attribute_value(void *sipSelf, PyObject *sipPy, PyObject *)
{
     ::QVariant*sipVal;
     ::QInputMethodEvent::Attribute *sipCpp = reinterpret_cast< ::QInputMethodEvent::Attribute *>(sipSelf);

    int sipIsErr = 0;
    int sipValState;
    sipVal = reinterpret_cast< ::QVariant *>(sipForceConvertToType(sipPy, sipType_QVariant, SIP_NULLPTR, SIP_NOT_NONE, &sipValState, &sipIsErr));

    if (sipIsErr)
        return -1;

    sipCpp->value = *sipVal;

    sipReleaseType(sipVal, sipType_QVariant, sipValState);

    return 0;
}

sipVariableDef variables_QInputMethodEvent_Attribute[] = {
    {InstanceVariable, sipName_length, (PyMethodDef *)varget_QInputMethodEvent_Attribute_length, (PyMethodDef *)varset_QInputMethodEvent_Attribute_length, SIP_NULLPTR, SIP_NULLPTR},
    {InstanceVariable, sipName_start, (PyMethodDef *)varget_QInputMethodEvent_Attribute_start, (PyMethodDef *)varset_QInputMethodEvent_Attribute_start, SIP_NULLPTR, SIP_NULLPTR},
    {InstanceVariable, sipName_type, (PyMethodDef *)varget_QInputMethodEvent_Attribute_type, (PyMethodDef *)varset_QInputMethodEvent_Attribute_type, SIP_NULLPTR, SIP_NULLPTR},
    {InstanceVariable, sipName_value, (PyMethodDef *)varget_QInputMethodEvent_Attribute_value, (PyMethodDef *)varset_QInputMethodEvent_Attribute_value, SIP_NULLPTR, SIP_NULLPTR},
};

PyDoc_STRVAR(doc_QInputMethodEvent_Attribute, "\1QInputMethodEvent.Attribute(QInputMethodEvent.AttributeType, int, int, Any)\n"
"QInputMethodEvent.Attribute(QInputMethodEvent.AttributeType, int, int)\n"
"QInputMethodEvent.Attribute(QInputMethodEvent.Attribute)");


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


sipClassTypeDef sipTypeDef_QtGui_QInputMethodEvent_Attribute = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_SUPER_INIT|SIP_TYPE_LIMITED_API|SIP_TYPE_CLASS,
        sipNameNr_QInputMethodEvent__Attribute,
        SIP_NULLPTR,
        &plugin_QInputMethodEvent_Attribute
    },
    {
        sipNameNr_Attribute,
        {87, 255, 0},
        0, SIP_NULLPTR,
        0, SIP_NULLPTR,
        4, variables_QInputMethodEvent_Attribute,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    },
    doc_QInputMethodEvent_Attribute,
    -1,
    sipNameNr_sip_simplewrapper,
    SIP_NULLPTR,
    SIP_NULLPTR,
    init_type_QInputMethodEvent_Attribute,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    dealloc_QInputMethodEvent_Attribute,
    assign_QInputMethodEvent_Attribute,
    SIP_NULLPTR,
    copy_QInputMethodEvent_Attribute,
    release_QInputMethodEvent_Attribute,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    sizeof ( ::QInputMethodEvent::Attribute),
};
