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;
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
void tapToClickChanged(bool tapToClick)
轻触时点击改变信号
void setAccelerationProfile(AccelerationProfile accelerationProfile) override
设置指针加速方式
DInputDeviceTouchPad(const DeviceInfo &info=DeviceInfoInitializer, bool enabled=true, QObject *parent=nullptr)
空参构造函数和指定父对象的构造函数
void setAccelerationSpeed(double accelerationSpeed) override
设置指针加速度
bool tapToClick() const
获取是否轻触时点击
void setNaturalScroll(bool naturalScroll)
设置是否自然滚动
void setDisableWhileTyping(bool disableWhileTyping)
设置是否在打字时禁用
bool disableWhileTyping() const
获取是否在打字时禁用
DExpected< void > enable(bool enabled=true)
设置enabled属性
bool enabled() const override
获取设备是否启用
void setLeftHanded(bool leftHanded) override
设置是否是左手模式
bool leftHanded() const override
获取是否是左手模式
void setScrollMethod(ScrollMethod scrollMethod) override
设置滚动模式
void setTapToClick(bool tapToClick)
设置轻触时点击
double accelerationSpeed() const override
获取指针加速度
void disableWhileTypingChanged(bool disableWhileTyping)
是否在打字时禁用改变信号
bool naturalScroll() const
获取是否自然滚动
void naturalScrollChanged(bool naturalScroll)
是否自然滚动改变信号
ScrollMethod scrollMethod() const override
获取当前滚动模式
DExpected< void > reset() override
重置触摸板的所有设置
AccelerationProfile accelerationProfile() const override
获取当前的指针加速方式
ScrollMethod
滚动方式
Definition: dtkinputdevices_types.h:33
AccelerationProfile
指针加速方式
Definition: dtkinputdevices_types.h:27
设备信息类
Definition: dtkinputdevices_types.h:16