00001
00002
00003
00004
00005
00006
00007
00008
00009 #include "./kmailicalIface.h"
00010
00011 #include <kdatastream.h>
00012 #include <qasciidict.h>
00013
00014
00015 static const int KMailICalIface_fhash = 19;
00016 static const char* const KMailICalIface_ftable[18][3] = {
00017 { "bool", "isWritableFolder(QString,QString)", "isWritableFolder(QString type,QString resource)" },
00018 { "KMailICalIface::StorageFormat", "storageFormat(QString)", "storageFormat(QString resource)" },
00019 { "KURL", "getAttachment(QString,Q_UINT32,QString)", "getAttachment(QString resource,Q_UINT32 sernum,QString filename)" },
00020 { "QString", "attachmentMimetype(QString,Q_UINT32,QString)", "attachmentMimetype(QString resource,Q_UINT32 sernum,QString filename)" },
00021 { "QStringList", "listAttachments(QString,Q_UINT32)", "listAttachments(QString resource,Q_UINT32 sernum)" },
00022 { "Q_UINT32", "update(QString,Q_UINT32,QString,QString,QMap<QCString,QString>,QStringList,QStringList,QStringList,QStringList)", "update(QString resource,Q_UINT32 sernum,QString subject,QString plainTextBody,QMap<QCString,QString> customHeaders,QStringList attachmentURLs,QStringList attachmentMimetypes,QStringList attachmentNames,QStringList deletedAttachments)" },
00023 { "KMailICalIface::Answer", "messageReadyForUpdate(QString,Q_UINT32)", "messageReadyForUpdate(QString resource,Q_UINT32 sernum)" },
00024 { "bool", "deleteIncidenceKolab(QString,Q_UINT32)", "deleteIncidenceKolab(QString resource,Q_UINT32 sernum)" },
00025 { "int", "incidencesKolabCount(QString,QString)", "incidencesKolabCount(QString mimetype,QString resource)" },
00026 { "QMap<Q_UINT32, QString>", "incidencesKolab(QString,QString,int,int)", "incidencesKolab(QString mimetype,QString resource,int startIndex,int nbMessages)" },
00027 { "QValueList<KMailICalIface::SubResource>", "subresourcesKolab(QString)", "subresourcesKolab(QString contentsType)" },
00028 { "bool", "addSubresource(QString,QString,QString)", "addSubresource(QString resource,QString parent,QString contentsType)" },
00029 { "bool", "removeSubresource(QString)", "removeSubresource(QString resource)" },
00030 { "int", "dimapAccounts()", "dimapAccounts()" },
00031 { "QString", "dimapFolderAccountName(QString)", "dimapFolderAccountName(QString folderPath)" },
00032 { "bool", "triggerSync(QString)", "triggerSync(QString)" },
00033 { "void", "changeResourceUIName(QString,QString)", "changeResourceUIName(QString folderPath,QString newName)" },
00034 { 0, 0, 0 }
00035 };
00036 static const int KMailICalIface_ftable_hiddens[17] = {
00037 0,
00038 0,
00039 0,
00040 0,
00041 0,
00042 0,
00043 0,
00044 0,
00045 0,
00046 0,
00047 0,
00048 0,
00049 0,
00050 0,
00051 0,
00052 0,
00053 0,
00054 };
00055
00056 bool KMailICalIface::process(const QCString &fun, const QByteArray &data, QCString& replyType, QByteArray &replyData)
00057 {
00058 static QAsciiDict<int>* fdict = 0;
00059 if ( !fdict ) {
00060 fdict = new QAsciiDict<int>( KMailICalIface_fhash, true, false );
00061 for ( int i = 0; KMailICalIface_ftable[i][1]; i++ )
00062 fdict->insert( KMailICalIface_ftable[i][1], new int( i ) );
00063 }
00064 int* fp = fdict->find( fun );
00065 switch ( fp?*fp:-1) {
00066 case 0: {
00067 QString arg0;
00068 QString arg1;
00069 QDataStream arg( data, IO_ReadOnly );
00070 if (arg.atEnd()) return false;
00071 arg >> arg0;
00072 if (arg.atEnd()) return false;
00073 arg >> arg1;
00074 replyType = KMailICalIface_ftable[0][0];
00075 QDataStream _replyStream( replyData, IO_WriteOnly );
00076 _replyStream << isWritableFolder(arg0, arg1 );
00077 } break;
00078 case 1: {
00079 QString arg0;
00080 QDataStream arg( data, IO_ReadOnly );
00081 if (arg.atEnd()) return false;
00082 arg >> arg0;
00083 replyType = KMailICalIface_ftable[1][0];
00084 QDataStream _replyStream( replyData, IO_WriteOnly );
00085 _replyStream << storageFormat(arg0 );
00086 } break;
00087 case 2: {
00088 QString arg0;
00089 Q_UINT32 arg1;
00090 QString arg2;
00091 QDataStream arg( data, IO_ReadOnly );
00092 if (arg.atEnd()) return false;
00093 arg >> arg0;
00094 if (arg.atEnd()) return false;
00095 arg >> arg1;
00096 if (arg.atEnd()) return false;
00097 arg >> arg2;
00098 replyType = KMailICalIface_ftable[2][0];
00099 QDataStream _replyStream( replyData, IO_WriteOnly );
00100 _replyStream << getAttachment(arg0, arg1, arg2 );
00101 } break;
00102 case 3: {
00103 QString arg0;
00104 Q_UINT32 arg1;
00105 QString arg2;
00106 QDataStream arg( data, IO_ReadOnly );
00107 if (arg.atEnd()) return false;
00108 arg >> arg0;
00109 if (arg.atEnd()) return false;
00110 arg >> arg1;
00111 if (arg.atEnd()) return false;
00112 arg >> arg2;
00113 replyType = KMailICalIface_ftable[3][0];
00114 QDataStream _replyStream( replyData, IO_WriteOnly );
00115 _replyStream << attachmentMimetype(arg0, arg1, arg2 );
00116 } break;
00117 case 4: {
00118 QString arg0;
00119 Q_UINT32 arg1;
00120 QDataStream arg( data, IO_ReadOnly );
00121 if (arg.atEnd()) return false;
00122 arg >> arg0;
00123 if (arg.atEnd()) return false;
00124 arg >> arg1;
00125 replyType = KMailICalIface_ftable[4][0];
00126 QDataStream _replyStream( replyData, IO_WriteOnly );
00127 _replyStream << listAttachments(arg0, arg1 );
00128 } break;
00129 case 5: {
00130 QString arg0;
00131 Q_UINT32 arg1;
00132 QString arg2;
00133 QString arg3;
00134 QMap<QCString,QString> arg4;
00135 QStringList arg5;
00136 QStringList arg6;
00137 QStringList arg7;
00138 QStringList arg8;
00139 QDataStream arg( data, IO_ReadOnly );
00140 if (arg.atEnd()) return false;
00141 arg >> arg0;
00142 if (arg.atEnd()) return false;
00143 arg >> arg1;
00144 if (arg.atEnd()) return false;
00145 arg >> arg2;
00146 if (arg.atEnd()) return false;
00147 arg >> arg3;
00148 if (arg.atEnd()) return false;
00149 arg >> arg4;
00150 if (arg.atEnd()) return false;
00151 arg >> arg5;
00152 if (arg.atEnd()) return false;
00153 arg >> arg6;
00154 if (arg.atEnd()) return false;
00155 arg >> arg7;
00156 if (arg.atEnd()) return false;
00157 arg >> arg8;
00158 replyType = KMailICalIface_ftable[5][0];
00159 QDataStream _replyStream( replyData, IO_WriteOnly );
00160 _replyStream << update(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8 );
00161 } break;
00162 case 6: {
00163 QString arg0;
00164 Q_UINT32 arg1;
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 replyType = KMailICalIface_ftable[6][0];
00171 QDataStream _replyStream( replyData, IO_WriteOnly );
00172 _replyStream << messageReadyForUpdate(arg0, arg1 );
00173 } break;
00174 case 7: {
00175 QString arg0;
00176 Q_UINT32 arg1;
00177 QDataStream arg( data, IO_ReadOnly );
00178 if (arg.atEnd()) return false;
00179 arg >> arg0;
00180 if (arg.atEnd()) return false;
00181 arg >> arg1;
00182 replyType = KMailICalIface_ftable[7][0];
00183 QDataStream _replyStream( replyData, IO_WriteOnly );
00184 _replyStream << deleteIncidenceKolab(arg0, arg1 );
00185 } break;
00186 case 8: {
00187 QString arg0;
00188 QString arg1;
00189 QDataStream arg( data, IO_ReadOnly );
00190 if (arg.atEnd()) return false;
00191 arg >> arg0;
00192 if (arg.atEnd()) return false;
00193 arg >> arg1;
00194 replyType = KMailICalIface_ftable[8][0];
00195 QDataStream _replyStream( replyData, IO_WriteOnly );
00196 _replyStream << incidencesKolabCount(arg0, arg1 );
00197 } break;
00198 case 9: {
00199 QString arg0;
00200 QString arg1;
00201 int arg2;
00202 int arg3;
00203 QDataStream arg( data, IO_ReadOnly );
00204 if (arg.atEnd()) return false;
00205 arg >> arg0;
00206 if (arg.atEnd()) return false;
00207 arg >> arg1;
00208 if (arg.atEnd()) return false;
00209 arg >> arg2;
00210 if (arg.atEnd()) return false;
00211 arg >> arg3;
00212 replyType = KMailICalIface_ftable[9][0];
00213 QDataStream _replyStream( replyData, IO_WriteOnly );
00214 _replyStream << incidencesKolab(arg0, arg1, arg2, arg3 );
00215 } break;
00216 case 10: {
00217 QString arg0;
00218 QDataStream arg( data, IO_ReadOnly );
00219 if (arg.atEnd()) return false;
00220 arg >> arg0;
00221 replyType = KMailICalIface_ftable[10][0];
00222 QDataStream _replyStream( replyData, IO_WriteOnly );
00223 _replyStream << subresourcesKolab(arg0 );
00224 } break;
00225 case 11: {
00226 QString arg0;
00227 QString arg1;
00228 QString arg2;
00229 QDataStream arg( data, IO_ReadOnly );
00230 if (arg.atEnd()) return false;
00231 arg >> arg0;
00232 if (arg.atEnd()) return false;
00233 arg >> arg1;
00234 if (arg.atEnd()) return false;
00235 arg >> arg2;
00236 replyType = KMailICalIface_ftable[11][0];
00237 QDataStream _replyStream( replyData, IO_WriteOnly );
00238 _replyStream << addSubresource(arg0, arg1, arg2 );
00239 } break;
00240 case 12: {
00241 QString arg0;
00242 QDataStream arg( data, IO_ReadOnly );
00243 if (arg.atEnd()) return false;
00244 arg >> arg0;
00245 replyType = KMailICalIface_ftable[12][0];
00246 QDataStream _replyStream( replyData, IO_WriteOnly );
00247 _replyStream << removeSubresource(arg0 );
00248 } break;
00249 case 13: {
00250 replyType = KMailICalIface_ftable[13][0];
00251 QDataStream _replyStream( replyData, IO_WriteOnly );
00252 _replyStream << dimapAccounts( );
00253 } break;
00254 case 14: {
00255 QString arg0;
00256 QDataStream arg( data, IO_ReadOnly );
00257 if (arg.atEnd()) return false;
00258 arg >> arg0;
00259 replyType = KMailICalIface_ftable[14][0];
00260 QDataStream _replyStream( replyData, IO_WriteOnly );
00261 _replyStream << dimapFolderAccountName(arg0 );
00262 } break;
00263 case 15: {
00264 QString arg0;
00265 QDataStream arg( data, IO_ReadOnly );
00266 if (arg.atEnd()) return false;
00267 arg >> arg0;
00268 replyType = KMailICalIface_ftable[15][0];
00269 QDataStream _replyStream( replyData, IO_WriteOnly );
00270 _replyStream << triggerSync(arg0 );
00271 } break;
00272 case 16: {
00273 QString arg0;
00274 QString arg1;
00275 QDataStream arg( data, IO_ReadOnly );
00276 if (arg.atEnd()) return false;
00277 arg >> arg0;
00278 if (arg.atEnd()) return false;
00279 arg >> arg1;
00280 replyType = KMailICalIface_ftable[16][0];
00281 changeResourceUIName(arg0, arg1 );
00282 } break;
00283 default:
00284 return DCOPObject::process( fun, data, replyType, replyData );
00285 }
00286 return true;
00287 }
00288
00289 QCStringList KMailICalIface::interfaces()
00290 {
00291 QCStringList ifaces = DCOPObject::interfaces();
00292 ifaces += "KMailICalIface";
00293 return ifaces;
00294 }
00295
00296 QCStringList KMailICalIface::functions()
00297 {
00298 QCStringList funcs = DCOPObject::functions();
00299 for ( int i = 0; KMailICalIface_ftable[i][2]; i++ ) {
00300 if (KMailICalIface_ftable_hiddens[i])
00301 continue;
00302 QCString func = KMailICalIface_ftable[i][0];
00303 func += ' ';
00304 func += KMailICalIface_ftable[i][2];
00305 funcs << func;
00306 }
00307 return funcs;
00308 }
00309
00310 void KMailICalIface::incidenceAdded( const QString& arg0, const QString& arg1, Q_UINT32 arg2, int arg3, const QString& arg4 )
00311 {
00312 QByteArray data;
00313 QDataStream arg( data, IO_WriteOnly );
00314 arg << arg0;
00315 arg << arg1;
00316 arg << arg2;
00317 arg << arg3;
00318 arg << arg4;
00319 emitDCOPSignal( "incidenceAdded(QString,QString,Q_UINT32,int,QString)", data );
00320 }
00321
00322 void KMailICalIface::asyncLoadResult( const QMap<Q_UINT32,QString> arg0, const QString& arg1, const QString& arg2 )
00323 {
00324 QByteArray data;
00325 QDataStream arg( data, IO_WriteOnly );
00326 arg << arg0;
00327 arg << arg1;
00328 arg << arg2;
00329 emitDCOPSignal( "asyncLoadResult(QMap<Q_UINT32,QString>,QString,QString)", data );
00330 }
00331
00332 void KMailICalIface::incidenceDeleted( const QString& arg0, const QString& arg1, const QString& arg2 )
00333 {
00334 QByteArray data;
00335 QDataStream arg( data, IO_WriteOnly );
00336 arg << arg0;
00337 arg << arg1;
00338 arg << arg2;
00339 emitDCOPSignal( "incidenceDeleted(QString,QString,QString)", data );
00340 }
00341
00342 void KMailICalIface::signalRefresh( const QString& arg0, const QString& arg1 )
00343 {
00344 QByteArray data;
00345 QDataStream arg( data, IO_WriteOnly );
00346 arg << arg0;
00347 arg << arg1;
00348 emitDCOPSignal( "signalRefresh(QString,QString)", data );
00349 }
00350
00351 void KMailICalIface::subresourceAdded( const QString& arg0, const QString& arg1, const QString& arg2, bool arg3, bool arg4 )
00352 {
00353 QByteArray data;
00354 QDataStream arg( data, IO_WriteOnly );
00355 arg << arg0;
00356 arg << arg1;
00357 arg << arg2;
00358 arg << arg3;
00359 arg << arg4;
00360 emitDCOPSignal( "subresourceAdded(QString,QString,QString,bool,bool)", data );
00361 }
00362
00363 void KMailICalIface::subresourceDeleted( const QString& arg0, const QString& arg1 )
00364 {
00365 QByteArray data;
00366 QDataStream arg( data, IO_WriteOnly );
00367 arg << arg0;
00368 arg << arg1;
00369 emitDCOPSignal( "subresourceDeleted(QString,QString)", data );
00370 }
00371
00372