| 1 | /**************************************************************************** |
| 2 | ** |
| 3 | ** Copyright (C) 2017 The Qt Company Ltd. |
| 4 | ** Contact: http://www.qt.io/licensing/ |
| 5 | ** |
| 6 | ** This file is part of the Qt Labs Platform module of the Qt Toolkit. |
| 7 | ** |
| 8 | ** $QT_BEGIN_LICENSE:LGPL3$ |
| 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 http://www.qt.io/terms-conditions. For further |
| 15 | ** information use the contact form at http://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.LGPLv3 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.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 later as published by the Free |
| 28 | ** Software Foundation and appearing in the file LICENSE.GPL included in |
| 29 | ** the packaging of this file. Please review the following information to |
| 30 | ** ensure the GNU General Public License version 2.0 requirements will be |
| 31 | ** met: http://www.gnu.org/licenses/gpl-2.0.html. |
| 32 | ** |
| 33 | ** $QT_END_LICENSE$ |
| 34 | ** |
| 35 | ****************************************************************************/ |
| 36 | |
| 37 | #ifndef QQUICKPLATFORMMENU_P_H |
| 38 | #define |
| 39 | |
| 40 | // |
| 41 | // W A R N I N G |
| 42 | // ------------- |
| 43 | // |
| 44 | // This file is not part of the Qt API. It exists purely as an |
| 45 | // implementation detail. This header file may change from version to |
| 46 | // version without notice, or even be removed. |
| 47 | // |
| 48 | // We mean it. |
| 49 | // |
| 50 | |
| 51 | #include <QtCore/qobject.h> |
| 52 | #include <QtCore/qurl.h> |
| 53 | #include <QtGui/qfont.h> |
| 54 | #include <QtGui/qpa/qplatformmenu.h> |
| 55 | #include <QtQml/qqmlparserstatus.h> |
| 56 | #include <QtQml/qqmllist.h> |
| 57 | #include <QtQml/qqml.h> |
| 58 | |
| 59 | #include "qquickplatformicon_p.h" |
| 60 | |
| 61 | QT_BEGIN_NAMESPACE |
| 62 | |
| 63 | class QIcon; |
| 64 | class QWindow; |
| 65 | class QQuickItem; |
| 66 | class ; |
| 67 | class QQmlV4Function; |
| 68 | class ; |
| 69 | class ; |
| 70 | class QQuickPlatformIconLoader; |
| 71 | class QQuickPlatformSystemTrayIcon; |
| 72 | |
| 73 | class : public QObject, public QQmlParserStatus |
| 74 | { |
| 75 | Q_OBJECT |
| 76 | Q_INTERFACES(QQmlParserStatus) |
| 77 | Q_PROPERTY(QQmlListProperty<QObject> data READ data FINAL) |
| 78 | Q_PROPERTY(QQmlListProperty<QQuickPlatformMenuItem> items READ items NOTIFY itemsChanged FINAL) |
| 79 | Q_PROPERTY(QQuickPlatformMenuBar *menuBar READ menuBar NOTIFY menuBarChanged FINAL) |
| 80 | Q_PROPERTY(QQuickPlatformMenu *parentMenu READ parentMenu NOTIFY parentMenuChanged FINAL) |
| 81 | Q_PROPERTY(QQuickPlatformSystemTrayIcon *systemTrayIcon READ systemTrayIcon NOTIFY systemTrayIconChanged FINAL) |
| 82 | Q_PROPERTY(QQuickPlatformMenuItem *menuItem READ menuItem CONSTANT FINAL) |
| 83 | Q_PROPERTY(bool enabled READ isEnabled WRITE setEnabled NOTIFY enabledChanged FINAL) |
| 84 | Q_PROPERTY(bool visible READ isVisible WRITE setVisible NOTIFY visibleChanged FINAL) |
| 85 | Q_PROPERTY(int minimumWidth READ minimumWidth WRITE setMinimumWidth NOTIFY minimumWidthChanged FINAL) |
| 86 | Q_PROPERTY(QPlatformMenu::MenuType type READ type WRITE setType NOTIFY typeChanged FINAL) |
| 87 | Q_PROPERTY(QString title READ title WRITE setTitle NOTIFY titleChanged FINAL) |
| 88 | Q_PROPERTY(QUrl iconSource READ iconSource WRITE setIconSource NOTIFY iconSourceChanged FINAL) |
| 89 | Q_PROPERTY(QString iconName READ iconName WRITE setIconName NOTIFY iconNameChanged FINAL) |
| 90 | Q_PROPERTY(QFont font READ font WRITE setFont NOTIFY fontChanged FINAL) |
| 91 | Q_PROPERTY(QQuickPlatformIcon icon READ icon WRITE setIcon NOTIFY iconChanged FINAL REVISION 1) |
| 92 | Q_ENUMS(QPlatformMenu::MenuType) |
| 93 | Q_CLASSINFO("DefaultProperty" , "data" ) |
| 94 | |
| 95 | public: |
| 96 | explicit (QObject *parent = nullptr); |
| 97 | (); |
| 98 | |
| 99 | QPlatformMenu *handle() const; |
| 100 | QPlatformMenu *(); |
| 101 | void (); |
| 102 | void (); |
| 103 | |
| 104 | QQmlListProperty<QObject> (); |
| 105 | QQmlListProperty<QQuickPlatformMenuItem> (); |
| 106 | |
| 107 | QQuickPlatformMenuBar *() const; |
| 108 | void (QQuickPlatformMenuBar *); |
| 109 | |
| 110 | QQuickPlatformMenu *() const; |
| 111 | void (QQuickPlatformMenu *); |
| 112 | |
| 113 | QQuickPlatformSystemTrayIcon *() const; |
| 114 | void (QQuickPlatformSystemTrayIcon *icon); |
| 115 | |
| 116 | QQuickPlatformMenuItem *() const; |
| 117 | |
| 118 | bool () const; |
| 119 | void (bool enabled); |
| 120 | |
| 121 | bool () const; |
| 122 | void (bool visible); |
| 123 | |
| 124 | int () const; |
| 125 | void (int width); |
| 126 | |
| 127 | QPlatformMenu::MenuType () const; |
| 128 | void (QPlatformMenu::MenuType type); |
| 129 | |
| 130 | QString () const; |
| 131 | void (const QString &title); |
| 132 | |
| 133 | QUrl () const; |
| 134 | void (const QUrl &source); |
| 135 | |
| 136 | QString () const; |
| 137 | void (const QString &name); |
| 138 | |
| 139 | QFont () const; |
| 140 | void (const QFont &font); |
| 141 | |
| 142 | QQuickPlatformIcon () const; |
| 143 | void (const QQuickPlatformIcon &icon); |
| 144 | |
| 145 | Q_INVOKABLE void (QQuickPlatformMenuItem *item); |
| 146 | Q_INVOKABLE void (int index, QQuickPlatformMenuItem *item); |
| 147 | Q_INVOKABLE void (QQuickPlatformMenuItem *item); |
| 148 | |
| 149 | Q_INVOKABLE void (QQuickPlatformMenu *); |
| 150 | Q_INVOKABLE void (int index, QQuickPlatformMenu *); |
| 151 | Q_INVOKABLE void (QQuickPlatformMenu *); |
| 152 | |
| 153 | Q_INVOKABLE void (); |
| 154 | |
| 155 | public Q_SLOTS: |
| 156 | void (QQmlV4Function *args); |
| 157 | void (); |
| 158 | |
| 159 | Q_SIGNALS: |
| 160 | void (); |
| 161 | void (); |
| 162 | |
| 163 | void (); |
| 164 | void (); |
| 165 | void (); |
| 166 | void (); |
| 167 | void (); |
| 168 | void (); |
| 169 | void (); |
| 170 | void (); |
| 171 | void (); |
| 172 | void (); |
| 173 | void (); |
| 174 | void (); |
| 175 | Q_REVISION(1) void (); |
| 176 | |
| 177 | protected: |
| 178 | void () override; |
| 179 | void () override; |
| 180 | |
| 181 | QQuickPlatformIconLoader *() const; |
| 182 | |
| 183 | QWindow *(QQuickItem *target, QPoint *offset) const; |
| 184 | |
| 185 | static void (QQmlListProperty<QObject> *property, QObject *object); |
| 186 | static int (QQmlListProperty<QObject> *property); |
| 187 | static QObject *(QQmlListProperty<QObject> *property, int index); |
| 188 | static void (QQmlListProperty<QObject> *property); |
| 189 | |
| 190 | static void (QQmlListProperty<QQuickPlatformMenuItem> *property, QQuickPlatformMenuItem *item); |
| 191 | static int (QQmlListProperty<QQuickPlatformMenuItem> *property); |
| 192 | static QQuickPlatformMenuItem *(QQmlListProperty<QQuickPlatformMenuItem> *property, int index); |
| 193 | static void (QQmlListProperty<QQuickPlatformMenuItem> *property); |
| 194 | |
| 195 | private Q_SLOTS: |
| 196 | void (); |
| 197 | |
| 198 | private: |
| 199 | void (); |
| 200 | |
| 201 | bool ; |
| 202 | bool ; |
| 203 | bool ; |
| 204 | int ; |
| 205 | QPlatformMenu::MenuType ; |
| 206 | QString ; |
| 207 | QFont ; |
| 208 | QList<QObject *> ; |
| 209 | QList<QQuickPlatformMenuItem *> ; |
| 210 | QQuickPlatformMenuBar *; |
| 211 | QQuickPlatformMenu *; |
| 212 | QQuickPlatformSystemTrayIcon *; |
| 213 | mutable QQuickPlatformMenuItem *; |
| 214 | mutable QQuickPlatformIconLoader *; |
| 215 | QPlatformMenu *m_handle; |
| 216 | }; |
| 217 | |
| 218 | QT_END_NAMESPACE |
| 219 | |
| 220 | QML_DECLARE_TYPE(QQuickPlatformMenu) |
| 221 | Q_DECLARE_METATYPE(QPlatformMenu::MenuType) |
| 222 | |
| 223 | #endif // QQUICKPLATFORMMENU_P_H |
| 224 | |