| 1 | /**************************************************************************** |
| 2 | ** |
| 3 | ** Copyright (C) 2016 The Qt Company Ltd. |
| 4 | ** Contact: https://www.qt.io/licensing/ |
| 5 | ** |
| 6 | ** This file is part of the QtGui module of the Qt Toolkit. |
| 7 | ** |
| 8 | ** $QT_BEGIN_LICENSE:LGPL$ |
| 9 | ** Commercial License Usage |
| 10 | ** Licensees holding valid commercial Qt licenses may use this file in |
| 11 | ** accordance with the commercial license agreement provided with the |
| 12 | ** Software or, alternatively, in accordance with the terms contained in |
| 13 | ** a written agreement between you and The Qt Company. For licensing terms |
| 14 | ** and conditions see https://www.qt.io/terms-conditions. For further |
| 15 | ** information use the contact form at https://www.qt.io/contact-us. |
| 16 | ** |
| 17 | ** GNU Lesser General Public License Usage |
| 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser |
| 19 | ** General Public License version 3 as published by the Free Software |
| 20 | ** Foundation and appearing in the file LICENSE.LGPL3 included in the |
| 21 | ** packaging of this file. Please review the following information to |
| 22 | ** ensure the GNU Lesser General Public License version 3 requirements |
| 23 | ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. |
| 24 | ** |
| 25 | ** GNU General Public License Usage |
| 26 | ** Alternatively, this file may be used under the terms of the GNU |
| 27 | ** General Public License version 2.0 or (at your option) the GNU General |
| 28 | ** Public license version 3 or any later version approved by the KDE Free |
| 29 | ** Qt Foundation. The licenses are as published by the Free Software |
| 30 | ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 |
| 31 | ** included in the packaging of this file. Please review the following |
| 32 | ** information to ensure the GNU General Public License requirements will |
| 33 | ** be met: https://www.gnu.org/licenses/gpl-2.0.html and |
| 34 | ** https://www.gnu.org/licenses/gpl-3.0.html. |
| 35 | ** |
| 36 | ** $QT_END_LICENSE$ |
| 37 | ** |
| 38 | ****************************************************************************/ |
| 39 | |
| 40 | #ifndef QDBUSPLATFORMMENU_H |
| 41 | #define |
| 42 | |
| 43 | // |
| 44 | // W A R N I N G |
| 45 | // ------------- |
| 46 | // |
| 47 | // This file is not part of the Qt API. It exists purely as an |
| 48 | // implementation detail. This header file may change from version to |
| 49 | // version without notice, or even be removed. |
| 50 | // |
| 51 | // We mean it. |
| 52 | // |
| 53 | // |
| 54 | // W A R N I N G |
| 55 | // ------------- |
| 56 | // |
| 57 | // This file is part of the DBus menu support and is not meant to be used |
| 58 | // in applications. Usage of this API may make your code |
| 59 | // source and binary incompatible with future versions of Qt. |
| 60 | // |
| 61 | |
| 62 | #include <qpa/qplatformmenu.h> |
| 63 | #include <QLoggingCategory> |
| 64 | #include "qdbusmenutypes_p.h" |
| 65 | |
| 66 | QT_BEGIN_NAMESPACE |
| 67 | Q_DECLARE_LOGGING_CATEGORY() |
| 68 | |
| 69 | class QDBusPlatformMenu; |
| 70 | |
| 71 | class : public QPlatformMenuItem |
| 72 | { |
| 73 | Q_OBJECT |
| 74 | |
| 75 | public: |
| 76 | (); |
| 77 | (); |
| 78 | |
| 79 | const QString () const { return m_text; } |
| 80 | void (const QString &text) override; |
| 81 | QIcon () const { return m_icon; } |
| 82 | void (const QIcon &icon) override; |
| 83 | const QPlatformMenu *() const { return m_subMenu; } |
| 84 | void (QPlatformMenu *) override; |
| 85 | bool () const { return m_isEnabled; } |
| 86 | void (bool enabled) override; |
| 87 | bool () const { return m_isVisible; } |
| 88 | void (bool isVisible) override; |
| 89 | bool () const { return m_isSeparator; } |
| 90 | void (bool isSeparator) override; |
| 91 | void (const QFont &font) override { Q_UNUSED(font); } |
| 92 | void (MenuRole role) override; |
| 93 | bool () const { return m_isCheckable; } |
| 94 | void (bool checkable) override; |
| 95 | bool () const { return m_isChecked; } |
| 96 | void (bool isChecked) override; |
| 97 | bool () const { return m_hasExclusiveGroup; } |
| 98 | void (bool hasExclusiveGroup) override; |
| 99 | #ifndef QT_NO_SHORTCUT |
| 100 | QKeySequence () const { return m_shortcut; } |
| 101 | void (const QKeySequence& shortcut) override; |
| 102 | #endif |
| 103 | void (int size) override { Q_UNUSED(size); } |
| 104 | void (WId item) override { Q_UNUSED(item); } |
| 105 | |
| 106 | int () const { return m_dbusID; } |
| 107 | |
| 108 | void (); |
| 109 | |
| 110 | static QDBusPlatformMenuItem *(int id); |
| 111 | static QList<const QDBusPlatformMenuItem *> (const QList<int> &ids); |
| 112 | |
| 113 | private: |
| 114 | QString ; |
| 115 | QIcon ; |
| 116 | QPlatformMenu *; |
| 117 | MenuRole : 4; |
| 118 | bool : 1; |
| 119 | bool : 1; |
| 120 | bool : 1; |
| 121 | bool : 1; |
| 122 | bool : 1; |
| 123 | bool : 1; |
| 124 | short /*unused*/ : 6; |
| 125 | short : 16; |
| 126 | QKeySequence ; |
| 127 | }; |
| 128 | |
| 129 | class : public QPlatformMenu |
| 130 | { |
| 131 | Q_OBJECT |
| 132 | |
| 133 | public: |
| 134 | (); |
| 135 | (); |
| 136 | void (QPlatformMenuItem *, QPlatformMenuItem *before) override; |
| 137 | void (QPlatformMenuItem *) override; |
| 138 | void (const QDBusPlatformMenu *); |
| 139 | void (QPlatformMenuItem *) override; |
| 140 | void (bool enable) override { Q_UNUSED(enable); } |
| 141 | |
| 142 | const QString () const { return m_text; } |
| 143 | void (const QString &text) override; |
| 144 | QIcon () const { return m_icon; } |
| 145 | void (const QIcon &icon) override; |
| 146 | bool () const override { return m_isEnabled; } |
| 147 | void (bool enabled) override; |
| 148 | bool () const { return m_isVisible; } |
| 149 | void (bool visible) override; |
| 150 | void (int width) override { Q_UNUSED(width); } |
| 151 | void (const QFont &font) override { Q_UNUSED(font); } |
| 152 | void (MenuType type) override { Q_UNUSED(type); } |
| 153 | void (QDBusPlatformMenuItem *item); |
| 154 | |
| 155 | void (const QWindow *parentWindow, const QRect &targetRect, const QPlatformMenuItem *item) override; |
| 156 | |
| 157 | void () override { } // Closes this and all its related menu popups |
| 158 | |
| 159 | QPlatformMenuItem *(int position) const override; |
| 160 | QPlatformMenuItem *(quintptr tag) const override; |
| 161 | const QList<QDBusPlatformMenuItem *> () const; |
| 162 | |
| 163 | QPlatformMenuItem *() const override; |
| 164 | QPlatformMenu *() const override; |
| 165 | |
| 166 | uint () const { return m_revision; } |
| 167 | |
| 168 | void (); |
| 169 | |
| 170 | signals: |
| 171 | void (uint revision, int dbusId); |
| 172 | void (QDBusMenuItemList updatedProps, QDBusMenuItemKeysList removedProps); |
| 173 | void (int id, uint timestamp); |
| 174 | |
| 175 | private: |
| 176 | QString ; |
| 177 | QIcon ; |
| 178 | bool ; |
| 179 | bool ; |
| 180 | uint ; |
| 181 | QHash<quintptr, QDBusPlatformMenuItem *> ; |
| 182 | QList<QDBusPlatformMenuItem *> ; |
| 183 | QDBusPlatformMenuItem *; |
| 184 | }; |
| 185 | |
| 186 | QT_END_NAMESPACE |
| 187 | |
| 188 | #endif |
| 189 | |
| 190 | |