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 <KConfigGroup> | | |||
40 | #include "ui_kcmmouse.h" | 37 | #include "ui_kcmmouse.h" | ||
41 | 38 | #include "mousesettings.h" | |||
42 | #define RIGHT_HANDED 0 | | |||
43 | #define LEFT_HANDED 1 | | |||
44 | 39 | | |||
45 | class QCheckBox; | 40 | class QCheckBox; | ||
46 | class QDoubleSpinBox; | 41 | class QDoubleSpinBox; | ||
47 | class QSlider; | 42 | class QSlider; | ||
48 | class QSpinBox; | 43 | class QSpinBox; | ||
49 | class QTabWidget; | 44 | class QTabWidget; | ||
50 | 45 | | |||
51 | class MouseSettings | 46 | class MouseSettings; | ||
52 | { | 47 | class MouseBackend; | ||
53 | public: | | |||
54 | void save(KConfig *); | | |||
55 | void load(KConfig *, Display *dpy = QX11Info::display()); | | |||
56 | void apply(bool force=false); | | |||
57 | | ||||
58 | public: | | |||
59 | int num_buttons; | | |||
60 | int middle_button; | | |||
61 | bool handedEnabled; | | |||
62 | bool m_handedNeedsApply; | | |||
63 | int handed; | | |||
64 | double accelRate; | | |||
65 | int thresholdMove; | | |||
66 | int doubleClickInterval; | | |||
67 | int dragStartTime; | | |||
68 | int dragStartDist; | | |||
69 | bool singleClick; | | |||
70 | int wheelScrollLines; | | |||
71 | bool reverseScrollPolarity; | | |||
72 | }; | | |||
73 | 48 | | |||
74 | class MouseConfig : public KCModule, public Ui::KCMMouse | 49 | class MouseConfig : public KCModule, public Ui::KCMMouse | ||
75 | { | 50 | { | ||
76 | Q_OBJECT | 51 | Q_OBJECT | ||
77 | public: | 52 | public: | ||
78 | MouseConfig(QWidget *parent, const QVariantList &args); | 53 | MouseConfig(QWidget *parent, const QVariantList &args); | ||
79 | ~MouseConfig(); | 54 | ~MouseConfig(); | ||
80 | 55 | | |||
81 | void save(); | 56 | void save(); | ||
82 | void load(); | 57 | void load(); | ||
83 | void defaults(); | 58 | void defaults(); | ||
84 | 59 | | |||
85 | private Q_SLOTS: | 60 | private Q_SLOTS: | ||
86 | void slotHandedChanged(int val); | 61 | void slotHandedChanged(int val); | ||
87 | void slotScrollPolarityChanged(); | 62 | void slotScrollPolarityChanged(); | ||
88 | void checkAccess(); | 63 | void checkAccess(); | ||
89 | void slotThreshChanged(int value); | 64 | void slotThreshChanged(int value); | ||
90 | void slotDragStartDistChanged(int value); | 65 | void slotDragStartDistChanged(int value); | ||
91 | void slotWheelScrollLinesChanged(int value); | 66 | void slotWheelScrollLinesChanged(int value); | ||
92 | 67 | | |||
93 | private: | 68 | private: | ||
94 | double getAccel(); | 69 | double getAccel(); | ||
95 | int getThreshold(); | 70 | int getThreshold(); | ||
96 | int getHandedness(); | 71 | MouseHanded getHandedness(); | ||
97 | 72 | | |||
98 | void setAccel(double); | 73 | void setAccel(double); | ||
99 | void setThreshold(int); | 74 | void setThreshold(int); | ||
100 | void setHandedness(int); | 75 | void setHandedness(MouseHanded); | ||
101 | 76 | | |||
102 | MouseSettings *settings; | 77 | MouseSettings *settings; | ||
78 | | ||||
79 | MouseBackend *backend; | ||||
103 | }; | 80 | }; | ||
104 | 81 | | |||
105 | #endif | 82 | #endif | ||
106 | |