Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/QtGui/qinputdevice.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 // Copyright (C) 2020 The Qt Company Ltd.
0002 // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
0003 
0004 #ifndef QINPUTDEVICE_H
0005 #define QINPUTDEVICE_H
0006 
0007 #include <QtGui/qtguiglobal.h>
0008 #include <QtCore/qobject.h>
0009 #include <QtGui/qscreen.h>
0010 
0011 QT_BEGIN_NAMESPACE
0012 
0013 class QDebug;
0014 class QInputDevicePrivate;
0015 
0016 class Q_GUI_EXPORT QInputDevice : public QObject
0017 {
0018     Q_OBJECT
0019     Q_DECLARE_PRIVATE(QInputDevice)
0020     Q_PROPERTY(QString name READ name CONSTANT)
0021     Q_PROPERTY(DeviceType type READ type CONSTANT)
0022     Q_PROPERTY(Capabilities capabilities READ capabilities CONSTANT)
0023     Q_PROPERTY(qint64 systemId READ systemId CONSTANT)
0024     Q_PROPERTY(QString seatName READ seatName CONSTANT)
0025     Q_PROPERTY(QRect availableVirtualGeometry READ availableVirtualGeometry
0026                NOTIFY availableVirtualGeometryChanged)
0027 
0028 public:
0029     enum class DeviceType {
0030         Unknown = 0x0000,
0031         Mouse = 0x0001,
0032         TouchScreen = 0x0002,
0033         TouchPad = 0x0004,
0034         Puck = 0x0008,
0035         Stylus = 0x0010,
0036         Airbrush = 0x0020,
0037         Keyboard = 0x1000,
0038         AllDevices = 0x7FFFFFFF
0039     };
0040     Q_DECLARE_FLAGS(DeviceTypes, DeviceType)
0041     Q_FLAG(DeviceTypes)
0042 
0043     enum class Capability {
0044         None = 0,
0045         Position = 0x0001,
0046         Area = 0x0002,
0047         Pressure = 0x0004,
0048         Velocity = 0x0008,
0049         NormalizedPosition = 0x0020,
0050         MouseEmulation = 0x0040,
0051         PixelScroll = 0x0080,
0052         Scroll      = 0x0100,
0053         Hover       = 0x0200,
0054         Rotation    = 0x0400,
0055         XTilt       = 0x0800,
0056         YTilt       = 0x1000,
0057         TangentialPressure = 0x2000,
0058         ZPosition   = 0x4000,
0059         All = 0x7FFFFFFF
0060     };
0061     Q_DECLARE_FLAGS(Capabilities, Capability)
0062     Q_FLAG(Capabilities)
0063 
0064     QInputDevice(QObject *parent = nullptr);
0065     ~QInputDevice();
0066     QInputDevice(const QString &name, qint64 systemId, DeviceType type,
0067                  const QString &seatName = QString(), QObject *parent = nullptr);
0068 
0069     QString name() const;
0070     DeviceType type() const;
0071     Capabilities capabilities() const;
0072     bool hasCapability(Capability cap) const;
0073     qint64 systemId() const;
0074     QString seatName() const;
0075     QRect availableVirtualGeometry() const;
0076 
0077     static QStringList seatNames();
0078     static QList<const QInputDevice *> devices();
0079     static const QInputDevice *primaryKeyboard(const QString& seatName = QString());
0080 
0081     bool operator==(const QInputDevice &other) const;
0082 
0083 Q_SIGNALS:
0084     void availableVirtualGeometryChanged(QRect area);
0085 
0086 protected:
0087     QInputDevice(QInputDevicePrivate &d, QObject *parent);
0088 
0089     Q_DISABLE_COPY_MOVE(QInputDevice)
0090 };
0091 
0092 Q_DECLARE_OPERATORS_FOR_FLAGS(QInputDevice::DeviceTypes)
0093 Q_DECLARE_OPERATORS_FOR_FLAGS(QInputDevice::Capabilities)
0094 
0095 #ifndef QT_NO_DEBUG_STREAM
0096 Q_GUI_EXPORT QDebug operator<<(QDebug, const QInputDevice *);
0097 #endif
0098 
0099 QT_END_NAMESPACE
0100 
0101 #endif // QINPUTDEVICE_H