00001
00002
00003
00004
00005
00006
00007
00008
00009 #include "./kmailIface.h"
00010
00011 #include <kdatastream.h>
00012 #include <qasciidict.h>
00013
00014
00015 static const int KMailIface_fhash = 37;
00016 static const char* const KMailIface_ftable[34][3] = {
00017 { "void", "checkMail()", "checkMail()" },
00018 { "QStringList", "accounts()", "accounts()" },
00019 { "void", "checkAccount(QString)", "checkAccount(QString account)" },
00020 { "void", "openReader()", "openReader()" },
00021 { "int", "openComposer(QString,QString,QString,QString,QString,int,KURL)", "openComposer(QString to,QString cc,QString bcc,QString subject,QString body,int hidden,KURL messageFile)" },
00022 { "int", "openComposer(QString,QString,QString,QString,QString,int,KURL,KURL)", "openComposer(QString to,QString cc,QString bcc,QString subject,QString body,int hidden,KURL messageFile,KURL attachURL)" },
00023 { "int", "openComposer(QString,QString,QString,QString,QString,int,KURL,KURL::List)", "openComposer(QString to,QString cc,QString bcc,QString subject,QString body,int hidden,KURL messageFile,KURL::List attachURLs)" },
00024 { "int", "openComposer(QString,QString,QString,QString,QString,int,QString,QCString,QCString,QCString,QCString,QCString,QString,QCString)", "openComposer(QString to,QString cc,QString bcc,QString subject,QString body,int hidden,QString attachName,QCString attachCte,QCString attachData,QCString attachType,QCString attachSubType,QCString attachParamAttr,QString attachParamValue,QCString attachContDisp)" },
00025 { "int", "openComposer(QString,QString,QString,QString,QString,int,QString,QCString,QCString,QCString,QCString,QCString,QString,QCString,QCString)", "openComposer(QString to,QString cc,QString bcc,QString subject,QString body,int hidden,QString attachName,QCString attachCte,QCString attachData,QCString attachType,QCString attachSubType,QCString attachParamAttr,QString attachParamValue,QCString attachContDisp,QCString attachCharset)" },
00026 { "DCOPRef", "openComposer(QString,QString,QString,QString,QString,bool)", "openComposer(QString to,QString cc,QString bcc,QString subject,QString body,bool hidden)" },
00027 { "int", "sendCertificate(QString,QByteArray)", "sendCertificate(QString to,QByteArray certData)" },
00028 { "void", "compactAllFolders()", "compactAllFolders()" },
00029 { "int", "dcopAddMessage(QString,QString,QString)", "dcopAddMessage(QString foldername,QString messagefile,QString MsgStatusFlags)" },
00030 { "int", "dcopAddMessage(QString,KURL,QString)", "dcopAddMessage(QString foldername,KURL messagefile,QString MsgStatusFlags)" },
00031 { "QStringList", "folderList()", "folderList()" },
00032 { "DCOPRef", "getFolder(QString)", "getFolder(QString vpath)" },
00033 { "void", "selectFolder(QString)", "selectFolder(QString folder)" },
00034 { "bool", "canQueryClose()", "canQueryClose()" },
00035 { "void", "setDefaultTransport(QString)", "setDefaultTransport(QString transport)" },
00036 { "int", "timeOfLastMessageCountChange()", "timeOfLastMessageCountChange()" },
00037 { "void", "pauseBackgroundJobs()", "pauseBackgroundJobs()" },
00038 { "void", "resumeBackgroundJobs()", "resumeBackgroundJobs()" },
00039 { "void", "stopNetworkJobs()", "stopNetworkJobs()" },
00040 { "void", "resumeNetworkJobs()", "resumeNetworkJobs()" },
00041 { "DCOPRef", "newMessage(QString,QString,QString,bool,bool,KURL,KURL)", "newMessage(QString to,QString cc,QString bcc,bool hidden,bool useFolderId,KURL messageFile,KURL attachURL)" },
00042 { "bool", "showMail(Q_UINT32,QString)", "showMail(Q_UINT32 serialNumber,QString messageId)" },
00043 { "bool", "handleCommandLine(bool)", "handleCommandLine(bool noArgsOpensReader)" },
00044 { "QString", "getFrom(Q_UINT32)", "getFrom(Q_UINT32 serialNumber)" },
00045 { "QString", "debugScheduler()", "debugScheduler()" },
00046 { "QString", "debugSernum(Q_UINT32)", "debugSernum(Q_UINT32 serialNumber)" },
00047 { "int", "dcopAddMessage_fastImport(QString,QString,QString)", "dcopAddMessage_fastImport(QString foldername,QString messagefile,QString MsgStatusFlags)" },
00048 { "int", "dcopAddMessage_fastImport(QString,KURL,QString)", "dcopAddMessage_fastImport(QString foldername,KURL messagefile,QString MsgStatusFlags)" },
00049 { "void", "dcopResetAddMessage()", "dcopResetAddMessage()" },
00050 { 0, 0, 0 }
00051 };
00052 static const int KMailIface_ftable_hiddens[33] = {
00053 0,
00054 0,
00055 0,
00056 0,
00057 0,
00058 0,
00059 0,
00060 0,
00061 0,
00062 0,
00063 0,
00064 0,
00065 0,
00066 0,
00067 0,
00068 0,
00069 0,
00070 0,
00071 0,
00072 0,
00073 0,
00074 0,
00075 0,
00076 0,
00077 1,
00078 1,
00079 1,
00080 1,
00081 1,
00082 1,
00083 1,
00084 1,
00085 1,
00086 };
00087
00088 bool KMailIface::process(const QCString &fun, const QByteArray &data, QCString& replyType, QByteArray &replyData)
00089 {
00090 static QAsciiDict<int>* fdict = 0;
00091 if ( !fdict ) {
00092 fdict = new QAsciiDict<int>( KMailIface_fhash, true, false );
00093 for ( int i = 0; KMailIface_ftable[i][1]; i++ )
00094 fdict->insert( KMailIface_ftable[i][1], new int( i ) );
00095 }
00096 int* fp = fdict->find( fun );
00097 switch ( fp?*fp:-1) {
00098 case 0: {
00099 replyType = KMailIface_ftable[0][0];
00100 checkMail( );
00101 } break;
00102 case 1: {
00103 replyType = KMailIface_ftable[1][0];
00104 QDataStream _replyStream( replyData, IO_WriteOnly );
00105 _replyStream << accounts( );
00106 } break;
00107 case 2: {
00108 QString arg0;
00109 QDataStream arg( data, IO_ReadOnly );
00110 if (arg.atEnd()) return false;
00111 arg >> arg0;
00112 replyType = KMailIface_ftable[2][0];
00113 checkAccount(arg0 );
00114 } break;
00115 case 3: {
00116 replyType = KMailIface_ftable[3][0];
00117 openReader( );
00118 } break;
00119 case 4: {
00120 QString arg0;
00121 QString arg1;
00122 QString arg2;
00123 QString arg3;
00124 QString arg4;
00125 int arg5;
00126 KURL arg6;
00127 QDataStream arg( data, IO_ReadOnly );
00128 if (arg.atEnd()) return false;
00129 arg >> arg0;
00130 if (arg.atEnd()) return false;
00131 arg >> arg1;
00132 if (arg.atEnd()) return false;
00133 arg >> arg2;
00134 if (arg.atEnd()) return false;
00135 arg >> arg3;
00136 if (arg.atEnd()) return false;
00137 arg >> arg4;
00138 if (arg.atEnd()) return false;
00139 arg >> arg5;
00140 if (arg.atEnd()) return false;
00141 arg >> arg6;
00142 replyType = KMailIface_ftable[4][0];
00143 QDataStream _replyStream( replyData, IO_WriteOnly );
00144 _replyStream << openComposer(arg0, arg1, arg2, arg3, arg4, arg5, arg6 );
00145 } break;
00146 case 5: {
00147 QString arg0;
00148 QString arg1;
00149 QString arg2;
00150 QString arg3;
00151 QString arg4;
00152 int arg5;
00153 KURL arg6;
00154 KURL arg7;
00155 QDataStream arg( data, IO_ReadOnly );
00156 if (arg.atEnd()) return false;
00157 arg >> arg0;
00158 if (arg.atEnd()) return false;
00159 arg >> arg1;
00160 if (arg.atEnd()) return false;
00161 arg >> arg2;
00162 if (arg.atEnd()) return false;
00163 arg >> arg3;
00164 if (arg.atEnd()) return false;
00165 arg >> arg4;
00166 if (arg.atEnd()) return false;
00167 arg >> arg5;
00168 if (arg.atEnd()) return false;
00169 arg >> arg6;
00170 if (arg.atEnd()) return false;
00171 arg >> arg7;
00172 replyType = KMailIface_ftable[5][0];
00173 QDataStream _replyStream( replyData, IO_WriteOnly );
00174 _replyStream << openComposer(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7 );
00175 } break;
00176 case 6: {
00177 QString arg0;
00178 QString arg1;
00179 QString arg2;
00180 QString arg3;
00181 QString arg4;
00182 int arg5;
00183 KURL arg6;
00184 KURL::List arg7;
00185 QDataStream arg( data, IO_ReadOnly );
00186 if (arg.atEnd()) return false;
00187 arg >> arg0;
00188 if (arg.atEnd()) return false;
00189 arg >> arg1;
00190 if (arg.atEnd()) return false;
00191 arg >> arg2;
00192 if (arg.atEnd()) return false;
00193 arg >> arg3;
00194 if (arg.atEnd()) return false;
00195 arg >> arg4;
00196 if (arg.atEnd()) return false;
00197 arg >> arg5;
00198 if (arg.atEnd()) return false;
00199 arg >> arg6;
00200 if (arg.atEnd()) return false;
00201 arg >> arg7;
00202 replyType = KMailIface_ftable[6][0];
00203 QDataStream _replyStream( replyData, IO_WriteOnly );
00204 _replyStream << openComposer(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7 );
00205 } break;
00206 case 7: {
00207 QString arg0;
00208 QString arg1;
00209 QString arg2;
00210 QString arg3;
00211 QString arg4;
00212 int arg5;
00213 QString arg6;
00214 QCString arg7;
00215 QCString arg8;
00216 QCString arg9;
00217 QCString arg10;
00218 QCString arg11;
00219 QString arg12;
00220 QCString arg13;
00221 QDataStream arg( data, IO_ReadOnly );
00222 if (arg.atEnd()) return false;
00223 arg >> arg0;
00224 if (arg.atEnd()) return false;
00225 arg >> arg1;
00226 if (arg.atEnd()) return false;
00227 arg >> arg2;
00228 if (arg.atEnd()) return false;
00229 arg >> arg3;
00230 if (arg.atEnd()) return false;
00231 arg >> arg4;
00232 if (arg.atEnd()) return false;
00233 arg >> arg5;
00234 if (arg.atEnd()) return false;
00235 arg >> arg6;
00236 if (arg.atEnd()) return false;
00237 arg >> arg7;
00238 if (arg.atEnd()) return false;
00239 arg >> arg8;
00240 if (arg.atEnd()) return false;
00241 arg >> arg9;
00242 if (arg.atEnd()) return false;
00243 arg >> arg10;
00244 if (arg.atEnd()) return false;
00245 arg >> arg11;
00246 if (arg.atEnd()) return false;
00247 arg >> arg12;
00248 if (arg.atEnd()) return false;
00249 arg >> arg13;
00250 replyType = KMailIface_ftable[7][0];
00251 QDataStream _replyStream( replyData, IO_WriteOnly );
00252 _replyStream << openComposer(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13 );
00253 } break;
00254 case 8: {
00255 QString arg0;
00256 QString arg1;
00257 QString arg2;
00258 QString arg3;
00259 QString arg4;
00260 int arg5;
00261 QString arg6;
00262 QCString arg7;
00263 QCString arg8;
00264 QCString arg9;
00265 QCString arg10;
00266 QCString arg11;
00267 QString arg12;
00268 QCString arg13;
00269 QCString arg14;
00270 QDataStream arg( data, IO_ReadOnly );
00271 if (arg.atEnd()) return false;
00272 arg >> arg0;
00273 if (arg.atEnd()) return false;
00274 arg >> arg1;
00275 if (arg.atEnd()) return false;
00276 arg >> arg2;
00277 if (arg.atEnd()) return false;
00278 arg >> arg3;
00279 if (arg.atEnd()) return false;
00280 arg >> arg4;
00281 if (arg.atEnd()) return false;
00282 arg >> arg5;
00283 if (arg.atEnd()) return false;
00284 arg >> arg6;
00285 if (arg.atEnd()) return false;
00286 arg >> arg7;
00287 if (arg.atEnd()) return false;
00288 arg >> arg8;
00289 if (arg.atEnd()) return false;
00290 arg >> arg9;
00291 if (arg.atEnd()) return false;
00292 arg >> arg10;
00293 if (arg.atEnd()) return false;
00294 arg >> arg11;
00295 if (arg.atEnd()) return false;
00296 arg >> arg12;
00297 if (arg.atEnd()) return false;
00298 arg >> arg13;
00299 if (arg.atEnd()) return false;
00300 arg >> arg14;
00301 replyType = KMailIface_ftable[8][0];
00302 QDataStream _replyStream( replyData, IO_WriteOnly );
00303 _replyStream << openComposer(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12, arg13, arg14 );
00304 } break;
00305 case 9: {
00306 QString arg0;
00307 QString arg1;
00308 QString arg2;
00309 QString arg3;
00310 QString arg4;
00311 bool arg5;
00312 QDataStream arg( data, IO_ReadOnly );
00313 if (arg.atEnd()) return false;
00314 arg >> arg0;
00315 if (arg.atEnd()) return false;
00316 arg >> arg1;
00317 if (arg.atEnd()) return false;
00318 arg >> arg2;
00319 if (arg.atEnd()) return false;
00320 arg >> arg3;
00321 if (arg.atEnd()) return false;
00322 arg >> arg4;
00323 if (arg.atEnd()) return false;
00324 arg >> arg5;
00325 replyType = KMailIface_ftable[9][0];
00326 QDataStream _replyStream( replyData, IO_WriteOnly );
00327 _replyStream << openComposer(arg0, arg1, arg2, arg3, arg4, arg5 );
00328 } break;
00329 case 10: {
00330 QString arg0;
00331 QByteArray arg1;
00332 QDataStream arg( data, IO_ReadOnly );
00333 if (arg.atEnd()) return false;
00334 arg >> arg0;
00335 if (arg.atEnd()) return false;
00336 arg >> arg1;
00337 replyType = KMailIface_ftable[10][0];
00338 QDataStream _replyStream( replyData, IO_WriteOnly );
00339 _replyStream << sendCertificate(arg0, arg1 );
00340 } break;
00341 case 11: {
00342 replyType = KMailIface_ftable[11][0];
00343 compactAllFolders( );
00344 } break;
00345 case 12: {
00346 QString arg0;
00347 QString arg1;
00348 QString arg2;
00349 QDataStream arg( data, IO_ReadOnly );
00350 if (arg.atEnd()) return false;
00351 arg >> arg0;
00352 if (arg.atEnd()) return false;
00353 arg >> arg1;
00354 if (arg.atEnd()) return false;
00355 arg >> arg2;
00356 replyType = KMailIface_ftable[12][0];
00357 QDataStream _replyStream( replyData, IO_WriteOnly );
00358 _replyStream << dcopAddMessage(arg0, arg1, arg2 );
00359 } break;
00360 case 13: {
00361 QString arg0;
00362 KURL arg1;
00363 QString arg2;
00364 QDataStream arg( data, IO_ReadOnly );
00365 if (arg.atEnd()) return false;
00366 arg >> arg0;
00367 if (arg.atEnd()) return false;
00368 arg >> arg1;
00369 if (arg.atEnd()) return false;
00370 arg >> arg2;
00371 replyType = KMailIface_ftable[13][0];
00372 QDataStream _replyStream( replyData, IO_WriteOnly );
00373 _replyStream << dcopAddMessage(arg0, arg1, arg2 );
00374 } break;
00375 case 14: {
00376 replyType = KMailIface_ftable[14][0];
00377 QDataStream _replyStream( replyData, IO_WriteOnly );
00378 _replyStream << folderList( );
00379 } break;
00380 case 15: {
00381 QString arg0;
00382 QDataStream arg( data, IO_ReadOnly );
00383 if (arg.atEnd()) return false;
00384 arg >> arg0;
00385 replyType = KMailIface_ftable[15][0];
00386 QDataStream _replyStream( replyData, IO_WriteOnly );
00387 _replyStream << getFolder(arg0 );
00388 } break;
00389 case 16: {
00390 QString arg0;
00391 QDataStream arg( data, IO_ReadOnly );
00392 if (arg.atEnd()) return false;
00393 arg >> arg0;
00394 replyType = KMailIface_ftable[16][0];
00395 selectFolder(arg0 );
00396 } break;
00397 case 17: {
00398 replyType = KMailIface_ftable[17][0];
00399 QDataStream _replyStream( replyData, IO_WriteOnly );
00400 _replyStream << canQueryClose( );
00401 } break;
00402 case 18: {
00403 QString arg0;
00404 QDataStream arg( data, IO_ReadOnly );
00405 if (arg.atEnd()) return false;
00406 arg >> arg0;
00407 replyType = KMailIface_ftable[18][0];
00408 setDefaultTransport(arg0 );
00409 } break;
00410 case 19: {
00411 replyType = KMailIface_ftable[19][0];
00412 QDataStream _replyStream( replyData, IO_WriteOnly );
00413 _replyStream << timeOfLastMessageCountChange( );
00414 } break;
00415 case 20: {
00416 replyType = KMailIface_ftable[20][0];
00417 pauseBackgroundJobs( );
00418 } break;
00419 case 21: {
00420 replyType = KMailIface_ftable[21][0];
00421 resumeBackgroundJobs( );
00422 } break;
00423 case 22: {
00424 replyType = KMailIface_ftable[22][0];
00425 stopNetworkJobs( );
00426 } break;
00427 case 23: {
00428 replyType = KMailIface_ftable[23][0];
00429 resumeNetworkJobs( );
00430 } break;
00431 case 24: {
00432 QString arg0;
00433 QString arg1;
00434 QString arg2;
00435 bool arg3;
00436 bool arg4;
00437 KURL arg5;
00438 KURL arg6;
00439 QDataStream arg( data, IO_ReadOnly );
00440 if (arg.atEnd()) return false;
00441 arg >> arg0;
00442 if (arg.atEnd()) return false;
00443 arg >> arg1;
00444 if (arg.atEnd()) return false;
00445 arg >> arg2;
00446 if (arg.atEnd()) return false;
00447 arg >> arg3;
00448 if (arg.atEnd()) return false;
00449 arg >> arg4;
00450 if (arg.atEnd()) return false;
00451 arg >> arg5;
00452 if (arg.atEnd()) return false;
00453 arg >> arg6;
00454 replyType = KMailIface_ftable[24][0];
00455 QDataStream _replyStream( replyData, IO_WriteOnly );
00456 _replyStream << newMessage(arg0, arg1, arg2, arg3, arg4, arg5, arg6 );
00457 } break;
00458 case 25: {
00459 Q_UINT32 arg0;
00460 QString arg1;
00461 QDataStream arg( data, IO_ReadOnly );
00462 if (arg.atEnd()) return false;
00463 arg >> arg0;
00464 if (arg.atEnd()) return false;
00465 arg >> arg1;
00466 replyType = KMailIface_ftable[25][0];
00467 QDataStream _replyStream( replyData, IO_WriteOnly );
00468 _replyStream << showMail(arg0, arg1 );
00469 } break;
00470 case 26: {
00471 bool arg0;
00472 QDataStream arg( data, IO_ReadOnly );
00473 if (arg.atEnd()) return false;
00474 arg >> arg0;
00475 replyType = KMailIface_ftable[26][0];
00476 QDataStream _replyStream( replyData, IO_WriteOnly );
00477 _replyStream << handleCommandLine(arg0 );
00478 } break;
00479 case 27: {
00480 Q_UINT32 arg0;
00481 QDataStream arg( data, IO_ReadOnly );
00482 if (arg.atEnd()) return false;
00483 arg >> arg0;
00484 replyType = KMailIface_ftable[27][0];
00485 QDataStream _replyStream( replyData, IO_WriteOnly );
00486 _replyStream << getFrom(arg0 );
00487 } break;
00488 case 28: {
00489 replyType = KMailIface_ftable[28][0];
00490 QDataStream _replyStream( replyData, IO_WriteOnly );
00491 _replyStream << debugScheduler( );
00492 } break;
00493 case 29: {
00494 Q_UINT32 arg0;
00495 QDataStream arg( data, IO_ReadOnly );
00496 if (arg.atEnd()) return false;
00497 arg >> arg0;
00498 replyType = KMailIface_ftable[29][0];
00499 QDataStream _replyStream( replyData, IO_WriteOnly );
00500 _replyStream << debugSernum(arg0 );
00501 } break;
00502 case 30: {
00503 QString arg0;
00504 QString arg1;
00505 QString arg2;
00506 QDataStream arg( data, IO_ReadOnly );
00507 if (arg.atEnd()) return false;
00508 arg >> arg0;
00509 if (arg.atEnd()) return false;
00510 arg >> arg1;
00511 if (arg.atEnd()) return false;
00512 arg >> arg2;
00513 replyType = KMailIface_ftable[30][0];
00514 QDataStream _replyStream( replyData, IO_WriteOnly );
00515 _replyStream << dcopAddMessage_fastImport(arg0, arg1, arg2 );
00516 } break;
00517 case 31: {
00518 QString arg0;
00519 KURL arg1;
00520 QString arg2;
00521 QDataStream arg( data, IO_ReadOnly );
00522 if (arg.atEnd()) return false;
00523 arg >> arg0;
00524 if (arg.atEnd()) return false;
00525 arg >> arg1;
00526 if (arg.atEnd()) return false;
00527 arg >> arg2;
00528 replyType = KMailIface_ftable[31][0];
00529 QDataStream _replyStream( replyData, IO_WriteOnly );
00530 _replyStream << dcopAddMessage_fastImport(arg0, arg1, arg2 );
00531 } break;
00532 case 32: {
00533 replyType = KMailIface_ftable[32][0];
00534 dcopResetAddMessage( );
00535 } break;
00536 default:
00537 return DCOPObject::process( fun, data, replyType, replyData );
00538 }
00539 return true;
00540 }
00541
00542 QCStringList KMailIface::interfaces()
00543 {
00544 QCStringList ifaces = DCOPObject::interfaces();
00545 ifaces += "KMailIface";
00546 return ifaces;
00547 }
00548
00549 QCStringList KMailIface::functions()
00550 {
00551 QCStringList funcs = DCOPObject::functions();
00552 for ( int i = 0; KMailIface_ftable[i][2]; i++ ) {
00553 if (KMailIface_ftable_hiddens[i])
00554 continue;
00555 QCString func = KMailIface_ftable[i][0];
00556 func += ' ';
00557 func += KMailIface_ftable[i][2];
00558 funcs << func;
00559 }
00560 return funcs;
00561 }
00562
00563 void KMailIface::unreadCountChanged()
00564 {
00565 QByteArray data;
00566 emitDCOPSignal( "unreadCountChanged()", data );
00567 }
00568
00569 void KMailIface::unreadCountChanged( const QString& arg0, int arg1 )
00570 {
00571 QByteArray data;
00572 QDataStream arg( data, IO_WriteOnly );
00573 arg << arg0;
00574 arg << arg1;
00575 emitDCOPSignal( "unreadCountChanged(QString,int)", data );
00576 }
00577
00578