/*
 * 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.sip"
#include <kde_terminal_interface.h>
#line 85 "/work/a/ports/devel/kdebindings4-python-pykde4/work/pykde4-4.7.3/sip/kterminal/sipkterminalpart3.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/sipkterminalpart3.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/sipkterminalpart3.cpp"


class sipTerminalInterface : public TerminalInterface
{
public:
    sipTerminalInterface();
    sipTerminalInterface(const TerminalInterface&);
    virtual ~sipTerminalInterface();

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

public:
    sipSimpleWrapper *sipPySelf;

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

    char sipPyMethods[3];
};

sipTerminalInterface::sipTerminalInterface(): TerminalInterface(), sipPySelf(0)
{
    memset(sipPyMethods, 0, sizeof (sipPyMethods));
}

sipTerminalInterface::sipTerminalInterface(const TerminalInterface& a0): TerminalInterface(a0), sipPySelf(0)
{
    memset(sipPyMethods, 0, sizeof (sipPyMethods));
}

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

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

    sipMeth = sipIsPyMethod(&sipGILState,&sipPyMethods[0],sipPySelf,sipName_TerminalInterface,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 sipTerminalInterface::showShellInDir(const QString& a0)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState,&sipPyMethods[1],sipPySelf,sipName_TerminalInterface,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 sipTerminalInterface::sendInput(const QString& a0)
{
    sip_gilstate_t sipGILState;
    PyObject *sipMeth;

    sipMeth = sipIsPyMethod(&sipGILState,&sipPyMethods[2],sipPySelf,sipName_TerminalInterface,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_TerminalInterface_startProgram(PyObject *, PyObject *);}
static PyObject *meth_TerminalInterface_startProgram(PyObject *sipSelf, PyObject *sipArgs)
{
    PyObject *sipParseErr = NULL;
    PyObject *sipOrigSelf = sipSelf;

    {
        const QString * a0;
        int a0State = 0;
        const QStringList * a1;
        int a1State = 0;
        TerminalInterface *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "BJ1J1", &sipSelf, sipType_TerminalInterface, &sipCpp, sipType_QString,&a0, &a0State, sipType_QStringList,&a1, &a1State))
        {
            if (!sipOrigSelf)
            {
                sipAbstractMethod(sipName_TerminalInterface, sipName_startProgram);
                return NULL;
            }

            Py_BEGIN_ALLOW_THREADS
            sipCpp->startProgram(*a0,*a1);
            Py_END_ALLOW_THREADS
            sipReleaseType(const_cast<QString *>(a0),sipType_QString,a0State);
            sipReleaseType(const_cast<QStringList *>(a1),sipType_QStringList,a1State);

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

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

    return NULL;
}


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

    {
        const QString * a0;
        int a0State = 0;
        TerminalInterface *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "BJ1", &sipSelf, sipType_TerminalInterface, &sipCpp, sipType_QString,&a0, &a0State))
        {
            if (!sipOrigSelf)
            {
                sipAbstractMethod(sipName_TerminalInterface, sipName_showShellInDir);
                return NULL;
            }

            Py_BEGIN_ALLOW_THREADS
            sipCpp->showShellInDir(*a0);
            Py_END_ALLOW_THREADS
            sipReleaseType(const_cast<QString *>(a0),sipType_QString,a0State);

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

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

    return NULL;
}


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

    {
        const QString * a0;
        int a0State = 0;
        TerminalInterface *sipCpp;

        if (sipParseArgs(&sipParseErr, sipArgs, "BJ1", &sipSelf, sipType_TerminalInterface, &sipCpp, sipType_QString,&a0, &a0State))
        {
            if (!sipOrigSelf)
            {
                sipAbstractMethod(sipName_TerminalInterface, sipName_sendInput);
                return NULL;
            }

            Py_BEGIN_ALLOW_THREADS
            sipCpp->sendInput(*a0);
            Py_END_ALLOW_THREADS
            sipReleaseType(const_cast<QString *>(a0),sipType_QString,a0State);

            Py_INCREF(Py_None);
            return Py_None;
        }
    }

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

    return NULL;
}


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

    return NULL;
}


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

    if (sipState & SIP_DERIVED_CLASS)
        delete reinterpret_cast<sipTerminalInterface *>(sipCppV);
    else
        delete reinterpret_cast<TerminalInterface *>(sipCppV);

    Py_END_ALLOW_THREADS
}


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

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


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

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    {
        const TerminalInterface * a0;

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

            sipCpp->sipPySelf = sipSelf;

            return sipCpp;
        }
    }

    return NULL;
}


static PyMethodDef methods_TerminalInterface[] = {
    {SIP_MLNAME_CAST(sipName_sendInput), meth_TerminalInterface_sendInput, METH_VARARGS, NULL},
    {SIP_MLNAME_CAST(sipName_showShellInDir), meth_TerminalInterface_showShellInDir, METH_VARARGS, NULL},
    {SIP_MLNAME_CAST(sipName_startProgram), meth_TerminalInterface_startProgram, METH_VARARGS, NULL}
};


pyqt4ClassTypeDef sipTypeDef_kterminal_TerminalInterface = {
{
    {
        -1,
        0,
        0,
        SIP_TYPE_ABSTRACT|SIP_TYPE_CLASS,
        sipNameNr_TerminalInterface,
        {0}
    },
    {
        sipNameNr_TerminalInterface,
        {0, 0, 1},
        3, methods_TerminalInterface,
        0, 0,
        0, 0,
        {0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
    },
    0,
    sipNameNr_PyQt4_QtCore_pyqtWrapperType,
    -1,
    0,
    0,
    init_TerminalInterface,
    0,
    0,
#if PY_MAJOR_VERSION >= 3
    0,
    0,
#else
    0,
    0,
    0,
    0,
#endif
    dealloc_TerminalInterface,
    0,
    0,
    0,
    release_TerminalInterface,
    cast_TerminalInterface,
    0,
    0,
    0
},
    0,
    0,
    0
};
