kdirnotify_skel.cpp00001
00002
00003
00004
00005
00006
00007
00008
00009 #include "./kdirnotify.h"
00010
00011 #include <kdatastream.h>
00012
00013
00014 static const char* const KDirNotify_ftable[5][3] = {
00015 { "ASYNC", "FilesAdded(KURL)", "FilesAdded(KURL directory)" },
00016 { "ASYNC", "FilesRemoved(KURL::List)", "FilesRemoved(KURL::List fileList)" },
00017 { "ASYNC", "FilesChanged(KURL::List)", "FilesChanged(KURL::List fileList)" },
00018 { "ASYNC", "FileRenamed(KURL,KURL)", "FileRenamed(KURL src,KURL dst)" },
00019 { 0, 0, 0 }
00020 };
00021 static const int KDirNotify_ftable_hiddens[4] = {
00022 0,
00023 0,
00024 0,
00025 0,
00026 };
00027
00028 bool KDirNotify::process(const QCString &fun, const QByteArray &data, QCString& replyType, QByteArray &replyData)
00029 {
00030 if ( fun == KDirNotify_ftable[0][1] ) {
00031 KURL arg0;
00032 QDataStream arg( data, IO_ReadOnly );
00033 if (arg.atEnd()) return false;
00034 arg >> arg0;
00035 replyType = KDirNotify_ftable[0][0];
00036 FilesAdded(arg0 );
00037 } else if ( fun == KDirNotify_ftable[1][1] ) {
00038 KURL::List arg0;
00039 QDataStream arg( data, IO_ReadOnly );
00040 if (arg.atEnd()) return false;
00041 arg >> arg0;
00042 replyType = KDirNotify_ftable[1][0];
00043 FilesRemoved(arg0 );
00044 } else if ( fun == KDirNotify_ftable[2][1] ) {
00045 KURL::List arg0;
00046 QDataStream arg( data, IO_ReadOnly );
00047 if (arg.atEnd()) return false;
00048 arg >> arg0;
00049 replyType = KDirNotify_ftable[2][0];
00050 FilesChanged(arg0 );
00051 } else if ( fun == KDirNotify_ftable[3][1] ) {
00052 KURL arg0;
00053 KURL arg1;
00054 QDataStream arg( data, IO_ReadOnly );
00055 if (arg.atEnd()) return false;
00056 arg >> arg0;
00057 if (arg.atEnd()) return false;
00058 arg >> arg1;
00059 replyType = KDirNotify_ftable[3][0];
00060 FileRenamed(arg0, arg1 );
00061 } else {
00062 return DCOPObject::process( fun, data, replyType, replyData );
00063 }
00064 return true;
00065 }
00066
00067 QCStringList KDirNotify::interfaces()
00068 {
00069 QCStringList ifaces = DCOPObject::interfaces();
00070 ifaces += "KDirNotify";
00071 return ifaces;
00072 }
00073
00074 QCStringList KDirNotify::functions()
00075 {
00076 QCStringList funcs = DCOPObject::functions();
00077 for ( int i = 0; KDirNotify_ftable[i][2]; i++ ) {
00078 if (KDirNotify_ftable_hiddens[i])
00079 continue;
00080 QCString func = KDirNotify_ftable[i][0];
00081 func += ' ';
00082 func += KDirNotify_ftable[i][2];
00083 funcs << func;
00084 }
00085 return funcs;
00086 }
00087
00088
|