11 #ifndef NOTIFICATIONS_H
12 #define NOTIFICATIONS_H
14 #include <QtCore/QObject>
15 #include <QtCore/QByteArray>
16 #include <QtCore/QList>
17 #include <QtCore/QMap>
18 #include <QtCore/QString>
19 #include <QtCore/QStringList>
20 #include <QtCore/QVariant>
21 #include <QtDBus/QtDBus>
30 static inline const char *staticInterfaceName()
31 {
return "org.freedesktop.Notifications"; }
39 inline QDBusPendingReply<> CloseNotification(uint
id)
42 argumentList << QVariant::fromValue(
id);
43 return asyncCallWithArgumentList(QStringLiteral(
"CloseNotification"), argumentList);
46 inline QDBusPendingReply<QStringList> GetCapabilities()
49 return asyncCallWithArgumentList(QStringLiteral(
"GetCapabilities"), argumentList);
52 inline QDBusPendingReply<QString, QString, QString, QString> GetServerInformation()
55 return asyncCallWithArgumentList(QStringLiteral(
"GetServerInformation"), argumentList);
57 inline QDBusReply<QString> GetServerInformation(QString &vendor, QString &version, QString &spec_version)
60 QDBusMessage reply = callWithArgumentList(QDBus::Block, QStringLiteral(
"GetServerInformation"), argumentList);
61 if (reply.type() == QDBusMessage::ReplyMessage && reply.arguments().count() == 4) {
62 vendor = qdbus_cast<QString>(reply.arguments().at(1));
63 version = qdbus_cast<QString>(reply.arguments().at(2));
64 spec_version = qdbus_cast<QString>(reply.arguments().at(3));
69 inline QDBusPendingReply<> 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 expire_timeout)
72 argumentList << QVariant::fromValue(app_name) << QVariant::fromValue(replaces_id) << QVariant::fromValue(app_icon) << QVariant::fromValue(summary) << QVariant::fromValue(body) << QVariant::fromValue(actions) << QVariant::fromValue(hints) << QVariant::fromValue(expire_timeout);
73 return asyncCallWithArgumentList(QStringLiteral(
"Notify"), argumentList);
77 void ActionInvoked(uint
id,
const QString &action_key);
78 void NotificationClosed(uint
id, uint reason);
82 namespace freedesktop {
83 typedef ::OrgFreedesktopNotificationsInterface Notifications;