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

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

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


static const int tdepowersave_fhash = 23;
static const char* const tdepowersave_ftable[22][3] = {
    { "bool", "lockScreen()", "lockScreen()" },
    { "bool", "do_setScheme(TQString)", "do_setScheme(TQString)" },
    { "bool", "do_setCPUFreqPolicy(TQString)", "do_setCPUFreqPolicy(TQString)" },
    { "bool", "do_suspendToDisk()", "do_suspendToDisk()" },
    { "bool", "do_suspendHybrid()", "do_suspendHybrid()" },
    { "bool", "do_suspendToRAM()", "do_suspendToRAM()" },
    { "bool", "do_suspendFreeze()", "do_suspendFreeze()" },
    { "bool", "do_standBy()", "do_standBy()" },
    { "bool", "do_brightnessDown(int)", "do_brightnessDown(int percentageStep)" },
    { "bool", "do_brightnessUp(int)", "do_brightnessUp(int percentageStep)" },
    { "void", "disableAutosuspend(bool)", "disableAutosuspend(bool)" },
    { "void", "showDetailedDialog()", "showDetailedDialog()" },
    { "bool", "openConfigureDialog()", "openConfigureDialog()" },
    { "bool", "currentSchemeManagesDPMS()", "currentSchemeManagesDPMS()" },
    { "int", "brightnessGet()", "brightnessGet()" },
    { "void", "brightnessSet(int)", "brightnessSet(int percentage)" },
    { "TQString", "currentScheme()", "currentScheme()" },
    { "TQString", "currentCPUFreqPolicy()", "currentCPUFreqPolicy()" },
    { "TQStringList", "allowed_sleepingStates()", "allowed_sleepingStates()" },
    { "TQStringList", "listSchemes()", "listSchemes()" },
    { "TQStringList", "listCPUFreqPolicies()", "listCPUFreqPolicies()" },
    { 0, 0, 0 }
};
static const int tdepowersave_ftable_hiddens[21] = {
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
};

bool tdepowersave::process(const TQCString &fun, const TQByteArray &data, TQCString& replyType, TQByteArray &replyData)
{
    static TQAsciiDict<int>* fdict = 0;
    if ( !fdict ) {
	fdict = new TQAsciiDict<int>( tdepowersave_fhash, true, false );
	for ( int i = 0; tdepowersave_ftable[i][1]; i++ )
	    fdict->insert( tdepowersave_ftable[i][1],  new int( i ) );
    }
    int* fp = fdict->find( fun );
    switch ( fp?*fp:-1) {
    case 0: { // bool lockScreen()
	replyType = tdepowersave_ftable[0][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << lockScreen( );
    } break;
    case 1: { // bool do_setScheme(TQString)
	TQString arg0;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	replyType = tdepowersave_ftable[1][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << do_setScheme(arg0 );
    } break;
    case 2: { // bool do_setCPUFreqPolicy(TQString)
	TQString arg0;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	replyType = tdepowersave_ftable[2][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << do_setCPUFreqPolicy(arg0 );
    } break;
    case 3: { // bool do_suspendToDisk()
	replyType = tdepowersave_ftable[3][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << do_suspendToDisk( );
    } break;
    case 4: { // bool do_suspendHybrid()
	replyType = tdepowersave_ftable[4][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << do_suspendHybrid( );
    } break;
    case 5: { // bool do_suspendToRAM()
	replyType = tdepowersave_ftable[5][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << do_suspendToRAM( );
    } break;
    case 6: { // bool do_suspendFreeze()
	replyType = tdepowersave_ftable[6][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << do_suspendFreeze( );
    } break;
    case 7: { // bool do_standBy()
	replyType = tdepowersave_ftable[7][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << do_standBy( );
    } break;
    case 8: { // bool do_brightnessDown(int)
	int arg0;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	replyType = tdepowersave_ftable[8][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << do_brightnessDown(arg0 );
    } break;
    case 9: { // bool do_brightnessUp(int)
	int arg0;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	replyType = tdepowersave_ftable[9][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << do_brightnessUp(arg0 );
    } break;
    case 10: { // void disableAutosuspend(bool)
	bool arg0;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	replyType = tdepowersave_ftable[10][0]; 
	disableAutosuspend(arg0 );
    } break;
    case 11: { // void showDetailedDialog()
	replyType = tdepowersave_ftable[11][0]; 
	showDetailedDialog( );
    } break;
    case 12: { // bool openConfigureDialog()
	replyType = tdepowersave_ftable[12][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << openConfigureDialog( );
    } break;
    case 13: { // bool currentSchemeManagesDPMS()
	replyType = tdepowersave_ftable[13][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << currentSchemeManagesDPMS( );
    } break;
    case 14: { // int brightnessGet()
	replyType = tdepowersave_ftable[14][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << brightnessGet( );
    } break;
    case 15: { // void brightnessSet(int)
	int arg0;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	replyType = tdepowersave_ftable[15][0]; 
	brightnessSet(arg0 );
    } break;
    case 16: { // TQString currentScheme()
	replyType = tdepowersave_ftable[16][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << currentScheme( );
    } break;
    case 17: { // TQString currentCPUFreqPolicy()
	replyType = tdepowersave_ftable[17][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << currentCPUFreqPolicy( );
    } break;
    case 18: { // TQStringList allowed_sleepingStates()
	replyType = tdepowersave_ftable[18][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << allowed_sleepingStates( );
    } break;
    case 19: { // TQStringList listSchemes()
	replyType = tdepowersave_ftable[19][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << listSchemes( );
    } break;
    case 20: { // TQStringList listCPUFreqPolicies()
	replyType = tdepowersave_ftable[20][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << listCPUFreqPolicies( );
    } break;
    default: 
	return DCOPObject::process( fun, data, replyType, replyData );
    }
    return true;
}

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

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


