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

#line 26 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtCore/qvariant.sip"
#include <qvariant.h>
#line 33 "/build/pyqt5/src/PyQt5-5.15.7/build/QtGui/sipQtGuiQTextLength.cpp"


PyDoc_STRVAR(doc_QTextLength_type, "type(self) -> QTextLength.Type");

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

    {
        const  ::QTextLength *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_QTextLength, &sipCpp))
        {
             ::QTextLength::Type sipRes;

            sipRes = sipCpp->type();

            return sipConvertFromEnum(static_cast<int>(sipRes), sipType_QTextLength_Type);
        }
    }

    sipNoMethod(sipParseErr, sipName_QTextLength, sipName_type, doc_QTextLength_type);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QTextLength_value, "value(self, float) -> float");

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

    {
         ::qreal a0;
        const  ::QTextLength *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "Bd", &sipSelf, sipType_QTextLength, &sipCpp, &a0))
        {
             ::qreal sipRes;

            sipRes = sipCpp->value(a0);

            return PyFloat_FromDouble(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_QTextLength, sipName_value, doc_QTextLength_value);

    return SIP_NULLPTR;
}


PyDoc_STRVAR(doc_QTextLength_rawValue, "rawValue(self) -> float");

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

    {
        const  ::QTextLength *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_QTextLength, &sipCpp))
        {
             ::qreal sipRes;

            sipRes = sipCpp->rawValue();

            return PyFloat_FromDouble(sipRes);
        }
    }

    sipNoMethod(sipParseErr, sipName_QTextLength, sipName_rawValue, doc_QTextLength_rawValue);

    return SIP_NULLPTR;
}


extern "C" {static PyObject *slot_QTextLength___ne__(PyObject *,PyObject *);}
static PyObject *slot_QTextLength___ne__(PyObject *sipSelf,PyObject *sipArg)
{
     ::QTextLength *sipCpp = reinterpret_cast< ::QTextLength *>(sipGetCppPtr((sipSimpleWrapper *)sipSelf,sipType_QTextLength));

    if (!sipCpp)
        return SIP_NULLPTR;

    PyObject *sipParseErr = SIP_NULLPTR;

    {
        const  ::QTextLength* a0;

        if (sipParseArgs(&sipParseErr, sipArg, "1J9", sipType_QTextLength, &a0))
        {
            bool sipRes;

            sipRes = sipCpp-> ::QTextLength::operator!=(*a0);

            return PyBool_FromLong(sipRes);
        }
    }

    Py_XDECREF(sipParseErr);

    if (sipParseErr == Py_None)
        return SIP_NULLPTR;

    return sipPySlotExtend(&sipModuleAPI_QtGui, ne_slot, sipType_QTextLength, sipSelf, sipArg);
}


