Changeset View
Changeset View
Standalone View
Standalone View
kcms/input/backends/x11/x11_libinput_backend.h
- This file was added.
1 | /* | ||||
---|---|---|---|---|---|
2 | * Copyright 2018 Roman Gilg <subdiff@gmail.com> | ||||
3 | * | ||||
4 | * 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 | * the Free Software Foundation; either version 2 of the License, or | ||||
7 | * (at your option) any later version. | ||||
8 | * | ||||
9 | * This program is distributed in the hope that it will be useful, | ||||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
12 | * GNU General Public License for more details. | ||||
13 | * | ||||
14 | * You should have received a copy of the GNU General Public License | ||||
15 | * along with this program; if not, write to the Free Software | ||||
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||||
17 | */ | ||||
18 | | ||||
19 | #ifndef X11LIBINPUTBACKEND_H | ||||
20 | #define X11LIBINPUTBACKEND_H | ||||
21 | | ||||
22 | #include "x11_backend.h" | ||||
23 | | ||||
24 | #include <QVector> | ||||
25 | | ||||
26 | class X11LibinputBackend : public X11Backend | ||||
27 | { | ||||
28 | Q_OBJECT | ||||
29 | | ||||
30 | Q_PROPERTY(int deviceCount READ deviceCount CONSTANT) | ||||
31 | | ||||
32 | public: | ||||
33 | explicit X11LibinputBackend(QObject *parent = 0); | ||||
34 | ~X11LibinputBackend() = default; | ||||
35 | | ||||
36 | void kcmInit() override; | ||||
37 | | ||||
38 | bool applyConfig() override; | ||||
39 | bool getConfig() override; | ||||
40 | bool getDefaultConfig() override; | ||||
41 | bool isChangedConfig() const override; | ||||
42 | QString errorString() const override { return m_errorString; } | ||||
43 | | ||||
44 | virtual int deviceCount() const override { return 1; } | ||||
45 | virtual QVector<QObject*> getDevices() const override { | ||||
46 | return QVector<QObject*>(1, m_device); | ||||
47 | } | ||||
48 | | ||||
49 | private: | ||||
50 | QObject *m_device; | ||||
51 | QString m_errorString = QString(); | ||||
52 | }; | ||||
53 | | ||||
54 | #endif // X11LIBINPUTBACKEND_H |