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

#include "/tmp/buildd/tde-packaging/arch/tde-core/tde-tdebase/src/tdebase-trinity-14.1.6/kate/app/katedocmanageriface.h"

#include <kdatastream.h>
#include <tqasciidict.h>


static const int KateDocManagerDCOPIface_fhash = 13;
static const char* const KateDocManagerDCOPIface_ftable[12][3] = {
    { "DCOPRef", "document(uint)", "document(uint n)" },
    { "DCOPRef", "activeDocument()", "activeDocument()" },
    { "uint", "activeDocumentNumber()", "activeDocumentNumber()" },
    { "DCOPRef", "documentWithID(uint)", "documentWithID(uint id)" },
    { "int", "findDocument(KURL)", "findDocument(KURL url)" },
    { "bool", "isOpen(KURL)", "isOpen(KURL url)" },
    { "uint", "documents()", "documents()" },
    { "DCOPRef", "openURL(KURL,TQString)", "openURL(KURL url,TQString encoding)" },
    { "bool", "closeDocument(uint)", "closeDocument(uint n)" },
    { "bool", "closeDocumentWithID(uint)", "closeDocumentWithID(uint id)" },
    { "bool", "closeAllDocuments()", "closeAllDocuments()" },
    { 0, 0, 0 }
};
static const int KateDocManagerDCOPIface_ftable_hiddens[11] = {
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
};

bool KateDocManagerDCOPIface::process(const TQCString &fun, const TQByteArray &data, TQCString& replyType, TQByteArray &replyData)
{
    static TQAsciiDict<int>* fdict = 0;
    if ( !fdict ) {
	fdict = new TQAsciiDict<int>( KateDocManagerDCOPIface_fhash, true, false );
	for ( int i = 0; KateDocManagerDCOPIface_ftable[i][1]; i++ )
	    fdict->insert( KateDocManagerDCOPIface_ftable[i][1],  new int( i ) );
    }
    int* fp = fdict->find( fun );
    switch ( fp?*fp:-1) {
    case 0: { // DCOPRef document(uint)
	uint arg0;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	replyType = KateDocManagerDCOPIface_ftable[0][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << document(arg0 );
    } break;
    case 1: { // DCOPRef activeDocument()
	replyType = KateDocManagerDCOPIface_ftable[1][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << activeDocument( );
    } break;
    case 2: { // uint activeDocumentNumber()
	replyType = KateDocManagerDCOPIface_ftable[2][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << activeDocumentNumber( );
    } break;
    case 3: { // DCOPRef documentWithID(uint)
	uint arg0;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	replyType = KateDocManagerDCOPIface_ftable[3][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << documentWithID(arg0 );
    } break;
    case 4: { // int findDocument(KURL)
	KURL arg0;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	replyType = KateDocManagerDCOPIface_ftable[4][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << findDocument(arg0 );
    } break;
    case 5: { // bool isOpen(KURL)
	KURL arg0;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	replyType = KateDocManagerDCOPIface_ftable[5][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << isOpen(arg0 );
    } break;
    case 6: { // uint documents()
	replyType = KateDocManagerDCOPIface_ftable[6][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << documents( );
    } break;
    case 7: { // DCOPRef openURL(KURL,TQString)
	KURL arg0;
	TQString arg1;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	if (arg.atEnd()) return false;
	arg >> arg1;
	replyType = KateDocManagerDCOPIface_ftable[7][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << openURL(arg0, arg1 );
    } break;
    case 8: { // bool closeDocument(uint)
	uint arg0;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	replyType = KateDocManagerDCOPIface_ftable[8][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << closeDocument(arg0 );
    } break;
    case 9: { // bool closeDocumentWithID(uint)
	uint arg0;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	replyType = KateDocManagerDCOPIface_ftable[9][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << closeDocumentWithID(arg0 );
    } break;
    case 10: { // bool closeAllDocuments()
	replyType = KateDocManagerDCOPIface_ftable[10][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << closeAllDocuments( );
    } break;
    default: 
	return DCOPObject::process( fun, data, replyType, replyData );
    }
    return true;
}

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

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


