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

46 lines
1.5 KiB
C++

//
// 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"
#include "notification-client.h"
namespace UkuiNotification {
class NotificationClientPrivate : public QObject
{
Q_OBJECT
public:
explicit NotificationClientPrivate(NotificationClient *q, QObject *parent = nullptr);
~NotificationClientPrivate() override;
bool init();
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);
void closeNotification(uint id, NotificationClient::CloseReason reason);
void invokeAction(uint id, const QString &action_key, const QString &action, const QString &display);
private Q_SLOTS:
void notificationClosed(uint id, uint reason);
void serviceChange(const QString &service, const QString &oldOwner, const QString &newOwner);
bool registerClient();
void unRegisterClient();
private:
OrgFreedesktopNotificationsInterface* m_notificationsInterface = nullptr;
QDBusInterface *m_serverInterface = nullptr;
NotificationClient *q;
};
}
#endif //UKUI_NOTIFICATION_NOTIFICATION_CLIENT_PRIVATE_H