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

#include "/tmp/buildd/tde-packaging/arch/tde-extra/tde-k3b/src/k3b-trinity-14.1.6/src/k3bdataprojectinterface.h"

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


static const int K3bDataProjectInterface_fhash = 11;
static const char* const K3bDataProjectInterface_ftable[11][3] = {
    { "bool", "createFolder(TQString)", "createFolder(TQString name)" },
    { "bool", "createFolder(TQString,TQString)", "createFolder(TQString name,TQString parent)" },
    { "void", "addUrl(TQString,TQString)", "addUrl(TQString url,TQString parent)" },
    { "void", "addUrls(TQStringList,TQString)", "addUrls(TQStringList urls,TQString parent)" },
    { "bool", "removeItem(TQString)", "removeItem(TQString path)" },
    { "bool", "renameItem(TQString,TQString)", "renameItem(TQString path,TQString newName)" },
    { "void", "setVolumeID(TQString)", "setVolumeID(TQString id)" },
    { "bool", "isFolder(TQString)", "isFolder(TQString path)" },
    { "TQStringList", "children(TQString)", "children(TQString path)" },
    { "bool", "setSortWeight(TQString,long int)", "setSortWeight(TQString path,long int weight)" },
    { 0, 0, 0 }
};
static const int K3bDataProjectInterface_ftable_hiddens[10] = {
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
};

bool K3bDataProjectInterface::process(const TQCString &fun, const TQByteArray &data, TQCString& replyType, TQByteArray &replyData)
{
    static TQAsciiDict<int>* fdict = 0;
    if ( !fdict ) {
	fdict = new TQAsciiDict<int>( K3bDataProjectInterface_fhash, true, false );
	for ( int i = 0; K3bDataProjectInterface_ftable[i][1]; i++ )
	    fdict->insert( K3bDataProjectInterface_ftable[i][1],  new int( i ) );
    }
    int* fp = fdict->find( fun );
    switch ( fp?*fp:-1) {
    case 0: { // bool createFolder(TQString)
	TQString arg0;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	replyType = K3bDataProjectInterface_ftable[0][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << createFolder(arg0 );
    } break;
    case 1: { // bool createFolder(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 = K3bDataProjectInterface_ftable[1][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << createFolder(arg0, arg1 );
    } break;
    case 2: { // void addUrl(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 = K3bDataProjectInterface_ftable[2][0]; 
	addUrl(arg0, arg1 );
    } break;
    case 3: { // void addUrls(TQStringList,TQString)
	TQStringList arg0;
	TQString arg1;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	if (arg.atEnd()) return false;
	arg >> arg1;
	replyType = K3bDataProjectInterface_ftable[3][0]; 
	addUrls(arg0, arg1 );
    } break;
    case 4: { // bool removeItem(TQString)
	TQString arg0;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	replyType = K3bDataProjectInterface_ftable[4][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << removeItem(arg0 );
    } break;
    case 5: { // bool renameItem(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 = K3bDataProjectInterface_ftable[5][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << renameItem(arg0, arg1 );
    } break;
    case 6: { // void setVolumeID(TQString)
	TQString arg0;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	replyType = K3bDataProjectInterface_ftable[6][0]; 
	setVolumeID(arg0 );
    } break;
    case 7: { // bool isFolder(TQString)
	TQString arg0;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	replyType = K3bDataProjectInterface_ftable[7][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << isFolder(arg0 );
    } break;
    case 8: { // TQStringList children(TQString)
	TQString arg0;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	replyType = K3bDataProjectInterface_ftable[8][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << children(arg0 );
    } break;
    case 9: { // bool setSortWeight(TQString,long int)
	TQString arg0;
	long int arg1;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	if (arg.atEnd()) return false;
	arg >> arg1;
	replyType = K3bDataProjectInterface_ftable[9][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << setSortWeight(arg0, arg1 );
    } break;
    default: 
	return K3bProjectInterface::process( fun, data, replyType, replyData );
    }
    return true;
}

QCStringList K3bDataProjectInterface::interfaces()
{
    QCStringList ifaces = K3bProjectInterface::interfaces();
    ifaces += "K3bDataProjectInterface";
    return ifaces;
}

QCStringList K3bDataProjectInterface::functions()
{
    QCStringList funcs = K3bProjectInterface::functions();
    for ( int i = 0; K3bDataProjectInterface_ftable[i][2]; i++ ) {
	if (K3bDataProjectInterface_ftable_hiddens[i])
	    continue;
	TQCString func = K3bDataProjectInterface_ftable[i][0];
	func += ' ';
	func += K3bDataProjectInterface_ftable[i][2];
	funcs << func;
    }
    return funcs;
}


