| 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 | #if QT_CONFIG(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 | #if QT_CONFIG(shortcut) | 
|---|
| 127 | QKeySequence ; | 
|---|
| 128 | #endif | 
|---|
| 129 | }; | 
|---|
| 130 |  | 
|---|
| 131 | class  : public QPlatformMenu | 
|---|
| 132 | { | 
|---|
| 133 | Q_OBJECT | 
|---|
| 134 |  | 
|---|
| 135 | public: | 
|---|
| 136 | (); | 
|---|
| 137 | (); | 
|---|
| 138 | void (QPlatformMenuItem *, QPlatformMenuItem *before) override; | 
|---|
| 139 | void (QPlatformMenuItem *) override; | 
|---|
| 140 | void (const QDBusPlatformMenu *); | 
|---|
| 141 | void (QPlatformMenuItem *) override; | 
|---|
| 142 | void (bool enable) override { Q_UNUSED(enable); } | 
|---|
| 143 |  | 
|---|
| 144 | const QString () const { return m_text; } | 
|---|
| 145 | void (const QString &text) override; | 
|---|
| 146 | QIcon () const { return m_icon; } | 
|---|
| 147 | void (const QIcon &icon) override; | 
|---|
| 148 | bool () const override { return m_isEnabled; } | 
|---|
| 149 | void (bool enabled) override; | 
|---|
| 150 | bool () const { return m_isVisible; } | 
|---|
| 151 | void (bool visible) override; | 
|---|
| 152 | void (int width) override { Q_UNUSED(width); } | 
|---|
| 153 | void (const QFont &font) override { Q_UNUSED(font); } | 
|---|
| 154 | void (MenuType type) override { Q_UNUSED(type); } | 
|---|
| 155 | void (QDBusPlatformMenuItem *item); | 
|---|
| 156 |  | 
|---|
| 157 | void (const QWindow *parentWindow, const QRect &targetRect, const QPlatformMenuItem *item) override; | 
|---|
| 158 |  | 
|---|
| 159 | void () override { } // Closes this and all its related menu popups | 
|---|
| 160 |  | 
|---|
| 161 | QPlatformMenuItem *(int position) const override; | 
|---|
| 162 | QPlatformMenuItem *(quintptr tag) const override; | 
|---|
| 163 | const QList<QDBusPlatformMenuItem *> () const; | 
|---|
| 164 |  | 
|---|
| 165 | QPlatformMenuItem *() const override; | 
|---|
| 166 | QPlatformMenu *() const override; | 
|---|
| 167 |  | 
|---|
| 168 | uint () const { return m_revision; } | 
|---|
| 169 |  | 
|---|
| 170 | void (); | 
|---|
| 171 |  | 
|---|
| 172 | signals: | 
|---|
| 173 | void (uint revision, int dbusId); | 
|---|
| 174 | void (QDBusMenuItemList updatedProps, QDBusMenuItemKeysList removedProps); | 
|---|
| 175 | void (int id, uint timestamp); | 
|---|
| 176 |  | 
|---|
| 177 | private: | 
|---|
| 178 | QString ; | 
|---|
| 179 | QIcon ; | 
|---|
| 180 | bool ; | 
|---|
| 181 | bool ; | 
|---|
| 182 | uint ; | 
|---|
| 183 | QHash<quintptr, QDBusPlatformMenuItem *> ; | 
|---|
| 184 | QList<QDBusPlatformMenuItem *> ; | 
|---|
| 185 | QDBusPlatformMenuItem *; | 
|---|
| 186 | }; | 
|---|
| 187 |  | 
|---|
| 188 | QT_END_NAMESPACE | 
|---|
| 189 |  | 
|---|
| 190 | #endif | 
|---|
| 191 |  | 
|---|
| 192 |  | 
|---|