/*
 * Module code.
 *
 * Generated by SIP 4.11.2 on Wed Feb  9 17:29:48 2011
 */

#include "sipAPIpolkitqt.h"

#line 31 "/work/a/ports/devel/kdebindings4-python-pykde4/work/kdebindings-4.5.5/python/pykde4/sip/polkitqt/context.sip"
#include <PolicyKit/polkit-qt/context.h>
#line 12 "sippolkitqtpart1.cpp"

#line 41 "/usr/local/share/py-sip/QtCore/qstring.sip"
#include <qstring.h>
#line 16 "sippolkitqtpart1.cpp"
#line 36 "/usr/local/share/py-sip/QtCore/qcoreevent.sip"
#include <qcoreevent.h>
#line 19 "sippolkitqtpart1.cpp"
#line 315 "/usr/local/share/py-sip/QtCore/qcoreevent.sip"
#include <qcoreevent.h>
#line 22 "sippolkitqtpart1.cpp"
#line 303 "/usr/local/share/py-sip/QtCore/qcoreevent.sip"
#include <qcoreevent.h>
#line 25 "sippolkitqtpart1.cpp"
#line 39 "/usr/local/share/py-sip/QtCore/qobject.sip"
#include <qobject.h>
#line 28 "sippolkitqtpart1.cpp"
#line 41 "/usr/local/share/py-sip/QtCore/qvariant.sip"
#include <qvariant.h>
#line 31 "sippolkitqtpart1.cpp"
#line 38 "/usr/local/share/py-sip/QtCore/qlist.sip"
#include <qlist.h>
#line 34 "sippolkitqtpart1.cpp"
#line 42 "/usr/local/share/py-sip/QtCore/qbytearray.sip"
#include <qbytearray.h>
#line 37 "sippolkitqtpart1.cpp"
#line 40 "/usr/local/share/py-sip/QtCore/qnamespace.sip"
#include <qnamespace.h>
#line 40 "sippolkitqtpart1.cpp"
#line 125 "/usr/local/share/py-sip/QtCore/qlist.sip"
#include <qlist.h>
#line 43 "sippolkitqtpart1.cpp"
#line 36 "/usr/local/share/py-sip/QtCore/qthread.sip"
#include <qthread.h>
#line 46 "sippolkitqtpart1.cpp"
#line 40 "/usr/local/share/py-sip/QtCore/qregexp.sip"
#include <qregexp.h>
#line 49 "sippolkitqtpart1.cpp"
#line 36 "/usr/local/share/py-sip/QtCore/qobjectdefs.sip"
#include <qobjectdefs.h>
#line 52 "sippolkitqtpart1.cpp"


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

    {
        PolkitQt::Context *sipCpp;

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

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->hasError();
            Py_END_ALLOW_THREADS

            return PyBool_FromLong(sipRes);
        }
    }

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

    return NULL;
}


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

    {
        PolkitQt::Context *sipCpp;

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

            Py_BEGIN_ALLOW_THREADS
            sipRes = new QString(sipCpp->lastError());
            Py_END_ALLOW_THREADS

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

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

    return NULL;
}


/* Cast a pointer to a type somewhere in its superclass hierarchy. */
extern "C" {static void *cast_PolkitQt_Context(void *, const sipTypeDef *);}
static void *cast_PolkitQt_Context(void *ptr, const sipTypeDef *targetType)
{
    void *res;

    if (targetType == sipType_PolkitQt_Context)
        return ptr;

    if ((res = ((const sipClassTypeDef *)sipType_QObject)->ctd_cast((QObject *)(PolkitQt::Context *)ptr,targetType)) != NULL)
        return res;

    return NULL;
}


/* Call the instance's destructor. */
extern "C" {static void release_PolkitQt_Context(void *, int);}
static void release_PolkitQt_Context(void *sipCppV,int)
{
    Py_BEGIN_ALLOW_THREADS

    delete reinterpret_cast<PolkitQt::Context *>(sipCppV);

    Py_END_ALLOW_THREADS
}


extern "C" {static void dealloc_PolkitQt_Context(sipSimpleWrapper *);}
static void dealloc_PolkitQt_Context(sipSimpleWrapper *sipSelf)
{
    if (sipIsPyOwned(sipSelf))
    {
        release_PolkitQt_Context(sipGetAddress(sipSelf),0);
    }
}


/* Define this type's super-types. */
static sipEncodedTypeDef supers_PolkitQt_Context[] = {{133, 0, 1}};


static PyMethodDef methods_PolkitQt_Context[] = {
    {SIP_MLNAME_CAST(sipName_hasError), meth_PolkitQt_Context_hasError, METH_VARARGS, NULL},
    {SIP_MLNAME_CAST(sipName_lastError), meth_PolkitQt_Context_lastError, METH_VARARGS, NULL}
};


/* Define this type's PyQt4 signals. */
static const pyqt4QtSignal pyqt4_signals_PolkitQt_Context[] = {
    {"consoleKitDBChanged()", 0, 0},
    {"configChanged()", 0, 0},
    {0, 0, 0}
};


pyqt4ClassTypeDef sipTypeDef_polkitqt_PolkitQt_Context = {
{
    {
        -1,
        0,
        0,
        SIP_TYPE_ABSTRACT|SIP_TYPE_SCC|SIP_TYPE_CLASS,
        sipNameNr_PolkitQt__Context,
        {0}
    },
    {
        sipNameNr_Context,
        {0, 255, 0},
        2, methods_PolkitQt_Context,
        0, 0,
        0, 0,
        {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    },
    0,
    -1,
    -1,
    supers_PolkitQt_Context,
    0,
    0,
    0,
    0,
#if PY_MAJOR_VERSION >= 3
    0,
    0,
#else
    0,
    0,
    0,
    0,
#endif
    dealloc_PolkitQt_Context,
    0,
    0,
    0,
    release_PolkitQt_Context,
    cast_PolkitQt_Context,
    0,
    0,
    0
},
    &PolkitQt::Context::staticMetaObject,
    0,
    pyqt4_signals_PolkitQt_Context
};
