Debian Codegraph @

tests/mocks/Lomiri/InputInfo/qinputdeviceinfo_mock_p.h

raw
1 /*
2 * Copyright 2015 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17 #ifndef QINPUTDEVICEINFO_MOCK_H
18 #define QINPUTDEVICEINFO_MOCK_H
19
20 #include <QObject>
21 #include "qinputinfo.h"
22
23 class QInputDevicePrivate : public QObject
24 {
25 Q_OBJECT
26 public:
27 explicit QInputDevicePrivate(QObject *parent = 0);
28
29 QString name;
30 QString devicePath;
31 QList <int> buttons; //keys
32 QList <int> switches;
33 QList <int> relativeAxis;
34 QList <int> absoluteAxis;
35 QInputDevice::InputTypeFlags type;
36 };
37
38 class QInputDeviceManagerPrivate : public QObject
39 {
40 Q_OBJECT
41 public:
42 explicit QInputDeviceManagerPrivate(QObject *parent = 0);
43 ~QInputDeviceManagerPrivate();
44 QVector <QInputDevice *> deviceList;
45 QMap <QString, QInputDevice *> deviceMap;
46 static QInputDeviceManagerPrivate * instance();
47 QInputDevice::InputType currentFilter;
48
49 Q_INVOKABLE QInputDevice* addMockDevice(const QString &devicePath, QInputDevice::InputType type);
50 Q_INVOKABLE void removeDevice(const QString &devicePath);
51
52 Q_SIGNALS:
53 void deviceAdded(const QString &);
54 void deviceRemoved(const QString &);
55 void ready();
56 };
57
58 #endif // QINPUTDEVICEINFO_MOCK_H