1 | // Copyright (C) 2017 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 QQUICKLABSPLATFORMMENUITEM_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/qqml.h> |
24 | |
25 | #include "qquicklabsplatformicon_p.h" |
26 | |
27 | QT_BEGIN_NAMESPACE |
28 | |
29 | class ; |
30 | class ; |
31 | class QQuickLabsPlatformIconLoader; |
32 | class ; |
33 | |
34 | class : public QObject, public QQmlParserStatus |
35 | { |
36 | Q_OBJECT |
37 | QML_NAMED_ELEMENT(MenuItem) |
38 | QML_EXTENDED_NAMESPACE(QPlatformMenuItem) |
39 | Q_INTERFACES(QQmlParserStatus) |
40 | Q_PROPERTY(QQuickLabsPlatformMenu *menu READ menu NOTIFY menuChanged FINAL) |
41 | Q_PROPERTY(QQuickLabsPlatformMenu *subMenu READ subMenu NOTIFY subMenuChanged FINAL) |
42 | Q_PROPERTY(QQuickLabsPlatformMenuItemGroup *group READ group WRITE setGroup NOTIFY groupChanged FINAL) |
43 | Q_PROPERTY(bool enabled READ isEnabled WRITE setEnabled NOTIFY enabledChanged FINAL) |
44 | Q_PROPERTY(bool visible READ isVisible WRITE setVisible NOTIFY visibleChanged FINAL) |
45 | Q_PROPERTY(bool separator READ isSeparator WRITE setSeparator NOTIFY separatorChanged FINAL) |
46 | Q_PROPERTY(bool checkable READ isCheckable WRITE setCheckable NOTIFY checkableChanged FINAL) |
47 | Q_PROPERTY(bool checked READ isChecked WRITE setChecked NOTIFY checkedChanged FINAL) |
48 | Q_PROPERTY(QPlatformMenuItem::MenuRole role READ role WRITE setRole NOTIFY roleChanged FINAL) |
49 | Q_PROPERTY(QString text READ text WRITE setText NOTIFY textChanged FINAL) |
50 | Q_PROPERTY(QVariant shortcut READ shortcut WRITE setShortcut NOTIFY shortcutChanged FINAL) |
51 | Q_PROPERTY(QFont font READ font WRITE setFont NOTIFY fontChanged FINAL) |
52 | Q_PROPERTY(QQuickLabsPlatformIcon icon READ icon WRITE setIcon NOTIFY iconChanged FINAL REVISION(1, 1)) |
53 | |
54 | public: |
55 | explicit (QObject *parent = nullptr); |
56 | (); |
57 | |
58 | QPlatformMenuItem *handle() const; |
59 | QPlatformMenuItem *(); |
60 | void (); |
61 | |
62 | QQuickLabsPlatformMenu *() const; |
63 | void (QQuickLabsPlatformMenu* ); |
64 | |
65 | QQuickLabsPlatformMenu *() const; |
66 | void (QQuickLabsPlatformMenu *); |
67 | |
68 | QQuickLabsPlatformMenuItemGroup *() const; |
69 | void (QQuickLabsPlatformMenuItemGroup *group); |
70 | |
71 | bool () const; |
72 | void (bool enabled); |
73 | |
74 | bool () const; |
75 | void (bool visible); |
76 | |
77 | bool () const; |
78 | void (bool separator); |
79 | |
80 | bool () const; |
81 | void (bool checkable); |
82 | |
83 | bool () const; |
84 | void (bool checked); |
85 | |
86 | QPlatformMenuItem::MenuRole () const; |
87 | void (QPlatformMenuItem::MenuRole role); |
88 | |
89 | QString () const; |
90 | void (const QString &text); |
91 | |
92 | QVariant () const; |
93 | void (const QVariant& shortcut); |
94 | |
95 | QFont () const; |
96 | void (const QFont &font); |
97 | |
98 | QQuickLabsPlatformIcon () const; |
99 | void (const QQuickLabsPlatformIcon &icon); |
100 | |
101 | public Q_SLOTS: |
102 | void (); |
103 | |
104 | Q_SIGNALS: |
105 | void (); |
106 | void (); |
107 | |
108 | void (); |
109 | void (); |
110 | void (); |
111 | void (); |
112 | void (); |
113 | void (); |
114 | void (); |
115 | void (); |
116 | void (); |
117 | void (); |
118 | void (); |
119 | void (); |
120 | Q_REVISION(2, 1) void (); |
121 | |
122 | protected: |
123 | void () override; |
124 | void () override; |
125 | |
126 | QQuickLabsPlatformIconLoader *() const; |
127 | |
128 | bool (QEvent *e) override; |
129 | private Q_SLOTS: |
130 | void (); |
131 | void (); |
132 | |
133 | private: |
134 | void (); |
135 | void (); |
136 | |
137 | bool ; |
138 | bool ; |
139 | bool ; |
140 | bool ; |
141 | bool ; |
142 | bool ; |
143 | QPlatformMenuItem::MenuRole ; |
144 | QString ; |
145 | QVariant ; |
146 | QFont ; |
147 | QQuickLabsPlatformMenu *; |
148 | QQuickLabsPlatformMenu *; |
149 | QQuickLabsPlatformMenuItemGroup *; |
150 | mutable QQuickLabsPlatformIconLoader *; |
151 | QPlatformMenuItem *m_handle; |
152 | int = -1; |
153 | |
154 | friend class QQuickLabsPlatformMenu; |
155 | friend class QQuickLabsPlatformMenuItemGroup; |
156 | }; |
157 | |
158 | QT_END_NAMESPACE |
159 | |
160 | #endif // QQUICKLABSPLATFORMMENUITEM_P_H |
161 | |