00001
00002
00003
00004
00005
00006
00007
00008
00009
#include "./kmfactory.h"
00010
00011
#include <kdatastream.h>
00012
00013
00014
static const char*
const KMFactory_ftable[3][3] = {
00015 {
"ASYNC",
"slot_pluginChanged(pid_t)",
"slot_pluginChanged(pid_t)" },
00016 {
"ASYNC",
"slot_configChanged()",
"slot_configChanged()" },
00017 { 0, 0, 0 }
00018 };
00019
static const int KMFactory_ftable_hiddens[2] = {
00020 0,
00021 0,
00022 };
00023
00024
bool KMFactory::process(
const QCString &fun,
const QByteArray &data,
QCString& replyType,
QByteArray &replyData)
00025 {
00026
if ( fun == KMFactory_ftable[0][1] ) {
00027 pid_t arg0;
00028
QDataStream arg( data, IO_ReadOnly );
00029 arg >> arg0;
00030 replyType = KMFactory_ftable[0][0];
00031 slot_pluginChanged(arg0 );
00032 }
else if ( fun == KMFactory_ftable[1][1] ) {
00033 replyType = KMFactory_ftable[1][0];
00034 slot_configChanged( );
00035 }
else {
00036
return DCOPObject::process( fun, data, replyType, replyData );
00037 }
00038
return true;
00039 }
00040
00041 QCStringList KMFactory::interfaces()
00042 {
00043 QCStringList ifaces = DCOPObject::interfaces();
00044 ifaces +=
"KMFactory";
00045
return ifaces;
00046 }
00047
00048 QCStringList KMFactory::functions()
00049 {
00050 QCStringList funcs = DCOPObject::functions();
00051
for (
int i = 0; KMFactory_ftable[i][2]; i++ ) {
00052
if (KMFactory_ftable_hiddens[i])
00053
continue;
00054
QCString func = KMFactory_ftable[i][0];
00055 func +=
' ';
00056 func += KMFactory_ftable[i][2];
00057 funcs << func;
00058 }
00059
return funcs;
00060 }
00061
00062
void KMFactory::pluginChanged( pid_t arg0 )
00063 {
00064
QByteArray data;
00065
QDataStream arg( data, IO_WriteOnly );
00066 arg << arg0;
00067 emitDCOPSignal(
"pluginChanged(pid_t)", data );
00068 }
00069
00070
void KMFactory::configChanged()
00071 {
00072
QByteArray data;
00073 emitDCOPSignal(
"configChanged()", data );
00074 }
00075
00076