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

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


static const int NetworkStatusModule_fhash = 11;
static const char* const NetworkStatusModule_ftable[10][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)" },
    { "void", "setNetworkStatus(TQString,int)", "setNetworkStatus(TQString networkName,int status)" },
    { "void", "registerNetwork(TQString,NetworkStatus::Properties)", "registerNetwork(TQString networkName,NetworkStatus::Properties properties)" },
    { "void", "unregisterNetwork(TQString)", "unregisterNetwork(TQString networkName)" },
    { "void", "requestShutdown(TQString)", "requestShutdown(TQString networkName)" },
    { 0, 0, 0 }
};
static const int NetworkStatusModule_ftable_hiddens[9] = {
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
};

bool NetworkStatusModule::process(const TQCString &fun, const TQByteArray &data, TQCString& replyType, TQByteArray &replyData)
{
    static TQAsciiDict<int>* fdict = 0;
    if ( !fdict ) {
	fdict = new TQAsciiDict<int>( NetworkStatusModule_fhash, true, false );
	for ( int i = 0; NetworkStatusModule_ftable[i][1]; i++ )
	    fdict->insert( NetworkStatusModule_ftable[i][1],  new int( i ) );
    }
    int* fp = fdict->find( fun );
    switch ( fp?*fp:-1) {
    case 0: { // TQStringList networks()
	replyType = NetworkStatusModule_ftable[0][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << networks( );
    } break;
    case 1: { // int status(TQString)
	TQString arg0;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	replyType = NetworkStatusModule_ftable[1][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << status(arg0 );
    } break;
    case 2: { // 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 = NetworkStatusModule_ftable[2][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << request(arg0, arg1 );
    } break;
    case 3: { // void relinquish(TQString)
	TQString arg0;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	replyType = NetworkStatusModule_ftable[3][0]; 
	relinquish(arg0 );
    } break;
    case 4: { // bool reportFailure(TQString)
	TQString arg0;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	replyType = NetworkStatusModule_ftable[4][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << reportFailure(arg0 );
    } break;
    case 5: { // void setNetworkStatus(TQString,int)
	TQString arg0;
	int arg1;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	if (arg.atEnd()) return false;
	arg >> arg1;
	replyType = NetworkStatusModule_ftable[5][0]; 
	setNetworkStatus(arg0, arg1 );
    } break;
    case 6: { // void registerNetwork(TQString,NetworkStatus::Properties)
	TQString arg0;
	NetworkStatus::Properties arg1;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	if (arg.atEnd()) return false;
	arg >> arg1;
	replyType = NetworkStatusModule_ftable[6][0]; 
	registerNetwork(arg0, arg1 );
    } break;
    case 7: { // void unregisterNetwork(TQString)
	TQString arg0;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	replyType = NetworkStatusModule_ftable[7][0]; 
	unregisterNetwork(arg0 );
    } break;
    case 8: { // void requestShutdown(TQString)
	TQString arg0;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	replyType = NetworkStatusModule_ftable[8][0]; 
	requestShutdown(arg0 );
    } break;
    default: 
	return KDEDModule::process( fun, data, replyType, replyData );
    }
    return true;
}

QCStringList NetworkStatusModule::interfaces()
{
    QCStringList ifaces = KDEDModule::interfaces();
    ifaces += "NetworkStatusModule";
    return ifaces;
}

QCStringList NetworkStatusModule::functions()
{
    QCStringList funcs = KDEDModule::functions();
    for ( int i = 0; NetworkStatusModule_ftable[i][2]; i++ ) {
	if (NetworkStatusModule_ftable_hiddens[i])
	    continue;
	TQCString func = NetworkStatusModule_ftable[i][0];
	func += ' ';
	func += NetworkStatusModule_ftable[i][2];
	funcs << func;
    }
    return funcs;
}

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

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


