DtkDevice
DTK library for device.
载入中...
搜索中...
未找到
dinputdevicetrackpoint.h
浏览该文件的文档.
1// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd.
2//
3// SPDX-License-Identifier: LGPL-3.0-or-later
4
5#ifndef DINPUTDEVICETRACKPOINT_H
6#define DINPUTDEVICETRACKPOINT_H
8#include "dtkdevice_global.h"
9#include <DExpected>
10#include <QObject>
11DDEVICE_BEGIN_NAMESPACE
12using DCORE_NAMESPACE::DExpected;
13class DInputDeviceTrackPointPrivate;
14class LIBDTKDEVICESHARED_EXPORT DInputDeviceTrackPoint : public DInputDevicePointer
15{
16 Q_OBJECT
17 Q_PROPERTY(bool middleButtonEnabled READ middleButtonEnabled WRITE setMiddleButtonEnabled NOTIFY middleButtonEnabledChanged)
18 Q_PROPERTY(qint32 middleButtonTimeout READ middleButtonTimeout WRITE setMiddleButtonTimeout NOTIFY middleButtonTimeoutChanged)
19 Q_PROPERTY(bool wheelEmulation READ wheelEmulation WRITE setWheelEmulation NOTIFY wheelEmulationChanged)
20 Q_PROPERTY(
21 qint32 wheelEmulationButton READ wheelEmulationButton WRITE setWheelEmulationButton NOTIFY wheelEmulationButtonChanged)
22 Q_PROPERTY(qint32 wheelEmulationTimeout READ wheelEmulationTimeout WRITE setWheelEmulationTimeout NOTIFY
23 wheelEmulationTimeoutChanged)
24 Q_PROPERTY(
25 bool wheelHorizontalScroll READ wheelHorizontalScroll WRITE setWheelHorizontalScroll NOTIFY wheelHorizontalScrollChanged)
26
27public:
28 ~DInputDeviceTrackPoint() override;
29
30 bool middleButtonEnabled() const;
31 qint32 middleButtonTimeout() const;
32 bool wheelEmulation() const;
33 qint32 wheelEmulationButton() const;
34 qint32 wheelEmulationTimeout() const;
35 bool wheelHorizontalScroll() const;
36
37 void setMiddleButtonEnabled(bool enabled);
38 void setMiddleButtonTimeout(qint32 timeout);
39 void setWheelEmulation(bool emulation);
40 void setWheelEmulationButton(qint32 button);
41 void setWheelEmulationTimeout(qint32 timeout);
42 void setWheelHorizontalScroll(bool horizontalScroll);
43
44 bool leftHanded() const override;
45 ScrollMethod scrollMethod() const override;
46 AccelerationProfile accelerationProfile() const override;
47 double accelerationSpeed() const override;
48 void setLeftHanded(bool leftHanded) override;
49 void setScrollMethod(ScrollMethod scrollMethod) override;
50 void setAccelerationProfile(AccelerationProfile accelerationProfile) override;
51 void setAccelerationSpeed(double accelerationSpeed) override;
52
53Q_SIGNALS:
54
55 void middleButtonEnabledChanged(bool enabled);
56 void middleButtonTimeoutChanged(qint32 timeout);
57 void wheelEmulationChanged(bool emulation);
58 void wheelEmulationButtonChanged(qint32 button);
59 void wheelEmulationTimeoutChanged(qint32 timeout);
60 void wheelHorizontalScrollChanged(bool horizontalScroll);
61
62public Q_SLOTS:
63 DExpected<void> reset() override;
64
65protected:
66 DInputDeviceTrackPoint(const DeviceInfo &info = DeviceInfoInitializer, bool enabled = true, QObject *parent = nullptr);
67
68private:
69 friend class DInputDeviceManager;
70 D_DECLARE_PRIVATE(DInputDeviceTrackPoint)
71};
72DDEVICE_END_NAMESPACE
73#endif // DINPUTDEVICETRACKPOINT_H
Manager类
Definition dinputdevicemanager.h:27
抽象指针设备类
Definition dinputdevicepointer.h:20
指针杆设备类(小红点)
Definition dinputdevicetrackpoint.h:15
ScrollMethod
滚动方式
Definition dtkinputdevices_types.h:33
AccelerationProfile
指针加速方式
Definition dtkinputdevices_types.h:27
设备信息类
Definition dtkinputdevices_types.h:16