/*
 * Interface wrapper code.
 *
 * Generated by SIP 4.19.6
 */

#include "sipAPIKGuiAddons.h"

#include <kwordwrap.h>

#include <qpainter.h>
#include <qstring.h>
#include <qrect.h>
#include <qfontmetrics.h>


extern "C" {static PyObject *meth_KWordWrap_formatText(PyObject *, PyObject *);}
static PyObject *meth_KWordWrap_formatText(PyObject *, PyObject *sipArgs)
{
    PyObject *sipParseErr = NULL;

    {
         ::QFontMetrics* a0;
        const  ::QRect* a1;
        int a2;
        const  ::QString* a3;
        int a3State = 0;
        int a4 = -1;

        if (sipParseArgs(&sipParseErr, sipArgs, "J9J9iJ1|i", sipType_QFontMetrics, &a0, sipType_QRect, &a1, &a2, sipType_QString,&a3, &a3State, &a4))
        {
             ::KWordWrap*sipRes;

            sipRes = new  ::KWordWrap( ::KWordWrap::formatText(*a0,*a1,a2,*a3,a4));
            sipReleaseType(const_cast< ::QString *>(a3),sipType_QString,a3State);

            return sipConvertFromNewType(sipRes,sipType_KWordWrap,NULL);
        }
    }

    /* Raise an exception if the arguments couldn't be parsed. */
    sipNoMethod(sipParseErr, sipName_KWordWrap, sipName_formatText, NULL);

    return NULL;
}


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

    {
        const  ::KWordWrap *sipCpp;

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

            sipRes = new  ::QRect(sipCpp->boundingRect());

            return sipConvertFromNewType(sipRes,sipType_QRect,NULL);
        }
    }

    /* Raise an exception if the arguments couldn't be parsed. */
    sipNoMethod(sipParseErr, sipName_KWordWrap, sipName_boundingRect, NULL);

    return NULL;
}


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

    {
        const  ::KWordWrap *sipCpp;

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

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

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

    /* Raise an exception if the arguments couldn't be parsed. */
    sipNoMethod(sipParseErr, sipName_KWordWrap, sipName_wrappedString, NULL);

    return NULL;
}


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

    {
        bool a0 = 1;
        const  ::KWordWrap *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B|b", &sipSelf, sipType_KWordWrap, &sipCpp, &a0))
        {
             ::QString*sipRes;

            sipRes = new  ::QString(sipCpp->truncatedString(a0));

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

    /* Raise an exception if the arguments couldn't be parsed. */
    sipNoMethod(sipParseErr, sipName_KWordWrap, sipName_truncatedString, NULL);

    return NULL;
}


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

    {
         ::QPainter* a0;
        int a1;
        int a2;
        int a3 = Qt::AlignLeft;
        const  ::KWordWrap *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "BJ8ii|i", &sipSelf, sipType_KWordWrap, &sipCpp, sipType_QPainter, &a0, &a1, &a2, &a3))
        {
            sipCpp->drawText(a0,a1,a2,a3);

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    /* Raise an exception if the arguments couldn't be parsed. */
    sipNoMethod(sipParseErr, sipName_KWordWrap, sipName_drawText, NULL);

    return NULL;
}


