00001
00002
00003
00004
00005
00006
00007
00008
00009
#include "./searchdcopinterface.h"
00010
00011
#include <kdatastream.h>
00012
#include <qasciidict.h>
00013
00014
namespace KTextEditor {
00015
00016
static const int SearchDCOPInterface_fhash = 17;
00017
static const char*
const SearchDCOPInterface_ftable[14][3] = {
00018 {
"bool",
"findFirstString(QString,bool)",
"findFirstString(QString text,bool caseSensitive)" },
00019 {
"bool",
"findNextString(QString,bool)",
"findNextString(QString text,bool caseSensitive)" },
00020 {
"bool",
"findPreviousString(QString,bool)",
"findPreviousString(QString text,bool caseSensitive)" },
00021 {
"bool",
"findLastString(QString,bool)",
"findLastString(QString text,bool caseSensitive)" },
00022 {
"bool",
"findStringAt(uint,uint,QString,bool)",
"findStringAt(uint row,uint col,QString text,bool caseSensitive)" },
00023 {
"bool",
"findFirstRegExp(QString)",
"findFirstRegExp(QString regexp)" },
00024 {
"bool",
"findNextRegExp(QString)",
"findNextRegExp(QString regexp)" },
00025 {
"bool",
"findPreviousRegExp(QString)",
"findPreviousRegExp(QString regexp)" },
00026 {
"bool",
"findLastRegExp(QString)",
"findLastRegExp(QString regexp)" },
00027 {
"bool",
"findRegExpAt(uint,uint,QString)",
"findRegExpAt(uint row,uint col,QString regexp)" },
00028 {
"uint",
"currentMatchLine()",
"currentMatchLine()" },
00029 {
"uint",
"currentMatchCol()",
"currentMatchCol()" },
00030 {
"uint",
"currentMatchLength()",
"currentMatchLength()" },
00031 { 0, 0, 0 }
00032 };
00033
static const int SearchDCOPInterface_ftable_hiddens[13] = {
00034 0,
00035 0,
00036 0,
00037 0,
00038 0,
00039 0,
00040 0,
00041 0,
00042 0,
00043 0,
00044 0,
00045 0,
00046 0,
00047 };
00048
00049
bool SearchDCOPInterface::process(
const QCString &fun,
const QByteArray &data,
QCString& replyType,
QByteArray &replyData)
00050 {
00051
static QAsciiDict<int>* fdict = 0;
00052
if ( !fdict ) {
00053 fdict =
new QAsciiDict<int>( SearchDCOPInterface_fhash,
true,
false );
00054
for (
int i = 0; SearchDCOPInterface_ftable[i][1]; i++ )
00055 fdict->
insert( SearchDCOPInterface_ftable[i][1],
new int( i ) );
00056 }
00057
int* fp = fdict->
find( fun );
00058
switch ( fp?*fp:-1) {
00059
case 0: {
00060
QString arg0;
00061
bool arg1;
00062
QDataStream arg( data, IO_ReadOnly );
00063
if (arg.
atEnd())
return false;
00064 arg >> arg0;
00065
if (arg.
atEnd())
return false;
00066 arg >> arg1;
00067 replyType = SearchDCOPInterface_ftable[0][0];
00068
QDataStream _replyStream( replyData, IO_WriteOnly );
00069 _replyStream << findFirstString(arg0, arg1 );
00070 }
break;
00071
case 1: {
00072
QString arg0;
00073
bool arg1;
00074
QDataStream arg( data, IO_ReadOnly );
00075
if (arg.
atEnd())
return false;
00076 arg >> arg0;
00077
if (arg.
atEnd())
return false;
00078 arg >> arg1;
00079 replyType = SearchDCOPInterface_ftable[1][0];
00080
QDataStream _replyStream( replyData, IO_WriteOnly );
00081 _replyStream << findNextString(arg0, arg1 );
00082 }
break;
00083
case 2: {
00084
QString arg0;
00085
bool arg1;
00086
QDataStream arg( data, IO_ReadOnly );
00087
if (arg.
atEnd())
return false;
00088 arg >> arg0;
00089
if (arg.
atEnd())
return false;
00090 arg >> arg1;
00091 replyType = SearchDCOPInterface_ftable[2][0];
00092
QDataStream _replyStream( replyData, IO_WriteOnly );
00093 _replyStream << findPreviousString(arg0, arg1 );
00094 }
break;
00095
case 3: {
00096
QString arg0;
00097
bool arg1;
00098
QDataStream arg( data, IO_ReadOnly );
00099
if (arg.
atEnd())
return false;
00100 arg >> arg0;
00101
if (arg.
atEnd())
return false;
00102 arg >> arg1;
00103 replyType = SearchDCOPInterface_ftable[3][0];
00104
QDataStream _replyStream( replyData, IO_WriteOnly );
00105 _replyStream << findLastString(arg0, arg1 );
00106 }
break;
00107
case 4: {
00108 uint arg0;
00109 uint arg1;
00110
QString arg2;
00111
bool arg3;
00112
QDataStream arg( data, IO_ReadOnly );
00113
if (arg.
atEnd())
return false;
00114 arg >> arg0;
00115
if (arg.
atEnd())
return false;
00116 arg >> arg1;
00117
if (arg.
atEnd())
return false;
00118 arg >> arg2;
00119
if (arg.
atEnd())
return false;
00120 arg >> arg3;
00121 replyType = SearchDCOPInterface_ftable[4][0];
00122
QDataStream _replyStream( replyData, IO_WriteOnly );
00123 _replyStream << findStringAt(arg0, arg1, arg2, arg3 );
00124 }
break;
00125
case 5: {
00126
QString arg0;
00127
QDataStream arg( data, IO_ReadOnly );
00128
if (arg.
atEnd())
return false;
00129 arg >> arg0;
00130 replyType = SearchDCOPInterface_ftable[5][0];
00131
QDataStream _replyStream( replyData, IO_WriteOnly );
00132 _replyStream << findFirstRegExp(arg0 );
00133 }
break;
00134
case 6: {
00135
QString arg0;
00136
QDataStream arg( data, IO_ReadOnly );
00137
if (arg.
atEnd())
return false;
00138 arg >> arg0;
00139 replyType = SearchDCOPInterface_ftable[6][0];
00140
QDataStream _replyStream( replyData, IO_WriteOnly );
00141 _replyStream << findNextRegExp(arg0 );
00142 }
break;
00143
case 7: {
00144
QString arg0;
00145
QDataStream arg( data, IO_ReadOnly );
00146
if (arg.
atEnd())
return false;
00147 arg >> arg0;
00148 replyType = SearchDCOPInterface_ftable[7][0];
00149
QDataStream _replyStream( replyData, IO_WriteOnly );
00150 _replyStream << findPreviousRegExp(arg0 );
00151 }
break;
00152
case 8: {
00153
QString arg0;
00154
QDataStream arg( data, IO_ReadOnly );
00155
if (arg.
atEnd())
return false;
00156 arg >> arg0;
00157 replyType = SearchDCOPInterface_ftable[8][0];
00158
QDataStream _replyStream( replyData, IO_WriteOnly );
00159 _replyStream << findLastRegExp(arg0 );
00160 }
break;
00161
case 9: {
00162 uint arg0;
00163 uint arg1;
00164
QString arg2;
00165
QDataStream arg( data, IO_ReadOnly );
00166
if (arg.
atEnd())
return false;
00167 arg >> arg0;
00168
if (arg.
atEnd())
return false;
00169 arg >> arg1;
00170
if (arg.
atEnd())
return false;
00171 arg >> arg2;
00172 replyType = SearchDCOPInterface_ftable[9][0];
00173
QDataStream _replyStream( replyData, IO_WriteOnly );
00174 _replyStream << findRegExpAt(arg0, arg1, arg2 );
00175 }
break;
00176
case 10: {
00177 replyType = SearchDCOPInterface_ftable[10][0];
00178
QDataStream _replyStream( replyData, IO_WriteOnly );
00179 _replyStream << currentMatchLine( );
00180 }
break;
00181
case 11: {
00182 replyType = SearchDCOPInterface_ftable[11][0];
00183
QDataStream _replyStream( replyData, IO_WriteOnly );
00184 _replyStream << currentMatchCol( );
00185 }
break;
00186
case 12: {
00187 replyType = SearchDCOPInterface_ftable[12][0];
00188
QDataStream _replyStream( replyData, IO_WriteOnly );
00189 _replyStream << currentMatchLength( );
00190 }
break;
00191
default:
00192
return DCOPObject::process( fun, data, replyType, replyData );
00193 }
00194
return true;
00195 }
00196
00197 QCStringList
SearchDCOPInterface::interfaces()
00198 {
00199 QCStringList ifaces =
DCOPObject::interfaces();
00200 ifaces +=
"KTextEditor::SearchDCOPInterface";
00201
return ifaces;
00202 }
00203
00204 QCStringList
SearchDCOPInterface::functions()
00205 {
00206 QCStringList funcs =
DCOPObject::functions();
00207
for (
int i = 0; SearchDCOPInterface_ftable[i][2]; i++ ) {
00208
if (SearchDCOPInterface_ftable_hiddens[i])
00209
continue;
00210
QCString func = SearchDCOPInterface_ftable[i][0];
00211 func +=
' ';
00212 func += SearchDCOPInterface_ftable[i][2];
00213 funcs << func;
00214 }
00215
return funcs;
00216 }
00217
00218 }
00219