/*
 * Module code.
 *
 * Generated by SIP 4.12.4 on Fri Dec 30 00:38:39 2011
 *
 * 
 *  Copyright (c) 2011 Shaheed Haque (srhaque@theiet.org)
 * 
 *  This file is part of PyKDE4.
 * 
 *  PyKDE4 is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU Lesser General Public License as
 *  published by the Free Software Foundation; either version 2.1 of
 *  the License, or (at your option) any later version.
 * 
 *  PyKDE4 is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 * 
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http:www.gnu.org/licenses/>.
 * 
 * 
 *  Copyright (c) 2011 Shaheed Haque (srhaque@theiet.org)
 * 
 *  This file is part of PyKDE4.
 * 
 *  PyKDE4 is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU Lesser General Public License as
 *  published by the Free Software Foundation; either version 2.1 of
 *  the License, or (at your option) any later version.
 * 
 *  PyKDE4 is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 * 
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http:www.gnu.org/licenses/>.
 * 
 * 
 *  Copyright (c) 2011 Shaheed Haque (srhaque@theiet.org)
 * 
 *  This file is part of PyKDE4.
 * 
 *  PyKDE4 is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU Lesser General Public License as
 *  published by the Free Software Foundation; either version 2.1 of
 *  the License, or (at your option) any later version.
 * 
 *  PyKDE4 is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 * 
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http:www.gnu.org/licenses/>.
 * 
 * 
 *  Copyright (c) 2011 Shaheed Haque (srhaque@theiet.org)
 * 
 *  This file is part of PyKDE4.
 * 
 *  PyKDE4 is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU Lesser General Public License as
 *  published by the Free Software Foundation; either version 2.1 of
 *  the License, or (at your option) any later version.
 * 
 *  PyKDE4 is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 * 
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http:www.gnu.org/licenses/>.
 * 
 */

#include "sipAPIkterminal.h"

#line 25 "/work/a/ports/devel/kdebindings4-python-pykde4/work/pykde4-4.7.3/sip/kterminal/terminal_interface_v2.sip"
#include <kde_terminal_interface_v2.h>
#line 85 "/work/a/ports/devel/kdebindings4-python-pykde4/work/pykde4-4.7.3/sip/kterminal/sipkterminalpart2.cpp"

#line 36 "/usr/local/share/py-sip/QtCore/qstring.sip"
#include <qstring.h>
#line 89 "/work/a/ports/devel/kdebindings4-python-pykde4/work/pykde4-4.7.3/sip/kterminal/sipkterminalpart2.cpp"
#line 36 "/usr/local/share/py-sip/QtCore/qstringlist.sip"
#include <qstringlist.h>
#line 92 "/work/a/ports/devel/kdebindings4-python-pykde4/work/pykde4-4.7.3/sip/kterminal/sipkterminalpart2.cpp"


class sipTerminalInterfaceV2 : public TerminalInterfaceV2
{
public:
    sipTerminalInterfaceV2();
    sipTerminalInterfaceV2(const TerminalInterfaceV2&);
    virtual ~sipTerminalInterfaceV2();

    /*
     * There is a protected method for every virtual method visible from
     * this class.
     */
protected:
    int terminalProcessId();
    int foregroundProcessId();
    QString foregroundProcessName();
    void startProgram(const QString&,const QStringList&);
    void showShellInDir(const QString&);
    void sendInput(const QString&);

public:
    sipSimpleWrapper *sipPySelf;

private:
    sipTerminalInterfaceV2(const sipTerminalInterfaceV2 &);
    sipTerminalInterfaceV2 &operator = (const sipTerminalInterfaceV2 &);

    char sipPyMethods[6];
};

sipTerminalInterfaceV2::sipTerminalInterfaceV2(): TerminalInterfaceV2(), sipPySelf(0)
{
    memset(sipPyMethods, 0, sizeof (sipPyMethods));
}

sipTerminalInterfaceV2::sipTerminalInterfaceV2(const TerminalInterfaceV2& a0): TerminalInterfaceV2(a0), sipPySelf(0)
{
    memset(sipPyMethods, 0, sizeof (sipPyMethods));
}

