/*
 * Module code.
 *
 * Generated by SIP 4.19.3
 *
 * 
 *  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 "/usr/src/ports/python-pykde4/python-pykde4-4.14.3-4.i686/src/pykde4-4.14.3/sip/kterminal/terminal_interface.sip"
#include <kde_terminal_interface.h>
#line 85 "/usr/src/ports/python-pykde4/python-pykde4-4.14.3-4.i686/build/py3/sip/kterminal/sipkterminalpart3.cpp"

#line 27 "/usr/share/sip/PyQt4/QtCore/qstring.sip"
#include <qstring.h>
#line 89 "/usr/src/ports/python-pykde4/python-pykde4-4.14.3-4.i686/build/py3/sip/kterminal/sipkterminalpart3.cpp"
#line 27 "/usr/share/sip/PyQt4/QtCore/qstringlist.sip"
#include <qstringlist.h>
#line 92 "/usr/src/ports/python-pykde4/python-pykde4-4.14.3-4.i686/build/py3/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 sendInput(const  ::QString&);
    void showShellInDir(const  ::QString&);
    void startProgram(const  ::QString&,const  ::QStringList&);

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()
{
    sipInstanceDestroyed(sipPySelf);
}

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

    sipMeth = sipIsPyMethod(&sipGILState,&sipPyMethods[0],sipPySelf,sipName_TerminalInterface,sipName_sendInput);

    if (!sipMeth)
        return;

    extern void sipVH_kterminal_1(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, const  ::QString&);

    sipVH_kterminal_1(sipGILState, 0, sipPySelf, sipMeth, a0);
}

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;

    extern void sipVH_kterminal_1(sip_gilstate_t, sipVirtErrorHandlerFunc, sipSimpleWrapper *, PyObject *, const  ::QString&);

    sipVH_kterminal_1(sipGILState, 0, sipPySelf, sipMeth, a0);
}

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

    sipMeth = sipIsPyMethod(&sipGILState,&sipPyMethods[2],sipPySelf,sipName_TerminalInterface,sipName_startProgram);

    if (!sipMeth)
        return;

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

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


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;
}


/* 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 (sipIsDerivedClass(sipSelf))
        reinterpret_cast<sipTerminalInterface *>(sipGetAddress(sipSelf))->sipPySelf = NULL;

    if (sipIsOwnedByPython(sipSelf))
    {
        release_TerminalInterface(sipGetAddress(sipSelf), sipIsDerivedClass(sipSelf));
    }
}


extern "C" {static void *init_type_TerminalInterface(sipSimpleWrapper *, PyObject *, PyObject *, PyObject **, PyObject **, PyObject **);}
static void *init_type_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}
};


static pyqt4ClassPluginDef plugin_TerminalInterface = {
    0,
    0,
    0
};


sipClassTypeDef sipTypeDef_kterminal_TerminalInterface = {
    {
        -1,
        0,
        0,
        SIP_TYPE_ABSTRACT|SIP_TYPE_CLASS,
        sipNameNr_TerminalInterface,
        {0},
        &plugin_TerminalInterface
    },
    {
        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_type_TerminalInterface,
    0,
    0,
#if PY_MAJOR_VERSION >= 3
    0,
    0,
#else
    0,
    0,
    0,
    0,
#endif
    dealloc_TerminalInterface,
    0,
    0,
    0,
    release_TerminalInterface,
    0,
    0,
    0,
    0,
    0,
    0,
    0
};
