2
* Copyright (C) 2010 Andriy Rysin (rysin@kde.org)
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License as published by
6
* the Free Software Foundation; either version 2 of the License, or
7
* (at your option) any later version.
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20
#ifndef KEYBOARD_CONFIG_H_
21
#define KEYBOARD_CONFIG_H_
23
#include "x11_helper.h"
25
#include <QtCore/QString>
26
#include <QtCore/QStringList>
27
#include <QtCore/QList>
28
#include <QtCore/QMap>
29
#include <QtCore/QPair>
32
* This class provides configuration options for keyboard module
37
static const int MAX_LABEL_LEN = 3;
38
static const int NO_LOOPING; // = -1;
40
enum SwitchingPolicy {
41
SWITCH_POLICY_GLOBAL = 0,
42
SWITCH_POLICY_DESKTOP = 1,
43
SWITCH_POLICY_APPLICATION = 2,
44
SWITCH_POLICY_WINDOW = 3
47
QString keyboardModel;
48
// resetOldXkbOptions is now also "set xkb options"
49
bool resetOldXkbOptions;
50
QStringList xkbOptions;
52
// init layouts options
53
bool configureLayouts;
54
QList<LayoutUnit> layouts;
57
// switch cotrol options
58
SwitchingPolicy switchingPolicy;
59
// bool stickySwitching;
60
// int stickySwitchingDepth;
67
bool isSpareLayoutsEnabled() const {
68
return layoutLoopCount != KeyboardConfig::NO_LOOPING;
70
QList<LayoutUnit> getDefaultLayouts() const;
71
QList<LayoutUnit> getExtraLayouts() const;
77
static QString getSwitchingPolicyString(SwitchingPolicy switchingPolicy);
80
#endif /* KEYBOARD_CONFIG_H_ */