DtkSystemSettings
dtk library for systemsettings.
载入中...
搜索中...
未找到
dkbdbacklight.h
浏览该文件的文档.
1// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd.
2//
3// SPDX-License-Identifier: LGPL-3.0-or-later
4
5#pragma once
6
7#include "dtkpower_global.h"
8
9#include <dexpected.h>
10#include <qobject.h>
11#include <qscopedpointer.h>
12
13DPOWER_BEGIN_NAMESPACE
14using DCORE_NAMESPACE::DExpected;
15
16class DKbdBacklightPrivate;
17enum class KbdSource;
18
19class DKbdBacklight : public QObject
20{
21 Q_OBJECT
22public:
23 virtual ~DKbdBacklight();
24
25signals:
26 void brightnessChanged(const qint32 value);
27 void brightnessChangedWithSource(const qint32 value, const KbdSource &source);
28
29public slots:
30 DExpected<qint32> brightness() const;
31 DExpected<qint32> maxBrightness() const;
32 DExpected<void> setBrightness(const qint32 value);
33
34private:
35 QScopedPointer<DKbdBacklightPrivate> d_ptr;
36 Q_DECLARE_PRIVATE(DKbdBacklight)
37
38 explicit DKbdBacklight(QObject *parent = nullptr);
39 Q_DISABLE_COPY(DKbdBacklight)
40
41 friend class DPowerManager;
42};
43
44DPOWER_END_NAMESPACE
对于背光键盘的一些接口的封装(部分设备硬件不支持)
Definition dkbdbacklight.h:20
DExpected< void > setBrightness(const qint32 value)
设置键盘背光的亮度级别
void brightnessChangedWithSource(const qint32 value, const KbdSource &source)
信号: 键盘背光亮度级别已更改, 包括有关更改来源的信息
DExpected< qint32 > brightness() const
获取当前键盘背光亮度
void brightnessChanged(const qint32 value)
信号:键盘背光亮度发生改变
DExpected< qint32 > maxBrightness() const
获取最大键盘背光亮度
电源设备管理类, 用于管理电源设备, 包括电源设备的创建, 电源设备的属性获取, 电源设备的状态获取等
Definition dpowermanager.h:20
KbdSource
键盘背光的调整来源
Definition dpowertypes.h:34