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

46 lines
1.5 KiB
C
Raw Normal View History

2023-02-03 18:01:06 +08:00
//
// Created by zpf on 23-2-3.
//
#ifndef UKUI_NOTIFICATION_NOTIFICATION_CLIENT_PRIVATE_H
#define UKUI_NOTIFICATION_NOTIFICATION_CLIENT_PRIVATE_H
#include <QObject>
#include <QDBusInterface>
#include "notifications_interface.h"
2023-02-06 17:03:12 +08:00
#include "notification-client.h"
2023-02-03 18:01:06 +08:00
namespace UkuiNotification {
class NotificationClientPrivate : public QObject
{
Q_OBJECT
public:
2023-02-06 17:03:12 +08:00
explicit NotificationClientPrivate(NotificationClient *q, QObject *parent = nullptr);
2023-02-03 18:01:06 +08:00
~NotificationClientPrivate() override;
bool init();
2023-02-03 18:01:06 +08:00
static QString clientServicePath();
static QString clientServiceInterface();
void Notify(const QString &app_name,
uint replaces_id,
const QString &app_icon,
const QString &summary,
const QString &body,
const QStringList &actions,
const QVariantMap &hints,
int timeout);
2023-02-06 17:03:12 +08:00
void closeNotification(uint id, NotificationClient::CloseReason reason);
2023-02-14 17:21:09 +08:00
void invokeAction(uint id, const QString &action_key);
private Q_SLOTS:
2023-02-06 17:03:12 +08:00
void notificationClosed(uint id, uint reason);
void serviceChange(const QString &service, const QString &oldOwner, const QString &newOwner);
bool registerClient();
void unRegisterClient();
private:
2023-02-03 18:01:06 +08:00
OrgFreedesktopNotificationsInterface* m_notificationsInterface = nullptr;
QDBusInterface *m_serverInterface = nullptr;
2023-02-06 17:03:12 +08:00
NotificationClient *q;
2023-02-03 18:01:06 +08:00
};
}
#endif //UKUI_NOTIFICATION_NOTIFICATION_CLIENT_PRIVATE_H