00001
00002
00003
00004
00005
00006
00007
00008
00009 #include "./selectiondcopinterface.h"
00010
00011 #include <kdatastream.h>
00012
00013 namespace KTextEditor {
00014
00015 static const char* const SelectionDCOPInterface_ftable[7][3] = {
00016 { "bool", "setSelection(uint,uint,uint,uint)", "setSelection(uint startLine,uint startCol,uint endLine,uint endCol)" },
00017 { "bool", "clearSelection()", "clearSelection()" },
00018 { "bool", "hasSelection()", "hasSelection()" },
00019 { "QString", "selection()", "selection()" },
00020 { "bool", "removeSelectedText()", "removeSelectedText()" },
00021 { "bool", "selectAll()", "selectAll()" },
00022 { 0, 0, 0 }
00023 };
00024 static const int SelectionDCOPInterface_ftable_hiddens[6] = {
00025 0,
00026 0,
00027 0,
00028 0,
00029 0,
00030 0,
00031 };
00032
00033 bool SelectionDCOPInterface::process(const QCString &fun, const QByteArray &data, QCString& replyType, QByteArray &replyData)
00034 {
00035 if ( fun == SelectionDCOPInterface_ftable[0][1] ) {
00036 uint arg0;
00037 uint arg1;
00038 uint arg2;
00039 uint arg3;
00040 QDataStream arg( data, IO_ReadOnly );
00041 arg >> arg0;
00042 arg >> arg1;
00043 arg >> arg2;
00044 arg >> arg3;
00045 replyType = SelectionDCOPInterface_ftable[0][0];
00046 QDataStream _replyStream( replyData, IO_WriteOnly );
00047 _replyStream << setSelection(arg0, arg1, arg2, arg3 );
00048 } else if ( fun == SelectionDCOPInterface_ftable[1][1] ) {
00049 replyType = SelectionDCOPInterface_ftable[1][0];
00050 QDataStream _replyStream( replyData, IO_WriteOnly );
00051 _replyStream << clearSelection( );
00052 } else if ( fun == SelectionDCOPInterface_ftable[2][1] ) {
00053 replyType = SelectionDCOPInterface_ftable[2][0];
00054 QDataStream _replyStream( replyData, IO_WriteOnly );
00055 _replyStream << hasSelection( );
00056 } else if ( fun == SelectionDCOPInterface_ftable[3][1] ) {
00057 replyType = SelectionDCOPInterface_ftable[3][0];
00058 QDataStream _replyStream( replyData, IO_WriteOnly );
00059 _replyStream << selection( );
00060 } else if ( fun == SelectionDCOPInterface_ftable[4][1] ) {
00061 replyType = SelectionDCOPInterface_ftable[4][0];
00062 QDataStream _replyStream( replyData, IO_WriteOnly );
00063 _replyStream << removeSelectedText( );
00064 } else if ( fun == SelectionDCOPInterface_ftable[5][1] ) {
00065 replyType = SelectionDCOPInterface_ftable[5][0];
00066 QDataStream _replyStream( replyData, IO_WriteOnly );
00067 _replyStream << selectAll( );
00068 } else {
00069 return DCOPObject::process( fun, data, replyType, replyData );
00070 }
00071 return true;
00072 }
00073
00074 QCStringList SelectionDCOPInterface::interfaces()
00075 {
00076 QCStringList ifaces = DCOPObject::interfaces();
00077 ifaces += "KTextEditor::SelectionDCOPInterface";
00078 return ifaces;
00079 }
00080
00081 QCStringList SelectionDCOPInterface::functions()
00082 {
00083 QCStringList funcs = DCOPObject::functions();
00084 for ( int i = 0; SelectionDCOPInterface_ftable[i][2]; i++ ) {
00085 if (SelectionDCOPInterface_ftable_hiddens[i])
00086 continue;
00087 QCString func = SelectionDCOPInterface_ftable[i][0];
00088 func += ' ';
00089 func += SelectionDCOPInterface_ftable[i][2];
00090 funcs << func;
00091 }
00092 return funcs;
00093 }
00094
00095 }
00096