/*
 * Module code.
 *
 * Generated by SIP 4.8.2 on Sun Oct 11 20:27:58 2009
 */

#include "sipAPIpolkitqt.h"


#line 46 "/usr/local/share/py-sip/QtCore/qstring.sip"
#include <qstring.h>
#line 13 "sippolkitqtpart2.cpp"


extern "C" {static PyObject *meth_PolkitQt_Auth_isCallerAuthorized(PyObject *,PyObject *);}
static PyObject *meth_PolkitQt_Auth_isCallerAuthorized(PyObject *,PyObject *sipArgs)
{
    int sipArgsParsed = 0;

    {
        const QString * a0;
        int a0State = 0;
        qint64 a1;
        bool a2;

        if (sipParseArgs(&sipArgsParsed,sipArgs,"J1nb",sipType_QString,&a0,&a0State,&a1,&a2))
        {
            PolkitQt::Auth::Result sipRes;

            Py_BEGIN_ALLOW_THREADS
            sipRes = PolkitQt::Auth::isCallerAuthorized(*a0,a1,a2);
            Py_END_ALLOW_THREADS

            sipReleaseType(const_cast<QString *>(a0),sipType_QString,a0State);

            return sipConvertFromEnum(sipRes,sipType_PolkitQt_Auth_Result);
        }
    }

    {
        const QString * a0;
        int a0State = 0;
        const QString * a1;
        int a1State = 0;
        bool a2;

        if (sipParseArgs(&sipArgsParsed,sipArgs,"J1J1b",sipType_QString,&a0,&a0State,sipType_QString,&a1,&a1State,&a2))
        {
            PolkitQt::Auth::Result sipRes;

            Py_BEGIN_ALLOW_THREADS
            sipRes = PolkitQt::Auth::isCallerAuthorized(*a0,*a1,a2);
            Py_END_ALLOW_THREADS

            sipReleaseType(const_cast<QString *>(a0),sipType_QString,a0State);
            sipReleaseType(const_cast<QString *>(a1),sipType_QString,a1State);

            return sipConvertFromEnum(sipRes,sipType_PolkitQt_Auth_Result);
        }
    }

    /* Raise an exception if the arguments couldn't be parsed. */
    sipNoFunction(sipArgsParsed,sipName_isCallerAuthorized);

    return NULL;
}


extern "C" {static PyObject *meth_PolkitQt_Auth_obtainAuth(PyObject *,PyObject *);}
static PyObject *meth_PolkitQt_Auth_obtainAuth(PyObject *,PyObject *sipArgs)
{
    int sipArgsParsed = 0;

    {
        const QString * a0;
        int a0State = 0;
        WId a1 = 0;
        qint64 a2 = QCoreApplication::applicationPid();

        if (sipParseArgs(&sipArgsParsed,sipArgs,"J1|mn",sipType_QString,&a0,&a0State,&a1,&a2))
        {
            bool sipRes;

            Py_BEGIN_ALLOW_THREADS
            sipRes = PolkitQt::Auth::obtainAuth(*a0,a1,a2);
            Py_END_ALLOW_THREADS

            sipReleaseType(const_cast<QString *>(a0),sipType_QString,a0State);

            return PyBool_FromLong(sipRes);
        }
    }

    /* Raise an exception if the arguments couldn't be parsed. */
    sipNoFunction(sipArgsParsed,sipName_obtainAuth);

    return NULL;
}


extern "C" {static PyObject *meth_PolkitQt_Auth_computeAndObtainAuth(PyObject *,PyObject *);}
static PyObject *meth_PolkitQt_Auth_computeAndObtainAuth(PyObject *,PyObject *sipArgs)
{
    int sipArgsParsed = 0;

    {
        const QString * a0;
        int a0State = 0;
        WId a1 = 0;
        qint64 a2 = QCoreApplication::applicationPid();

        if (sipParseArgs(&sipArgsParsed,sipArgs,"J1|mn",sipType_QString,&a0,&a0State,&a1,&a2))
        {
            bool sipRes;

            Py_BEGIN_ALLOW_THREADS
            sipRes = PolkitQt::Auth::computeAndObtainAuth(*a0,a1,a2);
            Py_END_ALLOW_THREADS

            sipReleaseType(const_cast<QString *>(a0),sipType_QString,a0State);

            return PyBool_FromLong(sipRes);
        }
    }

    /* Raise an exception if the arguments couldn't be parsed. */
    sipNoFunction(sipArgsParsed,sipName_computeAndObtainAuth);

    return NULL;
}


static PyMethodDef methods_PolkitQt_Auth[] = {
    {SIP_MLNAME_CAST(sipName_computeAndObtainAuth), meth_PolkitQt_Auth_computeAndObtainAuth, METH_VARARGS, NULL},
    {SIP_MLNAME_CAST(sipName_isCallerAuthorized), meth_PolkitQt_Auth_isCallerAuthorized, METH_VARARGS, NULL},
    {SIP_MLNAME_CAST(sipName_obtainAuth), meth_PolkitQt_Auth_obtainAuth, METH_VARARGS, NULL}
};

static sipEnumMemberDef enummembers_PolkitQt_Auth[] = {
    {sipName_AdminAuth, PolkitQt::Auth::AdminAuth, 5},
    {sipName_AdminAuthKeepAlways, PolkitQt::Auth::AdminAuthKeepAlways, 5},
    {sipName_AdminAuthKeepSession, PolkitQt::Auth::AdminAuthKeepSession, 5},
    {sipName_AdminAuthOneShot, PolkitQt::Auth::AdminAuthOneShot, 5},
    {sipName_No, PolkitQt::Auth::No, 5},
    {sipName_SelfAuth, PolkitQt::Auth::SelfAuth, 5},
    {sipName_SelfAuthKeepAlways, PolkitQt::Auth::SelfAuthKeepAlways, 5},
    {sipName_SelfAuthKeepSession, PolkitQt::Auth::SelfAuthKeepSession, 5},
    {sipName_SelfAuthOneShot, PolkitQt::Auth::SelfAuthOneShot, 5},
    {sipName_Unknown, PolkitQt::Auth::Unknown, 5},
    {sipName_Yes, PolkitQt::Auth::Yes, 5},
};


pyqt4ClassTypeDef pyqt4Type_polkitqt_PolkitQt_Auth = {
{
    {
        -1,
        0,
        0,
        SIP_TYPE_NAMESPACE,
        sipNameNr_PolkitQt__Auth,
        {0}
    },
    sipNameNr_Auth,
    -1,
    -1,
    {0, 255, 0},
    0,
    0,
    3, methods_PolkitQt_Auth,
    11, enummembers_PolkitQt_Auth,
    0, 0,
    0,
    0,
    0,
#if PY_MAJOR_VERSION >= 3
    0,
    0,
#else
    0,
    0,
    0,
    0,
#endif
    0,
    0,
    0,
    0,
    {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    0,
    0
},
    0,
    0,
    0,
    0
};
