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

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

namespace KTextEditor {

static const int SearchDCOPInterface_fhash = 17;
static const char* const SearchDCOPInterface_ftable[14][3] = {
    { "bool", "findFirstString(TQString,bool)", "findFirstString(TQString text,bool caseSensitive)" },
    { "bool", "findNextString(TQString,bool)", "findNextString(TQString text,bool caseSensitive)" },
    { "bool", "findPreviousString(TQString,bool)", "findPreviousString(TQString text,bool caseSensitive)" },
    { "bool", "findLastString(TQString,bool)", "findLastString(TQString text,bool caseSensitive)" },
    { "bool", "findStringAt(uint,uint,TQString,bool)", "findStringAt(uint row,uint col,TQString text,bool caseSensitive)" },
    { "bool", "findFirstRegExp(TQString)", "findFirstRegExp(TQString regexp)" },
    { "bool", "findNextRegExp(TQString)", "findNextRegExp(TQString regexp)" },
    { "bool", "findPreviousRegExp(TQString)", "findPreviousRegExp(TQString regexp)" },
    { "bool", "findLastRegExp(TQString)", "findLastRegExp(TQString regexp)" },
    { "bool", "findRegExpAt(uint,uint,TQString)", "findRegExpAt(uint row,uint col,TQString 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 TQCString &fun, const TQByteArray &data, TQCString& replyType, TQByteArray &replyData)
{
    static TQAsciiDict<int>* fdict = 0;
    if ( !fdict ) {
	fdict = new TQAsciiDict<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(TQString,bool)
	TQString arg0;
	bool arg1;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	if (arg.atEnd()) return false;
	arg >> arg1;
	replyType = SearchDCOPInterface_ftable[0][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << findFirstString(arg0, arg1 );
    } break;
    case 1: { // bool findNextString(TQString,bool)
	TQString arg0;
	bool arg1;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	if (arg.atEnd()) return false;
	arg >> arg1;
	replyType = SearchDCOPInterface_ftable[1][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << findNextString(arg0, arg1 );
    } break;
    case 2: { // bool findPreviousString(TQString,bool)
	TQString arg0;
	bool arg1;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	if (arg.atEnd()) return false;
	arg >> arg1;
	replyType = SearchDCOPInterface_ftable[2][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << findPreviousString(arg0, arg1 );
    } break;
    case 3: { // bool findLastString(TQString,bool)
	TQString arg0;
	bool arg1;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	if (arg.atEnd()) return false;
	arg >> arg1;
	replyType = SearchDCOPInterface_ftable[3][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << findLastString(arg0, arg1 );
    } break;
    case 4: { // bool findStringAt(uint,uint,TQString,bool)
	uint arg0;
	uint arg1;
	TQString arg2;
	bool 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 = SearchDCOPInterface_ftable[4][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << findStringAt(arg0, arg1, arg2, arg3 );
    } break;
    case 5: { // bool findFirstRegExp(TQString)
	TQString arg0;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	replyType = SearchDCOPInterface_ftable[5][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << findFirstRegExp(arg0 );
    } break;
    case 6: { // bool findNextRegExp(TQString)
	TQString arg0;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	replyType = SearchDCOPInterface_ftable[6][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << findNextRegExp(arg0 );
    } break;
    case 7: { // bool findPreviousRegExp(TQString)
	TQString arg0;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	replyType = SearchDCOPInterface_ftable[7][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << findPreviousRegExp(arg0 );
    } break;
    case 8: { // bool findLastRegExp(TQString)
	TQString arg0;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	replyType = SearchDCOPInterface_ftable[8][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << findLastRegExp(arg0 );
    } break;
    case 9: { // bool findRegExpAt(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 = SearchDCOPInterface_ftable[9][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << findRegExpAt(arg0, arg1, arg2 );
    } break;
    case 10: { // uint currentMatchLine()
	replyType = SearchDCOPInterface_ftable[10][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << currentMatchLine( );
    } break;
    case 11: { // uint currentMatchCol()
	replyType = SearchDCOPInterface_ftable[11][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << currentMatchCol( );
    } break;
    case 12: { // uint currentMatchLength()
	replyType = SearchDCOPInterface_ftable[12][0]; 
	TQDataStream _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;
	TQCString func = SearchDCOPInterface_ftable[i][0];
	func += ' ';
	func += SearchDCOPInterface_ftable[i][2];
	funcs << func;
    }
    return funcs;
}

} // namespace

