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

#include "/tmp/buildd/tde-packaging/arch/tde-extra/tde-kmplayer/src/kmplayer-trinity-14.1.6/src/kmplayer_callback.h"

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

namespace KMPlayer {

static const int Callback_fhash = 11;
static const char* const Callback_ftable[11][3] = {
    { "ASYNC", "statusMessage(int,TQString)", "statusMessage(int code,TQString msg)" },
    { "ASYNC", "errorMessage(int,TQString)", "errorMessage(int code,TQString msg)" },
    { "ASYNC", "subMrl(TQString,TQString)", "subMrl(TQString mrl,TQString title)" },
    { "ASYNC", "finished()", "finished()" },
    { "ASYNC", "playing()", "playing()" },
    { "ASYNC", "started(TQCString,TQByteArray)", "started(TQCString dcopname,TQByteArray data)" },
    { "ASYNC", "movieParams(int,int,int,float,TQStringList,TQStringList)", "movieParams(int length,int width,int height,float aspect,TQStringList alang,TQStringList slang)" },
    { "ASYNC", "moviePosition(int)", "moviePosition(int position)" },
    { "ASYNC", "loadingProgress(int)", "loadingProgress(int percentage)" },
    { "ASYNC", "toggleFullScreen()", "toggleFullScreen()" },
    { 0, 0, 0 }
};
static const int Callback_ftable_hiddens[10] = {
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
};

bool Callback::process(const TQCString &fun, const TQByteArray &data, TQCString& replyType, TQByteArray &replyData)
{
    static TQAsciiDict<int>* fdict = 0;
    if ( !fdict ) {
	fdict = new TQAsciiDict<int>( Callback_fhash, true, false );
	for ( int i = 0; Callback_ftable[i][1]; i++ )
	    fdict->insert( Callback_ftable[i][1],  new int( i ) );
    }
    int* fp = fdict->find( fun );
    switch ( fp?*fp:-1) {
    case 0: { // void statusMessage(int,TQString)
	int arg0;
	TQString arg1;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	if (arg.atEnd()) return false;
	arg >> arg1;
	replyType = Callback_ftable[0][0]; 
	statusMessage(arg0, arg1 );
    } break;
    case 1: { // void errorMessage(int,TQString)
	int arg0;
	TQString arg1;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	if (arg.atEnd()) return false;
	arg >> arg1;
	replyType = Callback_ftable[1][0]; 
	errorMessage(arg0, arg1 );
    } break;
    case 2: { // void subMrl(TQString,TQString)
	TQString arg0;
	TQString arg1;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	if (arg.atEnd()) return false;
	arg >> arg1;
	replyType = Callback_ftable[2][0]; 
	subMrl(arg0, arg1 );
    } break;
    case 3: { // void finished()
	replyType = Callback_ftable[3][0]; 
	finished( );
    } break;
    case 4: { // void playing()
	replyType = Callback_ftable[4][0]; 
	playing( );
    } break;
    case 5: { // void started(TQCString,TQByteArray)
	TQCString arg0;
	TQByteArray arg1;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	if (arg.atEnd()) return false;
	arg >> arg1;
	replyType = Callback_ftable[5][0]; 
	started(arg0, arg1 );
    } break;
    case 6: { // void movieParams(int,int,int,float,TQStringList,TQStringList)
	int arg0;
	int arg1;
	int arg2;
	float arg3;
	TQStringList arg4;
	TQStringList arg5;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	if (arg.atEnd()) return false;
	arg >> arg1;
	if (arg.atEnd()) return false;
	arg >> arg2;
	if (arg.atEnd()) return false;
	arg >> arg3;
	if (arg.atEnd()) return false;
	arg >> arg4;
	if (arg.atEnd()) return false;
	arg >> arg5;
	replyType = Callback_ftable[6][0]; 
	movieParams(arg0, arg1, arg2, arg3, arg4, arg5 );
    } break;
    case 7: { // void moviePosition(int)
	int arg0;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	replyType = Callback_ftable[7][0]; 
	moviePosition(arg0 );
    } break;
    case 8: { // void loadingProgress(int)
	int arg0;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	replyType = Callback_ftable[8][0]; 
	loadingProgress(arg0 );
    } break;
    case 9: { // void toggleFullScreen()
	replyType = Callback_ftable[9][0]; 
	toggleFullScreen( );
    } break;
    default: 
	return DCOPObject::process( fun, data, replyType, replyData );
    }
    return true;
}

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

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

} // namespace

