1 | // Copyright (C) 2020 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 QQUICKLABSPLATFORMMENU_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 <QtCore/qurl.h> |
20 | #include <QtGui/qfont.h> |
21 | #include <QtGui/qpa/qplatformmenu.h> |
22 | #include <QtQml/qqmlparserstatus.h> |
23 | #include <QtQml/qqmllist.h> |
24 | #include <QtQml/qqml.h> |
25 | |
26 | #include "qquicklabsplatformicon_p.h" |
27 | |
28 | QT_BEGIN_NAMESPACE |
29 | |
30 | class QIcon; |
31 | class QWindow; |
32 | class QQuickItem; |
33 | class ; |
34 | class QQmlV4Function; |
35 | class ; |
36 | class ; |
37 | class QQuickLabsPlatformIconLoader; |
38 | class QQuickLabsPlatformSystemTrayIcon; |
39 | |
40 | class : public QObject, public QQmlParserStatus |
41 | { |
42 | Q_OBJECT |
43 | QML_NAMED_ELEMENT(Menu) |
44 | QML_EXTENDED_NAMESPACE(QPlatformMenu) |
45 | Q_INTERFACES(QQmlParserStatus) |
46 | Q_PROPERTY(QQmlListProperty<QObject> data READ data FINAL) |
47 | Q_PROPERTY(QQmlListProperty<QQuickLabsPlatformMenuItem> items READ items NOTIFY itemsChanged FINAL) |
48 | Q_PROPERTY(QQuickLabsPlatformMenuBar *menuBar READ menuBar NOTIFY menuBarChanged FINAL) |
49 | Q_PROPERTY(QQuickLabsPlatformMenu *parentMenu READ parentMenu NOTIFY parentMenuChanged FINAL) |
50 | #if QT_CONFIG(systemtrayicon) |
51 | Q_PROPERTY(QQuickLabsPlatformSystemTrayIcon *systemTrayIcon READ systemTrayIcon NOTIFY systemTrayIconChanged FINAL) |
52 | #endif |
53 | Q_PROPERTY(QQuickLabsPlatformMenuItem *menuItem READ menuItem CONSTANT FINAL) |
54 | Q_PROPERTY(bool enabled READ isEnabled WRITE setEnabled NOTIFY enabledChanged FINAL) |
55 | Q_PROPERTY(bool visible READ isVisible WRITE setVisible NOTIFY visibleChanged FINAL) |
56 | Q_PROPERTY(int minimumWidth READ minimumWidth WRITE setMinimumWidth NOTIFY minimumWidthChanged FINAL) |
57 | Q_PROPERTY(QPlatformMenu::MenuType type READ type WRITE setType NOTIFY typeChanged FINAL) |
58 | Q_PROPERTY(QString title READ title WRITE setTitle NOTIFY titleChanged FINAL) |
59 | Q_PROPERTY(QFont font READ font WRITE setFont NOTIFY fontChanged FINAL) |
60 | Q_PROPERTY(QQuickLabsPlatformIcon icon READ icon WRITE setIcon NOTIFY iconChanged FINAL REVISION(1, 1)) |
61 | Q_CLASSINFO("DefaultProperty" , "data" ) |
62 | |
63 | public: |
64 | explicit (QObject *parent = nullptr); |
65 | (); |
66 | |
67 | QPlatformMenu *handle() const; |
68 | QPlatformMenu *(); |
69 | void (); |
70 | void (); |
71 | |
72 | QQmlListProperty<QObject> (); |
73 | QQmlListProperty<QQuickLabsPlatformMenuItem> (); |
74 | |
75 | QQuickLabsPlatformMenuBar *() const; |
76 | void (QQuickLabsPlatformMenuBar *); |
77 | |
78 | QQuickLabsPlatformMenu *() const; |
79 | void (QQuickLabsPlatformMenu *); |
80 | |
81 | #if QT_CONFIG(systemtrayicon) |
82 | QQuickLabsPlatformSystemTrayIcon *() const; |
83 | void (QQuickLabsPlatformSystemTrayIcon *icon); |
84 | #endif |
85 | |
86 | QQuickLabsPlatformMenuItem *() const; |
87 | |
88 | bool () const; |
89 | void (bool enabled); |
90 | |
91 | bool () const; |
92 | void (bool visible); |
93 | |
94 | int () const; |
95 | void (int width); |
96 | |
97 | QPlatformMenu::MenuType () const; |
98 | void (QPlatformMenu::MenuType type); |
99 | |
100 | QString () const; |
101 | void (const QString &title); |
102 | |
103 | QFont () const; |
104 | void (const QFont &font); |
105 | |
106 | QQuickLabsPlatformIcon () const; |
107 | void (const QQuickLabsPlatformIcon &icon); |
108 | |
109 | Q_INVOKABLE void (QQuickLabsPlatformMenuItem *item); |
110 | Q_INVOKABLE void (int index, QQuickLabsPlatformMenuItem *item); |
111 | Q_INVOKABLE void (QQuickLabsPlatformMenuItem *item); |
112 | |
113 | Q_INVOKABLE void (QQuickLabsPlatformMenu *); |
114 | Q_INVOKABLE void (int index, QQuickLabsPlatformMenu *); |
115 | Q_INVOKABLE void (QQuickLabsPlatformMenu *); |
116 | |
117 | Q_INVOKABLE void (); |
118 | |
119 | public Q_SLOTS: |
120 | void (QQmlV4Function *args); |
121 | void (); |
122 | |
123 | Q_SIGNALS: |
124 | void (); |
125 | void (); |
126 | |
127 | void (); |
128 | void (); |
129 | void (); |
130 | void (); |
131 | void (); |
132 | void (); |
133 | void (); |
134 | void (); |
135 | void (); |
136 | void (); |
137 | Q_REVISION(2, 1) void (); |
138 | |
139 | protected: |
140 | void () override; |
141 | void () override; |
142 | |
143 | QQuickLabsPlatformIconLoader *() const; |
144 | |
145 | QWindow *(QQuickItem *target, QPoint *offset) const; |
146 | |
147 | static void (QQmlListProperty<QObject> *property, QObject *object); |
148 | static qsizetype (QQmlListProperty<QObject> *property); |
149 | static QObject *(QQmlListProperty<QObject> *property, qsizetype index); |
150 | static void (QQmlListProperty<QObject> *property); |
151 | |
152 | static void (QQmlListProperty<QQuickLabsPlatformMenuItem> *property, QQuickLabsPlatformMenuItem *item); |
153 | static qsizetype (QQmlListProperty<QQuickLabsPlatformMenuItem> *property); |
154 | static QQuickLabsPlatformMenuItem *(QQmlListProperty<QQuickLabsPlatformMenuItem> *property, qsizetype index); |
155 | static void (QQmlListProperty<QQuickLabsPlatformMenuItem> *property); |
156 | |
157 | private Q_SLOTS: |
158 | void (); |
159 | |
160 | private: |
161 | void (); |
162 | |
163 | bool ; |
164 | bool ; |
165 | bool ; |
166 | int ; |
167 | QPlatformMenu::MenuType ; |
168 | QString ; |
169 | QFont ; |
170 | QList<QObject *> ; |
171 | QList<QQuickLabsPlatformMenuItem *> ; |
172 | QQuickLabsPlatformMenuBar *; |
173 | QQuickLabsPlatformMenu *; |
174 | QQuickLabsPlatformSystemTrayIcon *; |
175 | mutable QQuickLabsPlatformMenuItem *; |
176 | mutable QQuickLabsPlatformIconLoader *; |
177 | QPlatformMenu *m_handle; |
178 | }; |
179 | |
180 | QT_END_NAMESPACE |
181 | |
182 | QML_DECLARE_TYPE(QQuickLabsPlatformMenu) |
183 | |
184 | #endif // QQUICKLABSPLATFORMMENU_P_H |
185 | |