add more spacing
[personal-kdebase.git] / workspace / kcontrol / input / mouse.h
blobab988ba286de9c4ca21d6246328cdf3e07bfc32d
1 /*
2 * mouse.h
4 * Copyright (c) 1997 Patrick Dowler dowler@morgul.fsh.uvic.ca
6 * Layout management, enhancements:
7 * Copyright (c) 1999 Dirk A. Mueller <dmuell@gmx.net>
9 * SC/DC/AutoSelect/ChangeCursor:
10 * Copyright (c) 2000 David Faure <faure@kde.org>
12 * Requires the Qt widget libraries, available at no cost at
13 * http://www.troll.no/
15 * This program is free software; you can redistribute it and/or modify
16 * it under the terms of the GNU General Public License as published by
17 * the Free Software Foundation; either version 2 of the License, or
18 * (at your option) any later version.
20 * This program is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
25 * You should have received a copy of the GNU General Public License
26 * along with this program; if not, write to the Free Software
27 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
31 #ifndef __MOUSECONFIG_H__
32 #define __MOUSECONFIG_H__
34 #include <QLabel>
35 #include <QtGui/QLCDNumber>
36 #include <QPushButton>
37 #include <QRadioButton>
39 #include <kapplication.h>
41 #include <kglobalsettings.h>
42 #include <knuminput.h>
44 #include <config-workspace.h>
45 #include <config-kcontrol-input.h>
46 #ifdef HAVE_LIBUSB
47 #include "logitechmouse.h"
48 #endif
50 #include <kcmodule.h>
51 #include "ui_kmousedlg.h"
52 #include "themepage.h"
54 #define RIGHT_HANDED 0
55 #define LEFT_HANDED 1
57 class QCheckBox;
58 class QSlider;
59 class QTabWidget;
61 class KMouseDlg : public QWidget, public Ui::KMouseDlg
63 public:
64 KMouseDlg( QWidget *parent ) : QWidget( parent ) {
65 setupUi( this );
70 class MouseSettings
72 public:
73 void save(KConfig *);
74 void load(KConfig *);
75 void apply(bool force=false);
76 public:
77 int num_buttons;
78 int middle_button;
79 bool handedEnabled;
80 bool m_handedNeedsApply;
81 int handed;
82 double accelRate;
83 int thresholdMove;
84 int doubleClickInterval;
85 int dragStartTime;
86 int dragStartDist;
87 bool singleClick;
88 int autoSelectDelay;
89 bool changeCursor;
90 int wheelScrollLines;
91 bool reverseScrollPolarity;
93 #ifdef HAVE_LIBUSB
94 // TODO: In Qt4, replace with a better container.
95 QList <LogitechMouse*> logitechMouseList;
96 #endif
99 class MouseConfig : public KCModule
101 Q_OBJECT
102 public:
103 MouseConfig(QWidget *parent, const QVariantList &args);
104 ~MouseConfig();
106 void save();
107 void load();
108 void defaults();
110 private Q_SLOTS:
112 void slotClick();
113 /** No descriptions */
114 void slotHandedChanged(int val);
115 void slotScrollPolarityChanged();
116 void checkAccess();
117 void slotThreshChanged(int value);
118 void slotDragStartDistChanged(int value);
119 void slotWheelScrollLinesChanged(int value);
120 void slotSmartSliderEnabling();
122 private:
124 double getAccel();
125 int getThreshold();
126 int getHandedness();
128 void setAccel(double);
129 void setThreshold(int);
130 void setHandedness(int);
132 KDoubleNumInput *accel;
133 KIntNumInput *thresh;
134 KIntNumInput *doubleClickInterval;
135 KIntNumInput *dragStartTime;
136 KIntNumInput *dragStartDist;
137 KIntNumInput *wheelScrollLines;
139 // QRadioButton *leftHanded, *rightHanded;
140 // QCheckBox *doubleClick;
141 // QCheckBox *cbAutoSelect;
142 QLabel *lDelay;
143 // QSlider *slAutoSelect;
144 // QCheckBox *cbVisualActivate;
145 // QCheckBox *cbCursor;
146 // QCheckBox *cbLargeCursor;
148 QTabWidget *tabwidget;
149 QWidget *advancedTab;
150 KMouseDlg* generalTab;
151 ThemePage* themetab;
152 MouseSettings *settings;
154 QCheckBox *mouseKeys;
155 KIntNumInput *mk_delay, *mk_interval, *mk_time_to_max, *mk_max_speed,
156 *mk_curve;
161 #endif