summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qinputdevice.h
blob: 9afdcf68f593f85cf902c10bf9a2788be37e200b (plain)
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
// Copyright (C) 2020 The Qt Company Ltd.// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only#ifndef QINPUTDEVICE_H#define QINPUTDEVICE_H#include <QtGui/qtguiglobal.h>#include <QtCore/qobject.h>#include <QtGui/qscreen.h> QT_BEGIN_NAMESPACE class QDebug;class QInputDevicePrivate;class Q_GUI_EXPORT QInputDevice :public QObject { Q_OBJECT Q_DECLARE_PRIVATE(QInputDevice)Q_PROPERTY(QString name READ name CONSTANT)Q_PROPERTY(DeviceType type READ type CONSTANT)Q_PROPERTY(Capabilities capabilities READ capabilities NOTIFY capabilitiesChanged)Q_PROPERTY(qint64 systemId READ systemId CONSTANT)Q_PROPERTY(QString seatName READ seatName CONSTANT)Q_PROPERTY(QRect availableVirtualGeometry READ availableVirtualGeometry NOTIFY availableVirtualGeometryChanged)public:enumclass DeviceType { Unknown =0x0000, Mouse =0x0001, TouchScreen =0x0002, TouchPad =0x0004, Puck =0x0008, Stylus =0x0010, Airbrush =0x0020, Keyboard =0x1000, AllDevices =0x7FFFFFFF};Q_DECLARE_FLAGS(DeviceTypes, DeviceType)Q_FLAG(DeviceTypes)enumclass Capability { None =0, Position =0x0001, Area =0x0002, Pressure =0x0004, Velocity =0x0008, NormalizedPosition =0x0020, MouseEmulation =0x0040, PixelScroll =0x0080, Scroll =0x0100, Hover =0x0200, Rotation =0x0400, XTilt =0x0800, YTilt =0x1000, TangentialPressure =0x2000, ZPosition =0x4000, All =0x7FFFFFFF};Q_DECLARE_FLAGS(Capabilities, Capability)Q_FLAG(Capabilities)QInputDevice(QObject *parent =nullptr);~QInputDevice();QInputDevice(const QString &name, qint64 systemId, DeviceType type,const QString &seatName =QString(), QObject *parent =nullptr); QString name()const; DeviceType type()const; Capabilities capabilities()const;boolhasCapability(Capability cap)const; qint64 systemId()const; QString seatName()const; QRect availableVirtualGeometry()const;static QStringList seatNames();static QList<const QInputDevice *>devices();static const QInputDevice *primaryKeyboard(const QString& seatName =QString());booloperator==(const QInputDevice &other)const; Q_SIGNALS:voidavailableVirtualGeometryChanged(QRect area);Q_REVISION(6,9)voidcapabilitiesChanged(Capabilities capabilities);protected:QInputDevice(QInputDevicePrivate &d, QObject *parent);Q_DISABLE_COPY_MOVE(QInputDevice)};Q_DECLARE_OPERATORS_FOR_FLAGS(QInputDevice::DeviceTypes)Q_DECLARE_OPERATORS_FOR_FLAGS(QInputDevice::Capabilities)#ifndef QT_NO_DEBUG_STREAM Q_GUI_EXPORT QDebug operator<<(QDebug,const QInputDevice *);#endif QT_END_NAMESPACE #endif// QINPUTDEVICE_H
close