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