DtkDevice
DTK library for device.
载入中...
搜索中...
未找到
dinputdevicesetting.h
浏览该文件的文档.
1// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd.
2//
3// SPDX-License-Identifier: LGPL-3.0-or-later
4
5#ifndef DDEVICEETTING_H
6#define DDEVICEETTING_H
7
8#include "dtkdevice_global.h"
10
11#include <DExpected>
12#include <DObject>
13
14#include <QObject>
15#include <QSharedPointer>
16
17using DInputKeyAction = DTK_DEVICE_NAMESPACE::KeyAction;
18using DInputKey = DTK_DEVICE_NAMESPACE::Key;
19DDEVICE_BEGIN_NAMESPACE
20using DCORE_NAMESPACE::DExpected;
21using DCORE_NAMESPACE::DObject;
22
23class DInputDeviceSettingPrivate;
24class LIBDTKDEVICESHARED_EXPORT DInputDeviceSetting : public QObject, public DObject
25{
26 Q_OBJECT
27 Q_PROPERTY(bool disableTouchPadWhileMouse READ disableTouchPadWhileMouse WRITE setDisableTouchPadWhileMouse NOTIFY
28 disableTouchPadWhileMouseChanged)
29 Q_PROPERTY(
30 quint32 doubleClickInterval READ doubleClickInterval WRITE setDoubleClickInterval NOTIFY doubleClickIntervalChanged)
31 Q_PROPERTY(quint32 dragThreshold READ dragThreshold WRITE setDragThreshold NOTIFY dragThresholdChanged)
32 Q_PROPERTY(bool repeatEnabled READ repeatEnabled WRITE setRepeatEnabled NOTIFY repeatEnabledChanged)
33 Q_PROPERTY(quint32 repeatDelay READ repeatDelay WRITE setRepeatDelay NOTIFY repeatDelayChanged)
34 Q_PROPERTY(quint32 repeatInterval READ repeatInterval WRITE setRepeatInterval NOTIFY repeatIntervalChanged)
35 Q_PROPERTY(qint32 cursorBlinkInterval READ cursorBlinkInterval WRITE setCursorBlinkInterval NOTIFY cursorBlinkIntervalChanged)
36 Q_PROPERTY(quint32 wheelSpeed READ wheelSpeed WRITE setWheelSpeed NOTIFY wheelSpeedChanged)
37
38public:
39 using Ptr = QSharedPointer<DInputDeviceSetting>;
40 ~DInputDeviceSetting() override;
41
42 bool disableTouchPadWhileMouse() const;
43 quint32 doubleClickInterval() const;
44 quint32 dragThreshold() const;
45 bool repeatEnabled() const;
46 quint32 repeatDelay() const;
47 quint32 repeatInterval() const;
48 qint32 cursorBlinkInterval() const;
49 quint32 wheelSpeed() const;
50
51 void setDisableTouchPadWhileMouse(bool disabled);
52 void setDoubleClickInterval(quint32 interval);
53 void setDragThreshold(quint32 distance);
54 void setRepeatEnabled(bool enabled);
55 void setRepeatDelay(quint32 delay);
56 void setRepeatInterval(quint32 interval);
57 void setCursorBlinkInterval(qint32 interval);
58 void setWheelSpeed(quint32 speed);
59
60Q_SIGNALS:
61 void disableTouchPadWhileMouseChanged(bool disabled);
62 void doubleClickIntervalChanged(quint32 interval);
63 void dragThresholdChanged(quint32 distance);
64 void repeatEnabledChanged(bool enabled);
65 void repeatDelayChanged(quint32 delay);
66 void repeatIntervalChanged(quint32 interval);
67 void cursorBlinkIntervalChanged(qint32 interval);
68 void wheelSpeedChanged(quint32 speed);
69
70public Q_SLOTS:
71 DExpected<quint32> pressureSensitivity(quint32 id);
72 DExpected<quint32> rawSampleSize(quint32 id);
73 DExpected<quint32> pressureThreshold(quint32 id);
74 DExpected<bool> forceProportions(quint32 id);
75 DExpected<QString> mapOutput(quint32 id);
76 DExpected<bool> mouseEnterRemap(quint32 id);
77 DExpected<quint32> suppress(quint32 id);
78 DExpected<void> setPressureSensitivity(quint32 id, quint32 sensitivity);
79 DExpected<void> setRawSampleSize(quint32 id, quint32 size);
80 DExpected<void> setPressureThreshold(quint32 id, quint32 threshold);
81 DExpected<void> setForceProportions(quint32 id, bool force);
82 DExpected<void> setMouseEnterRemap(quint32 id, bool remap);
83 DExpected<void> setSuppress(quint32 id, quint32 suppress);
84 DExpected<DInputKeyAction> keymap(quint32 id, DInputKey key);
85 DExpected<void> setKeymap(quint32 id, DInputKey key, DInputKeyAction action);
86
87private:
88 explicit DInputDeviceSetting(QObject *parent = nullptr);
89 friend class DInputDeviceManager;
90 D_DECLARE_PRIVATE(DInputDeviceSetting)
91};
92DDEVICE_END_NAMESPACE
93
94#endif
Manager类
Definition dinputdevicemanager.h:27
全局设置类
Definition dinputdevicesetting.h:25