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

#include "/opt/trinity/include/kspeechsink.h"

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


static const int KSpeechSink_fhash = 17;
static const char* const KSpeechSink_ftable[14][3] = {
    { "ASYNC", "kttsdStarted()", "kttsdStarted()" },
    { "ASYNC", "kttsdExiting()", "kttsdExiting()" },
    { "ASYNC", "markerSeen(TQCString,TQString)", "markerSeen(TQCString appId,TQString markerName)" },
    { "ASYNC", "sentenceStarted(TQCString,uint,uint)", "sentenceStarted(TQCString appId,uint jobNum,uint seq)" },
    { "ASYNC", "sentenceFinished(TQCString,uint,uint)", "sentenceFinished(TQCString appId,uint jobNum,uint seq)" },
    { "ASYNC", "textSet(TQCString,uint)", "textSet(TQCString appId,uint jobNum)" },
    { "ASYNC", "textAppended(TQCString,uint,int)", "textAppended(TQCString appId,uint jobNum,int partNum)" },
    { "ASYNC", "textStarted(TQCString,uint)", "textStarted(TQCString appId,uint jobNum)" },
    { "ASYNC", "textFinished(TQCString,uint)", "textFinished(TQCString appId,uint jobNum)" },
    { "ASYNC", "textStopped(TQCString,uint)", "textStopped(TQCString appId,uint jobNum)" },
    { "ASYNC", "textPaused(TQCString,uint)", "textPaused(TQCString appId,uint jobNum)" },
    { "ASYNC", "textResumed(TQCString,uint)", "textResumed(TQCString appId,uint jobNum)" },
    { "ASYNC", "textRemoved(TQCString,uint)", "textRemoved(TQCString appId,uint jobNum)" },
    { 0, 0, 0 }
};
static const int KSpeechSink_ftable_hiddens[13] = {
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
};

bool KSpeechSink::process(const TQCString &fun, const TQByteArray &data, TQCString& replyType, TQByteArray &replyData)
{
    static TQAsciiDict<int>* fdict = 0;
    if ( !fdict ) {
	fdict = new TQAsciiDict<int>( KSpeechSink_fhash, true, false );
	for ( int i = 0; KSpeechSink_ftable[i][1]; i++ )
	    fdict->insert( KSpeechSink_ftable[i][1],  new int( i ) );
    }
    int* fp = fdict->find( fun );
    switch ( fp?*fp:-1) {
    case 0: { // void kttsdStarted()
	replyType = KSpeechSink_ftable[0][0]; 
	kttsdStarted( );
    } break;
    case 1: { // void kttsdExiting()
	replyType = KSpeechSink_ftable[1][0]; 
	kttsdExiting( );
    } break;
    case 2: { // void markerSeen(TQCString,TQString)
	TQCString arg0;
	TQString arg1;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	if (arg.atEnd()) return false;
	arg >> arg1;
	replyType = KSpeechSink_ftable[2][0]; 
	markerSeen(arg0, arg1 );
    } break;
    case 3: { // void sentenceStarted(TQCString,uint,uint)
	TQCString arg0;
	uint arg1;
	uint arg2;
	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;
	replyType = KSpeechSink_ftable[3][0]; 
	sentenceStarted(arg0, arg1, arg2 );
    } break;
    case 4: { // void sentenceFinished(TQCString,uint,uint)
	TQCString arg0;
	uint arg1;
	uint arg2;
	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;
	replyType = KSpeechSink_ftable[4][0]; 
	sentenceFinished(arg0, arg1, arg2 );
    } break;
    case 5: { // void textSet(TQCString,uint)
	TQCString arg0;
	uint arg1;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	if (arg.atEnd()) return false;
	arg >> arg1;
	replyType = KSpeechSink_ftable[5][0]; 
	textSet(arg0, arg1 );
    } break;
    case 6: { // void textAppended(TQCString,uint,int)
	TQCString arg0;
	uint arg1;
	int arg2;
	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;
	replyType = KSpeechSink_ftable[6][0]; 
	textAppended(arg0, arg1, arg2 );
    } break;
    case 7: { // void textStarted(TQCString,uint)
	TQCString arg0;
	uint arg1;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	if (arg.atEnd()) return false;
	arg >> arg1;
	replyType = KSpeechSink_ftable[7][0]; 
	textStarted(arg0, arg1 );
    } break;
    case 8: { // void textFinished(TQCString,uint)
	TQCString arg0;
	uint arg1;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	if (arg.atEnd()) return false;
	arg >> arg1;
	replyType = KSpeechSink_ftable[8][0]; 
	textFinished(arg0, arg1 );
    } break;
    case 9: { // void textStopped(TQCString,uint)
	TQCString arg0;
	uint arg1;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	if (arg.atEnd()) return false;
	arg >> arg1;
	replyType = KSpeechSink_ftable[9][0]; 
	textStopped(arg0, arg1 );
    } break;
    case 10: { // void textPaused(TQCString,uint)
	TQCString arg0;
	uint arg1;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	if (arg.atEnd()) return false;
	arg >> arg1;
	replyType = KSpeechSink_ftable[10][0]; 
	textPaused(arg0, arg1 );
    } break;
    case 11: { // void textResumed(TQCString,uint)
	TQCString arg0;
	uint arg1;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	if (arg.atEnd()) return false;
	arg >> arg1;
	replyType = KSpeechSink_ftable[11][0]; 
	textResumed(arg0, arg1 );
    } break;
    case 12: { // void textRemoved(TQCString,uint)
	TQCString arg0;
	uint arg1;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	if (arg.atEnd()) return false;
	arg >> arg1;
	replyType = KSpeechSink_ftable[12][0]; 
	textRemoved(arg0, arg1 );
    } break;
    default: 
	return DCOPObject::process( fun, data, replyType, replyData );
    }
    return true;
}

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

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


