1 | // Copyright (C) 2016 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 | #ifndef QDBUSPLATFORMMENU_H |
5 | #define |
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 | // W A R N I N G |
19 | // ------------- |
20 | // |
21 | // This file is part of the DBus menu support and is not meant to be used |
22 | // in applications. Usage of this API may make your code |
23 | // source and binary incompatible with future versions of Qt. |
24 | // |
25 | |
26 | #include <qpa/qplatformmenu.h> |
27 | #include <QLoggingCategory> |
28 | #include "qdbusmenutypes_p.h" |
29 | |
30 | QT_BEGIN_NAMESPACE |
31 | Q_DECLARE_LOGGING_CATEGORY() |
32 | |
33 | class QDBusPlatformMenu; |
34 | |
35 | class : public QPlatformMenuItem |
36 | { |
37 | Q_OBJECT |
38 | |
39 | public: |
40 | (); |
41 | (); |
42 | |
43 | const QString () const { return m_text; } |
44 | void (const QString &text) override; |
45 | QIcon () const { return m_icon; } |
46 | void (const QIcon &icon) override; |
47 | const QPlatformMenu *() const { return m_subMenu; } |
48 | void (QPlatformMenu *) override; |
49 | bool () const { return m_isEnabled; } |
50 | void (bool enabled) override; |
51 | bool () const { return m_isVisible; } |
52 | void (bool isVisible) override; |
53 | bool () const { return m_isSeparator; } |
54 | void (bool isSeparator) override; |
55 | void (const QFont &font) override { Q_UNUSED(font); } |
56 | void (MenuRole role) override; |
57 | bool () const { return m_isCheckable; } |
58 | void (bool checkable) override; |
59 | bool () const { return m_isChecked; } |
60 | void (bool isChecked) override; |
61 | bool () const { return m_hasExclusiveGroup; } |
62 | void (bool hasExclusiveGroup) override; |
63 | #if QT_CONFIG(shortcut) |
64 | QKeySequence () const { return m_shortcut; } |
65 | void (const QKeySequence& shortcut) override; |
66 | #endif |
67 | void (int size) override { Q_UNUSED(size); } |
68 | void (WId item) override { Q_UNUSED(item); } |
69 | |
70 | int () const { return m_dbusID; } |
71 | |
72 | void (); |
73 | |
74 | static QDBusPlatformMenuItem *(int id); |
75 | static QList<const QDBusPlatformMenuItem *> (const QList<int> &ids); |
76 | |
77 | private: |
78 | QString ; |
79 | QIcon ; |
80 | QPlatformMenu *; |
81 | MenuRole : 4; |
82 | bool : 1; |
83 | bool : 1; |
84 | bool : 1; |
85 | bool : 1; |
86 | bool : 1; |
87 | bool : 1; |
88 | short /*unused*/ : 6; |
89 | short : 16; |
90 | #if QT_CONFIG(shortcut) |
91 | QKeySequence ; |
92 | #endif |
93 | }; |
94 | |
95 | class : public QPlatformMenu |
96 | { |
97 | Q_OBJECT |
98 | |
99 | public: |
100 | (); |
101 | (); |
102 | void (QPlatformMenuItem *, QPlatformMenuItem *before) override; |
103 | void (QPlatformMenuItem *) override; |
104 | void (const QDBusPlatformMenu *); |
105 | void (QPlatformMenuItem *) override; |
106 | void (bool enable) override { Q_UNUSED(enable); } |
107 | |
108 | const QString () const { return m_text; } |
109 | void (const QString &text) override; |
110 | QIcon () const { return m_icon; } |
111 | void (const QIcon &icon) override; |
112 | bool () const override { return m_isEnabled; } |
113 | void (bool enabled) override; |
114 | bool () const { return m_isVisible; } |
115 | void (bool visible) override; |
116 | void (int width) override { Q_UNUSED(width); } |
117 | void (const QFont &font) override { Q_UNUSED(font); } |
118 | void (MenuType type) override { Q_UNUSED(type); } |
119 | void (QDBusPlatformMenuItem *item); |
120 | |
121 | void (const QWindow *parentWindow, const QRect &targetRect, const QPlatformMenuItem *item) override; |
122 | |
123 | void () override { } // Closes this and all its related menu popups |
124 | |
125 | QPlatformMenuItem *(int position) const override; |
126 | QPlatformMenuItem *(quintptr tag) const override; |
127 | const QList<QDBusPlatformMenuItem *> () const; |
128 | |
129 | QPlatformMenuItem *() const override; |
130 | QPlatformMenu *() const override; |
131 | |
132 | uint () const { return m_revision; } |
133 | |
134 | void (); |
135 | |
136 | signals: |
137 | void (uint revision, int dbusId); |
138 | void (QDBusMenuItemList updatedProps, QDBusMenuItemKeysList removedProps); |
139 | void (int id, uint timestamp); |
140 | |
141 | private: |
142 | QString ; |
143 | QIcon ; |
144 | bool ; |
145 | bool ; |
146 | uint ; |
147 | QHash<quintptr, QDBusPlatformMenuItem *> ; |
148 | QList<QDBusPlatformMenuItem *> ; |
149 | QDBusPlatformMenuItem *; |
150 | }; |
151 | |
152 | QT_END_NAMESPACE |
153 | |
154 | #endif |
155 | |
156 | |