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

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

namespace KTextEditor {

static const int EditDCOPInterface_fhash = 11;
static const char* const EditDCOPInterface_ftable[10][3] = {
    { "QString", "text()", "text()" },
    { "QString", "textLine(uint)", "textLine(uint line)" },
    { "int", "numLines()", "numLines()" },
    { "int", "length()", "length()" },
    { "void", "setText(QString)", "setText(QString text)" },
    { "bool", "insertText(uint,uint,QString)", "insertText(uint line,uint col,QString text)" },
    { "bool", "removeText(uint,uint,uint,uint)", "removeText(uint startLine,uint startCol,uint endLine,uint endCol)" },
    { "bool", "insertLine(uint,QString)", "insertLine(uint line,QString 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 QCString &fun, const QByteArray &data, QCString& replyType, QByteArray &replyData)
{
    static QAsciiDict<int>* fdict = 0;
    if ( !fdict ) {
	fdict = new QAsciiDict<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: { // QString text()
	replyType = EditDCOPInterface_ftable[0][0]; 
	QDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << text( );
    } break;
    case 1: { // QString textLine(uint)
	uint arg0;
	QDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	replyType = EditDCOPInterface_ftable[1][0]; 
	QDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << textLine(arg0 );
    } break;
    case 2: { // int numLines()
	replyType = EditDCOPInterface_ftable[2][0]; 
	QDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << numLines( );
    } break;
    case 3: { // int length()
	replyType = EditDCOPInterface_ftable[3][0]; 
	QDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << length( );
    } break;
    case 4: { // void setText(QString)
	QString arg0;
	QDataStream 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,QString)
	uint arg0;
	uint arg1;
	QString arg2;
	QDataStream 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]; 
	QDataStream _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;
	QDataStream 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]; 
	QDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << removeText(arg0, arg1, arg2, arg3 );
    } break;
    case 7: { // bool insertLine(uint,QString)
	uint arg0;
	QString arg1;
	QDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	if (arg.atEnd()) return false;
	arg >> arg1;
	replyType = EditDCOPInterface_ftable[7][0]; 
	QDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << insertLine(arg0, arg1 );
    } break;
    case 8: { // bool removeLine(uint)
	uint arg0;
	QDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	replyType = EditDCOPInterface_ftable[8][0]; 
	QDataStream _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;
	QCString func = EditDCOPInterface_ftable[i][0];
	func += ' ';
	func += EditDCOPInterface_ftable[i][2];
	funcs << func;
    }
    return funcs;
}

} // namespace

