~ubuntu-branches/ubuntu/utopic/kde-workspace/utopic-proposed

« back to all changes in this revision

Viewing changes to kcontrol/keyboard/kcm_keyboard_widget.h

  • Committer: Bazaar Package Importer
  • Author(s): Michał Zając
  • Date: 2011-07-09 08:31:15 UTC
  • Revision ID: james.westby@ubuntu.com-20110709083115-ohyxn6z93mily9fc
Tags: upstream-4.6.90
Import upstream version 4.6.90

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 *  Copyright (C) 2010 Andriy Rysin (rysin@kde.org)
 
3
 *
 
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.
 
8
 *
 
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.
 
13
 *
 
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.
 
17
 */
 
18
 
 
19
 
 
20
#ifndef KCM_KEYBOARD_WIDGET_H_
 
21
#define KCM_KEYBOARD_WIDGET_H_
 
22
 
 
23
#include "ui_kcm_keyboard.h"
 
24
 
 
25
#include <kcomponentdata.h>
 
26
#include <QtGui/QTabWidget>
 
27
 
 
28
class QWidget;
 
29
class KeyboardConfig;
 
30
class Rules;
 
31
class Flags;
 
32
class KComponentData;
 
33
class QString;
 
34
class QPushButton;
 
35
class LayoutsTableModel;
 
36
class KCMiscKeyboardWidget;
 
37
class KeyboardLayoutActionCollection;
 
38
 
 
39
class KCMKeyboardWidget: public QTabWidget
 
40
{
 
41
        Q_OBJECT
 
42
 
 
43
public:
 
44
        KCMKeyboardWidget(Rules* rules, KeyboardConfig* keyboardConfig,
 
45
                        const KComponentData componentData, const QVariantList &args, QWidget* parent=0);
 
46
        virtual ~KCMKeyboardWidget();
 
47
 
 
48
        void updateUI();
 
49
        void save();
 
50
 
 
51
        //temp hack
 
52
        KCMiscKeyboardWidget* getKcmMiscWidget() const { return kcmMiscWidget; }
 
53
 
 
54
Q_SIGNALS:
 
55
        void changed(bool state);
 
56
 
 
57
private Q_SLOTS:
 
58
        void addLayout();
 
59
        void removeLayout();
 
60
        void layoutSelectionChanged();
 
61
        void uiChanged();
 
62
    void scrollToGroupShortcut();
 
63
    void scrollTo3rdLevelShortcut();
 
64
    void clearGroupShortcuts();
 
65
    void clear3rdLevelShortcuts();
 
66
    void updateXkbShortcutsButtons();
 
67
    void moveUp();
 
68
    void moveDown();
 
69
    void configureLayoutsChanged();
 
70
    void configureXkbOptionsChanged();
 
71
 
 
72
private:
 
73
    Rules *rules;
 
74
    Flags *flags;
 
75
    Ui::TabWidget *uiWidget;
 
76
    KeyboardConfig *keyboardConfig;
 
77
        const KComponentData componentData;
 
78
        KeyboardLayoutActionCollection* actionCollection;
 
79
        LayoutsTableModel* layoutsTableModel;
 
80
        KCMiscKeyboardWidget* kcmMiscWidget;
 
81
        bool uiUpdating;
 
82
 
 
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);
 
98
};
 
99
 
 
100
 
 
101
#endif /* KCM_KEYBOARD_WIDGET_H_ */