00001
00002
00003
00004
00005
00006
00007
00008
00009
#include "./undodcopinterface.h"
00010
00011
#include <kdatastream.h>
00012
#include <qasciidict.h>
00013
00014
namespace KTextEditor {
00015
00016
static const int UndoDCOPInterface_fhash = 11;
00017
static const char*
const UndoDCOPInterface_ftable[11][3] = {
00018 {
"uint",
"undoInterfaceNumber()",
"undoInterfaceNumber()" },
00019 {
"void",
"undo()",
"undo()" },
00020 {
"void",
"redo()",
"redo()" },
00021 {
"void",
"clearUndo()",
"clearUndo()" },
00022 {
"void",
"clearRedo()",
"clearRedo()" },
00023 {
"uint",
"undoCount()",
"undoCount()" },
00024 {
"uint",
"redoCount()",
"redoCount()" },
00025 {
"uint",
"undoSteps()",
"undoSteps()" },
00026 {
"void",
"setUndoSteps(uint)",
"setUndoSteps(uint steps)" },
00027 {
"void",
"undoChanged()",
"undoChanged()" },
00028 { 0, 0, 0 }
00029 };
00030
static const int UndoDCOPInterface_ftable_hiddens[10] = {
00031 0,
00032 0,
00033 0,
00034 0,
00035 0,
00036 0,
00037 0,
00038 0,
00039 0,
00040 0,
00041 };
00042
00043
bool UndoDCOPInterface::process(
const QCString &fun,
const QByteArray &data,
QCString& replyType,
QByteArray &replyData)
00044 {
00045
static QAsciiDict<int>* fdict = 0;
00046
if ( !fdict ) {
00047 fdict =
new QAsciiDict<int>( UndoDCOPInterface_fhash,
true,
false );
00048
for (
int i = 0; UndoDCOPInterface_ftable[i][1]; i++ )
00049 fdict->
insert( UndoDCOPInterface_ftable[i][1],
new int( i ) );
00050 }
00051
int* fp = fdict->
find( fun );
00052
switch ( fp?*fp:-1) {
00053
case 0: {
00054 replyType = UndoDCOPInterface_ftable[0][0];
00055
QDataStream _replyStream( replyData, IO_WriteOnly );
00056 _replyStream << undoInterfaceNumber( );
00057 }
break;
00058
case 1: {
00059 replyType = UndoDCOPInterface_ftable[1][0];
00060 undo( );
00061 }
break;
00062
case 2: {
00063 replyType = UndoDCOPInterface_ftable[2][0];
00064 redo( );
00065 }
break;
00066
case 3: {
00067 replyType = UndoDCOPInterface_ftable[3][0];
00068 clearUndo( );
00069 }
break;
00070
case 4: {
00071 replyType = UndoDCOPInterface_ftable[4][0];
00072 clearRedo( );
00073 }
break;
00074
case 5: {
00075 replyType = UndoDCOPInterface_ftable[5][0];
00076
QDataStream _replyStream( replyData, IO_WriteOnly );
00077 _replyStream << undoCount( );
00078 }
break;
00079
case 6: {
00080 replyType = UndoDCOPInterface_ftable[6][0];
00081
QDataStream _replyStream( replyData, IO_WriteOnly );
00082 _replyStream << redoCount( );
00083 }
break;
00084
case 7: {
00085 replyType = UndoDCOPInterface_ftable[7][0];
00086
QDataStream _replyStream( replyData, IO_WriteOnly );
00087 _replyStream << undoSteps( );
00088 }
break;
00089
case 8: {
00090 uint arg0;
00091
QDataStream arg( data, IO_ReadOnly );
00092
if (arg.
atEnd())
return false;
00093 arg >> arg0;
00094 replyType = UndoDCOPInterface_ftable[8][0];
00095 setUndoSteps(arg0 );
00096 }
break;
00097
case 9: {
00098 replyType = UndoDCOPInterface_ftable[9][0];
00099 undoChanged( );
00100 }
break;
00101
default:
00102
return DCOPObject::process( fun, data, replyType, replyData );
00103 }
00104
return true;
00105 }
00106
00107 QCStringList
UndoDCOPInterface::interfaces()
00108 {
00109 QCStringList ifaces =
DCOPObject::interfaces();
00110 ifaces +=
"KTextEditor::UndoDCOPInterface";
00111
return ifaces;
00112 }
00113
00114 QCStringList
UndoDCOPInterface::functions()
00115 {
00116 QCStringList funcs =
DCOPObject::functions();
00117
for (
int i = 0; UndoDCOPInterface_ftable[i][2]; i++ ) {
00118
if (UndoDCOPInterface_ftable_hiddens[i])
00119
continue;
00120
QCString func = UndoDCOPInterface_ftable[i][0];
00121 func +=
' ';
00122 func += UndoDCOPInterface_ftable[i][2];
00123 funcs << func;
00124 }
00125
return funcs;
00126 }
00127
00128 }
00129