summaryrefslogtreecommitdiffstats
path: root/kkbswitch/kbswitchintf_skel.cpp
blob: 1cc05e16450a087b426e79bcf6dcd1c4880e8c22 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/****************************************************************************
**
** DCOP Skeleton created by dcopidl2cpp from kbswitchintf.kidl
**
** WARNING! All changes made in this file will be lost!
**
*****************************************************************************/

#include "./kbswitchintf.h"

#include <kdatastream.h>


static const char* const KBSwitchIntf_ftable[5][3] = {
    { "int", "getNumKbdGroups()", "getNumKbdGroups()" },
    { "ASYNC", "selectNextGroup()", "selectNextGroup()" },
    { "ASYNC", "selectGroup(int)", "selectGroup(int groupno)" },
    { "TQStringList", "getGroupNames()", "getGroupNames()" },
    { 0, 0, 0 }
};
static const int KBSwitchIntf_ftable_hiddens[4] = {
    0,
    0,
    0,
    0,
};

bool KBSwitchIntf::process(const TQCString &fun, const TQByteArray &data, TQCString& replyType, TQByteArray &replyData)
{
    if ( fun == KBSwitchIntf_ftable[0][1] ) { // int getNumKbdGroups()
	replyType = KBSwitchIntf_ftable[0][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << getNumKbdGroups( );
    } else if ( fun == KBSwitchIntf_ftable[1][1] ) { // void selectNextGroup()
	replyType = KBSwitchIntf_ftable[1][0]; 
	selectNextGroup( );
    } else if ( fun == KBSwitchIntf_ftable[2][1] ) { // void selectGroup(int)
	int arg0;
	TQDataStream arg( data, IO_ReadOnly );
	arg >> arg0;
	replyType = KBSwitchIntf_ftable[2][0]; 
	selectGroup(arg0 );
    } else if ( fun == KBSwitchIntf_ftable[3][1] ) { // TQStringList getGroupNames()
	replyType = KBSwitchIntf_ftable[3][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << getGroupNames( );
    } else {
	return DCOPObject::process( fun, data, replyType, replyData );
    }
    return true;
}

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

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