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

#include "/tmp/buildd/tde-packaging/arch/tde-core/tde-tdelibs/src/tdelibs-trinity-14.1.6/interfaces/tdetexteditor/editdcopinterface.h"

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

namespace KTextEditor {

static const int EditDCOPInterface_fhash = 11;
static const char* const EditDCOPInterface_ftable[10][3] = {
    { "TQString", "text()", "text()" },
    { "TQString", "textLine(uint)", "textLine(uint line)" },
    { "int", "numLines()", "numLines()" },
    { "int", "length()", "length()" },
    { "void", "setText(TQString)", "setText(TQString text)" },
    { "bool", "insertText(uint,uint,TQString)", "insertText(uint line,uint col,TQString text)" },
    { "bool", "removeText(uint,uint,uint,uint)", "removeText(uint startLine,uint startCol,uint endLine,uint endCol)" },
    { "bool", "insertLine(uint,TQString)", "insertLine(uint line,TQString text)" },
    { "bool", "removeLine(uint)", "removeLine(uint line)" },
    { 0, 0, 0 }
};
static const int EditDCOPInterface_ftable_hiddens[9] = {
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
};

bool EditDCOPInterface::process(const TQCString &fun, const TQByteArray &data, TQCString& replyType, TQByteArray &replyData)
{
    static TQAsciiDict<int>* fdict = 0;
    if ( !fdict ) {
	fdict = new TQAsciiDict<int>( EditDCOPInterface_fhash, true, false );
	for ( int i = 0; EditDCOPInterface_ftable[i][1]; i++ )
	    fdict->insert( EditDCOPInterface_ftable[i][1],  new int( i ) );
    }
    int* fp = fdict->find( fun );
    switch ( fp?*fp:-1) {
    case 0: { // TQString text()
	replyType = EditDCOPInterface_ftable[0][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << text( );
    } break;
    case 1: { // TQString textLine(uint)
	uint arg0;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	replyType = EditDCOPInterface_ftable[1][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << textLine(arg0 );
    } break;
    case 2: { // int numLines()
	replyType = EditDCOPInterface_ftable[2][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << numLines( );
    } break;
    case 3: { // int length()
	replyType = EditDCOPInterface_ftable[3][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << length( );
    } break;
    case 4: { // void setText(TQString)
	TQString arg0;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	replyType = EditDCOPInterface_ftable[4][0]; 
	setText(arg0 );
    } break;
    case 5: { // bool insertText(uint,uint,TQString)
	uint arg0;
	uint arg1;
	TQString 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 = EditDCOPInterface_ftable[5][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << insertText(arg0, arg1, arg2 );
    } break;
    case 6: { // bool removeText(uint,uint,uint,uint)
	uint arg0;
	uint arg1;
	uint arg2;
	uint arg3;
	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;
	replyType = EditDCOPInterface_ftable[6][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << removeText(arg0, arg1, arg2, arg3 );
    } break;
    case 7: { // bool insertLine(uint,TQString)
	uint arg0;
	TQString arg1;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	if (arg.atEnd()) return false;
	arg >> arg1;
	replyType = EditDCOPInterface_ftable[7][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << insertLine(arg0, arg1 );
    } break;
    case 8: { // bool removeLine(uint)
	uint arg0;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	replyType = EditDCOPInterface_ftable[8][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << removeLine(arg0 );
    } break;
    default: 
	return DCOPObject::process( fun, data, replyType, replyData );
    }
    return true;
}

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

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

} // namespace

