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

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

namespace KTextEditor {

static const int SearchDCOPInterface_fhash = 17;
static const char* const SearchDCOPInterface_ftable[14][3] = {
    { "bool", "findFirstString(QString,bool)", "findFirstString(QString text,bool caseSensitive)" },
    { "bool", "findNextString(QString,bool)", "findNextString(QString text,bool caseSensitive)" },
    { "bool", "findPreviousString(QString,bool)", "findPreviousString(QString text,bool caseSensitive)" },
    { "bool", "findLastString(QString,bool)", "findLastString(QString text,bool caseSensitive)" },
    { "bool", "findStringAt(uint,uint,QString,bool)", "findStringAt(uint row,uint col,QString text,bool caseSensitive)" },
    { "bool", "findFirstRegExp(QString)", "findFirstRegExp(QString regexp)" },
    { "bool", "findNextRegExp(QString)", "findNextRegExp(QString regexp)" },
    { "bool", "findPreviousRegExp(QString)", "findPreviousRegExp(QString regexp)" },
    { "bool", "findLastRegExp(QString)", "findLastRegExp(QString regexp)" },
    { "bool", "findRegExpAt(uint,uint,QString)", "findRegExpAt(uint row,uint col,QString regexp)" },
    { "uint", "currentMatchLine()", "currentMatchLine()" },
    { "uint", "currentMatchCol()", "currentMatchCol()" },
    { "uint", "currentMatchLength()", "currentMatchLength()" },
    { 0, 0, 0 }
};
static const int SearchDCOPInterface_ftable_hiddens[13] = {
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
};

bool SearchDCOPInterface::process(const QCString &fun, const QByteArray &data, QCString& replyType, QByteArray &replyData)
{
    static QAsciiDict<int>* fdict = 0;
    if ( !fdict ) {
	fdict = new QAsciiDict<int>( SearchDCOPInterface_fhash, true, false );
	for ( int i = 0; SearchDCOPInterface_ftable[i][1]; i++ )
	    fdict->insert( SearchDCOPInterface_ftable[i][1],  new int( i ) );
    }
    int* fp = fdict->find( fun );
    switch ( fp?*fp:-1) {
    case 0: { // bool findFirstString(QString,bool)
	QString arg0;
	bool arg1;
	QDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	if (arg.atEnd()) return false;
	arg >> arg1;
	replyType = SearchDCOPInterface_ftable[0][0]; 
	QDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << findFirstString(arg0, arg1 );
    } break;
    case 1: { // bool findNextString(QString,bool)
	QString arg0;
	bool arg1;
	QDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	if (arg.atEnd()) return false;
	arg >> arg1;
	replyType = SearchDCOPInterface_ftable[1][0]; 
	QDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << findNextString(arg0, arg1 );
    } break;
    case 2: { // bool findPreviousString(QString,bool)
	QString arg0;
	bool arg1;
	QDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	if (arg.atEnd()) return false;
	arg >> arg1;
	replyType = SearchDCOPInterface_ftable[2][0]; 
	QDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << findPreviousString(arg0, arg1 );
    } break;
    case 3: { // bool findLastString(QString,bool)
	QString arg0;
	bool arg1;
	QDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	if (arg.atEnd()) return false;
	arg >> arg1;
	replyType = SearchDCOPInterface_ftable[3][0]; 
	QDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << findLastString(arg0, arg1 );
    } break;
    case 4: { // bool findStringAt(uint,uint,QString,bool)
	uint arg0;
	uint arg1;
	QString arg2;
	bool 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 = SearchDCOPInterface_ftable[4][0]; 
	QDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << findStringAt(arg0, arg1, arg2, arg3 );
    } break;
    case 5: { // bool findFirstRegExp(QString)
	QString arg0;
	QDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	replyType = SearchDCOPInterface_ftable[5][0]; 
	QDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << findFirstRegExp(arg0 );
    } break;
    case 6: { // bool findNextRegExp(QString)
	QString arg0;
	QDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	replyType = SearchDCOPInterface_ftable[6][0]; 
	QDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << findNextRegExp(arg0 );
    } break;
    case 7: { // bool findPreviousRegExp(QString)
	QString arg0;
	QDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	replyType = SearchDCOPInterface_ftable[7][0]; 
	QDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << findPreviousRegExp(arg0 );
    } break;
    case 8: { // bool findLastRegExp(QString)
	QString arg0;
	QDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	replyType = SearchDCOPInterface_ftable[8][0]; 
	QDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << findLastRegExp(arg0 );
    } break;
    case 9: { // bool findRegExpAt(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 = SearchDCOPInterface_ftable[9][0]; 
	QDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << findRegExpAt(arg0, arg1, arg2 );
    } break;
    case 10: { // uint currentMatchLine()
	replyType = SearchDCOPInterface_ftable[10][0]; 
	QDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << currentMatchLine( );
    } break;
    case 11: { // uint currentMatchCol()
	replyType = SearchDCOPInterface_ftable[11][0]; 
	QDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << currentMatchCol( );
    } break;
    case 12: { // uint currentMatchLength()
	replyType = SearchDCOPInterface_ftable[12][0]; 
	QDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << currentMatchLength( );
    } break;
    default: 
	return DCOPObject::process( fun, data, replyType, replyData );
    }
    return true;
}

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

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

} // namespace

