Changeset View
Changeset View
Standalone View
Standalone View
kcms/touchpad/src/touchpadbackend.h
1 | /* | 1 | /* | ||
---|---|---|---|---|---|
2 | * Copyright (C) 2013 Alexander Mezin <mezin.alexander@gmail.com> | 2 | * Copyright 2016 Roman Gilg <subdiff@gmail.com> | ||
3 | * Copyright 2013 Alexander Mezin <mezin.alexander@gmail.com> | ||||
3 | * | 4 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | 5 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License as published by | 6 | * it under the terms of the GNU General Public License as published by | ||
Context not available. | |||||
20 | #define TOUCHPADBACKEND_H | 21 | #define TOUCHPADBACKEND_H | ||
21 | 22 | | |||
22 | #include <QObject> | 23 | #include <QObject> | ||
24 | #include <QVector> | ||||
23 | #include <QVariantHash> | 25 | #include <QVariantHash> | ||
24 | 26 | | |||
25 | //#include <kdemacros.h> | | |||
26 | | ||||
27 | class Q_DECL_EXPORT TouchpadBackend : public QObject | 27 | class Q_DECL_EXPORT TouchpadBackend : public QObject | ||
28 | { | 28 | { | ||
29 | Q_OBJECT | 29 | Q_OBJECT | ||
30 | 30 | | |||
31 | protected: | 31 | protected: | ||
32 | explicit TouchpadBackend(QObject *parent); | 32 | explicit TouchpadBackend(QObject *parent) : QObject(parent) {} | ||
33 | 33 | | |||
34 | public: | 34 | public: | ||
35 | | ||||
36 | static TouchpadBackend *implementation(); | 35 | static TouchpadBackend *implementation(); | ||
37 | 36 | | |||
38 | virtual bool applyConfig(const QVariantHash &) = 0; | 37 | virtual bool applyConfig(const QVariantHash &) {return false;} | ||
39 | virtual bool getConfig(QVariantHash &) = 0; | 38 | virtual bool getConfig(QVariantHash &) {return false;} | ||
40 | virtual QStringList supportedParameters() const = 0; | 39 | | ||
41 | virtual const QString &errorString() const = 0; | 40 | virtual bool applyConfig() {return false;} | ||
42 | virtual bool hasTouchpad() const = 0; | 41 | virtual bool getConfig() {return false;} | ||
42 | virtual bool getDefaultConfig() {return false;} | ||||
43 | virtual bool isChangedConfig() const {return false;} | ||||
44 | | ||||
45 | virtual QStringList supportedParameters() const {return QStringList();} | ||||
46 | virtual const QString &errorString() const {return QString();} | ||||
47 | | ||||
48 | virtual QVector<QObject*> getDevices() const { return QVector<QObject*>(); } | ||||
49 | virtual int touchpadCount() const {return 0;} | ||||
43 | 50 | | |||
44 | enum TouchpadOffState { | 51 | enum TouchpadOffState { | ||
45 | TouchpadEnabled, TouchpadTapAndScrollDisabled, TouchpadFullyDisabled | 52 | TouchpadEnabled, TouchpadTapAndScrollDisabled, TouchpadFullyDisabled | ||
46 | }; | 53 | }; | ||
47 | virtual void setTouchpadOff(TouchpadOffState) = 0; | 54 | virtual void setTouchpadOff(TouchpadOffState) {} | ||
48 | virtual TouchpadOffState getTouchpadOff() = 0; | 55 | virtual TouchpadOffState getTouchpadOff() {return TouchpadFullyDisabled;} | ||
49 | 56 | | |||
50 | virtual bool isTouchpadAvailable() = 0; | 57 | virtual bool isTouchpadAvailable() {return false;} | ||
51 | virtual bool isTouchpadEnabled() = 0; | 58 | virtual bool isTouchpadEnabled() {return false;} | ||
52 | virtual void setTouchpadEnabled(bool) = 0; | 59 | virtual void setTouchpadEnabled(bool) {} | ||
53 | 60 | | |||
54 | virtual QStringList listMouses(const QStringList &blacklist) = 0; | 61 | virtual void watchForEvents(bool keyboard) {} | ||
55 | 62 | | |||
56 | virtual void watchForEvents(bool keyboard) = 0; | 63 | virtual QStringList listMouses(const QStringList &blacklist) {return QStringList();} | ||
57 | 64 | | |||
58 | Q_SIGNALS: | 65 | Q_SIGNALS: | ||
59 | void touchpadStateChanged(); | 66 | void touchpadStateChanged(); | ||
Context not available. | |||||
61 | void touchpadReset(); | 68 | void touchpadReset(); | ||
62 | void keyboardActivityStarted(); | 69 | void keyboardActivityStarted(); | ||
63 | void keyboardActivityFinished(); | 70 | void keyboardActivityFinished(); | ||
71 | | ||||
72 | void touchpadAdded(bool success); | ||||
73 | void touchpadRemoved(int index); | ||||
64 | }; | 74 | }; | ||
65 | 75 | | |||
66 | #endif // TOUCHPADBACKEND_H | 76 | #endif // TOUCHPADBACKEND_H | ||
Context not available. |