DtkDevice
DTK library for device.
dinputdevicepointer.h
浏览该文件的文档.
1// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd.
2//
3// SPDX-License-Identifier: LGPL-3.0-or-later
4
5#ifndef DINPUTDEVICEPOINTER_H
6#define DINPUTDEVICEPOINTER_H
7
8#include "dtkdevice_global.h"
9
10#include <DExpected>
11#include <QObject>
12
13#include "dinputdevicegeneric.h"
15
16DDEVICE_BEGIN_NAMESPACE
17
18class DInputDevicePointerPrivate;
19class LIBDTKDEVICESHARED_EXPORT DInputDevicePointer : public DInputDeviceGeneric
20{
21 Q_OBJECT
22 Q_PROPERTY(bool leftHanded READ leftHanded WRITE setLeftHanded NOTIFY leftHandedChanged)
23 Q_PROPERTY(ScrollMethod scrollMethod READ scrollMethod WRITE setScrollMethod NOTIFY scrollMethodChanged)
24 Q_PROPERTY(AccelerationProfile accelerationProfile READ accelerationProfile WRITE setAccelerationProfile NOTIFY
25 accelerationProfileChanged)
26 Q_PROPERTY(double accelerationSpeed READ accelerationSpeed WRITE setAccelerationSpeed NOTIFY accelerationSpeedChanged)
27
28public:
29 ~DInputDevicePointer() override;
30
31 virtual bool leftHanded() const = 0;
32 virtual ScrollMethod scrollMethod() const = 0;
34 virtual double accelerationSpeed() const = 0;
35
36 virtual void setLeftHanded(bool leftHanded) = 0;
37 virtual void setScrollMethod(ScrollMethod scrollMethod) = 0;
38 virtual void setAccelerationProfile(AccelerationProfile accelerationProfile) = 0;
39 virtual void setAccelerationSpeed(double accelerationSpeed) = 0;
40
41Q_SIGNALS:
42 void leftHandedChanged(bool leftHanded);
45 void accelerationSpeedChanged(double speed);
46
47protected:
48 explicit DInputDevicePointer(const DeviceInfo &info = DeviceInfoInitializer, bool enabled = true, QObject *parent = nullptr);
49 DInputDevicePointer(DInputDevicePointerPrivate &dd, const DeviceInfo &info, bool enabled = true, QObject *parent = nullptr);
50
51private:
52 D_DECLARE_PRIVATE(DInputDevicePointer)
53};
54
55DDEVICE_END_NAMESPACE
56#endif
基本设备类
Definition: dinputdevicegeneric.h:23
抽象指针设备类
Definition: dinputdevicepointer.h:20
virtual void setScrollMethod(ScrollMethod scrollMethod)=0
设置滚动模式
virtual double accelerationSpeed() const =0
获取指针加速度
void accelerationSpeedChanged(double speed)
指针加速度修改信号
void accelerationProfileChanged(AccelerationProfile profile)
指针加速方式切换信号
virtual void setAccelerationSpeed(double accelerationSpeed)=0
设置指针加速度
void leftHandedChanged(bool leftHanded)
左手模式切换信号
virtual AccelerationProfile accelerationProfile() const =0
获取当前的指针加速方式
virtual ScrollMethod scrollMethod() const =0
获取当前滚动模式
virtual void setAccelerationProfile(AccelerationProfile accelerationProfile)=0
设置指针加速方式
void scrollMethodChanged(ScrollMethod method)
滚动模式切换信号
virtual void setLeftHanded(bool leftHanded)=0
设置是否是左手模式
virtual bool leftHanded() const =0
获取是否是左手模式
ScrollMethod
滚动方式
Definition: dtkinputdevices_types.h:33
AccelerationProfile
指针加速方式
Definition: dtkinputdevices_types.h:27
设备信息类
Definition: dtkinputdevices_types.h:16