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#ifndef QDBUSMENUBAR_P_H
5#define QDBUSMENUBAR_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <private/qdbusplatformmenu_p.h>
19#include <private/qdbusmenuadaptor_p.h>
20#include <QtCore/QHash>
21#include <QtCore/QString>
22#include <QtGui/QWindow>
23
24QT_BEGIN_NAMESPACE
25
26class QDBusMenuBar : public QPlatformMenuBar
27{
28 Q_OBJECT
29
30public:
31 QDBusMenuBar();
32 virtual ~QDBusMenuBar();
33
34 void insertMenu(QPlatformMenu *menu, QPlatformMenu *before) override;
35 void removeMenu(QPlatformMenu *menu) override;
36 void syncMenu(QPlatformMenu *menu) override;
37 void handleReparent(QWindow *newParentWindow) override;
38 QPlatformMenu *menuForTag(quintptr tag) const override;
39 QPlatformMenu *createMenu() const override;
40
41private:
42 QDBusPlatformMenu *m_menu;
43 QDBusMenuAdaptor *m_menuAdaptor;
44 QHash<quintptr, QDBusPlatformMenuItem *> m_menuItems;
45 uint m_windowId;
46 QString m_objectPath;
47
48 QDBusPlatformMenuItem *menuItemForMenu(QPlatformMenu *menu);
49 static void updateMenuItem(QDBusPlatformMenuItem *item, QPlatformMenu *menu);
50 void registerMenuBar();
51 void unregisterMenuBar();
52};
53
54QT_END_NAMESPACE
55
56#endif // QDBUSMENUBAR_P_H
57

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