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

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

#include <kdatastream.h>


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

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

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

void dcopIface_stub::openTheme( TQString arg0 )
{
    if ( !dcopClient()  ) {
	setStatus( CallFailed );
	return;
    }
    TQByteArray data;
    TQDataStream arg( data, IO_WriteOnly );
    arg << arg0;
    dcopClient()->send( app(), obj(), "openTheme(TQString)", data );
    setStatus( CallSucceeded );
}

void dcopIface_stub::openNamedTheme( TQString arg0, TQString arg1, bool arg2 )
{
    if ( !dcopClient()  ) {
	setStatus( CallFailed );
	return;
    }
    TQByteArray data;
    TQDataStream arg( data, IO_WriteOnly );
    arg << arg0;
    arg << arg1;
    arg << arg2;
    dcopClient()->send( app(), obj(), "openNamedTheme(TQString,TQString,bool)", data );
    setStatus( CallSucceeded );
}

void dcopIface_stub::closeTheme( TQString arg0 )
{
    if ( !dcopClient()  ) {
	setStatus( CallFailed );
	return;
    }
    TQByteArray data;
    TQDataStream arg( data, IO_WriteOnly );
    arg << arg0;
    dcopClient()->send( app(), obj(), "closeTheme(TQString)", data );
    setStatus( CallSucceeded );
}

void dcopIface_stub::quit()
{
    if ( !dcopClient()  ) {
	setStatus( CallFailed );
	return;
    }
    TQByteArray data;
    dcopClient()->send( app(), obj(), "quit()", data );
    setStatus( CallSucceeded );
}

void dcopIface_stub::hideSystemTray( bool arg0 )
{
    if ( !dcopClient()  ) {
	setStatus( CallFailed );
	return;
    }
    TQByteArray data;
    TQDataStream arg( data, IO_WriteOnly );
    arg << arg0;
    dcopClient()->send( app(), obj(), "hideSystemTray(bool)", data );
    setStatus( CallSucceeded );
}

void dcopIface_stub::showThemeDialog()
{
    if ( !dcopClient()  ) {
	setStatus( CallFailed );
	return;
    }
    TQByteArray data;
    dcopClient()->send( app(), obj(), "showThemeDialog()", data );
    setStatus( CallSucceeded );
}

int dcopIface_stub::themeAdded( TQString arg0, TQString arg1 )
{
    int result = 0;
    if ( !dcopClient()  ) {
	setStatus( CallFailed );
	return result;
    }
    TQByteArray data, replyData;
    TQCString replyType;
    TQDataStream arg( data, IO_WriteOnly );
    arg << arg0;
    arg << arg1;
    if ( dcopClient()->call( app(), obj(), "themeAdded(TQString,TQString)", data, replyType, replyData ) ) {
	if ( replyType == "int" ) {
	    TQDataStream _reply_stream( replyData, IO_ReadOnly );
	    _reply_stream >> result;
	    setStatus( CallSucceeded );
	} else {
	    callFailed();
	}
    } else { 
	callFailed();
    }
    return result;
}

void dcopIface_stub::themeClosed( TQString arg0, TQString arg1, int arg2 )
{
    if ( !dcopClient()  ) {
	setStatus( CallFailed );
	return;
    }
    TQByteArray data;
    TQDataStream arg( data, IO_WriteOnly );
    arg << arg0;
    arg << arg1;
    arg << arg2;
    dcopClient()->send( app(), obj(), "themeClosed(TQString,TQString,int)", data );
    setStatus( CallSucceeded );
}

void dcopIface_stub::themeNotify( TQString arg0, TQString arg1 )
{
    if ( !dcopClient()  ) {
	setStatus( CallFailed );
	return;
    }
    TQByteArray data;
    TQDataStream arg( data, IO_WriteOnly );
    arg << arg0;
    arg << arg1;
    dcopClient()->send( app(), obj(), "themeNotify(TQString,TQString)", data );
    setStatus( CallSucceeded );
}

void dcopIface_stub::setIncomingData( TQString arg0, TQString arg1 )
{
    if ( !dcopClient()  ) {
	setStatus( CallFailed );
	return;
    }
    TQByteArray data;
    TQDataStream arg( data, IO_WriteOnly );
    arg << arg0;
    arg << arg1;
    dcopClient()->send( app(), obj(), "setIncomingData(TQString,TQString)", data );
    setStatus( CallSucceeded );
}

bool dcopIface_stub::isMainKaramba()
{
    bool result = false;
    if ( !dcopClient()  ) {
	setStatus( CallFailed );
	return result;
    }
    TQByteArray data, replyData;
    TQCString replyType;
    if ( dcopClient()->call( app(), obj(), "isMainKaramba()", data, replyType, replyData ) ) {
	if ( replyType == "bool" ) {
	    TQDataStream _reply_stream( replyData, IO_ReadOnly );
	    _reply_stream >> result;
	    setStatus( CallSucceeded );
	} else {
	    callFailed();
	}
    } else { 
	callFailed();
    }
    return result;
}