sipTerminalInterfaceV2::~sipTerminalInterfaceV2()
{
    sipCommonDtor(sipPySelf);
}

int sipTerminalInterfaceV2::terminalProcessId()
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState,&sipPyMethods[0],sipPySelf,sipName_TerminalInterfaceV2,sipName_terminalProcessId);

    if (!sipMeth)
        return 0;

    typedef int (*sipVH_QtCore_6)(sip_gilstate_t,PyObject *);

    return ((sipVH_QtCore_6)(sipModuleAPI_kterminal_QtCore->em_virthandlers[6]))(sipGILState,sipMeth);
}

int sipTerminalInterfaceV2::foregroundProcessId()
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState,&sipPyMethods[1],sipPySelf,sipName_TerminalInterfaceV2,sipName_foregroundProcessId);

    if (!sipMeth)
        return 0;

    typedef int (*sipVH_QtCore_6)(sip_gilstate_t,PyObject *);

    return ((sipVH_QtCore_6)(sipModuleAPI_kterminal_QtCore->em_virthandlers[6]))(sipGILState,sipMeth);
}

QString sipTerminalInterfaceV2::foregroundProcessName()
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState,&sipPyMethods[2],sipPySelf,sipName_TerminalInterfaceV2,sipName_foregroundProcessName);

    if (!sipMeth)
        return QString();

    typedef QString (*sipVH_QtCore_62)(sip_gilstate_t,PyObject *);

    return ((sipVH_QtCore_62)(sipModuleAPI_kterminal_QtCore->em_virthandlers[62]))(sipGILState,sipMeth);
}

void sipTerminalInterfaceV2::startProgram(const QString& a0,const QStringList& a1)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState,&sipPyMethods[3],sipPySelf,sipName_TerminalInterfaceV2,sipName_startProgram);

    if (!sipMeth)
        return;

    extern void sipVH_kterminal_0(sip_gilstate_t,PyObject *,const QString&,const QStringList&);

    sipVH_kterminal_0(sipGILState,sipMeth,a0,a1);
}

void sipTerminalInterfaceV2::showShellInDir(const QString& a0)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState,&sipPyMethods[4],sipPySelf,sipName_TerminalInterfaceV2,sipName_showShellInDir);

    if (!sipMeth)
        return;

    typedef void (*sipVH_QtCore_33)(sip_gilstate_t,PyObject *,const QString&);

    ((sipVH_QtCore_33)(sipModuleAPI_kterminal_QtCore->em_virthandlers[33]))(sipGILState,sipMeth,a0);
}

void sipTerminalInterfaceV2::sendInput(const QString& a0)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState,&sipPyMethods[5],sipPySelf,sipName_TerminalInterfaceV2,sipName_sendInput);

    if (!sipMeth)
        return;

    typedef void (*sipVH_QtCore_33)(sip_gilstate_t,PyObject *,const QString&);

    ((sipVH_QtCore_33)(sipModuleAPI_kterminal_QtCore->em_virthandlers[33]))(sipGILState,sipMeth,a0);
}


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

    {
        TerminalInterfaceV2 *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_TerminalInterfaceV2, &sipCpp))
        {
            int sipRes;

            if (!sipOrigSelf)
            {
                sipAbstractMethod(sipName_TerminalInterfaceV2, sipName_terminalProcessId);
                return NULL;
            }

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->terminalProcessId();
            Py_END_ALLOW_THREADS

            return SIPLong_FromLong(sipRes);
        }
    }

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

    return NULL;
}


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

    {
        TerminalInterfaceV2 *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "B", &sipSelf, sipType_TerminalInterfaceV2, &sipCpp))
        {
            int sipRes;

            if (!sipOrigSelf)
            {
                sipAbstractMethod(sipName_TerminalInterfaceV2, sipName_foregroundProcessId);
                return NULL;
            }

            Py_BEGIN_ALLOW_THREADS
            sipRes = sipCpp->foregroundProcessId();
            Py_END_ALLOW_THREADS

            return SIPLong_FromLong(sipRes);
        }
    }

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

    return NULL;
}


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

    {
        TerminalInterfaceV2 *sipCpp;

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

            if (!sipOrigSelf)
            {
                sipAbstractMethod(sipName_TerminalInterfaceV2, sipName_foregroundProcessName);
                return NULL;
            }

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

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

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

    return NULL;
}


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

    if (targetType == sipType_TerminalInterfaceV2)
        return ptr;

    if ((res = ((const sipClassTypeDef *)sipType_TerminalInterface)->ctd_cast((TerminalInterface *)(TerminalInterfaceV2 *)ptr,targetType)) != NULL)
        return res;

    return NULL;
}


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

    if (sipState & SIP_DERIVED_CLASS)
        delete reinterpret_cast<sipTerminalInterfaceV2 *>(sipCppV);
    else
        delete reinterpret_cast<TerminalInterfaceV2 *>(sipCppV);

    Py_END_ALLOW_THREADS
}


