Changeset View
Changeset View
Standalone View
Standalone View
kcms/touchpad/src/touchpadbackend.h
Show All 18 Lines | |||||
19 | 19 | | |||
20 | #ifndef TOUCHPADBACKEND_H | 20 | #ifndef TOUCHPADBACKEND_H | ||
21 | #define TOUCHPADBACKEND_H | 21 | #define TOUCHPADBACKEND_H | ||
22 | 22 | | |||
23 | #include <QObject> | 23 | #include <QObject> | ||
24 | #include <QVector> | 24 | #include <QVector> | ||
25 | #include <QVariantHash> | 25 | #include <QVariantHash> | ||
26 | 26 | | |||
27 | enum class TouchpadInputBackendMode { | ||||
28 | WaylandLibinput = 0, | ||||
29 | XLibinput = 1, | ||||
30 | XSynaptics = 2 | ||||
31 | }; | ||||
32 | | ||||
27 | class Q_DECL_EXPORT TouchpadBackend : public QObject | 33 | class Q_DECL_EXPORT TouchpadBackend : public QObject | ||
28 | { | 34 | { | ||
29 | Q_OBJECT | 35 | Q_OBJECT | ||
30 | 36 | | |||
31 | protected: | 37 | protected: | ||
32 | explicit TouchpadBackend(QObject *parent) : QObject(parent) {} | 38 | explicit TouchpadBackend(QObject *parent) : QObject(parent) {} | ||
39 | void setMode(TouchpadInputBackendMode mode); | ||||
33 | 40 | | |||
34 | public: | 41 | public: | ||
35 | static TouchpadBackend *implementation(); | 42 | static TouchpadBackend *implementation(); | ||
36 | 43 | | |||
44 | TouchpadInputBackendMode getMode() const {return m_mode;} | ||||
romangg: Such a member varialbe shouldn't be public. | |||||
45 | | ||||
37 | virtual bool applyConfig(const QVariantHash &) {return false;} | 46 | virtual bool applyConfig(const QVariantHash &) {return false;} | ||
38 | virtual bool getConfig(QVariantHash &) {return false;} | 47 | virtual bool getConfig(QVariantHash &) {return false;} | ||
39 | 48 | | |||
40 | virtual bool applyConfig() {return false;} | 49 | virtual bool applyConfig() {return false;} | ||
41 | virtual bool getConfig() {return false;} | 50 | virtual bool getConfig() {return false;} | ||
42 | virtual bool getDefaultConfig() {return false;} | 51 | virtual bool getDefaultConfig() {return false;} | ||
43 | virtual bool isChangedConfig() const {return false;} | 52 | virtual bool isChangedConfig() const {return false;} | ||
44 | 53 | | |||
45 | virtual QStringList supportedParameters() const {return QStringList();} | 54 | virtual QStringList supportedParameters() const {return QStringList();} | ||
46 | virtual QString errorString() const {return QString();} | 55 | virtual QString errorString() const {return QString();} | ||
romangg: Unnecessary changes. Revert these pls to keep the diff size in check. | |||||
47 | 56 | | |||
48 | virtual QVector<QObject*> getDevices() const { return QVector<QObject*>(); } | 57 | virtual QVector<QObject*> getDevices() const { return QVector<QObject*>(); } | ||
49 | virtual int touchpadCount() const {return 0;} | 58 | virtual int touchpadCount() const {return 0;} | ||
50 | 59 | | |||
51 | enum TouchpadOffState { | 60 | enum TouchpadOffState { | ||
52 | TouchpadEnabled, TouchpadTapAndScrollDisabled, TouchpadFullyDisabled | 61 | TouchpadEnabled, TouchpadTapAndScrollDisabled, TouchpadFullyDisabled | ||
53 | }; | 62 | }; | ||
54 | virtual void setTouchpadOff(TouchpadOffState) {} | 63 | virtual void setTouchpadOff(TouchpadOffState) {} | ||
55 | virtual TouchpadOffState getTouchpadOff() {return TouchpadFullyDisabled;} | 64 | virtual TouchpadOffState getTouchpadOff() {return TouchpadFullyDisabled;} | ||
56 | 65 | | |||
57 | virtual bool isTouchpadAvailable() {return false;} | 66 | virtual bool isTouchpadAvailable() {return false;} | ||
58 | virtual bool isTouchpadEnabled() {return false;} | 67 | virtual bool isTouchpadEnabled() {return false;} | ||
59 | virtual void setTouchpadEnabled(bool) {} | 68 | virtual void setTouchpadEnabled(bool) {} | ||
60 | 69 | | |||
61 | virtual void watchForEvents(bool keyboard) {} | 70 | virtual void watchForEvents(bool keyboard) {} | ||
62 | 71 | | |||
63 | virtual QStringList listMouses(const QStringList &blacklist) {return QStringList();} | 72 | virtual QStringList listMouses(const QStringList &blacklist) {return QStringList();} | ||
64 | 73 | | |||
74 | private: | ||||
75 | TouchpadInputBackendMode m_mode; | ||||
76 | | ||||
65 | Q_SIGNALS: | 77 | Q_SIGNALS: | ||
66 | void touchpadStateChanged(); | 78 | void touchpadStateChanged(); | ||
67 | void mousesChanged(); | 79 | void mousesChanged(); | ||
68 | void touchpadReset(); | 80 | void touchpadReset(); | ||
69 | void keyboardActivityStarted(); | 81 | void keyboardActivityStarted(); | ||
70 | void keyboardActivityFinished(); | 82 | void keyboardActivityFinished(); | ||
71 | 83 | | |||
72 | void touchpadAdded(bool success); | 84 | void touchpadAdded(bool success); | ||
73 | void touchpadRemoved(int index); | 85 | void touchpadRemoved(int index); | ||
74 | }; | 86 | }; | ||
75 | 87 | | |||
76 | #endif // TOUCHPADBACKEND_H | 88 | #endif // TOUCHPADBACKEND_H |
Such a member varialbe shouldn't be public.