7#include "dtkpower_global.h"
13using DCORE_NAMESPACE::DExpected;
15class DPowerSettingsPrivate;
27 Q_PROPERTY(QString cpuGovernor READ cpuGovernor NOTIFY cpuGovernorChanged);
28 Q_PROPERTY(
PowerMode powerMode READ powerMode WRITE setPowerMode NOTIFY powerModeChanged);
29 Q_PROPERTY(
bool autoPowerSavingOnBattery READ autoPowerSavingOnBattery WRITE setAutoPowerSavingOnBattery NOTIFY
30 autoPowerSavingOnBatteryChanged);
31 Q_PROPERTY(
bool autoPowerSavingWhenBatteryLow READ autoPowerSavingWhenBatteryLow WRITE setAutoPowerSavingWhenBatteryLow NOTIFY
32 autoPowerSavingWhenBatteryLowChanged);
33 Q_PROPERTY(quint32 powerSavingBrightnessDropPercent READ powerSavingBrightnessDropPercent WRITE
34 setPowerSavingBrightnessDropPercent NOTIFY powerSavingBrightnessDropPercentChanged);
35 Q_PROPERTY(
LidClosedAction batteryLidClosedAction READ batteryLidClosedAction WRITE setBatteryLidClosedAction NOTIFY
36 batteryLidClosedActionChanged);
37 Q_PROPERTY(qint32 batteryLockDelay READ batteryLockDelay WRITE setBatteryLockDelay NOTIFY batteryLockDelayChanged);
38 Q_PROPERTY(
PowerBtnAction batteryPressPowerBtnAction READ batteryPressPowerBtnAction WRITE setBatteryPressPowerBtnAction
39 NOTIFY batteryPressPowerBtnActionChanged);
40 Q_PROPERTY(qint32 batteryScreenBlackDelay READ batteryScreenBlackDelay WRITE setBatteryScreenBlackDelay NOTIFY
41 batteryScreenBlackDelayChanged);
42 Q_PROPERTY(qint32 batteryScreensaverDelay READ batteryScreensaverDelay WRITE setBatteryScreensaverDelay NOTIFY
43 batteryScreensaverDelayChanged);
44 Q_PROPERTY(qint32 batterySleepDelay READ batterySleepDelay WRITE setBatterySleepDelay NOTIFY batterySleepDelayChanged);
45 Q_PROPERTY(
LidClosedAction linePowerLidClosedAction READ linePowerLidClosedAction WRITE setLinePowerLidClosedAction NOTIFY
46 linePowerLidClosedActionChanged);
47 Q_PROPERTY(qint32 linePowerLockDelay READ linePowerLockDelay WRITE setLinePowerLockDelay NOTIFY linePowerLockDelayChanged);
48 Q_PROPERTY(
PowerBtnAction linePowerPressPowerBtnAction READ linePowerPressPowerBtnAction WRITE setLinePowerPressPowerBtnAction
49 NOTIFY linePowerPressPowerBtnActionChanged);
50 Q_PROPERTY(qint32 linePowerScreenBlackDelay READ linePowerScreenBlackDelay WRITE setLinePowerScreenBlackDelay NOTIFY
51 linePowerScreenBlackDelayChanged);
52 Q_PROPERTY(qint32 linePowerScreensaverDelay READ linePowerScreensaverDelay WRITE setLinePowerScreensaverDelay NOTIFY
53 linePowerScreensaverDelayChanged);
55 qint32 linePowerSleepDelay READ linePowerSleepDelay WRITE setLinePowerSleepDelay NOTIFY linePowerSleepDelayChanged);
56 Q_PROPERTY(qint32 lowPowerAutoSleepThreshold READ lowPowerAutoSleepThreshold WRITE setLowPowerAutoSleepThreshold NOTIFY
57 lowPowerAutoSleepThresholdChanged);
59 bool lowPowerNotifyEnable READ lowPowerNotifyEnable WRITE setLowPowerNotifyEnable NOTIFY lowPowerNotifyEnableChanged);
60 Q_PROPERTY(qint32 lowPowerNotifyThreshold READ lowPowerNotifyThreshold WRITE setLowPowerNotifyThreshold NOTIFY
61 lowPowerNotifyThresholdChanged);
62 Q_PROPERTY(
bool screenBlackLock READ screenBlackLock WRITE setScreenBlackLock NOTIFY screenBlackLockChanged);
63 Q_PROPERTY(
bool sleepLock READ sleepLock WRITE setSleepLock NOTIFY sleepLockChanged);
71 quint32 powerSavingBrightnessDropPercent()
const;
72 void setPowerSavingBrightnessDropPercent(
const quint32 value);
133 void cpuBoostChanged(
const bool value);
139 QScopedPointer<DPowerSettingsPrivate> d_ptr;
电源策略设置类
Definition dpowersettings.h:21
bool autoPowerSavingWhenBatteryLow() const
是否开启在使用电池且电量低的时候开启自动节能模式, 电池电量低将自动调整电源模式到节能
void setAutoPowerSavingWhenBatteryLow(const bool enabled)
设置开启在使用电池且电量低的时候开启自动节能模式, 电池电量低将自动调整电源模式到节能
void linePowerLidClosedActionChanged(const LidClosedAction &value)
void setLinePowerLidClosedAction(const LidClosedAction &value)
设置使用电源时笔记本盖子关闭行为
void autoPowerSavingOnBatteryChanged(const bool enabled)
使用电池时自动省电模式设置发生改变
qint32 linePowerSleepDelay() const
使用电源时休眠延时
qint32 batteryLockDelay() const
使用电池的时锁屏延时
void setLowPowerAutoSleepThreshold(const qint32 value)
设置低电量自动睡眠阈值
void batteryPressPowerBtnActionChanged(const PowerBtnAction &value)
使用电池时按压电源按钮的行为发生改变
bool lowPowerNotifyEnable() const
是否打开低电量通知
bool autoPowerSavingOnBattery() const
是否开启在使用电池的时候开启自动节能模式, 断开ac电源之后自动调整电源模式到节能
void setBatteryLockDelay(const qint32 value)
设置使用电池时锁屏延时
QString cpuGovernor() const
获取当前cpu电源策略
void setLinePowerLockDelay(const qint32 value)
设置使用电源时锁屏延时
void powerSavingModeEnabledChanged(const bool value)
void setScreenBlackLock(const bool value)
设置关闭屏幕并锁屏
void setBatteryPressPowerBtnAction(const PowerBtnAction &value)
设置使用电池时电源按钮按下的行为
qint32 lowPowerAutoSleepThreshold() const
返回低电量自动睡眠阈值
void sleepLockChanged(const bool value)
PowerBtnAction batteryPressPowerBtnAction() const
使用电池时电源按钮被按下的行为
void batteryLockDelayChanged(const qint32 value)
void setBatteryScreensaverDelay(const qint32 value)
设置使用电池时屏幕变暗省电延时
void batteryScreenBlackDelayChanged(const qint32 value)
void setSleepLock(const bool value)
设置睡眠是否锁屏
void setBatteryLidClosedAction(const LidClosedAction &value)
设置使用电池时笔记本盖子关闭行为
void linePowerSleepDelayChanged(const qint32 value)
LidClosedAction batteryLidClosedAction() const
获取使用电池时笔记本盖子关闭时的行为
void powerSavingModeBrightnessDataChanged(const QString &value)
void batteryLidClosedActionChanged(const LidClosedAction &value)
使用电池时关闭盖子的行为发生改变
void screenBlackLockChanged(const bool value)
void batterySleepDelayChanged(const qint32 value)
DPowerSettings(QObject *parent=nullptr)
构造函数
PowerBtnAction linePowerPressPowerBtnAction() const
使用电源时电源按钮被按下的行为
void setLinePowerPressPowerBtnAction(const PowerBtnAction &value)
设置使用电源时电源按钮按下的行为
void lowPowerNotifyThresholdChanged(const qint32 value)
void cpuGovernorChanged(const QString &value)
cpu电源策略发生改变
void setLinePowerScreensaverDelay(const qint32 value)
设置使用电源时屏幕变暗省电延时
void setLinePowerScreenBlackDelay(const qint32 value)
设置使用电源时关闭屏幕延时
void lowPowerAutoSleepThresholdChanged(const qint32 value)
qint32 batteryScreensaverDelay() const
使用电池时屏幕变暗省电的延时
qint32 linePowerScreenBlackDelay() const
使用电源时关闭屏幕延时
void powerModeChanged(const PowerMode &mode)
平台电源策略发生改变
void linePowerScreenBlackDelayChanged(const qint32 value)
void setAutoPowerSavingOnBattery(const bool enabled)
设置开启在使用电池的时候开启自动节能模式, 断开ac电源之后自动调整电源模式到节能
bool sleepLock() const
睡眠是否锁屏
void setLowPowerNotifyEnable(const bool value)
设置打开低电量通知
void linePowerLockDelayChanged(const qint32 value)
qint32 linePowerLockDelay() const
使用电源的时锁屏延时
qint32 linePowerScreensaverDelay() const
使用电源时屏幕变暗省电的延时
LidClosedAction linePowerLidClosedAction() const
获取使用电源时笔记本盖子关闭时的行为
PowerMode powerMode() const
获取当前系统电源策略
void linePowerPressPowerBtnActionChanged(const PowerBtnAction &value)
void setPowerMode(const PowerMode &mode)
设置当前系统电源策略
void lowPowerNotifyEnableChanged(const bool value)
qint32 lowPowerNotifyThreshold() const
低电量通知的阈值:阈值:每百分之25为一个单位
qint32 batterySleepDelay() const
使用电池时休眠延时
qint32 batteryScreenBlackDelay() const
使用电池时关闭屏幕延时
void setLowPowerNotifyThreshold(const qint32 value)
设置低电量通知的阈值:阈值:每百分之25为一个单位
void setLinePowerSleepDelay(const qint32 value)
设置使用电源时休眠延时
void setBatterySleepDelay(const qint32 value)
设置使用电池时休眠延时
bool screenBlackLock() const
屏幕关闭是否锁屏
void linePowerScreensaverDelayChanged(const qint32 value)
void powerSavingBrightnessDropPercentChanged(const quint32 value)
省电模式下屏幕亮度改变百分比发生改变
void setBatteryScreenBlackDelay(const qint32 value)
设置使用电池时关闭屏幕延时
void batteryScreensaverDelayChanged(const qint32 value)
DExpected< void > reset()
重置设置
void autoPowerSavingWhenBatteryLowChanged(const bool enabled)
在使用电池时且电池电量低开启自动节能模式设置发生改变
PowerBtnAction
按下电源键的行为
Definition dpowertypes.h:40
LidClosedAction
关闭笔记本电脑盖子的行为
Definition dpowertypes.h:38
PowerMode
键盘背光的调整来源
Definition dpowertypes.h:36