| 1 | // Copyright (C) 2023 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 QQUICKNATIVEMENUITEM_P_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 | #include <QtCore/qobject.h> |
| 19 | #include <QtQuickTemplates2/private/qtquicktemplates2global_p.h> |
| 20 | #include <QtQuickTemplates2/private/qquickicon_p.h> |
| 21 | |
| 22 | QT_BEGIN_NAMESPACE |
| 23 | |
| 24 | class QQuickAction; |
| 25 | class QQuickNativeIconLoader; |
| 26 | class ; |
| 27 | class ; |
| 28 | class ; |
| 29 | |
| 30 | class Q_QUICKTEMPLATES2_EXPORT : public QObject |
| 31 | { |
| 32 | Q_OBJECT |
| 33 | |
| 34 | public: |
| 35 | static QQuickNativeMenuItem *( |
| 36 | QQuickMenu *, QQuickItem *nonNativeItem); |
| 37 | (); |
| 38 | |
| 39 | QQuickAction *() const; |
| 40 | QQuickMenu *() const; |
| 41 | QQuickMenuSeparator *() const; |
| 42 | QPlatformMenuItem *handle() const; |
| 43 | void (); |
| 44 | |
| 45 | QQuickIcon () const; |
| 46 | QQuickNativeIconLoader *() const; |
| 47 | void (); |
| 48 | |
| 49 | QString () const; |
| 50 | |
| 51 | private Q_SLOTS: |
| 52 | void (); |
| 53 | |
| 54 | private: |
| 55 | enum class { |
| 56 | , |
| 57 | // It's an Action or a MenuItem with an Action. |
| 58 | , |
| 59 | // It's a MenuItem without an Action. |
| 60 | , |
| 61 | , |
| 62 | |
| 63 | }; |
| 64 | |
| 65 | explicit (QQuickMenu *, QQuickItem *nonNativeItem, Type type); |
| 66 | |
| 67 | void (); |
| 68 | void (); |
| 69 | |
| 70 | QQuickMenu * = nullptr; |
| 71 | QQuickItem * = nullptr; |
| 72 | Type = Type::Unknown; |
| 73 | mutable QQuickNativeIconLoader * = nullptr; |
| 74 | std::unique_ptr<QPlatformMenuItem> m_handle = nullptr; |
| 75 | int = -1; |
| 76 | bool = false; |
| 77 | }; |
| 78 | |
| 79 | QT_END_NAMESPACE |
| 80 | |
| 81 | #endif // QQUICKNATIVEMENUITEM_P_H |
| 82 | |