/****************************************************************************
**
** DCOP Skeleton created by dcopidl2cpp from kltiface.kidl
**
** WARNING! All changes made in this file will be lost!
**
*****************************************************************************/

#include "./kltiface.h"

#include <kdatastream.h>


static const char* const KltIface_ftable[7][3] = {
    { "int", "sessionCount()", "sessionCount()" },
    { "QString", "currentSession()", "currentSession()" },
    { "QString", "newSession(QString)", "newSession(QString type)" },
    { "QString", "sessionId(int)", "sessionId(int position)" },
    { "void", "activateSession(QString)", "activateSession(QString sessionId)" },
    { "ASYNC", "reparseConfiguration()", "reparseConfiguration()" },
    { 0, 0, 0 }
};

bool KltIface::process(const QCString &fun, const QByteArray &data, QCString& replyType, QByteArray &replyData)
{
    if ( fun == KltIface_ftable[0][1] ) { // int sessionCount()
	replyType = KltIface_ftable[0][0]; 
	QDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << sessionCount( );
    } else if ( fun == KltIface_ftable[1][1] ) { // QString currentSession()
	replyType = KltIface_ftable[1][0]; 
	QDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << currentSession( );
    } else if ( fun == KltIface_ftable[2][1] ) { // QString newSession(QString)
	QString arg0;
	QDataStream arg( data, IO_ReadOnly );
	arg >> arg0;
	replyType = KltIface_ftable[2][0]; 
	QDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << newSession(arg0 );
    } else if ( fun == KltIface_ftable[3][1] ) { // QString sessionId(int)
	int arg0;
	QDataStream arg( data, IO_ReadOnly );
	arg >> arg0;
	replyType = KltIface_ftable[3][0]; 
	QDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << sessionId(arg0 );
    } else if ( fun == KltIface_ftable[4][1] ) { // void activateSession(QString)
	QString arg0;
	QDataStream arg( data, IO_ReadOnly );
	arg >> arg0;
	replyType = KltIface_ftable[4][0]; 
	activateSession(arg0 );
    } else if ( fun == KltIface_ftable[5][1] ) { // void reparseConfiguration()
	replyType = KltIface_ftable[5][0]; 
	reparseConfiguration( );
    } else {
	return DCOPObject::process( fun, data, replyType, replyData );
    }
    return TRUE;
}

QCStringList KltIface::interfaces()
{
    QCStringList ifaces = DCOPObject::interfaces();
    ifaces += "KltIface";
    return ifaces;
}

QCStringList KltIface::functions()
{
    QCStringList funcs = DCOPObject::functions();
    for ( int i = 0; KltIface_ftable[i][2]; i++ ) {
	QCString func = KltIface_ftable[i][0];
	func += ' ';
	func += KltIface_ftable[i][2];
	funcs << func;
    }
    return funcs;
}


