1// Copyright (C) 2016 Dmitry Shachnev <mitya57@gmail.com>
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: qdbusxml2cpp -p qdbusmenuregistrarproxy ../../3rdparty/dbus-ifaces/com.canonical.AppMenu.Registrar.xml
7 *
8 * However it is maintained manually.
9 */
10
11#ifndef QDBUSMENUREGISTRARPROXY_P_H
12#define QDBUSMENUREGISTRARPROXY_P_H
13
14//
15// W A R N I N G
16// -------------
17//
18// This file is not part of the Qt API. It exists purely as an
19// implementation detail. This header file may change from version to
20// version without notice, or even be removed.
21//
22// We mean it.
23//
24
25#include <QtCore/QObject>
26#include <QtCore/QByteArray>
27#include <QtCore/QList>
28#include <QtCore/QString>
29#include <QtCore/QVariant>
30#include <QtDBus/QDBusAbstractInterface>
31#include <QtDBus/QDBusConnection>
32#include <QtDBus/QDBusReply>
33#include <QtCore/private/qglobal_p.h>
34
35QT_BEGIN_NAMESPACE
36
37/*
38 * Proxy class for interface com.canonical.AppMenu.Registrar
39 */
40class QDBusMenuRegistrarInterface : public QDBusAbstractInterface
41{
42 Q_OBJECT
43public:
44 static inline const char *staticInterfaceName()
45 {
46 return "com.canonical.AppMenu.Registrar";
47 }
48
49public:
50 explicit QDBusMenuRegistrarInterface(const QString &service,
51 const QString &path,
52 const QDBusConnection &connection,
53 QObject *parent = nullptr);
54
55 ~QDBusMenuRegistrarInterface();
56
57public Q_SLOTS: // METHODS
58 QDBusPendingReply<QString, QDBusObjectPath> GetMenuForWindow(uint windowId)
59 {
60 return asyncCall(QStringLiteral("GetMenuForWindow"), args&: windowId);
61 }
62 QDBusReply<QString> GetMenuForWindow(uint windowId, QDBusObjectPath &menuObjectPath)
63 {
64 QDBusMessage reply = call(mode: QDBus::Block, QStringLiteral("GetMenuForWindow"), args&: windowId);
65 QList<QVariant> arguments = reply.arguments();
66 if (reply.type() == QDBusMessage::ReplyMessage && arguments.size() == 2)
67 menuObjectPath = qdbus_cast<QDBusObjectPath>(v: arguments.at(i: 1));
68 return reply;
69 }
70
71 QDBusPendingReply<> RegisterWindow(uint windowId, const QDBusObjectPath &menuObjectPath)
72 {
73 return asyncCall(QStringLiteral("RegisterWindow"), args&: windowId, args: menuObjectPath);
74 }
75
76 QDBusPendingReply<> UnregisterWindow(uint windowId)
77 {
78 return asyncCall(QStringLiteral("UnregisterWindow"), args&: windowId);
79 }
80};
81
82QT_END_NAMESPACE
83
84#endif // QDBUSMENUREGISTRARPROXY_P_H
85

source code of qtbase/src/gui/platform/unix/dbusmenu/qdbusmenuregistrarproxy_p.h