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
if (arg.
atEnd())
return false;
00042 arg >> arg0;
00043
if (arg.
atEnd())
return false;
00044 arg >> arg1;
00045
if (arg.
atEnd())
return false;
00046 arg >> arg2;
00047
if (arg.
atEnd())
return false;
00048 arg >> arg3;
00049 replyType = SelectionDCOPInterface_ftable[0][0];
00050
QDataStream _replyStream( replyData, IO_WriteOnly );
00051 _replyStream <<
setSelection(arg0, arg1, arg2, arg3 );
00052 }
else if ( fun == SelectionDCOPInterface_ftable[1][1] ) {
00053 replyType = SelectionDCOPInterface_ftable[1][0];
00054
QDataStream _replyStream( replyData, IO_WriteOnly );
00055 _replyStream <<
clearSelection( );
00056 }
else if ( fun == SelectionDCOPInterface_ftable[2][1] ) {
00057 replyType = SelectionDCOPInterface_ftable[2][0];
00058
QDataStream _replyStream( replyData, IO_WriteOnly );
00059 _replyStream <<
hasSelection( );
00060 }
else if ( fun == SelectionDCOPInterface_ftable[3][1] ) {
00061 replyType = SelectionDCOPInterface_ftable[3][0];
00062
QDataStream _replyStream( replyData, IO_WriteOnly );
00063 _replyStream <<
selection( );
00064 }
else if ( fun == SelectionDCOPInterface_ftable[4][1] ) {
00065 replyType = SelectionDCOPInterface_ftable[4][0];
00066
QDataStream _replyStream( replyData, IO_WriteOnly );
00067 _replyStream <<
removeSelectedText( );
00068 }
else if ( fun == SelectionDCOPInterface_ftable[5][1] ) {
00069 replyType = SelectionDCOPInterface_ftable[5][0];
00070
QDataStream _replyStream( replyData, IO_WriteOnly );
00071 _replyStream <<
selectAll( );
00072 }
else {
00073
return DCOPObject::process( fun, data, replyType, replyData );
00074 }
00075
return true;
00076 }
00077
00078 QCStringList
SelectionDCOPInterface::interfaces()
00079 {
00080 QCStringList ifaces =
DCOPObject::interfaces();
00081 ifaces +=
"KTextEditor::SelectionDCOPInterface";
00082
return ifaces;
00083 }
00084
00085 QCStringList
SelectionDCOPInterface::functions()
00086 {
00087 QCStringList funcs =
DCOPObject::functions();
00088
for (
int i = 0; SelectionDCOPInterface_ftable[i][2]; i++ ) {
00089
if (SelectionDCOPInterface_ftable_hiddens[i])
00090
continue;
00091
QCString func = SelectionDCOPInterface_ftable[i][0];
00092 func +=
' ';
00093 func += SelectionDCOPInterface_ftable[i][2];
00094 funcs << func;
00095 }
00096
return funcs;
00097 }
00098
00099 }
00100