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