/****************************************************************************
**
** DCOP Skeleton generated by dcopidl2cpp from provideriface.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/provideriface.h"

#include <kdatastream.h>


static const char* const ProviderIface_ftable[6][3] = {
    { "int", "status(TQString)", "status(TQString network)" },
    { "int", "establish(TQString)", "establish(TQString network)" },
    { "int", "shutdown(TQString)", "shutdown(TQString network)" },
    { "void", "simulateFailure()", "simulateFailure()" },
    { "void", "simulateDisconnect()", "simulateDisconnect()" },
    { 0, 0, 0 }
};
static const int ProviderIface_ftable_hiddens[5] = {
    0,
    0,
    0,
    0,
    0,
};

bool ProviderIface::process(const TQCString &fun, const TQByteArray &data, TQCString& replyType, TQByteArray &replyData)
{
    if ( fun == ProviderIface_ftable[0][1] ) { // int status(TQString)
	TQString arg0;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	replyType = ProviderIface_ftable[0][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << status(arg0 );
    } else if ( fun == ProviderIface_ftable[1][1] ) { // int establish(TQString)
	TQString arg0;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	replyType = ProviderIface_ftable[1][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << establish(arg0 );
    } else if ( fun == ProviderIface_ftable[2][1] ) { // int shutdown(TQString)
	TQString arg0;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	replyType = ProviderIface_ftable[2][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << shutdown(arg0 );
    } else if ( fun == ProviderIface_ftable[3][1] ) { // void simulateFailure()
	replyType = ProviderIface_ftable[3][0]; 
	simulateFailure( );
    } else if ( fun == ProviderIface_ftable[4][1] ) { // void simulateDisconnect()
	replyType = ProviderIface_ftable[4][0]; 
	simulateDisconnect( );
    } else {
	return DCOPObject::process( fun, data, replyType, replyData );
    }
    return true;
}

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

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


