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

#include "/usr/src/ports/kdelibs3/kdelibs3-3.5.10-11.i686/src/kdelibs-3.5.10/interfaces/kmediaplayer/playerdcopobject.h"

#include <kdatastream.h>
#include <qasciidict.h>

namespace KMediaPlayer {

static const int PlayerDCOPObject_fhash = 17;
static const char* const PlayerDCOPObject_ftable[14][3] = {
    { "bool", "openURL(KURL)", "openURL(KURL file)" },
    { "void", "pause()", "pause()" },
    { "void", "play()", "play()" },
    { "void", "stop()", "stop()" },
    { "void", "seek(unsigned long int)", "seek(unsigned long int msec)" },
    { "bool", "isSeekable()", "isSeekable()" },
    { "unsigned long int", "position()", "position()" },
    { "bool", "hasLength()", "hasLength()" },
    { "unsigned long int", "length()", "length()" },
    { "void", "setLooping(bool)", "setLooping(bool)" },
    { "bool", "isLooping()", "isLooping()" },
    { "int", "state()", "state()" },
    { "void", "setState(int)", "setState(int)" },
    { 0, 0, 0 }
};
static const int PlayerDCOPObject_ftable_hiddens[13] = {
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
};

bool PlayerDCOPObject::process(const QCString &fun, const QByteArray &data, QCString& replyType, QByteArray &replyData)
{
    static QAsciiDict<int>* fdict = 0;
    if ( !fdict ) {
	fdict = new QAsciiDict<int>( PlayerDCOPObject_fhash, true, false );
	for ( int i = 0; PlayerDCOPObject_ftable[i][1]; i++ )
	    fdict->insert( PlayerDCOPObject_ftable[i][1],  new int( i ) );
    }
    int* fp = fdict->find( fun );
    switch ( fp?*fp:-1) {
    case 0: { // bool openURL(KURL)
	KURL arg0;
	QDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	replyType = PlayerDCOPObject_ftable[0][0]; 
	QDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << openURL(arg0 );
    } break;
    case 1: { // void pause()
	replyType = PlayerDCOPObject_ftable[1][0]; 
	pause( );
    } break;
    case 2: { // void play()
	replyType = PlayerDCOPObject_ftable[2][0]; 
	play( );
    } break;
    case 3: { // void stop()
	replyType = PlayerDCOPObject_ftable[3][0]; 
	stop( );
    } break;
    case 4: { // void seek(unsigned long int)
	unsigned long int arg0;
	QDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	replyType = PlayerDCOPObject_ftable[4][0]; 
	seek(arg0 );
    } break;
    case 5: { // bool isSeekable()
	replyType = PlayerDCOPObject_ftable[5][0]; 
	QDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << isSeekable( );
    } break;
    case 6: { // unsigned long int position()
	replyType = PlayerDCOPObject_ftable[6][0]; 
	QDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << position( );
    } break;
    case 7: { // bool hasLength()
	replyType = PlayerDCOPObject_ftable[7][0]; 
	QDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << hasLength( );
    } break;
    case 8: { // unsigned long int length()
	replyType = PlayerDCOPObject_ftable[8][0]; 
	QDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << length( );
    } break;
    case 9: { // void setLooping(bool)
	bool arg0;
	QDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	replyType = PlayerDCOPObject_ftable[9][0]; 
	setLooping(arg0 );
    } break;
    case 10: { // bool isLooping()
	replyType = PlayerDCOPObject_ftable[10][0]; 
	QDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << isLooping( );
    } break;
    case 11: { // int state()
	replyType = PlayerDCOPObject_ftable[11][0]; 
	QDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << state( );
    } break;
    case 12: { // void setState(int)
	int arg0;
	QDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	replyType = PlayerDCOPObject_ftable[12][0]; 
	setState(arg0 );
    } break;
    default: 
	return DCOPObject::process( fun, data, replyType, replyData );
    }
    return true;
}

QCStringList PlayerDCOPObject::interfaces()
{
    QCStringList ifaces = DCOPObject::interfaces();
    ifaces += "KMediaPlayer::PlayerDCOPObject";
    return ifaces;
}

QCStringList PlayerDCOPObject::functions()
{
    QCStringList funcs = DCOPObject::functions();
    for ( int i = 0; PlayerDCOPObject_ftable[i][2]; i++ ) {
	if (PlayerDCOPObject_ftable_hiddens[i])
	    continue;
	QCString func = PlayerDCOPObject_ftable[i][0];
	func += ' ';
	func += PlayerDCOPObject_ftable[i][2];
	funcs << func;
    }
    return funcs;
}

} // namespace

