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

#include "/tmp/buildd/tde-packaging/arch/tde-core/tde-tdebase/src/tdebase-trinity-14.1.6/ksysguard/gui/ksysguard.h"

#include <kdatastream.h>
#include <tqasciidict.h>


static const int TopLevel_fhash = 11;
static const char* const TopLevel_ftable[9][3] = {
    { "ASYNC", "showProcesses()", "showProcesses()" },
    { "ASYNC", "showOnCurrentDesktop()", "showOnCurrentDesktop()" },
    { "ASYNC", "loadWorkSheet(TQString)", "loadWorkSheet(TQString fileName)" },
    { "ASYNC", "removeWorkSheet(TQString)", "removeWorkSheet(TQString fileName)" },
    { "TQStringList", "listHosts()", "listHosts()" },
    { "TQStringList", "listSensors(TQString)", "listSensors(TQString hostName)" },
    { "TQString", "readIntegerSensor(TQString)", "readIntegerSensor(TQString sensorLocator)" },
    { "TQStringList", "readListSensor(TQString)", "readListSensor(TQString sensorLocator)" },
    { 0, 0, 0 }
};
static const int TopLevel_ftable_hiddens[8] = {
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
};

bool TopLevel::process(const TQCString &fun, const TQByteArray &data, TQCString& replyType, TQByteArray &replyData)
{
    static TQAsciiDict<int>* fdict = 0;
    if ( !fdict ) {
	fdict = new TQAsciiDict<int>( TopLevel_fhash, true, false );
	for ( int i = 0; TopLevel_ftable[i][1]; i++ )
	    fdict->insert( TopLevel_ftable[i][1],  new int( i ) );
    }
    int* fp = fdict->find( fun );
    switch ( fp?*fp:-1) {
    case 0: { // void showProcesses()
	replyType = TopLevel_ftable[0][0]; 
	showProcesses( );
    } break;
    case 1: { // void showOnCurrentDesktop()
	replyType = TopLevel_ftable[1][0]; 
	showOnCurrentDesktop( );
    } break;
    case 2: { // void loadWorkSheet(TQString)
	TQString arg0;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	replyType = TopLevel_ftable[2][0]; 
	loadWorkSheet(arg0 );
    } break;
    case 3: { // void removeWorkSheet(TQString)
	TQString arg0;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	replyType = TopLevel_ftable[3][0]; 
	removeWorkSheet(arg0 );
    } break;
    case 4: { // TQStringList listHosts()
	replyType = TopLevel_ftable[4][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << listHosts( );
    } break;
    case 5: { // TQStringList listSensors(TQString)
	TQString arg0;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	replyType = TopLevel_ftable[5][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << listSensors(arg0 );
    } break;
    case 6: { // TQString readIntegerSensor(TQString)
	TQString arg0;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	replyType = TopLevel_ftable[6][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << readIntegerSensor(arg0 );
    } break;
    case 7: { // TQStringList readListSensor(TQString)
	TQString arg0;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	replyType = TopLevel_ftable[7][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << readListSensor(arg0 );
    } break;
    default: 
	return DCOPObject::process( fun, data, replyType, replyData );
    }
    return true;
}

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

QCStringList TopLevel::functions()
{
    QCStringList funcs = DCOPObject::functions();
    for ( int i = 0; TopLevel_ftable[i][2]; i++ ) {
	if (TopLevel_ftable_hiddens[i])
	    continue;
	TQCString func = TopLevel_ftable[i][0];
	func += ' ';
	func += TopLevel_ftable[i][2];
	funcs << func;
    }
    return funcs;
}


