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

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

namespace KMPlayer {

static const int Backend_fhash = 19;
static const char* const Backend_ftable[18][3] = {
    { "ASYNC", "setURL(TQString)", "setURL(TQString url)" },
    { "ASYNC", "setSubTitleURL(TQString)", "setSubTitleURL(TQString url)" },
    { "ASYNC", "play(int)", "play(int repeat_count)" },
    { "ASYNC", "stop()", "stop()" },
    { "ASYNC", "pause()", "pause()" },
    { "ASYNC", "seek(int,bool)", "seek(int pos,bool absolute)" },
    { "ASYNC", "hue(int,bool)", "hue(int h,bool absolute)" },
    { "ASYNC", "saturation(int,bool)", "saturation(int s,bool absolute)" },
    { "ASYNC", "contrast(int,bool)", "contrast(int c,bool absolute)" },
    { "ASYNC", "brightness(int,bool)", "brightness(int b,bool absolute)" },
    { "ASYNC", "volume(int,bool)", "volume(int v,bool absolute)" },
    { "ASYNC", "frequency(int)", "frequency(int f)" },
    { "ASYNC", "quit()", "quit()" },
    { "ASYNC", "setConfig(TQByteArray)", "setConfig(TQByteArray)" },
    { "ASYNC", "setAudioLang(int,TQString)", "setAudioLang(int,TQString)" },
    { "ASYNC", "setSubtitle(int,TQString)", "setSubtitle(int,TQString)" },
    { "bool", "isPlaying()", "isPlaying()" },
    { 0, 0, 0 }
};
static const int Backend_ftable_hiddens[17] = {
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
};

bool Backend::process(const TQCString &fun, const TQByteArray &data, TQCString& replyType, TQByteArray &replyData)
{
    static TQAsciiDict<int>* fdict = 0;
    if ( !fdict ) {
	fdict = new TQAsciiDict<int>( Backend_fhash, true, false );
	for ( int i = 0; Backend_ftable[i][1]; i++ )
	    fdict->insert( Backend_ftable[i][1],  new int( i ) );
    }
    int* fp = fdict->find( fun );
    switch ( fp?*fp:-1) {
    case 0: { // void setURL(TQString)
	TQString arg0;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	replyType = Backend_ftable[0][0]; 
	setURL(arg0 );
    } break;
    case 1: { // void setSubTitleURL(TQString)
	TQString arg0;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	replyType = Backend_ftable[1][0]; 
	setSubTitleURL(arg0 );
    } break;
    case 2: { // void play(int)
	int arg0;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	replyType = Backend_ftable[2][0]; 
	play(arg0 );
    } break;
    case 3: { // void stop()
	replyType = Backend_ftable[3][0]; 
	stop( );
    } break;
    case 4: { // void pause()
	replyType = Backend_ftable[4][0]; 
	pause( );
    } break;
    case 5: { // void seek(int,bool)
	int arg0;
	bool arg1;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	if (arg.atEnd()) return false;
	arg >> arg1;
	replyType = Backend_ftable[5][0]; 
	seek(arg0, arg1 );
    } break;
    case 6: { // void hue(int,bool)
	int arg0;
	bool arg1;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	if (arg.atEnd()) return false;
	arg >> arg1;
	replyType = Backend_ftable[6][0]; 
	hue(arg0, arg1 );
    } break;
    case 7: { // void saturation(int,bool)
	int arg0;
	bool arg1;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	if (arg.atEnd()) return false;
	arg >> arg1;
	replyType = Backend_ftable[7][0]; 
	saturation(arg0, arg1 );
    } break;
    case 8: { // void contrast(int,bool)
	int arg0;
	bool arg1;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	if (arg.atEnd()) return false;
	arg >> arg1;
	replyType = Backend_ftable[8][0]; 
	contrast(arg0, arg1 );
    } break;
    case 9: { // void brightness(int,bool)
	int arg0;
	bool arg1;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	if (arg.atEnd()) return false;
	arg >> arg1;
	replyType = Backend_ftable[9][0]; 
	brightness(arg0, arg1 );
    } break;
    case 10: { // void volume(int,bool)
	int arg0;
	bool arg1;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	if (arg.atEnd()) return false;
	arg >> arg1;
	replyType = Backend_ftable[10][0]; 
	volume(arg0, arg1 );
    } break;
    case 11: { // void frequency(int)
	int arg0;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	replyType = Backend_ftable[11][0]; 
	frequency(arg0 );
    } break;
    case 12: { // void quit()
	replyType = Backend_ftable[12][0]; 
	quit( );
    } break;
    case 13: { // void setConfig(TQByteArray)
	TQByteArray arg0;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	replyType = Backend_ftable[13][0]; 
	setConfig(arg0 );
    } break;
    case 14: { // void setAudioLang(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 = Backend_ftable[14][0]; 
	setAudioLang(arg0, arg1 );
    } break;
    case 15: { // void setSubtitle(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 = Backend_ftable[15][0]; 
	setSubtitle(arg0, arg1 );
    } break;
    case 16: { // bool isPlaying()
	replyType = Backend_ftable[16][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << isPlaying( );
    } break;
    default: 
	return DCOPObject::process( fun, data, replyType, replyData );
    }
    return true;
}

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

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

} // namespace

