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

#include "/tmp/buildd/tde-packaging/arch/tde-core/tde-tdelibs/src/tdelibs-trinity-14.1.6/networkstatus/clientiface.h"

#include <kdatastream.h>


static const char* const ClientIface_ftable[6][3] = {
    { "TQStringList", "networks()", "networks()" },
    { "int", "status(TQString)", "status(TQString host)" },
    { "int", "request(TQString,bool)", "request(TQString host,bool userInitiated)" },
    { "void", "relinquish(TQString)", "relinquish(TQString host)" },
    { "bool", "reportFailure(TQString)", "reportFailure(TQString host)" },
    { 0, 0, 0 }
};
static const int ClientIface_ftable_hiddens[5] = {
    0,
    0,
    0,
    0,
    0,
};

bool ClientIface::process(const TQCString &fun, const TQByteArray &data, TQCString& replyType, TQByteArray &replyData)
{
    if ( fun == ClientIface_ftable[0][1] ) { // TQStringList networks()
	replyType = ClientIface_ftable[0][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << networks( );
    } else if ( fun == ClientIface_ftable[1][1] ) { // int status(TQString)
	TQString arg0;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	replyType = ClientIface_ftable[1][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << status(arg0 );
    } else if ( fun == ClientIface_ftable[2][1] ) { // int request(TQString,bool)
	TQString arg0;
	bool arg1;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	if (arg.atEnd()) return false;
	arg >> arg1;
	replyType = ClientIface_ftable[2][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << request(arg0, arg1 );
    } else if ( fun == ClientIface_ftable[3][1] ) { // void relinquish(TQString)
	TQString arg0;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	replyType = ClientIface_ftable[3][0]; 
	relinquish(arg0 );
    } else if ( fun == ClientIface_ftable[4][1] ) { // bool reportFailure(TQString)
	TQString arg0;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	replyType = ClientIface_ftable[4][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << reportFailure(arg0 );
    } else {
	return DCOPObject::process( fun, data, replyType, replyData );
    }
    return true;
}

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

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

void ClientIface::statusChange( TQString arg0, int arg1 )
{
    TQByteArray data;
    TQDataStream arg( data, IO_WriteOnly );
    arg << arg0;
    arg << arg1;
    emitDCOPSignal( "statusChange(TQString,int)", data );
}

void ClientIface::shutdownRequested( TQString arg0 )
{
    TQByteArray data;
    TQDataStream arg( data, IO_WriteOnly );
    arg << arg0;
    emitDCOPSignal( "shutdownRequested(TQString)", data );
}