extern "C" {static PyObject *slot_QTextLength___eq__(PyObject *,PyObject *);}
static PyObject *slot_QTextLength___eq__(PyObject *sipSelf,PyObject *sipArg)
{
     ::QTextLength *sipCpp = reinterpret_cast< ::QTextLength *>(sipGetCppPtr((sipSimpleWrapper *)sipSelf,sipType_QTextLength));

    if (!sipCpp)
        return SIP_NULLPTR;

    PyObject *sipParseErr = SIP_NULLPTR;

    {
        const  ::QTextLength* a0;

        if (sipParseArgs(&sipParseErr, sipArg, "1J9", sipType_QTextLength, &a0))
        {
            bool sipRes;

            sipRes = sipCpp-> ::QTextLength::operator==(*a0);

            return PyBool_FromLong(sipRes);
        }
    }

    Py_XDECREF(sipParseErr);

    if (sipParseErr == Py_None)
        return SIP_NULLPTR;

    return sipPySlotExtend(&sipModuleAPI_QtGui, eq_slot, sipType_QTextLength, sipSelf, sipArg);
}


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


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


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


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


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


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


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

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

            return sipCpp;
        }
    }

    {
         ::QTextLength::Type a0;
         ::qreal a1;

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, SIP_NULLPTR, sipUnused, "Ed", sipType_QTextLength_Type, &a0, &a1))
        {
            sipCpp = new  ::QTextLength(a0,a1);

            return sipCpp;
        }
    }

    {
        const  ::QVariant* a0;
        PyObject *a0Wrapper;
        int a0State = 0;

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, SIP_NULLPTR, sipUnused, "@J1", &a0Wrapper, sipType_QVariant, &a0, &a0State))
        {
            sipErrorState sipError = sipErrorNone;

#line 46 "/build/pyqt5/src/PyQt5-5.15.7/sip/QtGui/qtextformat.sip"
        if (a0->canConvert<QTextLength>())
            sipCpp = new QTextLength(a0->value<QTextLength>());
        else
            sipError = sipBadCallableArg(0, a0Wrapper);
#line 268 "/build/pyqt5/src/PyQt5-5.15.7/build/QtGui/sipQtGuiQTextLength.cpp"
            sipReleaseType(const_cast< ::QVariant *>(a0), sipType_QVariant, a0State);

            if (sipError == sipErrorNone)
                return sipCpp;

            if (sipUnused)
            {
                Py_XDECREF(*sipUnused);
            }

            sipAddException(sipError, sipParseErr);

            if (sipError == sipErrorFail)
                return SIP_NULLPTR;
        }
    }

    {
        const  ::QTextLength* a0;

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

            return sipCpp;
        }
    }

    return SIP_NULLPTR;
}


/* Define this type's Python slots. */
static sipPySlotDef slots_QTextLength[] = {
    {(void *)slot_QTextLength___ne__, ne_slot},
    {(void *)slot_QTextLength___eq__, eq_slot},
    {0, (sipPySlotType)0}
};


static PyMethodDef methods_QTextLength[] = {
    {sipName_rawValue, meth_QTextLength_rawValue, METH_VARARGS, doc_QTextLength_rawValue},
    {sipName_type, meth_QTextLength_type, METH_VARARGS, doc_QTextLength_type},
    {sipName_value, meth_QTextLength_value, METH_VARARGS, doc_QTextLength_value}
};

static sipEnumMemberDef enummembers_QTextLength[] = {
    {sipName_FixedLength, static_cast<int>( ::QTextLength::FixedLength), 337},
    {sipName_PercentageLength, static_cast<int>( ::QTextLength::PercentageLength), 337},
    {sipName_VariableLength, static_cast<int>( ::QTextLength::VariableLength), 337},
};

PyDoc_STRVAR(doc_QTextLength, "\1QTextLength()\n"
"QTextLength(QTextLength.Type, float)\n"
"QTextLength(Any)\n"
"QTextLength(QTextLength)");


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


sipClassTypeDef sipTypeDef_QtGui_QTextLength = {
    {
        -1,
        SIP_NULLPTR,
        SIP_NULLPTR,
        SIP_TYPE_SUPER_INIT|SIP_TYPE_LIMITED_API|SIP_TYPE_CLASS,
        sipNameNr_QTextLength,
        SIP_NULLPTR,
        &plugin_QTextLength
    },
    {
        sipNameNr_QTextLength,
        {0, 0, 1},
        3, methods_QTextLength,
        3, enummembers_QTextLength,
        0, SIP_NULLPTR,
        {SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR, SIP_NULLPTR},
    },
    doc_QTextLength,
    -1,
    sipNameNr_sip_simplewrapper,
    SIP_NULLPTR,
    slots_QTextLength,
    init_type_QTextLength,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    dealloc_QTextLength,
    assign_QTextLength,
    array_QTextLength,
    copy_QTextLength,
    release_QTextLength,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    SIP_NULLPTR,
    array_delete_QTextLength,
    sizeof ( ::QTextLength),
};
