00001
00002
00003
00004
00005
00006
00007
00008
00009 #include "./katedocmanageriface.h"
00010
00011 #include <kdatastream.h>
00012 #include <qasciidict.h>
00013
00014
00015 static const int KateDocManagerDCOPIface_fhash = 13;
00016 static const char* const KateDocManagerDCOPIface_ftable[12][3] = {
00017 { "DCOPRef", "document(uint)", "document(uint n)" },
00018 { "DCOPRef", "activeDocument()", "activeDocument()" },
00019 { "uint", "activeDocumentNumber()", "activeDocumentNumber()" },
00020 { "DCOPRef", "documentWithID(uint)", "documentWithID(uint id)" },
00021 { "int", "findDocument(KURL)", "findDocument(KURL url)" },
00022 { "bool", "isOpen(KURL)", "isOpen(KURL url)" },
00023 { "uint", "documents()", "documents()" },
00024 { "DCOPRef", "openURL(KURL,QString)", "openURL(KURL url,QString encoding)" },
00025 { "bool", "closeDocument(uint)", "closeDocument(uint n)" },
00026 { "bool", "closeDocumentWithID(uint)", "closeDocumentWithID(uint id)" },
00027 { "bool", "closeAllDocuments()", "closeAllDocuments()" },
00028 { 0, 0, 0 }
00029 };
00030 static const int KateDocManagerDCOPIface_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 KateDocManagerDCOPIface::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>( KateDocManagerDCOPIface_fhash, true, false );
00049 for ( int i = 0; KateDocManagerDCOPIface_ftable[i][1]; i++ )
00050 fdict->insert( KateDocManagerDCOPIface_ftable[i][1], new int( i ) );
00051 }
00052 int* fp = fdict->find( fun );
00053 switch ( fp?*fp:-1) {
00054 case 0: {
00055 uint arg0;
00056 QDataStream arg( data, IO_ReadOnly );
00057 arg >> arg0;
00058 replyType = KateDocManagerDCOPIface_ftable[0][0];
00059 QDataStream _replyStream( replyData, IO_WriteOnly );
00060 _replyStream << document(arg0 );
00061 } break;
00062 case 1: {
00063 replyType = KateDocManagerDCOPIface_ftable[1][0];
00064 QDataStream _replyStream( replyData, IO_WriteOnly );
00065 _replyStream << activeDocument( );
00066 } break;
00067 case 2: {
00068 replyType = KateDocManagerDCOPIface_ftable[2][0];
00069 QDataStream _replyStream( replyData, IO_WriteOnly );
00070 _replyStream << activeDocumentNumber( );
00071 } break;
00072 case 3: {
00073 uint arg0;
00074 QDataStream arg( data, IO_ReadOnly );
00075 arg >> arg0;
00076 replyType = KateDocManagerDCOPIface_ftable[3][0];
00077 QDataStream _replyStream( replyData, IO_WriteOnly );
00078 _replyStream << documentWithID(arg0 );
00079 } break;
00080 case 4: {
00081 KURL arg0;
00082 QDataStream arg( data, IO_ReadOnly );
00083 arg >> arg0;
00084 replyType = KateDocManagerDCOPIface_ftable[4][0];
00085 QDataStream _replyStream( replyData, IO_WriteOnly );
00086 _replyStream << findDocument(arg0 );
00087 } break;
00088 case 5: {
00089 KURL arg0;
00090 QDataStream arg( data, IO_ReadOnly );
00091 arg >> arg0;
00092 replyType = KateDocManagerDCOPIface_ftable[5][0];
00093 QDataStream _replyStream( replyData, IO_WriteOnly );
00094 _replyStream << isOpen(arg0 );
00095 } break;
00096 case 6: {
00097 replyType = KateDocManagerDCOPIface_ftable[6][0];
00098 QDataStream _replyStream( replyData, IO_WriteOnly );
00099 _replyStream << documents( );
00100 } break;
00101 case 7: {
00102 KURL arg0;
00103 QString arg1;
00104 QDataStream arg( data, IO_ReadOnly );
00105 arg >> arg0;
00106 arg >> arg1;
00107 replyType = KateDocManagerDCOPIface_ftable[7][0];
00108 QDataStream _replyStream( replyData, IO_WriteOnly );
00109 _replyStream << openURL(arg0, arg1 );
00110 } break;
00111 case 8: {
00112 uint arg0;
00113 QDataStream arg( data, IO_ReadOnly );
00114 arg >> arg0;
00115 replyType = KateDocManagerDCOPIface_ftable[8][0];
00116 QDataStream _replyStream( replyData, IO_WriteOnly );
00117 _replyStream << closeDocument(arg0 );
00118 } break;
00119 case 9: {
00120 uint arg0;
00121 QDataStream arg( data, IO_ReadOnly );
00122 arg >> arg0;
00123 replyType = KateDocManagerDCOPIface_ftable[9][0];
00124 QDataStream _replyStream( replyData, IO_WriteOnly );
00125 _replyStream << closeDocumentWithID(arg0 );
00126 } break;
00127 case 10: {
00128 replyType = KateDocManagerDCOPIface_ftable[10][0];
00129 QDataStream _replyStream( replyData, IO_WriteOnly );
00130 _replyStream << closeAllDocuments( );
00131 } break;
00132 default:
00133 return DCOPObject::process( fun, data, replyType, replyData );
00134 }
00135 return true;
00136 }
00137
00138 QCStringList KateDocManagerDCOPIface::interfaces()
00139 {
00140 QCStringList ifaces = DCOPObject::interfaces();
00141 ifaces += "KateDocManagerDCOPIface";
00142 return ifaces;
00143 }
00144
00145 QCStringList KateDocManagerDCOPIface::functions()
00146 {
00147 QCStringList funcs = DCOPObject::functions();
00148 for ( int i = 0; KateDocManagerDCOPIface_ftable[i][2]; i++ ) {
00149 if (KateDocManagerDCOPIface_ftable_hiddens[i])
00150 continue;
00151 QCString func = KateDocManagerDCOPIface_ftable[i][0];
00152 func += ' ';
00153 func += KateDocManagerDCOPIface_ftable[i][2];
00154 funcs << func;
00155 }
00156 return funcs;
00157 }
00158
00159