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

#include "/usr/src/ports/kdebase3/kdebase3-3.5.10-11.x86_64/src/kdebase-3.5.10/ksmserver/KSMServerInterface.h"

#include <kdatastream.h>
#include <qasciidict.h>


static const int KSMServerInterface_fhash = 11;
static const char* const KSMServerInterface_ftable[11][3] = {
    { "void", "logout(int,int,int)", "logout(int,int,int)" },
    { "void", "restoreSessionInternal()", "restoreSessionInternal()" },
    { "void", "restoreSessionDoneInternal()", "restoreSessionDoneInternal()" },
    { "QStringList", "sessionList()", "sessionList()" },
    { "QString", "currentSession()", "currentSession()" },
    { "void", "saveCurrentSession()", "saveCurrentSession()" },
    { "void", "saveCurrentSessionAs(QString)", "saveCurrentSessionAs(QString)" },
    { "void", "autoStart2()", "autoStart2()" },
    { "void", "suspendStartup(QCString)", "suspendStartup(QCString)" },
    { "void", "resumeStartup(QCString)", "resumeStartup(QCString)" },
    { 0, 0, 0 }
};
static const int KSMServerInterface_ftable_hiddens[10] = {
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
};

bool KSMServerInterface::process(const QCString &fun, const QByteArray &data, QCString& replyType, QByteArray &replyData)
{
    static QAsciiDict<int>* fdict = 0;
    if ( !fdict ) {
	fdict = new QAsciiDict<int>( KSMServerInterface_fhash, true, false );
	for ( int i = 0; KSMServerInterface_ftable[i][1]; i++ )
	    fdict->insert( KSMServerInterface_ftable[i][1],  new int( i ) );
    }
    int* fp = fdict->find( fun );
    switch ( fp?*fp:-1) {
    case 0: { // void logout(int,int,int)
	int arg0;
	int arg1;
	int arg2;
	QDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	if (arg.atEnd()) return false;
	arg >> arg1;
	if (arg.atEnd()) return false;
	arg >> arg2;
	replyType = KSMServerInterface_ftable[0][0]; 
	logout(arg0, arg1, arg2 );
    } break;
    case 1: { // void restoreSessionInternal()
	replyType = KSMServerInterface_ftable[1][0]; 
	restoreSessionInternal( );
    } break;
    case 2: { // void restoreSessionDoneInternal()
	replyType = KSMServerInterface_ftable[2][0]; 
	restoreSessionDoneInternal( );
    } break;
    case 3: { // QStringList sessionList()
	replyType = KSMServerInterface_ftable[3][0]; 
	QDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << sessionList( );
    } break;
    case 4: { // QString currentSession()
	replyType = KSMServerInterface_ftable[4][0]; 
	QDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << currentSession( );
    } break;
    case 5: { // void saveCurrentSession()
	replyType = KSMServerInterface_ftable[5][0]; 
	saveCurrentSession( );
    } break;
    case 6: { // void saveCurrentSessionAs(QString)
	QString arg0;
	QDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	replyType = KSMServerInterface_ftable[6][0]; 
	saveCurrentSessionAs(arg0 );
    } break;
    case 7: { // void autoStart2()
	replyType = KSMServerInterface_ftable[7][0]; 
	autoStart2( );
    } break;
    case 8: { // void suspendStartup(QCString)
	QCString arg0;
	QDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	replyType = KSMServerInterface_ftable[8][0]; 
	suspendStartup(arg0 );
    } break;
    case 9: { // void resumeStartup(QCString)
	QCString arg0;
	QDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	replyType = KSMServerInterface_ftable[9][0]; 
	resumeStartup(arg0 );
    } break;
    default: 
	return DCOPObject::process( fun, data, replyType, replyData );
    }
    return true;
}

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

QCStringList KSMServerInterface::functions()
{
    QCStringList funcs = DCOPObject::functions();
    for ( int i = 0; KSMServerInterface_ftable[i][2]; i++ ) {
	if (KSMServerInterface_ftable_hiddens[i])
	    continue;
	QCString func = KSMServerInterface_ftable[i][0];
	func += ' ';
	func += KSMServerInterface_ftable[i][2];
	funcs << func;
    }
    return funcs;
}


