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 KCM_KEYBOARD_WIDGET_H_
21
#define KCM_KEYBOARD_WIDGET_H_
23
#include "ui_kcm_keyboard.h"
25
#include <kcomponentdata.h>
26
#include <QtGui/QTabWidget>
35
class LayoutsTableModel;
36
class KCMiscKeyboardWidget;
37
class KeyboardLayoutActionCollection;
39
class KCMKeyboardWidget: public QTabWidget
44
KCMKeyboardWidget(Rules* rules, KeyboardConfig* keyboardConfig,
45
const KComponentData componentData, const QVariantList &args, QWidget* parent=0);
46
virtual ~KCMKeyboardWidget();
52
KCMiscKeyboardWidget* getKcmMiscWidget() const { return kcmMiscWidget; }
55
void changed(bool state);
60
void layoutSelectionChanged();
62
void scrollToGroupShortcut();
63
void scrollTo3rdLevelShortcut();
64
void clearGroupShortcuts();
65
void clear3rdLevelShortcuts();
66
void updateXkbShortcutsButtons();
69
void configureLayoutsChanged();
70
void configureXkbOptionsChanged();
75
Ui::TabWidget *uiWidget;
76
KeyboardConfig *keyboardConfig;
77
const KComponentData componentData;
78
KeyboardLayoutActionCollection* actionCollection;
79
LayoutsTableModel* layoutsTableModel;
80
KCMiscKeyboardWidget* kcmMiscWidget;
83
void initializeLayoutsUI();
84
void initializeXkbOptionsUI();
85
void initializeKeyboardModelUI();
86
void updateHardwareUI();
87
void updateLayoutsUI();
88
void updateShortcutsUI();
89
void updateXkbOptionsUI();
90
void updateSwitcingPolicyUI();
91
void updateXkbShortcutButton(const QString& groupName, QPushButton* button);
92
void clearXkbGroup(const QString& groupName);
93
void moveSelectedLayouts(int shift);
94
void populateWithCurrentLayouts();
95
void populateWithCurrentXkbOptions();
96
void updateLoopCount();
97
void handleParameters(const QVariantList &args);
101
#endif /* KCM_KEYBOARD_WIDGET_H_ */