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

#include "/tmp/buildd/tde-packaging/arch/tde-extra/tde-konversation/src/konversation-trinity-14.1.6/konversation/src/linkaddressbook/kimiface.h"

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


static const int KIMIface_fhash = 23;
static const char* const KIMIface_ftable[20][3] = {
    { "TQStringList", "allContacts()", "allContacts()" },
    { "TQStringList", "reachableContacts()", "reachableContacts()" },
    { "TQStringList", "onlineContacts()", "onlineContacts()" },
    { "TQStringList", "fileTransferContacts()", "fileTransferContacts()" },
    { "bool", "isPresent(TQString)", "isPresent(TQString uid)" },
    { "TQString", "displayName(TQString)", "displayName(TQString uid)" },
    { "TQString", "presenceString(TQString)", "presenceString(TQString uid)" },
    { "int", "presenceStatus(TQString)", "presenceStatus(TQString uid)" },
    { "bool", "canReceiveFiles(TQString)", "canReceiveFiles(TQString uid)" },
    { "bool", "canRespond(TQString)", "canRespond(TQString uid)" },
    { "TQString", "locate(TQString,TQString)", "locate(TQString contactId,TQString protocol)" },
    { "TQPixmap", "icon(TQString)", "icon(TQString uid)" },
    { "TQString", "context(TQString)", "context(TQString uid)" },
    { "TQStringList", "protocols()", "protocols()" },
    { "void", "messageContact(TQString,TQString)", "messageContact(TQString uid,TQString message)" },
    { "void", "messageNewContact(TQString,TQString)", "messageNewContact(TQString contactId,TQString protocol)" },
    { "void", "chatWithContact(TQString)", "chatWithContact(TQString uid)" },
    { "void", "sendFile(TQString,KURL,TQString,uint)", "sendFile(TQString uid,KURL sourceURL,TQString altFileName,uint fileSize)" },
    { "bool", "addContact(TQString,TQString)", "addContact(TQString contactId,TQString protocol)" },
    { 0, 0, 0 }
};
static const int KIMIface_ftable_hiddens[19] = {
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
};

bool KIMIface::process(const TQCString &fun, const TQByteArray &data, TQCString& replyType, TQByteArray &replyData)
{
    static TQAsciiDict<int>* fdict = 0;
    if ( !fdict ) {
	fdict = new TQAsciiDict<int>( KIMIface_fhash, true, false );
	for ( int i = 0; KIMIface_ftable[i][1]; i++ )
	    fdict->insert( KIMIface_ftable[i][1],  new int( i ) );
    }
    int* fp = fdict->find( fun );
    switch ( fp?*fp:-1) {
    case 0: { // TQStringList allContacts()
	replyType = KIMIface_ftable[0][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << allContacts( );
    } break;
    case 1: { // TQStringList reachableContacts()
	replyType = KIMIface_ftable[1][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << reachableContacts( );
    } break;
    case 2: { // TQStringList onlineContacts()
	replyType = KIMIface_ftable[2][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << onlineContacts( );
    } break;
    case 3: { // TQStringList fileTransferContacts()
	replyType = KIMIface_ftable[3][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << fileTransferContacts( );
    } break;
    case 4: { // bool isPresent(TQString)
	TQString arg0;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	replyType = KIMIface_ftable[4][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << isPresent(arg0 );
    } break;
    case 5: { // TQString displayName(TQString)
	TQString arg0;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	replyType = KIMIface_ftable[5][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << displayName(arg0 );
    } break;
    case 6: { // TQString presenceString(TQString)
	TQString arg0;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	replyType = KIMIface_ftable[6][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << presenceString(arg0 );
    } break;
    case 7: { // int presenceStatus(TQString)
	TQString arg0;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	replyType = KIMIface_ftable[7][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << presenceStatus(arg0 );
    } break;
    case 8: { // bool canReceiveFiles(TQString)
	TQString arg0;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	replyType = KIMIface_ftable[8][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << canReceiveFiles(arg0 );
    } break;
    case 9: { // bool canRespond(TQString)
	TQString arg0;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	replyType = KIMIface_ftable[9][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << canRespond(arg0 );
    } break;
    case 10: { // TQString locate(TQString,TQString)
	TQString arg0;
	TQString arg1;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	if (arg.atEnd()) return false;
	arg >> arg1;
	replyType = KIMIface_ftable[10][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << locate(arg0, arg1 );
    } break;
    case 11: { // TQPixmap icon(TQString)
	TQString arg0;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	replyType = KIMIface_ftable[11][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << icon(arg0 );
    } break;
    case 12: { // TQString context(TQString)
	TQString arg0;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	replyType = KIMIface_ftable[12][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << context(arg0 );
    } break;
    case 13: { // TQStringList protocols()
	replyType = KIMIface_ftable[13][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << protocols( );
    } break;
    case 14: { // void messageContact(TQString,TQString)
	TQString arg0;
	TQString arg1;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	if (arg.atEnd()) return false;
	arg >> arg1;
	replyType = KIMIface_ftable[14][0]; 
	messageContact(arg0, arg1 );
    } break;
    case 15: { // void messageNewContact(TQString,TQString)
	TQString arg0;
	TQString arg1;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	if (arg.atEnd()) return false;
	arg >> arg1;
	replyType = KIMIface_ftable[15][0]; 
	messageNewContact(arg0, arg1 );
    } break;
    case 16: { // void chatWithContact(TQString)
	TQString arg0;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	replyType = KIMIface_ftable[16][0]; 
	chatWithContact(arg0 );
    } break;
    case 17: { // void sendFile(TQString,KURL,TQString,uint)
	TQString arg0;
	KURL arg1;
	TQString 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 = KIMIface_ftable[17][0]; 
	sendFile(arg0, arg1, arg2, arg3 );
    } break;
    case 18: { // bool addContact(TQString,TQString)
	TQString arg0;
	TQString arg1;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	if (arg.atEnd()) return false;
	arg >> arg1;
	replyType = KIMIface_ftable[18][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << addContact(arg0, arg1 );
    } break;
    default: 
	return DCOPObject::process( fun, data, replyType, replyData );
    }
    return true;
}

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

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

void KIMIface::contactPresenceChanged( TQString arg0, TQCString arg1, int arg2 )
{
    TQByteArray data;
    TQDataStream arg( data, IO_WriteOnly );
    arg << arg0;
    arg << arg1;
    arg << arg2;
    emitDCOPSignal( "contactPresenceChanged(TQString,TQCString,int)", data );
}


