00001
00002
00003
00004
00005
00006
00007
00008
00009 #include "./kateappIface.h"
00010
00011 #include <kdatastream.h>
00012 #include <qasciidict.h>
00013
00014
00015 static const int KateAppDCOPIface_fhash = 13;
00016 static const char* const KateAppDCOPIface_ftable[12][3] = {
00017 { "DCOPRef", "documentManager()", "documentManager()" },
00018 { "DCOPRef", "activeMainWindow()", "activeMainWindow()" },
00019 { "uint", "activeMainWindowNumber()", "activeMainWindowNumber()" },
00020 { "uint", "mainWindows()", "mainWindows()" },
00021 { "DCOPRef", "mainWindow(uint)", "mainWindow(uint n)" },
00022 { "bool", "openURL(KURL,QString)", "openURL(KURL url,QString encoding)" },
00023 { "bool", "openURL(KURL,QString,bool)", "openURL(KURL url,QString encoding,bool isTempFile)" },
00024 { "bool", "setCursor(int,int)", "setCursor(int line,int column)" },
00025 { "bool", "openInput(QString)", "openInput(QString text)" },
00026 { "bool", "activateSession(QString)", "activateSession(QString session)" },
00027 { "QString", "session()", "session()" },
00028 { 0, 0, 0 }
00029 };
00030 static const int KateAppDCOPIface_ftable_hiddens[11] = {
00031 0,
00032 0,
00033 0,
00034 0,
00035 0,
00036 0,
00037 0,
00038 0,
00039 0,
00040 0,
00041 0,
00042 };
00043
00044 bool KateAppDCOPIface::process(const QCString &fun, const QByteArray &data, QCString& replyType, QByteArray &replyData)
00045 {
00046 static QAsciiDict<int>* fdict = 0;
00047 if ( !fdict ) {
00048 fdict = new QAsciiDict<int>( KateAppDCOPIface_fhash, true, false );
00049 for ( int i = 0; KateAppDCOPIface_ftable[i][1]; i++ )
00050 fdict->insert( KateAppDCOPIface_ftable[i][1], new int( i ) );
00051 }
00052 int* fp = fdict->find( fun );
00053 switch ( fp?*fp:-1) {
00054 case 0: {
00055 replyType = KateAppDCOPIface_ftable[0][0];
00056 QDataStream _replyStream( replyData, IO_WriteOnly );
00057 _replyStream << documentManager( );
00058 } break;
00059 case 1: {
00060 replyType = KateAppDCOPIface_ftable[1][0];
00061 QDataStream _replyStream( replyData, IO_WriteOnly );
00062 _replyStream << activeMainWindow( );
00063 } break;
00064 case 2: {
00065 replyType = KateAppDCOPIface_ftable[2][0];
00066 QDataStream _replyStream( replyData, IO_WriteOnly );
00067 _replyStream << activeMainWindowNumber( );
00068 } break;
00069 case 3: {
00070 replyType = KateAppDCOPIface_ftable[3][0];
00071 QDataStream _replyStream( replyData, IO_WriteOnly );
00072 _replyStream << mainWindows( );
00073 } break;
00074 case 4: {
00075 uint arg0;
00076 QDataStream arg( data, IO_ReadOnly );
00077 if (arg.atEnd()) return false;
00078 arg >> arg0;
00079 replyType = KateAppDCOPIface_ftable[4][0];
00080 QDataStream _replyStream( replyData, IO_WriteOnly );
00081 _replyStream << mainWindow(arg0 );
00082 } break;
00083 case 5: {
00084 KURL arg0;
00085 QString arg1;
00086 QDataStream arg( data, IO_ReadOnly );
00087 if (arg.atEnd()) return false;
00088 arg >> arg0;
00089 if (arg.atEnd()) return false;
00090 arg >> arg1;
00091 replyType = KateAppDCOPIface_ftable[5][0];
00092 QDataStream _replyStream( replyData, IO_WriteOnly );
00093 _replyStream << openURL(arg0, arg1 );
00094 } break;
00095 case 6: {
00096 KURL arg0;
00097 QString arg1;
00098 bool arg2;
00099 QDataStream arg( data, IO_ReadOnly );
00100 if (arg.atEnd()) return false;
00101 arg >> arg0;
00102 if (arg.atEnd()) return false;
00103 arg >> arg1;
00104 if (arg.atEnd()) return false;
00105 arg >> arg2;
00106 replyType = KateAppDCOPIface_ftable[6][0];
00107 QDataStream _replyStream( replyData, IO_WriteOnly );
00108 _replyStream << openURL(arg0, arg1, arg2 );
00109 } break;
00110 case 7: {
00111 int arg0;
00112 int arg1;
00113 QDataStream arg( data, IO_ReadOnly );
00114 if (arg.atEnd()) return false;
00115 arg >> arg0;
00116 if (arg.atEnd()) return false;
00117 arg >> arg1;
00118 replyType = KateAppDCOPIface_ftable[7][0];
00119 QDataStream _replyStream( replyData, IO_WriteOnly );
00120 _replyStream << setCursor(arg0, arg1 );
00121 } break;
00122 case 8: {
00123 QString arg0;
00124 QDataStream arg( data, IO_ReadOnly );
00125 if (arg.atEnd()) return false;
00126 arg >> arg0;
00127 replyType = KateAppDCOPIface_ftable[8][0];
00128 QDataStream _replyStream( replyData, IO_WriteOnly );
00129 _replyStream << openInput(arg0 );
00130 } break;
00131 case 9: {
00132 QString arg0;
00133 QDataStream arg( data, IO_ReadOnly );
00134 if (arg.atEnd()) return false;
00135 arg >> arg0;
00136 replyType = KateAppDCOPIface_ftable[9][0];
00137 QDataStream _replyStream( replyData, IO_WriteOnly );
00138 _replyStream << activateSession(arg0 );
00139 } break;
00140 case 10: {
00141 replyType = KateAppDCOPIface_ftable[10][0];
00142 QDataStream _replyStream( replyData, IO_WriteOnly );
00143 _replyStream << session( );
00144 } break;
00145 default:
00146 return DCOPObject::process( fun, data, replyType, replyData );
00147 }
00148 return true;
00149 }
00150
00151 QCStringList KateAppDCOPIface::interfaces()
00152 {
00153 QCStringList ifaces = DCOPObject::interfaces();
00154 ifaces += "KateAppDCOPIface";
00155 return ifaces;
00156 }
00157
00158 QCStringList KateAppDCOPIface::functions()
00159 {
00160 QCStringList funcs = DCOPObject::functions();
00161 for ( int i = 0; KateAppDCOPIface_ftable[i][2]; i++ ) {
00162 if (KateAppDCOPIface_ftable_hiddens[i])
00163 continue;
00164 QCString func = KateAppDCOPIface_ftable[i][0];
00165 func += ' ';
00166 func += KateAppDCOPIface_ftable[i][2];
00167 funcs << func;
00168 }
00169 return funcs;
00170 }
00171
00172