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

#include "/tmp/buildd/tde-packaging/arch/tde-base/tde-tdegraphics/src/tdegraphics-trinity-14.1.6/kpdf/dcop.h"

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


static const int kpdf_dcop_fhash = 17;
static const char* const kpdf_dcop_ftable[14][3] = {
    { "ASYNC", "goToPage(uint)", "goToPage(uint page)" },
    { "ASYNC", "openDocument(KURL)", "openDocument(KURL doc)" },
    { "uint", "pages()", "pages()" },
    { "uint", "currentPage()", "currentPage()" },
    { "KURL", "currentDocument()", "currentDocument()" },
    { "void", "slotPreferences()", "slotPreferences()" },
    { "void", "slotFind()", "slotFind()" },
    { "void", "slotPrintPreview()", "slotPrintPreview()" },
    { "void", "slotPreviousPage()", "slotPreviousPage()" },
    { "void", "slotNextPage()", "slotNextPage()" },
    { "void", "slotGotoFirst()", "slotGotoFirst()" },
    { "void", "slotGotoLast()", "slotGotoLast()" },
    { "void", "slotTogglePresentation()", "slotTogglePresentation()" },
    { 0, 0, 0 }
};
static const int kpdf_dcop_ftable_hiddens[13] = {
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
};

bool kpdf_dcop::process(const TQCString &fun, const TQByteArray &data, TQCString& replyType, TQByteArray &replyData)
{
    static TQAsciiDict<int>* fdict = 0;
    if ( !fdict ) {
	fdict = new TQAsciiDict<int>( kpdf_dcop_fhash, true, false );
	for ( int i = 0; kpdf_dcop_ftable[i][1]; i++ )
	    fdict->insert( kpdf_dcop_ftable[i][1],  new int( i ) );
    }
    int* fp = fdict->find( fun );
    switch ( fp?*fp:-1) {
    case 0: { // void goToPage(uint)
	uint arg0;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	replyType = kpdf_dcop_ftable[0][0]; 
	goToPage(arg0 );
    } break;
    case 1: { // void openDocument(KURL)
	KURL arg0;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	replyType = kpdf_dcop_ftable[1][0]; 
	openDocument(arg0 );
    } break;
    case 2: { // uint pages()
	replyType = kpdf_dcop_ftable[2][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << pages( );
    } break;
    case 3: { // uint currentPage()
	replyType = kpdf_dcop_ftable[3][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << currentPage( );
    } break;
    case 4: { // KURL currentDocument()
	replyType = kpdf_dcop_ftable[4][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << currentDocument( );
    } break;
    case 5: { // void slotPreferences()
	replyType = kpdf_dcop_ftable[5][0]; 
	slotPreferences( );
    } break;
    case 6: { // void slotFind()
	replyType = kpdf_dcop_ftable[6][0]; 
	slotFind( );
    } break;
    case 7: { // void slotPrintPreview()
	replyType = kpdf_dcop_ftable[7][0]; 
	slotPrintPreview( );
    } break;
    case 8: { // void slotPreviousPage()
	replyType = kpdf_dcop_ftable[8][0]; 
	slotPreviousPage( );
    } break;
    case 9: { // void slotNextPage()
	replyType = kpdf_dcop_ftable[9][0]; 
	slotNextPage( );
    } break;
    case 10: { // void slotGotoFirst()
	replyType = kpdf_dcop_ftable[10][0]; 
	slotGotoFirst( );
    } break;
    case 11: { // void slotGotoLast()
	replyType = kpdf_dcop_ftable[11][0]; 
	slotGotoLast( );
    } break;
    case 12: { // void slotTogglePresentation()
	replyType = kpdf_dcop_ftable[12][0]; 
	slotTogglePresentation( );
    } break;
    default: 
	return DCOPObject::process( fun, data, replyType, replyData );
    }
    return true;
}

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

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


