2023-02-03 18:01:06 +08:00
|
|
|
//
|
|
|
|
// Created by zpf on 23-2-2.
|
|
|
|
//
|
|
|
|
|
|
|
|
#ifndef UKUI_NOTIFICATION_NOTIFICATION_CLIENT_H
|
|
|
|
#define UKUI_NOTIFICATION_NOTIFICATION_CLIENT_H
|
|
|
|
#include "ukui-notification_global.h"
|
|
|
|
#include <QObject>
|
2023-02-06 17:03:12 +08:00
|
|
|
#include "popup-notification.h"
|
2023-03-08 16:57:51 +08:00
|
|
|
#include "notification-close-reason.h"
|
2023-02-03 18:01:06 +08:00
|
|
|
namespace UkuiNotification {
|
|
|
|
class NotificationClientPrivate;
|
|
|
|
class UKUINOTIFICATION_EXPORT NotificationClient : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2023-02-16 09:28:41 +08:00
|
|
|
explicit NotificationClient(QObject *parent = nullptr);
|
2023-02-06 17:03:12 +08:00
|
|
|
~NotificationClient();
|
|
|
|
/**
|
|
|
|
* 注册成为弹窗通知客户端
|
|
|
|
* @return ture-成功 false 失败
|
|
|
|
*/
|
2023-02-03 18:01:06 +08:00
|
|
|
bool registerClient();
|
2023-02-17 16:54:45 +08:00
|
|
|
void unregisterClient();
|
2023-03-08 16:57:51 +08:00
|
|
|
bool closeNotification(uint id, NotificationCloseReason::CloseReason reason);
|
2023-02-17 16:54:45 +08:00
|
|
|
bool invokeAction(uint id, const QString &action_key);
|
2023-02-06 17:03:12 +08:00
|
|
|
Q_SIGNALS:
|
2023-03-08 16:57:51 +08:00
|
|
|
void newNotification(const UkuiNotification::PopupNotification ¬ification);
|
|
|
|
void notificationClosed(uint id, UkuiNotification::NotificationCloseReason::CloseReason closeReason);
|
2023-02-03 18:01:06 +08:00
|
|
|
private:
|
|
|
|
NotificationClientPrivate *d = nullptr;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // UkuiNotification
|
|
|
|
|
|
|
|
#endif //UKUI_NOTIFICATION_NOTIFICATION_CLIENT_H
|