Changeset View
Changeset View
Standalone View
Standalone View
kcms/input/mouse.h
Show All 25 Lines | |||||
26 | * along with this program; if not, write to the Free Software | 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. | 27 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
28 | */ | 28 | */ | ||
29 | 29 | | |||
30 | 30 | | |||
31 | #ifndef __MOUSECONFIG_H__ | 31 | #ifndef __MOUSECONFIG_H__ | ||
32 | #define __MOUSECONFIG_H__ | 32 | #define __MOUSECONFIG_H__ | ||
33 | 33 | | |||
34 | #include <QX11Info> | | |||
35 | | ||||
36 | #include <config-workspace.h> | 34 | #include <config-workspace.h> | ||
37 | 35 | | |||
38 | #include <kcmodule.h> | 36 | #include <kcmodule.h> | ||
39 | #include "ui_kmousedlg.h" | 37 | #include "mousebackend.h" | ||
40 | 38 | #include "ui_kcmmouse.h" | |||
41 | #define RIGHT_HANDED 0 | | |||
42 | #define LEFT_HANDED 1 | | |||
43 | 39 | | |||
44 | class QCheckBox; | 40 | class QCheckBox; | ||
45 | class QDoubleSpinBox; | 41 | class QDoubleSpinBox; | ||
46 | class QSlider; | 42 | class QSlider; | ||
47 | class QSpinBox; | 43 | class QSpinBox; | ||
48 | class QTabWidget; | 44 | class QTabWidget; | ||
49 | 45 | | |||
50 | class KMouseDlg : public QWidget, public Ui::KMouseDlg | 46 | class MouseSettings; | ||
51 | { | 47 | class MouseBackend; | ||
52 | public: | | |||
53 | KMouseDlg( QWidget *parent ) : QWidget( parent ) { | | |||
54 | setupUi( this ); | | |||
55 | } | | |||
56 | }; | | |||
57 | | ||||
58 | class MouseSettings | | |||
59 | { | | |||
60 | public: | | |||
61 | void save(KConfig *); | | |||
62 | void load(KConfig *, Display *dpy = QX11Info::display()); | | |||
63 | void apply(bool force=false); | | |||
64 | | ||||
65 | public: | | |||
66 | int num_buttons; | | |||
67 | int middle_button; | | |||
68 | bool handedEnabled; | | |||
69 | bool m_handedNeedsApply; | | |||
70 | int handed; | | |||
71 | double accelRate; | | |||
72 | int thresholdMove; | | |||
73 | int doubleClickInterval; | | |||
74 | int dragStartTime; | | |||
75 | int dragStartDist; | | |||
76 | bool singleClick; | | |||
77 | int wheelScrollLines; | | |||
78 | bool reverseScrollPolarity; | | |||
79 | }; | | |||
80 | 48 | | |||
81 | class MouseConfig : public KCModule | 49 | class MouseConfig : public KCModule, public Ui::KCMMouse | ||
82 | { | 50 | { | ||
83 | Q_OBJECT | 51 | Q_OBJECT | ||
84 | public: | 52 | public: | ||
85 | MouseConfig(QWidget *parent, const QVariantList &args); | 53 | MouseConfig(QWidget *parent, const QVariantList &args); | ||
86 | ~MouseConfig(); | 54 | ~MouseConfig(); | ||
87 | 55 | | |||
88 | void save(); | 56 | void save(); | ||
89 | void load(); | 57 | void load(); | ||
90 | void defaults(); | 58 | void defaults(); | ||
91 | 59 | | |||
92 | private Q_SLOTS: | 60 | private Q_SLOTS: | ||
93 | void slotHandedChanged(int val); | 61 | void slotHandedChanged(int val); | ||
94 | void slotScrollPolarityChanged(); | 62 | void slotScrollPolarityChanged(); | ||
95 | void checkAccess(); | 63 | void checkAccess(); | ||
96 | void slotThreshChanged(int value); | 64 | void slotThreshChanged(int value); | ||
97 | void slotDragStartDistChanged(int value); | 65 | void slotDragStartDistChanged(int value); | ||
98 | void slotWheelScrollLinesChanged(int value); | 66 | void slotWheelScrollLinesChanged(int value); | ||
99 | 67 | | |||
100 | private: | 68 | private: | ||
101 | double getAccel(); | 69 | double getAccel(); | ||
102 | int getThreshold(); | 70 | int getThreshold(); | ||
103 | int getHandedness(); | 71 | MouseHanded getHandedness(); | ||
104 | 72 | | |||
105 | void setAccel(double); | 73 | void setAccel(double); | ||
106 | void setThreshold(int); | 74 | void setThreshold(int); | ||
107 | void setHandedness(int); | 75 | void setHandedness(MouseHanded); | ||
108 | 76 | | |||
109 | QDoubleSpinBox *accel; | | |||
110 | QSpinBox *thresh; | | |||
111 | QSpinBox *doubleClickInterval; | | |||
112 | QSpinBox *dragStartTime; | | |||
113 | QSpinBox *dragStartDist; | | |||
114 | QSpinBox *wheelScrollLines; | | |||
115 | | ||||
116 | QTabWidget *tabwidget; | | |||
117 | QWidget *advancedTab; | | |||
118 | KMouseDlg* generalTab; | | |||
119 | MouseSettings *settings; | 77 | MouseSettings *settings; | ||
120 | 78 | | |||
121 | QCheckBox *mouseKeys; | 79 | MouseBackend *backend; | ||
122 | QSpinBox *mk_delay; | | |||
123 | QSpinBox *mk_interval; | | |||
124 | QSpinBox *mk_time_to_max; | | |||
125 | QSpinBox *mk_max_speed; | | |||
126 | QSpinBox *mk_curve; | | |||
127 | }; | 80 | }; | ||
128 | 81 | | |||
129 | #endif | 82 | #endif | ||
130 | 83 | |