00001
00002
00003
00004
00005
00006
00007
00008
00009 #include "./viewcursordcopinterface.h"
00010
00011 #include <kdatastream.h>
00012 #include <qasciidict.h>
00013
00014 namespace KTextEditor {
00015
00016 static const int ViewCursorDCOPInterface_fhash = 11;
00017 static const char* const ViewCursorDCOPInterface_ftable[11][3] = {
00018 { "uint", "viewCursorInterfaceNumber()", "viewCursorInterfaceNumber()" },
00019 { "QPoint", "cursorCoordinates()", "cursorCoordinates()" },
00020 { "void", "cursorPosition(uint,uint)", "cursorPosition(uint line,uint col)" },
00021 { "void", "cursorPositionReal(uint,uint)", "cursorPositionReal(uint line,uint col)" },
00022 { "bool", "setCursorPosition(uint,uint)", "setCursorPosition(uint line,uint col)" },
00023 { "bool", "setCursorPositionReal(uint,uint)", "setCursorPositionReal(uint line,uint col)" },
00024 { "uint", "cursorLine()", "cursorLine()" },
00025 { "uint", "cursorColumn()", "cursorColumn()" },
00026 { "uint", "cursorColumnReal()", "cursorColumnReal()" },
00027 { "void", "cursorPositionChanged()", "cursorPositionChanged()" },
00028 { 0, 0, 0 }
00029 };
00030 static const int ViewCursorDCOPInterface_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 ViewCursorDCOPInterface::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>( ViewCursorDCOPInterface_fhash, true, false );
00048 for ( int i = 0; ViewCursorDCOPInterface_ftable[i][1]; i++ )
00049 fdict->insert( ViewCursorDCOPInterface_ftable[i][1], new int( i ) );
00050 }
00051 int* fp = fdict->find( fun );
00052 switch ( fp?*fp:-1) {
00053 case 0: {
00054 replyType = ViewCursorDCOPInterface_ftable[0][0];
00055 QDataStream _replyStream( replyData, IO_WriteOnly );
00056 _replyStream << viewCursorInterfaceNumber( );
00057 } break;
00058 case 1: {
00059 replyType = ViewCursorDCOPInterface_ftable[1][0];
00060 QDataStream _replyStream( replyData, IO_WriteOnly );
00061 _replyStream << cursorCoordinates( );
00062 } break;
00063 case 2: {
00064 uint arg0;
00065 uint arg1;
00066 QDataStream arg( data, IO_ReadOnly );
00067 if (arg.atEnd()) return false;
00068 arg >> arg0;
00069 if (arg.atEnd()) return false;
00070 arg >> arg1;
00071 replyType = ViewCursorDCOPInterface_ftable[2][0];
00072 cursorPosition(arg0, arg1 );
00073 } break;
00074 case 3: {
00075 uint arg0;
00076 uint arg1;
00077 QDataStream arg( data, IO_ReadOnly );
00078 if (arg.atEnd()) return false;
00079 arg >> arg0;
00080 if (arg.atEnd()) return false;
00081 arg >> arg1;
00082 replyType = ViewCursorDCOPInterface_ftable[3][0];
00083 cursorPositionReal(arg0, arg1 );
00084 } break;
00085 case 4: {
00086 uint arg0;
00087 uint arg1;
00088 QDataStream arg( data, IO_ReadOnly );
00089 if (arg.atEnd()) return false;
00090 arg >> arg0;
00091 if (arg.atEnd()) return false;
00092 arg >> arg1;
00093 replyType = ViewCursorDCOPInterface_ftable[4][0];
00094 QDataStream _replyStream( replyData, IO_WriteOnly );
00095 _replyStream << setCursorPosition(arg0, arg1 );
00096 } break;
00097 case 5: {
00098 uint arg0;
00099 uint arg1;
00100 QDataStream arg( data, IO_ReadOnly );
00101 if (arg.atEnd()) return false;
00102 arg >> arg0;
00103 if (arg.atEnd()) return false;
00104 arg >> arg1;
00105 replyType = ViewCursorDCOPInterface_ftable[5][0];
00106 QDataStream _replyStream( replyData, IO_WriteOnly );
00107 _replyStream << setCursorPositionReal(arg0, arg1 );
00108 } break;
00109 case 6: {
00110 replyType = ViewCursorDCOPInterface_ftable[6][0];
00111 QDataStream _replyStream( replyData, IO_WriteOnly );
00112 _replyStream << cursorLine( );
00113 } break;
00114 case 7: {
00115 replyType = ViewCursorDCOPInterface_ftable[7][0];
00116 QDataStream _replyStream( replyData, IO_WriteOnly );
00117 _replyStream << cursorColumn( );
00118 } break;
00119 case 8: {
00120 replyType = ViewCursorDCOPInterface_ftable[8][0];
00121 QDataStream _replyStream( replyData, IO_WriteOnly );
00122 _replyStream << cursorColumnReal( );
00123 } break;
00124 case 9: {
00125 replyType = ViewCursorDCOPInterface_ftable[9][0];
00126 cursorPositionChanged( );
00127 } break;
00128 default:
00129 return DCOPObject::process( fun, data, replyType, replyData );
00130 }
00131 return true;
00132 }
00133
00134 QCStringList ViewCursorDCOPInterface::interfaces()
00135 {
00136 QCStringList ifaces = DCOPObject::interfaces();
00137 ifaces += "KTextEditor::ViewCursorDCOPInterface";
00138 return ifaces;
00139 }
00140
00141 QCStringList ViewCursorDCOPInterface::functions()
00142 {
00143 QCStringList funcs = DCOPObject::functions();
00144 for ( int i = 0; ViewCursorDCOPInterface_ftable[i][2]; i++ ) {
00145 if (ViewCursorDCOPInterface_ftable_hiddens[i])
00146 continue;
00147 QCString func = ViewCursorDCOPInterface_ftable[i][0];
00148 func += ' ';
00149 func += ViewCursorDCOPInterface_ftable[i][2];
00150 funcs << func;
00151 }
00152 return funcs;
00153 }
00154
00155 }
00156