/****************************************************************************
**
** DCOP Stub Implementation created by dcopidl2cpp from serviceiface.kidl
**
** WARNING! All changes made in this file will be lost!
**
*****************************************************************************/

#include "serviceiface_stub.h"
#include <dcopclient.h>

#include <kdatastream.h>


ServiceIface_stub::ServiceIface_stub( const TQCString& app, const TQCString& obj )
  : DCOPStub( app, obj )
{
}

ServiceIface_stub::ServiceIface_stub( DCOPClient* client, const TQCString& app, const TQCString& obj )
  : DCOPStub( client, app, obj )
{
}

ServiceIface_stub::ServiceIface_stub( const DCOPRef& ref )
  : DCOPStub( ref )
{
}

void ServiceIface_stub::setNetworkStatus( const TQString& arg0, int arg1 )
{
    if ( !dcopClient()  ) {
	setStatus( CallFailed );
	return;
    }
    TQByteArray data, replyData;
    TQCString replyType;
    TQDataStream arg( data, IO_WriteOnly );
    arg << arg0;
    arg << arg1;
    if ( dcopClient()->call( app(), obj(), "setNetworkStatus(TQString,int)", data, replyType, replyData ) ) {
	setStatus( CallSucceeded );
    } else { 
	callFailed();
    }
}

void ServiceIface_stub::registerNetwork( const TQString& arg0, NetworkStatus::Properties arg1 )
{
    if ( !dcopClient()  ) {
	setStatus( CallFailed );
	return;
    }
    TQByteArray data, replyData;
    TQCString replyType;
    TQDataStream arg( data, IO_WriteOnly );
    arg << arg0;
    arg << arg1;
    if ( dcopClient()->call( app(), obj(), "registerNetwork(TQString,NetworkStatus::Properties)", data, replyType, replyData ) ) {
	setStatus( CallSucceeded );
    } else { 
	callFailed();
    }
}

void ServiceIface_stub::unregisterNetwork( const TQString& arg0 )
{
    if ( !dcopClient()  ) {
	setStatus( CallFailed );
	return;
    }
    TQByteArray data, replyData;
    TQCString replyType;
    TQDataStream arg( data, IO_WriteOnly );
    arg << arg0;
    if ( dcopClient()->call( app(), obj(), "unregisterNetwork(TQString)", data, replyType, replyData ) ) {
	setStatus( CallSucceeded );
    } else { 
	callFailed();
    }
}

void ServiceIface_stub::requestShutdown( const TQString& arg0 )
{
    if ( !dcopClient()  ) {
	setStatus( CallFailed );
	return;
    }
    TQByteArray data, replyData;
    TQCString replyType;
    TQDataStream arg( data, IO_WriteOnly );
    arg << arg0;
    if ( dcopClient()->call( app(), obj(), "requestShutdown(TQString)", data, replyType, replyData ) ) {
	setStatus( CallSucceeded );
    } else { 
	callFailed();
    }
}