extern "C" {static void dealloc_TerminalInterfaceV2(sipSimpleWrapper *);}
static void dealloc_TerminalInterfaceV2(sipSimpleWrapper *sipSelf)
{
    if (sipIsDerived(sipSelf))
        reinterpret_cast<sipTerminalInterfaceV2 *>(sipGetAddress(sipSelf))->sipPySelf = NULL;

    if (sipIsPyOwned(sipSelf))
    {
        release_TerminalInterfaceV2(sipGetAddress(sipSelf),sipSelf->flags);
    }
}


extern "C" {static void *init_TerminalInterfaceV2(sipSimpleWrapper *, PyObject *, PyObject *, PyObject **, PyObject **, PyObject **);}
static void *init_TerminalInterfaceV2(sipSimpleWrapper *sipSelf, PyObject *sipArgs, PyObject *sipKwds, PyObject **sipUnused, PyObject **, PyObject **sipParseErr)
{
    sipTerminalInterfaceV2 *sipCpp = 0;

    {
        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, NULL, sipUnused, ""))
        {
            Py_BEGIN_ALLOW_THREADS
            sipCpp = new sipTerminalInterfaceV2();
            Py_END_ALLOW_THREADS

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    {
        const TerminalInterfaceV2 * a0;

        if (sipParseKwdArgs(sipParseErr, sipArgs, sipKwds, NULL, sipUnused, "J9", sipType_TerminalInterfaceV2, &a0))
        {
            Py_BEGIN_ALLOW_THREADS
            sipCpp = new sipTerminalInterfaceV2(*a0);
            Py_END_ALLOW_THREADS

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    return NULL;
}


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


static PyMethodDef methods_TerminalInterfaceV2[] = {
    {SIP_MLNAME_CAST(sipName_foregroundProcessId), meth_TerminalInterfaceV2_foregroundProcessId, METH_VARARGS, NULL},
    {SIP_MLNAME_CAST(sipName_foregroundProcessName), meth_TerminalInterfaceV2_foregroundProcessName, METH_VARARGS, NULL},
    {SIP_MLNAME_CAST(sipName_terminalProcessId), meth_TerminalInterfaceV2_terminalProcessId, METH_VARARGS, NULL}
};


pyqt4ClassTypeDef sipTypeDef_kterminal_TerminalInterfaceV2 = {
{
    {
        -1,
        0,
        0,
        SIP_TYPE_ABSTRACT|SIP_TYPE_CLASS,
        sipNameNr_TerminalInterfaceV2,
        {0}
    },
    {
        sipNameNr_TerminalInterfaceV2,
        {0, 0, 1},
        3, methods_TerminalInterfaceV2,
        0, 0,
        0, 0,
        {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    },
    0,
    -1,
    -1,
    supers_TerminalInterfaceV2,
    0,
    init_TerminalInterfaceV2,
    0,
    0,
#if PY_MAJOR_VERSION >= 3
    0,
    0,
#else
    0,
    0,
    0,
    0,
#endif
    dealloc_TerminalInterfaceV2,
    0,
    0,
    0,
    release_TerminalInterfaceV2,
    cast_TerminalInterfaceV2,
    0,
    0,
    0
},
    0,
    0,
    0
};
