observer_skel.cpp00001
00002
00003
00004
00005
00006
00007
00008
00009 #include "./observer.h"
00010
00011 #include <kdatastream.h>
00012
00013
00014 static const char* const Observer_ftable[3][3] = {
00015 { "void", "killJob(int)", "killJob(int progressId)" },
00016 { "KIO::MetaData", "metadata(int)", "metadata(int progressId)" },
00017 { 0, 0, 0 }
00018 };
00019 static const int Observer_ftable_hiddens[2] = {
00020 0,
00021 0,
00022 };
00023
00024 bool Observer::process(const QCString &fun, const QByteArray &data, QCString& replyType, QByteArray &replyData)
00025 {
00026 if ( fun == Observer_ftable[0][1] ) {
00027 int arg0;
00028 QDataStream arg( data, IO_ReadOnly );
00029 if (arg.atEnd()) return false;
00030 arg >> arg0;
00031 replyType = Observer_ftable[0][0];
00032 killJob(arg0 );
00033 } else if ( fun == Observer_ftable[1][1] ) {
00034 int arg0;
00035 QDataStream arg( data, IO_ReadOnly );
00036 if (arg.atEnd()) return false;
00037 arg >> arg0;
00038 replyType = Observer_ftable[1][0];
00039 QDataStream _replyStream( replyData, IO_WriteOnly );
00040 _replyStream << metadata(arg0 );
00041 } else {
00042 return DCOPObject::process( fun, data, replyType, replyData );
00043 }
00044 return true;
00045 }
00046
00047 QCStringList Observer::interfaces()
00048 {
00049 QCStringList ifaces = DCOPObject::interfaces();
00050 ifaces += "Observer";
00051 return ifaces;
00052 }
00053
00054 QCStringList Observer::functions()
00055 {
00056 QCStringList funcs = DCOPObject::functions();
00057 for ( int i = 0; Observer_ftable[i][2]; i++ ) {
00058 if (Observer_ftable_hiddens[i])
00059 continue;
00060 QCString func = Observer_ftable[i][0];
00061 func += ' ';
00062 func += Observer_ftable[i][2];
00063 funcs << func;
00064 }
00065 return funcs;
00066 }
00067
00068
|