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

« back to all changes in this revision

Viewing changes to kcontrol/keyboard/kcmmisc.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
 * keyboard.h
 
3
 *
 
4
 * Copyright (c) 1997 Patrick Dowler dowler@morgul.fsh.uvic.ca
 
5
 *
 
6
 * Requires the Qt widget libraries, available at no cost at
 
7
 * http://www.troll.no/
 
8
 *
 
9
 *  This program is free software; you can redistribute it and/or modify
 
10
 *  it under the terms of the GNU General Public License as published by
 
11
 *  the Free Software Foundation; either version 2 of the License, or
 
12
 *  (at your option) any later version.
 
13
 *
 
14
 *  This program is distributed in the hope that it will be useful,
 
15
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
16
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
17
 *  GNU General Public License for more details.
 
18
 *
 
19
 *  You should have received a copy of the GNU General Public License
 
20
 *  along with this program; if not, write to the Free Software
 
21
 *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 
22
 */
 
23
 
 
24
#ifndef __KCMMISC_H__
 
25
#define __KCMMISC_H__
 
26
 
 
27
#include <QtCore/QString>
 
28
#include <QtGui/QWidget>
 
29
 
 
30
class Ui_KeyboardConfigWidget;
 
31
 
 
32
enum TriState {
 
33
        STATE_ON = 0,  STATE_OFF = 1, STATE_UNCHANGED = 2
 
34
};
 
35
 
 
36
class KButtonGroup;
 
37
class TriStateHelper {
 
38
public:
 
39
        static void setTriState(KButtonGroup* group, TriState state);
 
40
        static TriState getTriState(const KButtonGroup* group);
 
41
 
 
42
        static TriState getTriState(int state) { return static_cast<TriState>(state); }
 
43
        static int getInt(TriState state) { return static_cast<int>(state); }
 
44
        static const char* getString(TriState state) {
 
45
                return state == STATE_ON ? "0" : state == STATE_OFF ? "1" : "2";
 
46
        }
 
47
};
 
48
 
 
49
class KCMiscKeyboardWidget : public QWidget
 
50
{
 
51
  Q_OBJECT
 
52
public:
 
53
  KCMiscKeyboardWidget(QWidget *parent);
 
54
  ~KCMiscKeyboardWidget();
 
55
 
 
56
  void save();
 
57
  void load();
 
58
  void defaults();
 
59
 
 
60
  QString quickHelp() const;
 
61
 
 
62
private slots:
 
63
  void changed();
 
64
 
 
65
  void delaySliderChanged (int value);
 
66
  void delaySpinboxChanged (int value);
 
67
  void rateSliderChanged (int value);
 
68
  void rateSpinboxChanged (double value);
 
69
  void keyboardRepeatStateChanged(int selection);
 
70
 
 
71
Q_SIGNALS:
 
72
        void changed(bool state);
 
73
 
 
74
private:
 
75
  void setClickVolume( int );
 
76
  void setRepeat( TriState flag, int delay, double rate);
 
77
  void setRepeatRate( int );
 
78
 
 
79
  int getClick();
 
80
  int getRepeatRate();
 
81
 
 
82
  int sliderMax;
 
83
  int clickVolume;
 
84
  enum TriState keyboardRepeat;
 
85
  enum TriState numlockState;
 
86
 
 
87
  Ui_KeyboardConfigWidget& ui;
 
88
};
 
89
 
 
90
#endif
 
91