00001
00002
00003
00004
00005
00006
00007
00008
00009
#include "./KNotesIface.h"
00010
00011
#include <kdatastream.h>
00012
#include <qasciidict.h>
00013
00014
00015
static const int KNotesIface_fhash = 17;
00016
static const char*
const KNotesIface_ftable[15][3] = {
00017 {
"QString",
"newNote(QString,QString)",
"newNote(QString name,QString text)" },
00018 {
"QString",
"newNoteFromClipboard(QString)",
"newNoteFromClipboard(QString name)" },
00019 {
"ASYNC",
"showNote(QString)",
"showNote(QString noteId)" },
00020 {
"ASYNC",
"hideNote(QString)",
"hideNote(QString noteId)" },
00021 {
"ASYNC",
"killNote(QString)",
"killNote(QString noteId)" },
00022 {
"ASYNC",
"killNote(QString,bool)",
"killNote(QString noteId,bool force)" },
00023 {
"QMap<QString,QString>",
"notes()",
"notes()" },
00024 {
"ASYNC",
"setName(QString,QString)",
"setName(QString noteId,QString newName)" },
00025 {
"ASYNC",
"setText(QString,QString)",
"setText(QString noteId,QString newText)" },
00026 {
"QString",
"name(QString)",
"name(QString noteId)" },
00027 {
"QString",
"text(QString)",
"text(QString noteId)" },
00028 {
"ASYNC",
"sync(QString)",
"sync(QString app)" },
00029 {
"bool",
"isNew(QString,QString)",
"isNew(QString app,QString noteId)" },
00030 {
"bool",
"isModified(QString,QString)",
"isModified(QString app,QString noteId)" },
00031 { 0, 0, 0 }
00032 };
00033
static const int KNotesIface_ftable_hiddens[14] = {
00034 0,
00035 0,
00036 0,
00037 0,
00038 0,
00039 0,
00040 0,
00041 0,
00042 0,
00043 0,
00044 0,
00045 0,
00046 0,
00047 0,
00048 };
00049
00050
bool KNotesIface::process(
const QCString &fun,
const QByteArray &data,
QCString& replyType,
QByteArray &replyData)
00051 {
00052
static QAsciiDict<int>* fdict = 0;
00053
if ( !fdict ) {
00054 fdict =
new QAsciiDict<int>( KNotesIface_fhash,
true,
false );
00055
for (
int i = 0; KNotesIface_ftable[i][1]; i++ )
00056 fdict->insert( KNotesIface_ftable[i][1],
new int( i ) );
00057 }
00058
int* fp = fdict->find( fun );
00059
switch ( fp?*fp:-1) {
00060
case 0: {
00061
QString arg0;
00062
QString arg1;
00063
QDataStream arg( data, IO_ReadOnly );
00064 arg >> arg0;
00065 arg >> arg1;
00066 replyType = KNotesIface_ftable[0][0];
00067
QDataStream _replyStream( replyData, IO_WriteOnly );
00068 _replyStream << newNote(arg0, arg1 );
00069 }
break;
00070
case 1: {
00071
QString arg0;
00072
QDataStream arg( data, IO_ReadOnly );
00073 arg >> arg0;
00074 replyType = KNotesIface_ftable[1][0];
00075
QDataStream _replyStream( replyData, IO_WriteOnly );
00076 _replyStream << newNoteFromClipboard(arg0 );
00077 }
break;
00078
case 2: {
00079
QString arg0;
00080
QDataStream arg( data, IO_ReadOnly );
00081 arg >> arg0;
00082 replyType = KNotesIface_ftable[2][0];
00083 showNote(arg0 );
00084 }
break;
00085
case 3: {
00086
QString arg0;
00087
QDataStream arg( data, IO_ReadOnly );
00088 arg >> arg0;
00089 replyType = KNotesIface_ftable[3][0];
00090 hideNote(arg0 );
00091 }
break;
00092
case 4: {
00093
QString arg0;
00094
QDataStream arg( data, IO_ReadOnly );
00095 arg >> arg0;
00096 replyType = KNotesIface_ftable[4][0];
00097 killNote(arg0 );
00098 }
break;
00099
case 5: {
00100
QString arg0;
00101
bool arg1;
00102
QDataStream arg( data, IO_ReadOnly );
00103 arg >> arg0;
00104 arg >> arg1;
00105 replyType = KNotesIface_ftable[5][0];
00106 killNote(arg0, arg1 );
00107 }
break;
00108
case 6: {
00109 replyType = KNotesIface_ftable[6][0];
00110
QDataStream _replyStream( replyData, IO_WriteOnly );
00111 _replyStream << notes( );
00112 }
break;
00113
case 7: {
00114
QString arg0;
00115
QString arg1;
00116
QDataStream arg( data, IO_ReadOnly );
00117 arg >> arg0;
00118 arg >> arg1;
00119 replyType = KNotesIface_ftable[7][0];
00120 setName(arg0, arg1 );
00121 }
break;
00122
case 8: {
00123
QString arg0;
00124
QString arg1;
00125
QDataStream arg( data, IO_ReadOnly );
00126 arg >> arg0;
00127 arg >> arg1;
00128 replyType = KNotesIface_ftable[8][0];
00129 setText(arg0, arg1 );
00130 }
break;
00131
case 9: {
00132
QString arg0;
00133
QDataStream arg( data, IO_ReadOnly );
00134 arg >> arg0;
00135 replyType = KNotesIface_ftable[9][0];
00136
QDataStream _replyStream( replyData, IO_WriteOnly );
00137 _replyStream << name(arg0 );
00138 }
break;
00139
case 10: {
00140
QString arg0;
00141
QDataStream arg( data, IO_ReadOnly );
00142 arg >> arg0;
00143 replyType = KNotesIface_ftable[10][0];
00144
QDataStream _replyStream( replyData, IO_WriteOnly );
00145 _replyStream << text(arg0 );
00146 }
break;
00147
case 11: {
00148
QString arg0;
00149
QDataStream arg( data, IO_ReadOnly );
00150 arg >> arg0;
00151 replyType = KNotesIface_ftable[11][0];
00152 sync(arg0 );
00153 }
break;
00154
case 12: {
00155
QString arg0;
00156
QString arg1;
00157
QDataStream arg( data, IO_ReadOnly );
00158 arg >> arg0;
00159 arg >> arg1;
00160 replyType = KNotesIface_ftable[12][0];
00161
QDataStream _replyStream( replyData, IO_WriteOnly );
00162 _replyStream << isNew(arg0, arg1 );
00163 }
break;
00164
case 13: {
00165
QString arg0;
00166
QString arg1;
00167
QDataStream arg( data, IO_ReadOnly );
00168 arg >> arg0;
00169 arg >> arg1;
00170 replyType = KNotesIface_ftable[13][0];
00171
QDataStream _replyStream( replyData, IO_WriteOnly );
00172 _replyStream << isModified(arg0, arg1 );
00173 }
break;
00174
default:
00175
return DCOPObject::process( fun, data, replyType, replyData );
00176 }
00177
return true;
00178 }
00179
00180 QCStringList KNotesIface::interfaces()
00181 {
00182 QCStringList ifaces = DCOPObject::interfaces();
00183 ifaces +=
"KNotesIface";
00184
return ifaces;
00185 }
00186
00187 QCStringList KNotesIface::functions()
00188 {
00189 QCStringList funcs = DCOPObject::functions();
00190
for (
int i = 0; KNotesIface_ftable[i][2]; i++ ) {
00191
if (KNotesIface_ftable_hiddens[i])
00192
continue;
00193
QCString func = KNotesIface_ftable[i][0];
00194 func +=
' ';
00195 func += KNotesIface_ftable[i][2];
00196 funcs << func;
00197 }
00198
return funcs;
00199 }
00200
00201