/****************************************************************************
**
** DCOP Skeleton generated by dcopidl2cpp from selectiondcopinterface.kidl
**
** WARNING! All changes made in this file will be lost!
**
*****************************************************************************/

#include "/tmp/buildd/tde-packaging/arch/tde-core/tde-tdelibs/src/tdelibs-trinity-14.1.6/interfaces/tdetexteditor/selectiondcopinterface.h"

#include <kdatastream.h>

namespace KTextEditor {

static const char* const SelectionDCOPInterface_ftable[7][3] = {
    { "bool", "setSelection(uint,uint,uint,uint)", "setSelection(uint startLine,uint startCol,uint endLine,uint endCol)" },
    { "bool", "clearSelection()", "clearSelection()" },
    { "bool", "hasSelection()", "hasSelection()" },
    { "TQString", "selection()", "selection()" },
    { "bool", "removeSelectedText()", "removeSelectedText()" },
    { "bool", "selectAll()", "selectAll()" },
    { 0, 0, 0 }
};
static const int SelectionDCOPInterface_ftable_hiddens[6] = {
    0,
    0,
    0,
    0,
    0,
    0,
};

bool SelectionDCOPInterface::process(const TQCString &fun, const TQByteArray &data, TQCString& replyType, TQByteArray &replyData)
{
    if ( fun == SelectionDCOPInterface_ftable[0][1] ) { // bool setSelection(uint,uint,uint,uint)
	uint arg0;
	uint arg1;
	uint arg2;
	uint arg3;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	if (arg.atEnd()) return false;
	arg >> arg1;
	if (arg.atEnd()) return false;
	arg >> arg2;
	if (arg.atEnd()) return false;
	arg >> arg3;
	replyType = SelectionDCOPInterface_ftable[0][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << setSelection(arg0, arg1, arg2, arg3 );
    } else if ( fun == SelectionDCOPInterface_ftable[1][1] ) { // bool clearSelection()
	replyType = SelectionDCOPInterface_ftable[1][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << clearSelection( );
    } else if ( fun == SelectionDCOPInterface_ftable[2][1] ) { // bool hasSelection()
	replyType = SelectionDCOPInterface_ftable[2][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << hasSelection( );
    } else if ( fun == SelectionDCOPInterface_ftable[3][1] ) { // TQString selection()
	replyType = SelectionDCOPInterface_ftable[3][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << selection( );
    } else if ( fun == SelectionDCOPInterface_ftable[4][1] ) { // bool removeSelectedText()
	replyType = SelectionDCOPInterface_ftable[4][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << removeSelectedText( );
    } else if ( fun == SelectionDCOPInterface_ftable[5][1] ) { // bool selectAll()
	replyType = SelectionDCOPInterface_ftable[5][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << selectAll( );
    } else {
	return DCOPObject::process( fun, data, replyType, replyData );
    }
    return true;
}

QCStringList SelectionDCOPInterface::interfaces()
{
    QCStringList ifaces = DCOPObject::interfaces();
    ifaces += "KTextEditor::SelectionDCOPInterface";
    return ifaces;
}

QCStringList SelectionDCOPInterface::functions()
{
    QCStringList funcs = DCOPObject::functions();
    for ( int i = 0; SelectionDCOPInterface_ftable[i][2]; i++ ) {
	if (SelectionDCOPInterface_ftable_hiddens[i])
	    continue;
	TQCString func = SelectionDCOPInterface_ftable[i][0];
	func += ' ';
	func += SelectionDCOPInterface_ftable[i][2];
	funcs << func;
    }
    return funcs;
}

} // namespace

