| 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 Quick Templates 2 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 QQUICKMENU_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 <QtQml/qqmllist.h> |
| 52 | #include <QtQml/qqml.h> |
| 53 | |
| 54 | #include "qquickpopup_p.h" |
| 55 | |
| 56 | QT_BEGIN_NAMESPACE |
| 57 | |
| 58 | class QQuickAction; |
| 59 | class QQmlComponent; |
| 60 | class ; |
| 61 | class ; |
| 62 | |
| 63 | class Q_QUICKTEMPLATES2_PRIVATE_EXPORT : public QQuickPopup |
| 64 | { |
| 65 | Q_OBJECT |
| 66 | Q_PROPERTY(QVariant contentModel READ contentModel CONSTANT FINAL) |
| 67 | Q_PROPERTY(QQmlListProperty<QObject> contentData READ contentData FINAL) |
| 68 | Q_PROPERTY(QString title READ title WRITE setTitle NOTIFY titleChanged FINAL) |
| 69 | // 2.3 (Qt 5.10) |
| 70 | Q_PROPERTY(int count READ count NOTIFY countChanged FINAL REVISION 3) |
| 71 | Q_PROPERTY(bool cascade READ cascade WRITE setCascade RESET resetCascade NOTIFY cascadeChanged FINAL REVISION 3) |
| 72 | Q_PROPERTY(qreal overlap READ overlap WRITE setOverlap NOTIFY overlapChanged FINAL REVISION 3) |
| 73 | Q_PROPERTY(QQmlComponent *delegate READ delegate WRITE setDelegate NOTIFY delegateChanged FINAL REVISION 3) |
| 74 | Q_PROPERTY(int currentIndex READ currentIndex WRITE setCurrentIndex NOTIFY currentIndexChanged FINAL REVISION 3) |
| 75 | Q_CLASSINFO("DefaultProperty" , "contentData" ) |
| 76 | |
| 77 | public: |
| 78 | explicit (QObject *parent = nullptr); |
| 79 | (); |
| 80 | |
| 81 | Q_INVOKABLE QQuickItem *(int index) const; |
| 82 | Q_INVOKABLE void (QQuickItem *item); |
| 83 | Q_INVOKABLE void (int index, QQuickItem *item); |
| 84 | Q_INVOKABLE void (int from, int to); |
| 85 | Q_INVOKABLE void (const QVariant &item); // ### Qt 6: remove |
| 86 | void (QQuickItem *item); // ### Qt 6: Q_INVOKABLE |
| 87 | |
| 88 | QVariant () const; |
| 89 | QQmlListProperty<QObject> (); |
| 90 | |
| 91 | QString () const; |
| 92 | void (QString &title); |
| 93 | |
| 94 | bool () const; |
| 95 | void (bool cascade); |
| 96 | void (); |
| 97 | |
| 98 | qreal () const; |
| 99 | void (qreal overlap); |
| 100 | |
| 101 | QQmlComponent *() const; |
| 102 | void (QQmlComponent *delegate); |
| 103 | |
| 104 | int () const; |
| 105 | void (int index); |
| 106 | |
| 107 | // 2.3 (Qt 5.10) |
| 108 | int () const; |
| 109 | Q_REVISION(3) Q_INVOKABLE QQuickItem *(int index); |
| 110 | |
| 111 | Q_REVISION(3) Q_INVOKABLE QQuickMenu *(int index) const; |
| 112 | Q_REVISION(3) Q_INVOKABLE void (QQuickMenu *); |
| 113 | Q_REVISION(3) Q_INVOKABLE void (int index, QQuickMenu *); |
| 114 | Q_REVISION(3) Q_INVOKABLE void (QQuickMenu *); |
| 115 | Q_REVISION(3) Q_INVOKABLE QQuickMenu *(int index); |
| 116 | |
| 117 | Q_REVISION(3) Q_INVOKABLE QQuickAction *(int index) const; |
| 118 | Q_REVISION(3) Q_INVOKABLE void (QQuickAction *action); |
| 119 | Q_REVISION(3) Q_INVOKABLE void (int index, QQuickAction *action); |
| 120 | Q_REVISION(3) Q_INVOKABLE void (QQuickAction *action); |
| 121 | Q_REVISION(3) Q_INVOKABLE QQuickAction *(int index); |
| 122 | |
| 123 | void (QQuickItem * = nullptr); |
| 124 | void (const QPointF &pos, QQuickItem * = nullptr); |
| 125 | |
| 126 | Q_REVISION(3) Q_INVOKABLE void (QQmlV4Function *args); |
| 127 | Q_REVISION(3) Q_INVOKABLE void (); |
| 128 | |
| 129 | protected: |
| 130 | void () override; |
| 131 | void (QQuickItem *newItem, QQuickItem *oldItem) override; |
| 132 | void (QQuickItem::ItemChange change, const QQuickItem::ItemChangeData &data) override; |
| 133 | void (QKeyEvent *event) override; |
| 134 | |
| 135 | Q_SIGNALS: |
| 136 | void (const QString &title); |
| 137 | // 2.3 (Qt 5.10) |
| 138 | Q_REVISION(3) void (); |
| 139 | Q_REVISION(3) void (bool cascade); |
| 140 | Q_REVISION(3) void (); |
| 141 | Q_REVISION(3) void (); |
| 142 | Q_REVISION(3) void (); |
| 143 | |
| 144 | protected: |
| 145 | void (QTimerEvent *event) override; |
| 146 | |
| 147 | QFont () const override; |
| 148 | QPalette () const override; |
| 149 | |
| 150 | #if QT_CONFIG(accessibility) |
| 151 | QAccessible::Role () const override; |
| 152 | #endif |
| 153 | |
| 154 | private: |
| 155 | Q_DISABLE_COPY() |
| 156 | Q_DECLARE_PRIVATE(QQuickMenu) |
| 157 | }; |
| 158 | |
| 159 | QT_END_NAMESPACE |
| 160 | |
| 161 | QML_DECLARE_TYPE(QQuickMenu) |
| 162 | |
| 163 | #endif // QQUICKMENU_P_H |
| 164 | |