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

#include "/usr/src/ports/kdelibs3/kdelibs3-3.5.10-11.i686/src/kdelibs-3.5.10/interfaces/ktexteditor/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()" },
    { "QString", "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 QCString &fun, const QByteArray &data, QCString& replyType, QByteArray &replyData)
{
    if ( fun == SelectionDCOPInterface_ftable[0][1] ) { // bool setSelection(uint,uint,uint,uint)
	uint arg0;
	uint arg1;
	uint arg2;
	uint arg3;
	QDataStream 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]; 
	QDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << setSelection(arg0, arg1, arg2, arg3 );
    } else if ( fun == SelectionDCOPInterface_ftable[1][1] ) { // bool clearSelection()
	replyType = SelectionDCOPInterface_ftable[1][0]; 
	QDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << clearSelection( );
    } else if ( fun == SelectionDCOPInterface_ftable[2][1] ) { // bool hasSelection()
	replyType = SelectionDCOPInterface_ftable[2][0]; 
	QDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << hasSelection( );
    } else if ( fun == SelectionDCOPInterface_ftable[3][1] ) { // QString selection()
	replyType = SelectionDCOPInterface_ftable[3][0]; 
	QDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << selection( );
    } else if ( fun == SelectionDCOPInterface_ftable[4][1] ) { // bool removeSelectedText()
	replyType = SelectionDCOPInterface_ftable[4][0]; 
	QDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << removeSelectedText( );
    } else if ( fun == SelectionDCOPInterface_ftable[5][1] ) { // bool selectAll()
	replyType = SelectionDCOPInterface_ftable[5][0]; 
	QDataStream _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;
	QCString func = SelectionDCOPInterface_ftable[i][0];
	func += ' ';
	func += SelectionDCOPInterface_ftable[i][2];
	funcs << func;
    }
    return funcs;
}

} // namespace

