summaryrefslogtreecommitdiffstats
path: root/kkbswitch/kbswitchintf.cpp
blob: f7e8098f6db5c8bd0bdfa055c07aa82f77910202 (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
/***************************************************************************
                          kbswitchintf.cpp  -  description
                             -------------------
    begin                : Sun Aug 12 2001
    copyright            : (C) 2001 by Leonid Zeitlin
    email                : lz@europe.com
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

#include "kbswitchintf.h"
//#include <kapp.h>

KBSwitchIntf::KBSwitchIntf(TQObject *parent, KBConfig *conf)
  : TQObject(parent, "KBSwitchIntf"), DCOPObject("KBSwitchIntf")
{
  m_kbconf = conf;
}

KBSwitchIntf::~KBSwitchIntf(){
}

int KBSwitchIntf::getNumKbdGroups()
{
  return m_kbconf->groupCount();
}

ASYNC KBSwitchIntf::selectNextGroup()
{
  emit nextGroupSelected();
}

ASYNC KBSwitchIntf::selectGroup(int groupno)
{
  emit groupSelected(groupno);
}

TQStringList KBSwitchIntf::getGroupNames()
{
  TQStringList result;
  for (int i = 0; i < m_kbconf->groupCount(); i++)
    result.append(m_kbconf->getGroup(i)->getName());
  return result;
}