dtknotifications
notification development tool kit
dnotificationdndmodeconfig.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 <QObject>
8#include "dtknotification_global.h"
10
11DNOTIFICATIONS_BEGIN_NAMESPACE
12
13class DNotificationDNDModeConfigPrivate;
15{
16 Q_OBJECT
17 Q_PROPERTY(bool DNDModeInLockScreenEnabled READ DNDModeInLockScreenEnabled WRITE setDNDModeInLockScreenEnabled NOTIFY DNDModeInLockScreenEnabledChanged)
18 Q_PROPERTY(bool openByTimeIntervalEnabled READ openByTimeIntervalEnabled WRITE setOpenByTimeIntervalEnabled NOTIFY openByTimeIntervalEnabledChanged)
19 Q_PROPERTY(QString startTime READ startTime WRITE setStartTime NOTIFY startTimeChanged)
20 Q_PROPERTY(QString endTime READ endTime WRITE setEndTime NOTIFY endTimeChanged)
21 Q_PROPERTY(bool showIconEnabled READ showIconEnabled WRITE setShowIconEnabled NOTIFY showIconEnabledChanged)
22 Q_DECLARE_PRIVATE(DNotificationDNDModeConfig)
23
24public:
25 DNotificationDNDModeConfig(const QString &name, QObject *parent = nullptr);
27
28 bool enabled() const override;
29 DExpected<void> setEnabled(bool enabled) override;
30
32 DExpected<void> setDNDModeInLockScreenEnabled(bool enabled);
33
35 DExpected<void> setOpenByTimeIntervalEnabled(bool enabled);
36
37 QString startTime() const;
38 DExpected<void> setStartTime(const QString &startTime);
39
40 QString endTime() const;
41 DExpected<void> setEndTime(const QString &endTime);
42
43 bool showIconEnabled() const;
44 DExpected<void> setShowIconEnabled(bool enabled);
45
46Q_SIGNALS:
47 void DNDModeInLockScreenEnabledChanged(const bool enabled);
48 void openByTimeIntervalEnabledChanged(const bool enabled);
49 void startTimeChanged(const QString& startTime);
50 void endTimeChanged(const QString& endTime);
51 void showIconEnabledChanged(const bool enabled);
52};
53typedef QSharedPointer<DNotificationDNDModeConfig> DNotificationDNDModeConfigPtr;
54
55DNOTIFICATIONS_END_NAMESPACE
DAbstractModeNotificationConfig类
Definition: dabstractnotificationmodeconfig.h:18
DNotificationDNDModeConfig类
Definition: dnotificationdndmodeconfig.h:15
void endTimeChanged(const QString &endTime)
勿扰模式的结束时间发生变化后发出的信号
bool showIconEnabled() const
判断dde-dock是否展示通知中心图标
void DNDModeInLockScreenEnabledChanged(const bool enabled)
锁屏界面是否启用勿扰模式的配置发生变化后发出的信号
QString startTime() const
获取勿扰模式启动时间
bool DNDModeInLockScreenEnabled() const
判断在锁屏界面是否启用勿扰模式
DExpected< void > setDNDModeInLockScreenEnabled(bool enabled)
设置在锁屏界面是否启用勿扰模式
DExpected< void > setEndTime(const QString &endTime)
设置勿扰模式结束时间
void startTimeChanged(const QString &startTime)
勿扰模式的启动时间发生变化后发出的信号
DExpected< void > setShowIconEnabled(bool enabled)
设置de-dock是否展示通知中心图标
QString endTime() const
获取勿扰模式结束时间
void openByTimeIntervalEnabledChanged(const bool enabled)
是否打开时间段的配置发生变化后发出的信号
DExpected< void > setStartTime(const QString &startTime)
设置勿扰模式启动时间
bool enabled() const override
判断是否启用了勿扰模式
DExpected< void > setOpenByTimeIntervalEnabled(bool enabled)
设置是否打开时间段
DExpected< void > setEnabled(bool enabled) override
设置是否启用勿扰模式
DNotificationDNDModeConfig(const QString &name, QObject *parent=nullptr)
构造通知系统配置对象
void showIconEnabledChanged(const bool enabled)
dde-dock是否展示通知中心图标的配置发生变化后发出的信号
bool openByTimeIntervalEnabled() const
判断是否打开时间段