2016-03-17 19:46:40 +11:00
|
|
|
#ifndef NOTIFICATIONDBUS_H
|
|
|
|
#define NOTIFICATIONDBUS_H
|
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
#include <QDBusConnection>
|
2016-03-29 17:42:24 +11:00
|
|
|
#include <QDBusMessage>
|
2016-03-17 19:46:40 +11:00
|
|
|
#include <QApplication>
|
2016-05-01 22:01:03 +10:00
|
|
|
#include <QIcon>
|
2016-03-17 19:46:40 +11:00
|
|
|
#include "notificationdialog.h"
|
2016-03-29 17:42:24 +11:00
|
|
|
#include "notifications_adaptor.h"
|
2016-05-01 22:01:03 +10:00
|
|
|
#include "infopanedropdown.h"
|
2016-03-29 17:42:24 +11:00
|
|
|
|
|
|
|
class NotificationDialog;
|
2016-03-17 19:46:40 +11:00
|
|
|
|
2016-05-29 17:03:52 +10:00
|
|
|
class InfoPaneDropdown;
|
|
|
|
|
2016-03-17 19:46:40 +11:00
|
|
|
class NotificationDBus : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
Q_CLASSINFO("D-Bus Interface", "org.freedesktop.Notifications")
|
|
|
|
public:
|
|
|
|
explicit NotificationDBus(QObject *parent = 0);
|
2016-05-29 17:03:52 +10:00
|
|
|
void setDropdownPane(InfoPaneDropdown* pane);
|
2016-03-17 19:46:40 +11:00
|
|
|
|
|
|
|
Q_SIGNALS:
|
2016-08-20 16:26:35 +10:00
|
|
|
Q_SCRIPTABLE void NotificationClosed(uint id, uint reason);
|
2016-03-29 17:42:24 +11:00
|
|
|
Q_SCRIPTABLE void ActionInvoked(uint id, QString action_key);
|
2016-05-01 22:01:03 +10:00
|
|
|
void newNotification(int id, QString summary, QString body, QIcon icon);
|
|
|
|
void removeNotification(int id);
|
2016-03-17 19:46:40 +11:00
|
|
|
|
|
|
|
public Q_SLOTS:
|
|
|
|
QStringList GetCapabilities();
|
|
|
|
uint Notify(QString app_name, uint replaces_id,
|
|
|
|
QString app_icon, QString summary,
|
|
|
|
QString body, QStringList actions,
|
|
|
|
QVariantMap hints, int expire_timeout);
|
2016-08-20 16:26:35 +10:00
|
|
|
void CloseNotification(uint id);
|
2016-03-29 17:42:24 +11:00
|
|
|
QString GetServerInformation(QString &vendor,
|
|
|
|
QString &version, QString &spec_version);
|
2016-08-20 16:26:35 +10:00
|
|
|
void invokeAction(uint id, QString key);
|
2016-03-17 19:46:40 +11:00
|
|
|
|
|
|
|
protected Q_SLOTS:
|
2016-03-29 17:42:24 +11:00
|
|
|
void sendCloseNotification(int id, int reason);
|
2016-05-01 22:01:03 +10:00
|
|
|
void CloseNotificationUserInitiated(int id);
|
2016-03-17 19:46:40 +11:00
|
|
|
|
|
|
|
private:
|
|
|
|
QList<NotificationDialog*> dialogs;
|
|
|
|
int nextId = 1;
|
2016-05-29 17:03:52 +10:00
|
|
|
|
|
|
|
InfoPaneDropdown* dropdownPane = NULL;
|
2016-03-17 19:46:40 +11:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // NOTIFICATIONDBUS_H
|