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 = 11;
00016 static const char* const KMailICalIface_ftable[10][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 { "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)" },
00021 { "bool", "deleteIncidenceKolab(QString,Q_UINT32)", "deleteIncidenceKolab(QString resource,Q_UINT32 sernum)" },
00022 { "int", "incidencesKolabCount(QString,QString)", "incidencesKolabCount(QString mimetype,QString resource)" },
00023 { "QMap<Q_UINT32, QString>", "incidencesKolab(QString,QString,int,int)", "incidencesKolab(QString mimetype,QString resource,int startIndex,int nbMessages)" },
00024 { "QValueList<KMailICalIface::SubResource>", "subresourcesKolab(QString)", "subresourcesKolab(QString contentsType)" },
00025 { "bool", "triggerSync(QString)", "triggerSync(QString)" },
00026 { 0, 0, 0 }
00027 };
00028 static const int KMailICalIface_ftable_hiddens[9] = {
00029 0,
00030 0,
00031 0,
00032 0,
00033 0,
00034 0,
00035 0,
00036 0,
00037 0,
00038 };
00039
00040 bool KMailICalIface::process(const QCString &fun, const QByteArray &data, QCString& replyType, QByteArray &replyData)
00041 {
00042 static QAsciiDict<int>* fdict = 0;
00043 if ( !fdict ) {
00044 fdict = new QAsciiDict<int>( KMailICalIface_fhash, true, false );
00045 for ( int i = 0; KMailICalIface_ftable[i][1]; i++ )
00046 fdict->insert( KMailICalIface_ftable[i][1], new int( i ) );
00047 }
00048 int* fp = fdict->find( fun );
00049 switch ( fp?*fp:-1) {
00050 case 0: {
00051 QString arg0;
00052 QString arg1;
00053 QDataStream arg( data, IO_ReadOnly );
00054 if (arg.atEnd()) return false;
00055 arg >> arg0;
00056 if (arg.atEnd()) return false;
00057 arg >> arg1;
00058 replyType = KMailICalIface_ftable[0][0];
00059 QDataStream _replyStream( replyData, IO_WriteOnly );
00060 _replyStream << isWritableFolder(arg0, arg1 );
00061 } break;
00062 case 1: {
00063 QString arg0;
00064 QDataStream arg( data, IO_ReadOnly );
00065 if (arg.atEnd()) return false;
00066 arg >> arg0;
00067 replyType = KMailICalIface_ftable[1][0];
00068 QDataStream _replyStream( replyData, IO_WriteOnly );
00069 _replyStream << storageFormat(arg0 );
00070 } break;
00071 case 2: {
00072 QString arg0;
00073 Q_UINT32 arg1;
00074 QString arg2;
00075 QDataStream arg( data, IO_ReadOnly );
00076 if (arg.atEnd()) return false;
00077 arg >> arg0;
00078 if (arg.atEnd()) return false;
00079 arg >> arg1;
00080 if (arg.atEnd()) return false;
00081 arg >> arg2;
00082 replyType = KMailICalIface_ftable[2][0];
00083 QDataStream _replyStream( replyData, IO_WriteOnly );
00084 _replyStream << getAttachment(arg0, arg1, arg2 );
00085 } break;
00086 case 3: {
00087 QString arg0;
00088 Q_UINT32 arg1;
00089 QString arg2;
00090 QString arg3;
00091 QMap<QCString,QString> arg4;
00092 QStringList arg5;
00093 QStringList arg6;
00094 QStringList arg7;
00095 QStringList arg8;
00096 QDataStream arg( data, IO_ReadOnly );
00097 if (arg.atEnd()) return false;
00098 arg >> arg0;
00099 if (arg.atEnd()) return false;
00100 arg >> arg1;
00101 if (arg.atEnd()) return false;
00102 arg >> arg2;
00103 if (arg.atEnd()) return false;
00104 arg >> arg3;
00105 if (arg.atEnd()) return false;
00106 arg >> arg4;
00107 if (arg.atEnd()) return false;
00108 arg >> arg5;
00109 if (arg.atEnd()) return false;
00110 arg >> arg6;
00111 if (arg.atEnd()) return false;
00112 arg >> arg7;
00113 if (arg.atEnd()) return false;
00114 arg >> arg8;
00115 replyType = KMailICalIface_ftable[3][0];
00116 QDataStream _replyStream( replyData, IO_WriteOnly );
00117 _replyStream << update(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8 );
00118 } break;
00119 case 4: {
00120 QString arg0;
00121 Q_UINT32 arg1;
00122 QDataStream arg( data, IO_ReadOnly );
00123 if (arg.atEnd()) return false;
00124 arg >> arg0;
00125 if (arg.atEnd()) return false;
00126 arg >> arg1;
00127 replyType = KMailICalIface_ftable[4][0];
00128 QDataStream _replyStream( replyData, IO_WriteOnly );
00129 _replyStream << deleteIncidenceKolab(arg0, arg1 );
00130 } break;
00131 case 5: {
00132 QString arg0;
00133 QString arg1;
00134 QDataStream arg( data, IO_ReadOnly );
00135 if (arg.atEnd()) return false;
00136 arg >> arg0;
00137 if (arg.atEnd()) return false;
00138 arg >> arg1;
00139 replyType = KMailICalIface_ftable[5][0];
00140 QDataStream _replyStream( replyData, IO_WriteOnly );
00141 _replyStream << incidencesKolabCount(arg0, arg1 );
00142 } break;
00143 case 6: {
00144 QString arg0;
00145 QString arg1;
00146 int arg2;
00147 int arg3;
00148 QDataStream arg( data, IO_ReadOnly );
00149 if (arg.atEnd()) return false;
00150 arg >> arg0;
00151 if (arg.atEnd()) return false;
00152 arg >> arg1;
00153 if (arg.atEnd()) return false;
00154 arg >> arg2;
00155 if (arg.atEnd()) return false;
00156 arg >> arg3;
00157 replyType = KMailICalIface_ftable[6][0];
00158 QDataStream _replyStream( replyData, IO_WriteOnly );
00159 _replyStream << incidencesKolab(arg0, arg1, arg2, arg3 );
00160 } break;
00161 case 7: {
00162 QString arg0;
00163 QDataStream arg( data, IO_ReadOnly );
00164 if (arg.atEnd()) return false;
00165 arg >> arg0;
00166 replyType = KMailICalIface_ftable[7][0];
00167 QDataStream _replyStream( replyData, IO_WriteOnly );
00168 _replyStream << subresourcesKolab(arg0 );
00169 } break;
00170 case 8: {
00171 QString arg0;
00172 QDataStream arg( data, IO_ReadOnly );
00173 if (arg.atEnd()) return false;
00174 arg >> arg0;
00175 replyType = KMailICalIface_ftable[8][0];
00176 QDataStream _replyStream( replyData, IO_WriteOnly );
00177 _replyStream << triggerSync(arg0 );
00178 } break;
00179 default:
00180 return DCOPObject::process( fun, data, replyType, replyData );
00181 }
00182 return true;
00183 }
00184
00185 QCStringList KMailICalIface::interfaces()
00186 {
00187 QCStringList ifaces = DCOPObject::interfaces();
00188 ifaces += "KMailICalIface";
00189 return ifaces;
00190 }
00191
00192 QCStringList KMailICalIface::functions()
00193 {
00194 QCStringList funcs = DCOPObject::functions();
00195 for ( int i = 0; KMailICalIface_ftable[i][2]; i++ ) {
00196 if (KMailICalIface_ftable_hiddens[i])
00197 continue;
00198 QCString func = KMailICalIface_ftable[i][0];
00199 func += ' ';
00200 func += KMailICalIface_ftable[i][2];
00201 funcs << func;
00202 }
00203 return funcs;
00204 }
00205
00206 void KMailICalIface::incidenceAdded( const QString& arg0, const QString& arg1, Q_UINT32 arg2, int arg3, const QString& arg4 )
00207 {
00208 QByteArray data;
00209 QDataStream arg( data, IO_WriteOnly );
00210 arg << arg0;
00211 arg << arg1;
00212 arg << arg2;
00213 arg << arg3;
00214 arg << arg4;
00215 emitDCOPSignal( "incidenceAdded(QString,QString,Q_UINT32,int,QString)", data );
00216 }
00217
00218 void KMailICalIface::asyncLoadResult( const QMap<Q_UINT32,QString> arg0, const QString& arg1, const QString& arg2 )
00219 {
00220 QByteArray data;
00221 QDataStream arg( data, IO_WriteOnly );
00222 arg << arg0;
00223 arg << arg1;
00224 arg << arg2;
00225 emitDCOPSignal( "asyncLoadResult(QMap<Q_UINT32,QString>,QString,QString)", data );
00226 }
00227
00228 void KMailICalIface::incidenceDeleted( const QString& arg0, const QString& arg1, const QString& arg2 )
00229 {
00230 QByteArray data;
00231 QDataStream arg( data, IO_WriteOnly );
00232 arg << arg0;
00233 arg << arg1;
00234 arg << arg2;
00235 emitDCOPSignal( "incidenceDeleted(QString,QString,QString)", data );
00236 }
00237
00238 void KMailICalIface::signalRefresh( const QString& arg0, const QString& arg1 )
00239 {
00240 QByteArray data;
00241 QDataStream arg( data, IO_WriteOnly );
00242 arg << arg0;
00243 arg << arg1;
00244 emitDCOPSignal( "signalRefresh(QString,QString)", data );
00245 }
00246
00247 void KMailICalIface::subresourceAdded( const QString& arg0, const QString& arg1, const QString& arg2 )
00248 {
00249 QByteArray data;
00250 QDataStream arg( data, IO_WriteOnly );
00251 arg << arg0;
00252 arg << arg1;
00253 arg << arg2;
00254 emitDCOPSignal( "subresourceAdded(QString,QString,QString)", data );
00255 }
00256
00257 void KMailICalIface::subresourceDeleted( const QString& arg0, const QString& arg1 )
00258 {
00259 QByteArray data;
00260 QDataStream arg( data, IO_WriteOnly );
00261 arg << arg0;
00262 arg << arg1;
00263 emitDCOPSignal( "subresourceDeleted(QString,QString)", data );
00264 }
00265
00266