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 Labs Platform 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 QQUICKPLATFORMMENUITEM_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 <QtCore/qobject.h> |
52 | #include <QtCore/qurl.h> |
53 | #include <QtGui/qfont.h> |
54 | #include <QtGui/qpa/qplatformmenu.h> |
55 | #include <QtQml/qqmlparserstatus.h> |
56 | #include <QtQml/qqml.h> |
57 | |
58 | #include "qquickplatformicon_p.h" |
59 | |
60 | QT_BEGIN_NAMESPACE |
61 | |
62 | class ; |
63 | class ; |
64 | class QQuickPlatformIconLoader; |
65 | class ; |
66 | |
67 | class : public QObject, public QQmlParserStatus |
68 | { |
69 | Q_OBJECT |
70 | Q_INTERFACES(QQmlParserStatus) |
71 | Q_PROPERTY(QQuickPlatformMenu *menu READ menu NOTIFY menuChanged FINAL) |
72 | Q_PROPERTY(QQuickPlatformMenu *subMenu READ subMenu NOTIFY subMenuChanged FINAL) |
73 | Q_PROPERTY(QQuickPlatformMenuItemGroup *group READ group WRITE setGroup NOTIFY groupChanged FINAL) |
74 | Q_PROPERTY(bool enabled READ isEnabled WRITE setEnabled NOTIFY enabledChanged FINAL) |
75 | Q_PROPERTY(bool visible READ isVisible WRITE setVisible NOTIFY visibleChanged FINAL) |
76 | Q_PROPERTY(bool separator READ isSeparator WRITE setSeparator NOTIFY separatorChanged FINAL) |
77 | Q_PROPERTY(bool checkable READ isCheckable WRITE setCheckable NOTIFY checkableChanged FINAL) |
78 | Q_PROPERTY(bool checked READ isChecked WRITE setChecked NOTIFY checkedChanged FINAL) |
79 | Q_PROPERTY(QPlatformMenuItem::MenuRole role READ role WRITE setRole NOTIFY roleChanged FINAL) |
80 | Q_PROPERTY(QString text READ text WRITE setText NOTIFY textChanged FINAL) |
81 | Q_PROPERTY(QUrl iconSource READ iconSource WRITE setIconSource NOTIFY iconSourceChanged FINAL) |
82 | Q_PROPERTY(QString iconName READ iconName WRITE setIconName NOTIFY iconNameChanged FINAL) |
83 | Q_PROPERTY(QVariant shortcut READ shortcut WRITE setShortcut NOTIFY shortcutChanged FINAL) |
84 | Q_PROPERTY(QFont font READ font WRITE setFont NOTIFY fontChanged FINAL) |
85 | Q_PROPERTY(QQuickPlatformIcon icon READ icon WRITE setIcon NOTIFY iconChanged FINAL REVISION 1) |
86 | Q_ENUMS(QPlatformMenuItem::MenuRole) |
87 | |
88 | public: |
89 | explicit (QObject *parent = nullptr); |
90 | (); |
91 | |
92 | QPlatformMenuItem *handle() const; |
93 | QPlatformMenuItem *(); |
94 | void (); |
95 | |
96 | QQuickPlatformMenu *() const; |
97 | void (QQuickPlatformMenu* ); |
98 | |
99 | QQuickPlatformMenu *() const; |
100 | void (QQuickPlatformMenu *); |
101 | |
102 | QQuickPlatformMenuItemGroup *() const; |
103 | void (QQuickPlatformMenuItemGroup *group); |
104 | |
105 | bool () const; |
106 | void (bool enabled); |
107 | |
108 | bool () const; |
109 | void (bool visible); |
110 | |
111 | bool () const; |
112 | void (bool separator); |
113 | |
114 | bool () const; |
115 | void (bool checkable); |
116 | |
117 | bool () const; |
118 | void (bool checked); |
119 | |
120 | QPlatformMenuItem::MenuRole () const; |
121 | void (QPlatformMenuItem::MenuRole role); |
122 | |
123 | QString () const; |
124 | void (const QString &text); |
125 | |
126 | QUrl () const; |
127 | void (const QUrl &source); |
128 | |
129 | QString () const; |
130 | void (const QString &name); |
131 | |
132 | QVariant () const; |
133 | void (const QVariant& shortcut); |
134 | |
135 | QFont () const; |
136 | void (const QFont &font); |
137 | |
138 | QQuickPlatformIcon () const; |
139 | void (const QQuickPlatformIcon &icon); |
140 | |
141 | public Q_SLOTS: |
142 | void (); |
143 | |
144 | Q_SIGNALS: |
145 | void (); |
146 | void (); |
147 | |
148 | void (); |
149 | void (); |
150 | void (); |
151 | void (); |
152 | void (); |
153 | void (); |
154 | void (); |
155 | void (); |
156 | void (); |
157 | void (); |
158 | void (); |
159 | void (); |
160 | void (); |
161 | void (); |
162 | Q_REVISION(1) void (); |
163 | |
164 | protected: |
165 | void () override; |
166 | void () override; |
167 | |
168 | QQuickPlatformIconLoader *() const; |
169 | |
170 | bool (QEvent *e) override; |
171 | private Q_SLOTS: |
172 | void (); |
173 | void (); |
174 | |
175 | private: |
176 | bool ; |
177 | bool ; |
178 | bool ; |
179 | bool ; |
180 | bool ; |
181 | bool ; |
182 | QPlatformMenuItem::MenuRole ; |
183 | QString ; |
184 | QVariant ; |
185 | QFont ; |
186 | QQuickPlatformMenu *; |
187 | QQuickPlatformMenu *; |
188 | QQuickPlatformMenuItemGroup *; |
189 | mutable QQuickPlatformIconLoader *; |
190 | QPlatformMenuItem *m_handle; |
191 | int = -1; |
192 | |
193 | friend class QQuickPlatformMenu; |
194 | friend class QQuickPlatformMenuItemGroup; |
195 | }; |
196 | |
197 | QT_END_NAMESPACE |
198 | |
199 | QML_DECLARE_TYPE(QQuickPlatformMenuItem) |
200 | |
201 | #endif // QQUICKPLATFORMMENUITEM_P_H |
202 | |