1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QEVDEVTABLETHANDLER_P_H
5#define QEVDEVTABLETHANDLER_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QObject>
19#include <QString>
20#include <QThread>
21#include <QtCore/private/qthread_p.h>
22
23QT_BEGIN_NAMESPACE
24
25class QSocketNotifier;
26class QEvdevTabletData;
27
28class QEvdevTabletHandler : public QObject
29{
30public:
31 explicit QEvdevTabletHandler(const QString &device, const QString &spec = QString(), QObject *parent = nullptr);
32 ~QEvdevTabletHandler();
33
34 qint64 deviceId() const;
35
36 void readData();
37
38private:
39 bool queryLimits();
40
41 int m_fd;
42 QString m_device;
43 QSocketNotifier *m_notifier;
44 QEvdevTabletData *d;
45};
46
47class QEvdevTabletHandlerThread : public QDaemonThread
48{
49public:
50 explicit QEvdevTabletHandlerThread(const QString &device, const QString &spec, QObject *parent = nullptr);
51 ~QEvdevTabletHandlerThread();
52 void run() override;
53 QEvdevTabletHandler *handler() { return m_handler; }
54
55private:
56 QString m_device;
57 QString m_spec;
58 QEvdevTabletHandler *m_handler;
59};
60
61QT_END_NAMESPACE
62
63#endif // QEVDEVTABLETHANDLER_P_H
64

source code of qtbase/src/platformsupport/input/evdevtablet/qevdevtablethandler_p.h