Changeset View
Changeset View
Standalone View
Standalone View
kcms/input/backends/kwin_wl/kwin_wl_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 KWINWAYLANDBACKEND_H | ||||
20 | #define KWINWAYLANDBACKEND_H | ||||
21 | | ||||
22 | #include "inputbackend.h" | ||||
23 | | ||||
24 | #include <QVector> | ||||
25 | | ||||
26 | class KWinWaylandDevice; | ||||
27 | class QDBusInterface; | ||||
28 | | ||||
29 | class KWinWaylandBackend : public InputBackend | ||||
30 | { | ||||
31 | Q_OBJECT | ||||
32 | | ||||
33 | Q_PROPERTY(int deviceCount READ deviceCount CONSTANT) | ||||
34 | | ||||
35 | public: | ||||
36 | explicit KWinWaylandBackend(QObject *parent = 0); | ||||
37 | ~KWinWaylandBackend(); | ||||
38 | | ||||
39 | bool applyConfig() override; | ||||
40 | bool getConfig() override; | ||||
41 | bool getDefaultConfig() override; | ||||
42 | bool isChangedConfig() const override; | ||||
43 | QString errorString() const override { return m_errorString; } | ||||
44 | | ||||
45 | virtual int deviceCount() const override { return m_devices.count(); } | ||||
46 | virtual QVector<QObject*> getDevices() const override { return m_devices; } | ||||
47 | | ||||
48 | private Q_SLOTS: | ||||
49 | void onDeviceAdded(QString); | ||||
50 | void onDeviceRemoved(QString); | ||||
51 | | ||||
52 | private: | ||||
53 | void findDevices(); | ||||
54 | | ||||
55 | QDBusInterface* m_deviceManager; | ||||
56 | QVector<QObject*> m_devices; | ||||
57 | | ||||
58 | QString m_errorString = QString(); | ||||
59 | }; | ||||
60 | | ||||
61 | #endif // KWINWAYLANDBACKEND_H |