ukui-notification/libukui-notification/notification-client.h

37 lines
1.1 KiB
C
Raw Normal View History

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"
#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();
void unregisterClient();
bool closeNotification(uint id, NotificationCloseReason::CloseReason reason);
bool invokeAction(uint id, const QString &action_key);
2023-02-06 17:03:12 +08:00
Q_SIGNALS:
void newNotification(const UkuiNotification::PopupNotification &notification);
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