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