Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qxdgnotificationproxy_p.h
Go to the documentation of this file.
1// Copyright (C) 2021 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4/*
5 This file was originally created by qdbusxml2cpp version 0.8
6 Command line was:
7 qdbusxml2cpp -p qxdgnotificationproxy ../../3rdparty/dbus-ifaces/org.freedesktop.Notifications.xml
8
9 However it is maintained manually.
10
11 It is also not part of the public API. This header file may change from
12 version to version without notice, or even be removed.
13*/
14
15#ifndef QXDGNOTIFICATIONPROXY_P_H
16#define QXDGNOTIFICATIONPROXY_P_H
17
18//
19// W A R N I N G
20// -------------
21//
22// This file is not part of the Qt API. It exists for the convenience
23// of other Qt classes. This header file may change from version to
24// version without notice, or even be removed.
25//
26// We mean it.
27//
28
29#include <QObject>
30#include <QByteArray>
31#include <QList>
32#include <QLoggingCategory>
33#include <QMap>
34#include <QString>
35#include <QStringList>
36#include <QVariant>
37#include <QDBusAbstractInterface>
38#include <QDBusPendingReply>
39#include <QDBusReply>
40#include <private/qglobal_p.h>
41
43
45
46/*
47 * Proxy class for interface org.freedesktop.Notifications
48 */
50{
52public:
53 static inline const char *staticInterfaceName()
54 { return "org.freedesktop.Notifications"; }
55
56public:
57 QXdgNotificationInterface(const QString &service, const QString &path,
58 const QDBusConnection &connection, QObject *parent = nullptr);
59
61
62public Q_SLOTS: // METHODS
64 {
65 return asyncCall(QStringLiteral("CloseNotification"), id);
66 }
67
68 inline QDBusPendingReply<QStringList> getCapabilities()
69 {
70 return asyncCall(QStringLiteral("GetCapabilities"));
71 }
72
73 inline QDBusPendingReply<QString, QString, QString, QString> getServerInformation()
74 {
75 return asyncCall(QStringLiteral("GetServerInformation"));
76 }
77 inline QDBusReply<QString> getServerInformation(QString &vendor, QString &version, QString &specVersion)
78 {
79 QDBusMessage reply = call(QDBus::Block, QStringLiteral("GetServerInformation"));
80 if (reply.type() == QDBusMessage::ReplyMessage && reply.arguments().size() == 4) {
81 vendor = qdbus_cast<QString>(reply.arguments().at(1));
82 version = qdbus_cast<QString>(reply.arguments().at(2));
83 specVersion = qdbus_cast<QString>(reply.arguments().at(3));
84 }
85 return reply;
86 }
87
88 // see https://developer.gnome.org/notification-spec/#basic-design
89 inline QDBusPendingReply<uint> notify(const QString &appName, uint replacesId, const QString &appIcon,
90 const QString &summary, const QString &body, const QStringList &actions,
91 const QVariantMap &hints, int timeout)
92 {
93 qCDebug(qLcTray) << appName << replacesId << appIcon << summary << body << actions << hints << timeout;
94 return asyncCall(QStringLiteral("Notify"), appName, replacesId, appIcon, summary, body, actions, hints, timeout);
95 }
96
98 void ActionInvoked(uint id, const QString &action_key);
99 void NotificationClosed(uint id, uint reason);
100};
101
103
104namespace org {
105 namespace freedesktop {
106 using Notifications = QT_PREPEND_NAMESPACE(QXdgNotificationInterface);
107 }
108}
109
110#endif
\inmodule QtDBus
\inmodule QtDBus
virtual qint64 size() const
For open random-access devices, this function returns the size of the device.
\inmodule QtCore
Definition qobject.h:103
\inmodule QtCore
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
void NotificationClosed(uint id, uint reason)
static const char * staticInterfaceName()
QDBusPendingReply closeNotification(uint id)
QDBusReply< QString > getServerInformation(QString &vendor, QString &version, QString &specVersion)
QDBusPendingReply< QStringList > getCapabilities()
QDBusPendingReply< uint > notify(const QString &appName, uint replacesId, const QString &appIcon, const QString &summary, const QString &body, const QStringList &actions, const QVariantMap &hints, int timeout)
QDBusPendingReply< QString, QString, QString, QString > getServerInformation()
void ActionInvoked(uint id, const QString &action_key)
Combined button and popup list for selecting options.
QT_PREPEND_NAMESPACE(QXdgNotificationInterface) Notifications
DBusConnection * connection
#define qCDebug(category,...)
#define Q_DECLARE_LOGGING_CATEGORY(name)
GLbitfield GLuint64 timeout
[4]
GLsizei const GLchar *const * path
#define QStringLiteral(str)
#define Q_OBJECT
#define Q_SLOTS
#define Q_SIGNALS
unsigned int uint
Definition qtypes.h:34
QNetworkReply * reply