DtkDevice
DTK library for device.
dinputdevicetablet.h
浏览该文件的文档.
1// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd.
2//
3// SPDX-License-Identifier: LGPL-3.0-or-later
4
5#ifndef DINPUTDEVICETABLET_H
6#define DINPUTDEVICETABLET_H
8#include "dtkdevice_global.h"
9#include <DExpected>
10
11DDEVICE_BEGIN_NAMESPACE
12using DCORE_NAMESPACE::DExpected;
13class DInputDeviceTabletPrivate;
14class LIBDTKDEVICESHARED_EXPORT DInputDeviceTablet : public DInputDevicePointer
15{
16 Q_OBJECT
17 Q_PROPERTY(bool cursorMode READ cursorMode WRITE setCursorMode NOTIFY cursorModeChanged)
18
19public:
20 bool cursorMode() const;
21 void setCursorMode(bool cursorMode);
22 ~DInputDeviceTablet() override;
23
24 bool leftHanded() const override;
25 ScrollMethod scrollMethod() const override;
27 double accelerationSpeed() const override;
28 void setLeftHanded(bool leftHanded) override;
29 void setScrollMethod(ScrollMethod scrollMethod) override;
30 void setAccelerationProfile(AccelerationProfile accelerationProfile) override;
31 void setAccelerationSpeed(double accelerationSpeed) override;
32
33Q_SIGNALS:
34 void cursorModeChanged(bool cursorMode);
35
36public Q_SLOTS:
37 DExpected<void> reset() override;
38
39protected:
40 DInputDeviceTablet(const DeviceInfo &info = DeviceInfoInitializer, bool enabled = true, QObject *parent = nullptr);
41
42private:
43 friend class DInputDeviceManager;
44 D_DECLARE_PRIVATE(DInputDeviceTablet);
45};
46DDEVICE_END_NAMESPACE
47#endif // DINPUTDEVICETABLET_H
Manager类
Definition: dinputdevicemanager.h:27
抽象指针设备类
Definition: dinputdevicepointer.h:20
数位板类
Definition: dinputdevicetablet.h:15
void setCursorMode(bool cursorMode)
设置数位笔是否为光标模式
void setLeftHanded(bool leftHanded) override
设置是否是左手模式
void setAccelerationSpeed(double accelerationSpeed) override
设置指针加速度
DExpected< void > reset() override
重置数位板/数位笔的所有设置
AccelerationProfile accelerationProfile() const override
获取当前的指针加速方式
void cursorModeChanged(bool cursorMode)
光标模式改变信号
bool cursorMode() const
获取数位笔是否处于光标模式
double accelerationSpeed() const override
获取指针加速度
ScrollMethod scrollMethod() const override
获取当前滚动模式
bool leftHanded() const override
获取是否是左手模式
void setScrollMethod(ScrollMethod scrollMethod) override
设置滚动模式
void setAccelerationProfile(AccelerationProfile accelerationProfile) override
设置指针加速方式
DInputDeviceTablet(const DeviceInfo &info=DeviceInfoInitializer, bool enabled=true, QObject *parent=nullptr)
空参构造函数和指定父对象的构造函数
ScrollMethod
滚动方式
Definition: dtkinputdevices_types.h:33
AccelerationProfile
指针加速方式
Definition: dtkinputdevices_types.h:27
设备信息类
Definition: dtkinputdevices_types.h:16