Changeset View
Changeset View
Standalone View
Standalone View
kcms/input/mouse.h
Show All 22 Lines | |||||
23 | * GNU General Public License for more details. | 23 | * GNU General Public License for more details. | ||
24 | * | 24 | * | ||
25 | * You should have received a copy of the GNU General Public License | 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 | 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> | 34 | #include <QX11Info> | ||
35 | 35 | | |||
36 | #include <config-workspace.h> | 36 | #include <KCModule> | ||
37 | 37 | | |||
38 | #include <kcmodule.h> | 38 | #include "config-workspace.h" | ||
39 | #include "ui_kmousedlg.h" | | |||
40 | 39 | | |||
41 | #define RIGHT_HANDED 0 | 40 | #include "ui_kmousedlg.h" | ||
42 | #define LEFT_HANDED 1 | | |||
43 | 41 | | |||
44 | class QCheckBox; | 42 | class QCheckBox; | ||
45 | class QDoubleSpinBox; | 43 | class QDoubleSpinBox; | ||
46 | class QSlider; | 44 | class QSlider; | ||
47 | class QSpinBox; | 45 | class QSpinBox; | ||
48 | class QTabWidget; | 46 | class QTabWidget; | ||
49 | 47 | | |||
50 | class KMouseDlg : public QWidget, public Ui::KMouseDlg | 48 | class KMouseDlg : public QWidget, public Ui::KMouseDlg | ||
51 | { | 49 | { | ||
52 | public: | 50 | public: | ||
53 | KMouseDlg( QWidget *parent ) : QWidget( parent ) { | 51 | KMouseDlg(QWidget *parent); | ||
54 | setupUi( this ); | | |||
55 | } | | |||
56 | }; | 52 | }; | ||
57 | 53 | | |||
58 | class MouseSettings | 54 | class MouseSettings | ||
59 | { | 55 | { | ||
60 | public: | 56 | public: | ||
61 | void save(KConfig *); | 57 | void save(KConfig *); | ||
62 | void load(KConfig *, Display *dpy = QX11Info::display()); | 58 | void load(KConfig *); | ||
63 | void apply(bool force=false); | 59 | void apply(bool force=false); | ||
64 | 60 | | |||
65 | public: | 61 | public: | ||
62 | enum class Handedness : int | ||||
63 | { | ||||
64 | Right = 0, | ||||
65 | Left = 1, | ||||
66 | }; | ||||
67 | | ||||
66 | int num_buttons; | 68 | int num_buttons; | ||
67 | int middle_button; | 69 | unsigned char middle_button; | ||
68 | bool handedEnabled; | 70 | bool handedEnabled; | ||
69 | bool m_handedNeedsApply; | 71 | bool handednessChanged; | ||
70 | int handed; | 72 | Handedness handed; | ||
71 | double accelRate; | 73 | double accelRate; | ||
72 | int thresholdMove; | 74 | int thresholdMove; | ||
73 | int doubleClickInterval; | 75 | int doubleClickInterval; | ||
74 | int dragStartTime; | 76 | int dragStartTime; | ||
75 | int dragStartDist; | 77 | int dragStartDist; | ||
76 | bool singleClick; | 78 | bool singleClick; | ||
77 | int wheelScrollLines; | 79 | int wheelScrollLines; | ||
78 | bool reverseScrollPolarity; | 80 | bool reverseScrollPolarity; | ||
81 | bool scrollPolarityChanged; | ||||
79 | }; | 82 | }; | ||
80 | 83 | | |||
81 | class MouseConfig : public KCModule | 84 | class MouseConfig : public KCModule | ||
82 | { | 85 | { | ||
83 | Q_OBJECT | 86 | Q_OBJECT | ||
84 | public: | 87 | public: | ||
85 | MouseConfig(QWidget *parent, const QVariantList &args); | 88 | MouseConfig(QWidget *parent, const QVariantList &args); | ||
86 | ~MouseConfig(); | 89 | ~MouseConfig(); | ||
87 | 90 | | |||
88 | void save(); | 91 | void save(); | ||
89 | void load(); | 92 | void load(); | ||
90 | void defaults(); | 93 | void defaults(); | ||
91 | 94 | | |||
92 | private Q_SLOTS: | 95 | private Q_SLOTS: | ||
93 | void slotHandedChanged(int val); | 96 | void slotHandedChanged(int val); | ||
94 | void slotScrollPolarityChanged(); | 97 | void slotScrollPolarityChanged(); | ||
95 | void checkAccess(); | 98 | void checkAccess(); | ||
96 | void slotThreshChanged(int value); | 99 | void slotThreshChanged(int value); | ||
97 | void slotDragStartDistChanged(int value); | 100 | void slotDragStartDistChanged(int value); | ||
98 | void slotWheelScrollLinesChanged(int value); | 101 | void slotWheelScrollLinesChanged(int value); | ||
99 | 102 | | |||
100 | private: | 103 | private: | ||
101 | double getAccel(); | 104 | double getAccel(); | ||
102 | int getThreshold(); | 105 | int getThreshold(); | ||
103 | int getHandedness(); | 106 | MouseSettings::Handedness getHandedness(); | ||
104 | 107 | | |||
105 | void setAccel(double); | 108 | void setAccel(double); | ||
106 | void setThreshold(int); | 109 | void setThreshold(int); | ||
107 | void setHandedness(int); | 110 | void setHandedness(MouseSettings::Handedness); | ||
108 | 111 | | |||
109 | QDoubleSpinBox *accel; | 112 | QDoubleSpinBox *accel; | ||
110 | QSpinBox *thresh; | 113 | QSpinBox *thresh; | ||
111 | QSpinBox *doubleClickInterval; | 114 | QSpinBox *doubleClickInterval; | ||
112 | QSpinBox *dragStartTime; | 115 | QSpinBox *dragStartTime; | ||
113 | QSpinBox *dragStartDist; | 116 | QSpinBox *dragStartDist; | ||
114 | QSpinBox *wheelScrollLines; | 117 | QSpinBox *wheelScrollLines; | ||
115 | 118 | | |||
116 | QTabWidget *tabwidget; | 119 | QTabWidget *tabwidget; | ||
117 | QWidget *advancedTab; | 120 | QWidget *advancedTab; | ||
118 | KMouseDlg* generalTab; | 121 | KMouseDlg* generalTab; | ||
119 | MouseSettings *settings; | 122 | MouseSettings *settings; | ||
120 | 123 | | |||
121 | QCheckBox *mouseKeys; | 124 | QCheckBox *mouseKeys; | ||
122 | QSpinBox *mk_delay; | 125 | QSpinBox *mk_delay; | ||
123 | QSpinBox *mk_interval; | 126 | QSpinBox *mk_interval; | ||
124 | QSpinBox *mk_time_to_max; | 127 | QSpinBox *mk_time_to_max; | ||
125 | QSpinBox *mk_max_speed; | 128 | QSpinBox *mk_max_speed; | ||
126 | QSpinBox *mk_curve; | 129 | QSpinBox *mk_curve; | ||
127 | }; | 130 | }; | ||
128 | 131 | | |||
129 | #endif | 132 | #endif | ||
130 | |