DtkDevice
DTK library for device.
载入中...
搜索中...
未找到
dinputdevicetouchpad.h
浏览该文件的文档.
1// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd.
2//
3// SPDX-License-Identifier: LGPL-3.0-or-later
4
5#ifndef DINPUTDEVICETOUCHPAD_H
6#define DINPUTDEVICETOUCHPAD_H
7
8#include "dtkdevice_global.h"
9
10#include <DExpected>
11#include <QObject>
12
13#include "dinputdevicepointer.h"
14
15DDEVICE_BEGIN_NAMESPACE
16
17using DCORE_NAMESPACE::DExpected;
18class DInputDeviceTouchPadPrivate;
19class LIBDTKDEVICESHARED_EXPORT DInputDeviceTouchPad : public DInputDevicePointer
20{
21 Q_OBJECT
22 Q_PROPERTY(bool disableWhileTyping READ disableWhileTyping WRITE setDisableWhileTyping NOTIFY disableWhileTypingChanged)
23 Q_PROPERTY(bool naturalScroll READ naturalScroll WRITE setNaturalScroll NOTIFY naturalScrollChanged)
24 Q_PROPERTY(bool tapToClick READ tapToClick WRITE setTapToClick NOTIFY tapToClickChanged)
25
26public:
27 ~DInputDeviceTouchPad() override;
28
29 bool disableWhileTyping() const;
30 bool naturalScroll() const;
31 bool tapToClick() const;
32
33 void setDisableWhileTyping(bool disableWhileTyping);
34 void setNaturalScroll(bool naturalScroll);
35 void setTapToClick(bool tapToClick);
36
37 bool enabled() const override;
38 bool leftHanded() const override;
39 ScrollMethod scrollMethod() const override;
40 AccelerationProfile accelerationProfile() const override;
41 double accelerationSpeed() const override;
42 void setLeftHanded(bool leftHanded) override;
43 void setScrollMethod(ScrollMethod scrollMethod) override;
44 void setAccelerationProfile(AccelerationProfile accelerationProfile) override;
45 void setAccelerationSpeed(double accelerationSpeed) override;
46
47public Q_SLOTS:
48 DExpected<void> reset() override;
49 DExpected<void> enable(bool enabled = true);
50
51Q_SIGNALS:
52 void disableWhileTypingChanged(bool disableWhileTyping);
53 void naturalScrollChanged(bool naturalScroll);
54 void tapToClickChanged(bool tapToClick);
55
56protected:
57 explicit DInputDeviceTouchPad(const DeviceInfo &info = DeviceInfoInitializer, bool enabled = true, QObject *parent = nullptr);
58
59private:
60 friend class DInputDeviceManager;
61 D_DECLARE_PRIVATE(DInputDeviceTouchPad)
62};
63
64DDEVICE_END_NAMESPACE
65
66#endif // DINPUTDEVICETOUCHPAD_H
Manager类
Definition dinputdevicemanager.h:27
抽象指针设备类
Definition dinputdevicepointer.h:20
触摸板设备
Definition dinputdevicetouchpad.h:20
ScrollMethod
滚动方式
Definition dtkinputdevices_types.h:33
AccelerationProfile
指针加速方式
Definition dtkinputdevices_types.h:27
设备信息类
Definition dtkinputdevices_types.h:16