37 lines
1.1 KiB
C++
37 lines
1.1 KiB
C++
//
|
|
// 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>
|
|
#include "popup-notification.h"
|
|
#include "notification-close-reason.h"
|
|
namespace UkuiNotification {
|
|
class NotificationClientPrivate;
|
|
class UKUINOTIFICATION_EXPORT NotificationClient : public QObject
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
explicit NotificationClient(QObject *parent = nullptr);
|
|
~NotificationClient();
|
|
/**
|
|
* 注册成为弹窗通知客户端
|
|
* @return ture-成功 false 失败
|
|
*/
|
|
bool registerClient();
|
|
void unregisterClient();
|
|
bool closeNotification(uint id, NotificationCloseReason::CloseReason reason);
|
|
bool invokeAction(uint id, const QString &action_key);
|
|
Q_SIGNALS:
|
|
void newNotification(const UkuiNotification::PopupNotification ¬ification);
|
|
void notificationClosed(uint id, UkuiNotification::NotificationCloseReason::CloseReason closeReason);
|
|
private:
|
|
NotificationClientPrivate *d = nullptr;
|
|
};
|
|
|
|
} // UkuiNotification
|
|
|
|
#endif //UKUI_NOTIFICATION_NOTIFICATION_CLIENT_H
|