extern "C" {static PyObject *meth_KWordWrap_drawFadeoutText(PyObject *, PyObject *);}
static PyObject *meth_KWordWrap_drawFadeoutText(PyObject *, PyObject *sipArgs)
{
    PyObject *sipParseErr = NULL;

    {
         ::QPainter* a0;
        int a1;
        int a2;
        int a3;
        const  ::QString* a4;
        int a4State = 0;

        if (sipParseArgs(&sipParseErr, sipArgs, "J8iiiJ1", sipType_QPainter, &a0, &a1, &a2, &a3, sipType_QString,&a4, &a4State))
        {
             ::KWordWrap::drawFadeoutText(a0,a1,a2,a3,*a4);
            sipReleaseType(const_cast< ::QString *>(a4),sipType_QString,a4State);

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    /* Raise an exception if the arguments couldn't be parsed. */
    sipNoMethod(sipParseErr, sipName_KWordWrap, sipName_drawFadeoutText, NULL);

    return NULL;
}


extern "C" {static PyObject *meth_KWordWrap_drawTruncateText(PyObject *, PyObject *);}
static PyObject *meth_KWordWrap_drawTruncateText(PyObject *, PyObject *sipArgs)
{
    PyObject *sipParseErr = NULL;

    {
         ::QPainter* a0;
        int a1;
        int a2;
        int a3;
        const  ::QString* a4;
        int a4State = 0;

        if (sipParseArgs(&sipParseErr, sipArgs, "J8iiiJ1", sipType_QPainter, &a0, &a1, &a2, &a3, sipType_QString,&a4, &a4State))
        {
             ::KWordWrap::drawTruncateText(a0,a1,a2,a3,*a4);
            sipReleaseType(const_cast< ::QString *>(a4),sipType_QString,a4State);

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

    /* Raise an exception if the arguments couldn't be parsed. */
    sipNoMethod(sipParseErr, sipName_KWordWrap, sipName_drawTruncateText, NULL);

    return NULL;
}


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


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


extern "C" {static void *init_type_KWordWrap(sipSimpleWrapper *, PyObject *, PyObject *, PyObject **, PyObject **, PyObject **);}
static void *init_type_KWordWrap(sipSimpleWrapper *, PyObject *sipArgs, PyObject *sipKwds, PyObject **sipUnused, PyObject **, PyObject **sipParseErr)
{
     ::KWordWrap *sipCpp = 0;

    {
        const  ::KWordWrap* a0;

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, NULL, sipUnused, "J9", sipType_KWordWrap, &a0))
        {
            sipCpp = new  ::KWordWrap(*a0);

            return sipCpp;
        }
    }

    return NULL;
}


static PyMethodDef methods_KWordWrap[] = {
    {SIP_MLNAME_CAST(sipName_boundingRect), meth_KWordWrap_boundingRect, METH_VARARGS, NULL},
    {SIP_MLNAME_CAST(sipName_drawFadeoutText), meth_KWordWrap_drawFadeoutText, METH_VARARGS, NULL},
    {SIP_MLNAME_CAST(sipName_drawText), meth_KWordWrap_drawText, METH_VARARGS, NULL},
    {SIP_MLNAME_CAST(sipName_drawTruncateText), meth_KWordWrap_drawTruncateText, METH_VARARGS, NULL},
    {SIP_MLNAME_CAST(sipName_formatText), meth_KWordWrap_formatText, METH_VARARGS, NULL},
    {SIP_MLNAME_CAST(sipName_truncatedString), meth_KWordWrap_truncatedString, METH_VARARGS, NULL},
    {SIP_MLNAME_CAST(sipName_wrappedString), meth_KWordWrap_wrappedString, METH_VARARGS, NULL}
};

static sipEnumMemberDef enummembers_KWordWrap[] = {
    {sipName_FadeOut, static_cast<int>( ::KWordWrap::FadeOut), -1},
    {sipName_Truncate, static_cast<int>( ::KWordWrap::Truncate), -1},
};


static pyqt5ClassPluginDef plugin_KWordWrap = {
    0,
    0,
    0,
    0
};


sipClassTypeDef sipTypeDef_KGuiAddons_KWordWrap = {
    {
        -1,
        0,
        0,
        SIP_TYPE_SUPER_INIT|SIP_TYPE_CLASS,
        sipNameNr_KWordWrap,
        {0},
        &plugin_KWordWrap
    },
    {
        sipNameNr_KWordWrap,
        {0, 0, 1},
        7, methods_KWordWrap,
        2, enummembers_KWordWrap,
        0, 0,
        {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    },
    0,
    -1,
    -1,
    0,
    0,
    init_type_KWordWrap,
    0,
    0,
#if PY_MAJOR_VERSION >= 3
    0,
    0,
#else
    0,
    0,
    0,
    0,
#endif
    dealloc_KWordWrap,
    0,
    0,
    0,
    release_KWordWrap,
    0,
    0,
    0,
    0,
    0,
    0,
    0
};
