1 /****************************************************************************
2 **
3 ** DQt - D bindings for the Qt Toolkit
4 **
5 ** GNU Lesser General Public License Usage
6 ** This file may be used under the terms of the GNU Lesser
7 ** General Public License version 3 as published by the Free Software
8 ** Foundation and appearing in the file LICENSE.LGPL3 included in the
9 ** packaging of this file. Please review the following information to
10 ** ensure the GNU Lesser General Public License version 3 requirements
11 ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
12 **
13 ****************************************************************************/
14 module qt.gui.event;
15 extern(C++):
16 
17 import core.stdc.config;
18 import qt.config;
19 import qt.core.coreevent;
20 import qt.core.file;
21 import qt.core.flags;
22 import qt.core.global;
23 import qt.core.iodevice;
24 import qt.core.list;
25 import qt.core.mimedata;
26 import qt.core.namespace;
27 import qt.core.object;
28 import qt.core.objectdefs;
29 import qt.core.point;
30 import qt.core.rect;
31 import qt.core.size;
32 import qt.core.string;
33 import qt.core.typeinfo;
34 import qt.core.url;
35 import qt.core.vector;
36 import qt.gui.region;
37 import qt.gui.screen;
38 import qt.gui.touchdevice;
39 import qt.gui.vector2d;
40 import qt.gui.windowdefs;
41 import qt.helpers;
42 version(QT_NO_INPUTMETHOD){}else
43     import qt.core.variant;
44 version(QT_NO_SHORTCUT){}else
45     import qt.gui.keysequence;
46 
47 /+ #ifndef QT_NO_GESTURES
48 class QGesture;
49 #endif
50 class QScreen; +/
51 
52 class /+ Q_GUI_EXPORT +/ QInputEvent : QEvent
53 {
54 public:
55     /+ explicit +/this(Type type, /+ Qt:: +/qt.core.namespace.KeyboardModifiers modifiers = /+ Qt:: +/qt.core.namespace.KeyboardModifier.NoModifier);
56     ~this();
57     pragma(inline, true) final /+ Qt:: +/qt.core.namespace.KeyboardModifiers modifiers() const { return modState; }
58     pragma(inline, true) final void setModifiers(/+ Qt:: +/qt.core.namespace.KeyboardModifiers amodifiers) { modState = amodifiers; }
59     pragma(inline, true) final cpp_ulong timestamp() const { return ts; }
60     pragma(inline, true) final void setTimestamp(cpp_ulong atimestamp) { ts = atimestamp; }
61 protected:
62     /+ Qt:: +/qt.core.namespace.KeyboardModifiers modState;
63     cpp_ulong ts;
64 }
65 
66 class /+ Q_GUI_EXPORT +/ QEnterEvent : QEvent
67 {
68 public:
69     this(ref const(QPointF) localPos, ref const(QPointF) windowPos, ref const(QPointF) screenPos);
70     ~this();
71 
72     version(QT_NO_INTEGER_EVENT_COORDINATES){}else
73     {
74 /+        pragma(inline, true) final QPoint pos() const { return l.toPoint(); }
75         pragma(inline, true) final QPoint globalPos() const { return s.toPoint(); }
76         pragma(inline, true) final int x() const { return qRound(l.x()); }
77         pragma(inline, true) final int y() const { return qRound(l.y()); }
78         pragma(inline, true) final int globalX() const { return qRound(s.x()); }
79         pragma(inline, true) final int globalY() const { return qRound(s.y()); }+/
80     }
81     final ref const(QPointF) localPos() const { return l; }
82     final ref const(QPointF) windowPos() const { return w; }
83     final ref const(QPointF) screenPos() const { return s; }
84 
85 protected:
86     QPointF l; QPointF w; QPointF s;
87 }
88 
89 class /+ Q_GUI_EXPORT +/ QMouseEvent : QInputEvent
90 {
91 public:
92     this(Type type, ref const(QPointF) localPos, /+ Qt:: +/qt.core.namespace.MouseButton button,
93                     /+ Qt:: +/qt.core.namespace.MouseButtons buttons, /+ Qt:: +/qt.core.namespace.KeyboardModifiers modifiers);
94     this(Type type, ref const(QPointF) localPos, ref const(QPointF) screenPos,
95                     /+ Qt:: +/qt.core.namespace.MouseButton button, /+ Qt:: +/qt.core.namespace.MouseButtons buttons,
96                     /+ Qt:: +/qt.core.namespace.KeyboardModifiers modifiers);
97     this(Type type, ref const(QPointF) localPos, ref const(QPointF) windowPos, ref const(QPointF) screenPos,
98                     /+ Qt:: +/qt.core.namespace.MouseButton button, /+ Qt:: +/qt.core.namespace.MouseButtons buttons,
99                     /+ Qt:: +/qt.core.namespace.KeyboardModifiers modifiers);
100     this(Type type, ref const(QPointF) localPos, ref const(QPointF) windowPos, ref const(QPointF) screenPos,
101                     /+ Qt:: +/qt.core.namespace.MouseButton button, /+ Qt:: +/qt.core.namespace.MouseButtons buttons,
102                     /+ Qt:: +/qt.core.namespace.KeyboardModifiers modifiers, /+ Qt:: +/qt.core.namespace.MouseEventSource source);
103     ~this();
104 
105     version(QT_NO_INTEGER_EVENT_COORDINATES){}else
106     {
107     /+    pragma(inline, true) final QPoint pos() const { return l.toPoint(); }
108         pragma(inline, true) final QPoint globalPos() const { return s.toPoint(); }
109         pragma(inline, true) final int x() const { return qRound(l.x()); }
110         pragma(inline, true) final int y() const { return qRound(l.y()); }
111         pragma(inline, true) final int globalX() const { return qRound(s.x()); }
112         pragma(inline, true) final int globalY() const { return qRound(s.y()); }+/
113     }
114     final ref const(QPointF) localPos() const { return l; }
115     final ref const(QPointF) windowPos() const { return w; }
116     final ref const(QPointF) screenPos() const { return s; }
117 
118     pragma(inline, true) final /+ Qt:: +/qt.core.namespace.MouseButton button() const { return b; }
119     pragma(inline, true) final /+ Qt:: +/qt.core.namespace.MouseButtons buttons() const { return mouseState; }
120 
121     pragma(inline, true) final void setLocalPos(ref const(QPointF) localPosition) { l = localPosition; }
122 
123 /+ #if QT_DEPRECATED_SINCE(5, 0)
124     QT_DEPRECATED inline QPointF posF() const { return l; }
125 #endif +/
126 
127     final /+ Qt:: +/qt.core.namespace.MouseEventSource source() const;
128     final /+ Qt:: +/qt.core.namespace.MouseEventFlags flags() const;
129 
130 protected:
131     QPointF l; QPointF w; QPointF s;
132     /+ Qt:: +/qt.core.namespace.MouseButton b;
133     /+ Qt:: +/qt.core.namespace.MouseButtons mouseState;
134     int caps;
135     QVector2D velocity;
136 
137     /+ friend class QGuiApplicationPrivate; +/
138 }
139 
140 class /+ Q_GUI_EXPORT +/ QHoverEvent : QInputEvent
141 {
142 public:
143     this(Type type, ref const(QPointF) pos, ref const(QPointF) oldPos, /+ Qt:: +/qt.core.namespace.KeyboardModifiers modifiers = /+ Qt:: +/qt.core.namespace.KeyboardModifier.NoModifier);
144     ~this();
145 
146     version(QT_NO_INTEGER_EVENT_COORDINATES){}else
147     {
148        /+ pragma(inline, true) final QPoint pos() const { return p.toPoint(); }
149         pragma(inline, true) final QPoint oldPos() const { return op.toPoint(); }+/
150     }
151 
152     pragma(inline, true) final ref const(QPointF) posF() const { return p; }
153     pragma(inline, true) final ref const(QPointF) oldPosF() const { return op; }
154 
155 protected:
156     QPointF p; QPointF op;
157 }
158 
159 /+ #if QT_CONFIG(wheelevent) +/
160 class /+ Q_GUI_EXPORT +/ QWheelEvent : QInputEvent
161 {
162 public:
163     enum { DefaultDeltasPerStep = 120 }
164 
165 /+ #if QT_DEPRECATED_SINCE(5, 15) +/
166     // Actually deprecated since 5.0, in docs
167     /+ QT_DEPRECATED_VERSION_X_5_15("Use the last QWheelEvent constructor taking pixelDelta, angleDelta, phase, and inverted") +/this(ref const(QPointF) pos, int delta,
168                     /+ Qt:: +/qt.core.namespace.MouseButtons buttons, /+ Qt:: +/qt.core.namespace.KeyboardModifiers modifiers,
169                     /+ Qt:: +/qt.core.namespace.Orientation orient = /+ Qt:: +/qt.core.namespace.Orientation.Vertical);
170     // Actually deprecated since 5.0, in docs
171     /+ QT_DEPRECATED_VERSION_X_5_15("Use the last QWheelEvent constructor taking pixelDelta, angleDelta, phase, and inverted") +/this(ref const(QPointF) pos, ref const(QPointF) globalPos, int delta,
172                     /+ Qt:: +/qt.core.namespace.MouseButtons buttons, /+ Qt:: +/qt.core.namespace.KeyboardModifiers modifiers,
173                     /+ Qt:: +/qt.core.namespace.Orientation orient = /+ Qt:: +/qt.core.namespace.Orientation.Vertical);
174     /+ QT_DEPRECATED_VERSION_X_5_15("Use the last QWheelEvent constructor taking pixelDelta, angleDelta, phase, and inverted") +/this(ref const(QPointF) pos, ref const(QPointF) globalPos,
175                     QPoint pixelDelta, QPoint angleDelta, int qt4Delta, /+ Qt:: +/qt.core.namespace.Orientation qt4Orientation,
176                     /+ Qt:: +/qt.core.namespace.MouseButtons buttons, /+ Qt:: +/qt.core.namespace.KeyboardModifiers modifiers);
177     /+ QT_DEPRECATED_VERSION_X_5_15("Use the last QWheelEvent constructor taking pixelDelta, angleDelta, phase, and inverted") +/this(ref const(QPointF) pos, ref const(QPointF) globalPos,
178                     QPoint pixelDelta, QPoint angleDelta, int qt4Delta, /+ Qt:: +/qt.core.namespace.Orientation qt4Orientation,
179                     /+ Qt:: +/qt.core.namespace.MouseButtons buttons, /+ Qt:: +/qt.core.namespace.KeyboardModifiers modifiers, /+ Qt:: +/qt.core.namespace.ScrollPhase phase);
180     /+ QT_DEPRECATED_VERSION_X_5_15("Use the last QWheelEvent constructor taking pixelDelta, angleDelta, phase, and inverted") +/this(ref const(QPointF) pos, ref const(QPointF) globalPos, QPoint pixelDelta, QPoint angleDelta,
181                     int qt4Delta, /+ Qt:: +/qt.core.namespace.Orientation qt4Orientation, /+ Qt:: +/qt.core.namespace.MouseButtons buttons,
182                     /+ Qt:: +/qt.core.namespace.KeyboardModifiers modifiers, /+ Qt:: +/qt.core.namespace.ScrollPhase phase, /+ Qt:: +/qt.core.namespace.MouseEventSource source);
183     /+ QT_DEPRECATED_VERSION_X_5_15("Use the last QWheelEvent constructor taking pixelDelta, angleDelta, phase, and inverted") +/this(ref const(QPointF) pos, ref const(QPointF) globalPos, QPoint pixelDelta, QPoint angleDelta,
184                     int qt4Delta, /+ Qt:: +/qt.core.namespace.Orientation qt4Orientation, /+ Qt:: +/qt.core.namespace.MouseButtons buttons,
185                     /+ Qt:: +/qt.core.namespace.KeyboardModifiers modifiers, /+ Qt:: +/qt.core.namespace.ScrollPhase phase, /+ Qt:: +/qt.core.namespace.MouseEventSource source, bool inverted);
186 /+ #endif +/
187 
188     this(QPointF pos, QPointF globalPos, QPoint pixelDelta, QPoint angleDelta,
189                     /+ Qt:: +/qt.core.namespace.MouseButtons buttons, /+ Qt:: +/qt.core.namespace.KeyboardModifiers modifiers, /+ Qt:: +/qt.core.namespace.ScrollPhase phase,
190                     bool inverted, /+ Qt:: +/qt.core.namespace.MouseEventSource source = /+ Qt:: +/qt.core.namespace.MouseEventSource.MouseEventNotSynthesized);
191     ~this();
192 
193 
194     pragma(inline, true) final QPoint pixelDelta() const { return pixelD; }
195     pragma(inline, true) final QPoint angleDelta() const { return angleD; }
196 
197 /+ #if QT_DEPRECATED_SINCE(5, 15) +/
198     // Actually deprecated since 5.0, in docs
199     /+ QT_DEPRECATED_VERSION_X_5_15("Use angleDelta()") +/
200         pragma(inline, true) final int delta() const  { return qt4D; }
201     // Actually deprecated since 5.0, in docs
202     /+ QT_DEPRECATED_VERSION_X_5_15("Use angleDelta()") +/
203         pragma(inline, true) final /+ Qt:: +/qt.core.namespace.Orientation orientation() const { return qt4O; }
204     version(QT_NO_INTEGER_EVENT_COORDINATES){}else
205     {
206       /+  /+ QT_DEPRECATED_VERSION_X_5_15("Use position()") +/
207             pragma(inline, true) final QPoint pos() const { return p.toPoint(); }
208         /+ QT_DEPRECATED_VERSION_X_5_15("Use globalPosition()") +/
209             pragma(inline, true) final QPoint globalPos()   const { return g.toPoint(); }
210         /+ QT_DEPRECATED_VERSION_X_5_15("Use position()") +/
211             pragma(inline, true) final int x() const { return cast(int)(p.x()); }
212         /+ QT_DEPRECATED_VERSION_X_5_15("Use position()") +/
213             pragma(inline, true) final int y() const { return cast(int)(p.y()); }
214         /+ QT_DEPRECATED_VERSION_X_5_15("Use globalPosition()") +/
215             pragma(inline, true) final int globalX() const { return cast(int)(g.x()); }
216         /+ QT_DEPRECATED_VERSION_X_5_15("Use globalPosition()") +/
217             pragma(inline, true) final int globalY() const { return cast(int)(g.y()); }+/
218     }
219     /+ QT_DEPRECATED_VERSION_X_5_15("Use position()") +/
220         pragma(inline, true) final ref const(QPointF) posF() const { return p; }
221     /+ QT_DEPRECATED_VERSION_X_5_15("Use globalPosition()") +/
222         pragma(inline, true) final ref const(QPointF) globalPosF()   const { return g; }
223 /+ #endif +/ // QT_DEPRECATED_SINCE(5, 15)
224 
225     pragma(inline, true) final QPointF position() const { return p; }
226     pragma(inline, true) final QPointF globalPosition() const { return g; }
227 
228     pragma(inline, true) final /+ Qt:: +/qt.core.namespace.MouseButtons buttons() const { return mouseState; }
229 
230 //    pragma(inline, true) final /+ Qt:: +/qt.core.namespace.ScrollPhase phase() const { return /+ Qt:: +/qt.core.namespace.ScrollPhase(ph); }
231     pragma(inline, true) final bool inverted() const { return invertedScrolling; }
232 
233 //    final /+ Qt:: +/qt.core.namespace.MouseEventSource source() const { return /+ Qt:: +/qt.core.namespace.MouseEventSource(src); }
234 
235 protected:
236     QPointF p;
237     QPointF g;
238     QPoint pixelD;
239     QPoint angleD;
240     int qt4D = 0;
241     /+ Qt:: +/qt.core.namespace.Orientation qt4O = /+ Qt:: +/qt.core.namespace.Orientation.Vertical;
242     /+ Qt:: +/qt.core.namespace.MouseButtons mouseState = /+ Qt:: +/qt.core.namespace.MouseButton.NoButton;
243     /+ uint _unused_ : 2; +/ // Kept for binary compatibility
244     uint bitfieldData__unused_;
245     uint _unused_() const
246     {
247         return (bitfieldData__unused_ >> 0) & 0x3;
248     }
249     uint _unused_(uint value)
250     {
251         bitfieldData__unused_ = (bitfieldData__unused_ & ~0x3) | ((value & 0x3) << 0);
252         return value;
253     }
254     /+ uint src: 2; +/
255     uint src() const
256     {
257         return (bitfieldData__unused_ >> 2) & 0x3;
258     }
259     uint src(uint value)
260     {
261         bitfieldData__unused_ = (bitfieldData__unused_ & ~0xc) | ((value & 0x3) << 2);
262         return value;
263     }
264     /+ bool invertedScrolling : 1; +/
265     bool invertedScrolling() const
266     {
267         return (bitfieldData__unused_ >> 4) & 0x1;
268     }
269     uint invertedScrolling(uint value)
270     {
271         bitfieldData__unused_ = (bitfieldData__unused_ & ~0x10) | ((value & 0x1) << 4);
272         return value;
273     }
274     /+ uint ph : 3; +/
275     uint ph() const
276     {
277         return (bitfieldData__unused_ >> 5) & 0x7;
278     }
279     uint ph(uint value)
280     {
281         bitfieldData__unused_ = (bitfieldData__unused_ & ~0xe0) | ((value & 0x7) << 5);
282         return value;
283     }
284     /+ int reserved : 24; +/
285     int reserved() const
286     {
287         return (bitfieldData__unused_ >> 8) & 0xffffff;
288     }
289     uint reserved(uint value)
290     {
291         bitfieldData__unused_ = (bitfieldData__unused_ & ~0xffffff00) | ((value & 0xffffff) << 8);
292         return value;
293     }
294 
295     /+ friend class QApplication; +/
296 }
297 /+ #endif
298 
299 #if QT_CONFIG(tabletevent) +/
300 class /+ Q_GUI_EXPORT +/ QTabletEvent : QInputEvent
301 {
302     mixin(Q_GADGET);
303 public:
304     enum TabletDevice { NoDevice, Puck, Stylus, Airbrush, FourDMouse,
305                         XFreeEraser /*internal*/, RotationStylus }
306     /+ Q_ENUM(TabletDevice) +/
307     enum PointerType { UnknownPointer, Pen, Cursor, Eraser }
308     /+ Q_ENUM(PointerType) +/
309 
310 /+ #if QT_DEPRECATED_SINCE(5, 15) +/
311     // Actually deprecated since 5.4, in docs
312     /+ QT_DEPRECATED_VERSION_X_5_15("Use the other QTabletEvent constructor") +/this(Type t, ref const(QPointF) pos, ref const(QPointF) globalPos,
313                      int device, int pointerType, qreal pressure, int xTilt, int yTilt,
314                      qreal tangentialPressure, qreal rotation, int z,
315                      /+ Qt:: +/qt.core.namespace.KeyboardModifiers keyState, qint64 uniqueID); // ### remove in Qt 6
316 /+ #endif +/
317     this(Type t, ref const(QPointF) pos, ref const(QPointF) globalPos,
318                      int device, int pointerType, qreal pressure, int xTilt, int yTilt,
319                      qreal tangentialPressure, qreal rotation, int z,
320                      /+ Qt:: +/qt.core.namespace.KeyboardModifiers keyState, qint64 uniqueID,
321                      /+ Qt:: +/qt.core.namespace.MouseButton button, /+ Qt:: +/qt.core.namespace.MouseButtons buttons);
322     ~this();
323 
324 //    pragma(inline, true) final QPoint pos() const { return mPos.toPoint(); }
325 //    pragma(inline, true) final QPoint globalPos() const { return mGPos.toPoint(); }
326 /+ #if QT_DEPRECATED_SINCE(5,0)
327     QT_DEPRECATED inline const QPointF &hiResGlobalPos() const { return mPos; }
328 #endif +/
329 
330     pragma(inline, true) final ref const(QPointF) posF() const { return mPos; }
331     pragma(inline, true) final ref const(QPointF) globalPosF() const { return mGPos; }
332 
333 /+    pragma(inline, true) final int x() const { return qRound(mPos.x()); }
334     pragma(inline, true) final int y() const { return qRound(mPos.y()); }
335     pragma(inline, true) final int globalX() const { return qRound(mGPos.x()); }
336     pragma(inline, true) final int globalY() const { return qRound(mGPos.y()); }+/
337 /+ #if QT_DEPRECATED_SINCE(5, 15) +/
338     /+ QT_DEPRECATED_VERSION_X_5_15("use globalPosF().x()") +/
339         pragma(inline, true) final qreal hiResGlobalX() const { return mGPos.x(); }
340     /+ QT_DEPRECATED_VERSION_X_5_15("use globalPosF().y()") +/
341         pragma(inline, true) final qreal hiResGlobalY() const { return mGPos.y(); }
342 /+    /+ QT_DEPRECATED_VERSION_X_5_15("Use deviceType()") +/
343         pragma(inline, true) final TabletDevice device() const { return TabletDevice(mDev); }
344 /+ #endif +/
345     pragma(inline, true) final TabletDevice deviceType() const { return TabletDevice(mDev); }
346     pragma(inline, true) final PointerType pointerType() const { return PointerType(mPointerType); }+/
347     pragma(inline, true) final qint64 uniqueId() const { return mUnique; }
348     pragma(inline, true) final qreal pressure() const { return mPress; }
349     pragma(inline, true) final int z() const { return mZ; }
350     pragma(inline, true) final qreal tangentialPressure() const { return mTangential; }
351     pragma(inline, true) final qreal rotation() const { return mRot; }
352     pragma(inline, true) final int xTilt() const { return mXT; }
353     pragma(inline, true) final int yTilt() const { return mYT; }
354     final /+ Qt:: +/qt.core.namespace.MouseButton button() const;
355     final /+ Qt:: +/qt.core.namespace.MouseButtons buttons() const;
356 
357 protected:
358     QPointF mPos; QPointF mGPos;
359     int mDev; int mPointerType; int mXT; int mYT; int mZ;
360     qreal mPress; qreal mTangential; qreal mRot;
361     qint64 mUnique;
362 
363     // QTabletEventPrivate for extra storage.
364     // ### Qt 6: QPointingEvent will have Buttons, QTabletEvent will inherit
365     void* mExtra;
366 }
367 /+ #endif +/ // QT_CONFIG(tabletevent)
368 
369 version(QT_NO_GESTURES){}else
370 {
371 class /+ Q_GUI_EXPORT +/ QNativeGestureEvent : QInputEvent
372 {
373 public:
374 /+ #if QT_DEPRECATED_SINCE(5, 10) +/
375     /+ QT_DEPRECATED +/this(/+ Qt:: +/qt.core.namespace.NativeGestureType type, ref const(QPointF) localPos, ref const(QPointF) windowPos,
376                             ref const(QPointF) screenPos, qreal value, cpp_ulong sequenceId, quint64 intArgument);
377 /+ #endif +/
378     this(/+ Qt:: +/qt.core.namespace.NativeGestureType type, const(QTouchDevice)* dev, ref const(QPointF) localPos, ref const(QPointF) windowPos,
379                             ref const(QPointF) screenPos, qreal value, cpp_ulong sequenceId, quint64 intArgument);
380     ~this();
381     final /+ Qt:: +/qt.core.namespace.NativeGestureType gestureType() const { return mGestureType; }
382     final qreal value() const { return mRealValue; }
383 
384 /+    version(QT_NO_INTEGER_EVENT_COORDINATES){}else
385     {
386         pragma(inline, true) final const(QPoint) pos() const { return mLocalPos.toPoint(); }
387         pragma(inline, true) final const(QPoint) globalPos() const { return mScreenPos.toPoint(); }
388     }
389 +/
390     final ref const(QPointF) localPos() const { return mLocalPos; }
391     final ref const(QPointF) windowPos() const { return mWindowPos; }
392     final ref const(QPointF) screenPos() const { return mScreenPos; }
393 
394     final const(QTouchDevice)* device() const;
395 
396 protected:
397     /+ Qt:: +/qt.core.namespace.NativeGestureType mGestureType;
398     QPointF mLocalPos;
399     QPointF mWindowPos;
400     QPointF mScreenPos;
401     qreal mRealValue;
402     cpp_ulong mSequenceId;
403     quint64 mIntValue;
404 }
405 }
406 
407 class /+ Q_GUI_EXPORT +/ QKeyEvent : QInputEvent
408 {
409 public:
410     this(Type type, int key, /+ Qt:: +/qt.core.namespace.KeyboardModifiers modifiers, ref const(QString) text = globalInitVar!QString,
411                   bool autorep = false, ushort count = 1);
412     this(Type type, int key, /+ Qt:: +/qt.core.namespace.KeyboardModifiers modifiers,
413                   quint32 nativeScanCode, quint32 nativeVirtualKey, quint32 nativeModifiers,
414                   ref const(QString) text = globalInitVar!QString, bool autorep = false, ushort count = 1);
415     ~this();
416 
417     final int key() const { return k; }
418     version(QT_NO_SHORTCUT){}else
419     {
420         final bool matches(QKeySequence.StandardKey key) const;
421     }
422 //    final /+ Qt:: +/qt.core.namespace.KeyboardModifiers modifiers() const;
423     pragma(inline, true) final QString text() const { return *cast(QString*)&txt; }
424     pragma(inline, true) final bool isAutoRepeat() const { return (autor) != 0; }
425     pragma(inline, true) final int count() const { return int(c); }
426 
427     pragma(inline, true) final quint32 nativeScanCode() const { return nScanCode; }
428     pragma(inline, true) final quint32 nativeVirtualKey() const { return nVirtualKey; }
429     pragma(inline, true) final quint32 nativeModifiers() const { return nModifiers; }
430 
431     // Functions for the extended key event information
432 /+ #if QT_DEPRECATED_SINCE(5, 0)
433     static inline QKeyEvent *createExtendedKeyEvent(Type type, int key, Qt::KeyboardModifiers modifiers,
434                                              quint32 nativeScanCode, quint32 nativeVirtualKey,
435                                              quint32 nativeModifiers,
436                                              const QString& text = QString(), bool autorep = false,
437                                              ushort count = 1)
438     {
439         return new QKeyEvent(type, key, modifiers,
440                              nativeScanCode, nativeVirtualKey, nativeModifiers,
441                              text, autorep, count);
442     }
443 
444     inline bool hasExtendedInfo() const { return true; }
445 #endif +/
446 
447 protected:
448     QString txt;
449     int k;
450     quint32 nScanCode;
451     quint32 nVirtualKey;
452     quint32 nModifiers;
453     ushort c;
454     /+ ushort autor:1; +/
455     ubyte bitfieldData_autor;
456     ushort autor() const
457     {
458         return (bitfieldData_autor >> 0) & 0x1;
459     }
460     uint autor(uint value)
461     {
462         bitfieldData_autor = (bitfieldData_autor & ~0x1) | ((value & 0x1) << 0);
463         return value;
464     }
465     // ushort reserved:15;
466 }
467 
468 
469 class /+ Q_GUI_EXPORT +/ QFocusEvent : QEvent
470 {
471 public:
472     /+ explicit +/this(Type type, /+ Qt:: +/qt.core.namespace.FocusReason reason=/+ Qt:: +/qt.core.namespace.FocusReason.OtherFocusReason);
473     ~this();
474 
475     pragma(inline, true) final bool gotFocus() const { return type() == Type.FocusIn; }
476     pragma(inline, true) final bool lostFocus() const { return type() == Type.FocusOut; }
477 
478     final /+ Qt:: +/qt.core.namespace.FocusReason reason() const;
479 
480 private:
481     /+ Qt:: +/qt.core.namespace.FocusReason m_reason;
482 }
483 
484 
485 class /+ Q_GUI_EXPORT +/ QPaintEvent : QEvent
486 {
487 public:
488     /+ explicit +/this(ref const(QRegion) paintRegion);
489     /+ explicit +/this(ref const(QRect) paintRect);
490     ~this();
491 
492     pragma(inline, true) final ref const(QRect) rect() const { return m_rect; }
493     pragma(inline, true) final ref const(QRegion) region() const { return m_region; }
494 
495 protected:
496     QRect m_rect;
497     QRegion m_region;
498     bool m_erased;
499 }
500 
501 class /+ Q_GUI_EXPORT +/ QMoveEvent : QEvent
502 {
503 public:
504     this(ref const(QPoint) pos, ref const(QPoint) oldPos);
505     ~this();
506 
507     pragma(inline, true) final ref const(QPoint) pos() const { return p; }
508     pragma(inline, true) final ref const(QPoint) oldPos() const { return oldp;}
509 protected:
510     QPoint p; QPoint oldp;
511     /+ friend class QApplication; +/
512 }
513 
514 class /+ Q_GUI_EXPORT +/ QExposeEvent : QEvent
515 {
516 public:
517     /+ explicit +/this(ref const(QRegion) rgn);
518     ~this();
519 
520     pragma(inline, true) final ref const(QRegion) region() const { return rgn; }
521 
522 protected:
523     QRegion rgn;
524 }
525 
526 class /+ Q_GUI_EXPORT +/ QPlatformSurfaceEvent : QEvent
527 {
528 public:
529     enum SurfaceEventType {
530         SurfaceCreated,
531         SurfaceAboutToBeDestroyed
532     }
533 
534     /+ explicit +/this(SurfaceEventType surfaceEventType);
535     ~this();
536 
537     pragma(inline, true) final SurfaceEventType surfaceEventType() const { return m_surfaceEventType; }
538 
539 protected:
540     SurfaceEventType m_surfaceEventType;
541 }
542 
543 class /+ Q_GUI_EXPORT +/ QResizeEvent : QEvent
544 {
545 public:
546     this(ref const(QSize) size, ref const(QSize) oldSize);
547     ~this();
548 
549     pragma(inline, true) final ref const(QSize) size() const { return s; }
550     pragma(inline, true) final ref const(QSize) oldSize()const { return olds;}
551 protected:
552     QSize s; QSize olds;
553     /+ friend class QApplication; +/
554 }
555 
556 
557 class /+ Q_GUI_EXPORT +/ QCloseEvent : QEvent
558 {
559 public:
560     this();
561     ~this();
562 }
563 
564 
565 class /+ Q_GUI_EXPORT +/ QIconDragEvent : QEvent
566 {
567 public:
568     this();
569     ~this();
570 }
571 
572 
573 class /+ Q_GUI_EXPORT +/ QShowEvent : QEvent
574 {
575 public:
576     this();
577     ~this();
578 }
579 
580 
581 class /+ Q_GUI_EXPORT +/ QHideEvent : QEvent
582 {
583 public:
584     this();
585     ~this();
586 }
587 
588 version(QT_NO_CONTEXTMENU){}else
589 {
590 class /+ Q_GUI_EXPORT +/ QContextMenuEvent : QInputEvent
591 {
592 public:
593     enum Reason { Mouse, Keyboard, Other }
594 
595     this(Reason reason, ref const(QPoint) pos, ref const(QPoint) globalPos,
596                           /+ Qt:: +/qt.core.namespace.KeyboardModifiers modifiers);
597     this(Reason reason, ref const(QPoint) pos, ref const(QPoint) globalPos);
598     this(Reason reason, ref const(QPoint) pos);
599     ~this();
600 
601     pragma(inline, true) final int x() const { return p.x(); }
602     pragma(inline, true) final int y() const { return p.y(); }
603     pragma(inline, true) final int globalX() const { return gp.x(); }
604     pragma(inline, true) final int globalY() const { return gp.y(); }
605 
606     pragma(inline, true) final ref const(QPoint) pos() const { return p; }
607     pragma(inline, true) final ref const(QPoint) globalPos() const { return gp; }
608 
609 //    pragma(inline, true) final Reason reason() const { return Reason(reas); }
610 
611 protected:
612     QPoint p;
613     QPoint gp;
614     /+ uint reas : 8; +/
615     ubyte bitfieldData_reas;
616     uint reas() const
617     {
618         return (bitfieldData_reas >> 0) & 0xff;
619     }
620     uint reas(uint value)
621     {
622         bitfieldData_reas = (bitfieldData_reas & ~0xff) | ((value & 0xff) << 0);
623         return value;
624     }
625 }
626 }
627 
628 version(QT_NO_INPUTMETHOD){}else
629 {
630 class /+ Q_GUI_EXPORT +/ QInputMethodEvent : QEvent
631 {
632 public:
633     enum AttributeType {
634        TextFormat,
635        Cursor,
636        Language,
637        Ruby,
638        Selection
639     }
640     extern(C++, class) struct Attribute {
641     public:
642         /+this(AttributeType typ, int s, int l, QVariant val)
643         {
644             this.type = typ;
645             this.start = s;
646             this.length = l;
647             this.value = /+ std:: +/move(cast(_Tp && )(val));
648         }
649         this(AttributeType typ, int s, int l)
650         {
651             this.type = typ;
652             this.start = s;
653             this.length = l;
654             this.value = typeof(this.value)();
655         }+/
656 
657         AttributeType type;
658         int start;
659         int length;
660         QVariant value;
661     }
662     this();
663 //    this(ref const(QString) preeditText, ref const(QList!(Attribute)) /+ QList<Attribute> +/ attributes);
664     ~this();
665 
666     final void setCommitString(ref const(QString) commitString, int replaceFrom = 0, int replaceLength = 0);
667 //    pragma(inline, true) final ref const(QList!(Attribute)) attributes() const { return attrs; }
668     pragma(inline, true) final ref const(QString) preeditString() const { return preedit; }
669 
670     pragma(inline, true) final ref const(QString) commitString() const { return commit; }
671     pragma(inline, true) final int replacementStart() const { return replace_from; }
672     pragma(inline, true) final int replacementLength() const { return replace_length; }
673 
674     /+ QInputMethodEvent(const QInputMethodEvent &other); +/
675 
676 private:
677     QString preedit;
678     QList!(void*) attrs;
679     QString commit;
680     int replace_from;
681     int replace_length;
682 }
683 /+ Q_DECLARE_TYPEINFO(QInputMethodEvent::Attribute, Q_MOVABLE_TYPE); +/
684 
685 class /+ Q_GUI_EXPORT +/ QInputMethodQueryEvent : QEvent
686 {
687 public:
688     /+ explicit +/this(/+ Qt:: +/qt.core.namespace.InputMethodQueries queries);
689     ~this();
690 
691     final /+ Qt:: +/qt.core.namespace.InputMethodQueries queries() const { return m_queries; }
692 
693     final void setValue(/+ Qt:: +/qt.core.namespace.InputMethodQuery query, ref const(QVariant) value);
694     final QVariant value(/+ Qt:: +/qt.core.namespace.InputMethodQuery query) const;
695 private:
696     /+ Qt:: +/qt.core.namespace.InputMethodQueries m_queries;
697     struct QueryPair {
698         /+ Qt:: +/qt.core.namespace.InputMethodQuery query;
699         QVariant value;
700     }
701     /+ friend QTypeInfo<QueryPair>; +/
702     QVector!(void*) m_values;
703 }
704 /+ Q_DECLARE_TYPEINFO(QInputMethodQueryEvent::QueryPair, Q_MOVABLE_TYPE); +/
705 
706 }
707 
708 /+ #if QT_CONFIG(draganddrop) +/
709 
710 /+ class QMimeData; +/
711 
712 class /+ Q_GUI_EXPORT +/ QDropEvent : QEvent
713 {
714 public:
715     this(ref const(QPointF) pos, /+ Qt:: +/qt.core.namespace.DropActions actions, const(QMimeData) data,
716                    /+ Qt:: +/qt.core.namespace.MouseButtons buttons, /+ Qt:: +/qt.core.namespace.KeyboardModifiers modifiers, Type type = Type.Drop);
717     ~this();
718 
719 //    pragma(inline, true) final QPoint pos() const { return p.toPoint(); }
720     pragma(inline, true) final ref const(QPointF) posF() const { return p; }
721     pragma(inline, true) final /+ Qt:: +/qt.core.namespace.MouseButtons mouseButtons() const { return mouseState; }
722     pragma(inline, true) final /+ Qt:: +/qt.core.namespace.KeyboardModifiers keyboardModifiers() const { return modState; }
723 
724     pragma(inline, true) final /+ Qt:: +/qt.core.namespace.DropActions possibleActions() const { return act; }
725     pragma(inline, true) final /+ Qt:: +/qt.core.namespace.DropAction proposedAction() const { return default_action; }
726     pragma(inline, true) final void acceptProposedAction() { drop_action = default_action; accept(); }
727 
728     pragma(inline, true) final /+ Qt:: +/qt.core.namespace.DropAction dropAction() const { return drop_action; }
729     final void setDropAction(/+ Qt:: +/qt.core.namespace.DropAction action);
730 
731     final QObject source() const;
732     pragma(inline, true) final const(QMimeData) mimeData() const { return mdata; }
733 
734 protected:
735     /+ friend class QApplication; +/
736     QPointF p;
737     /+ Qt:: +/qt.core.namespace.MouseButtons mouseState;
738     /+ Qt:: +/qt.core.namespace.KeyboardModifiers modState;
739     /+ Qt:: +/qt.core.namespace.DropActions act;
740     /+ Qt:: +/qt.core.namespace.DropAction drop_action;
741     /+ Qt:: +/qt.core.namespace.DropAction default_action;
742     const(QMimeData) mdata;
743 }
744 
745 
746 class /+ Q_GUI_EXPORT +/ QDragMoveEvent : QDropEvent
747 {
748 public:
749     this(ref const(QPoint) pos, /+ Qt:: +/qt.core.namespace.DropActions actions, const(QMimeData) data,
750                        /+ Qt:: +/qt.core.namespace.MouseButtons buttons, /+ Qt:: +/qt.core.namespace.KeyboardModifiers modifiers, Type type = Type.DragMove);
751     ~this();
752 
753     pragma(inline, true) final QRect answerRect() const { return rect; }
754 
755 //    pragma(inline, true) final void accept() { QDropEvent.accept(); }
756 //    pragma(inline, true) final void ignore() { QDropEvent.ignore(); }
757 
758 /+    pragma(inline, true) final void accept(ref const(QRect)  r) { accept(); rect = r; }
759     pragma(inline, true) final void ignore(ref const(QRect)  r) { ignore(); rect = r; }+/
760 
761 protected:
762     QRect rect;
763 }
764 
765 
766 class /+ Q_GUI_EXPORT +/ QDragEnterEvent : QDragMoveEvent
767 {
768 public:
769     this(ref const(QPoint) pos, /+ Qt:: +/qt.core.namespace.DropActions actions, const(QMimeData) data,
770                         /+ Qt:: +/qt.core.namespace.MouseButtons buttons, /+ Qt:: +/qt.core.namespace.KeyboardModifiers modifiers);
771     ~this();
772 }
773 
774 
775 class /+ Q_GUI_EXPORT +/ QDragLeaveEvent : QEvent
776 {
777 public:
778     this();
779     ~this();
780 }
781 /+ #endif +/ // QT_CONFIG(draganddrop)
782 
783 
784 class /+ Q_GUI_EXPORT +/ QHelpEvent : QEvent
785 {
786 public:
787     this(Type type, ref const(QPoint) pos, ref const(QPoint) globalPos);
788     ~this();
789 
790     pragma(inline, true) final int x() const { return p.x(); }
791     pragma(inline, true) final int y() const { return p.y(); }
792     pragma(inline, true) final int globalX() const { return gp.x(); }
793     pragma(inline, true) final int globalY() const { return gp.y(); }
794 
795     pragma(inline, true) final ref const(QPoint) pos()  const { return p; }
796     pragma(inline, true) final ref const(QPoint) globalPos() const { return gp; }
797 
798 private:
799     QPoint p;
800     QPoint gp;
801 }
802 
803 version(QT_NO_STATUSTIP){}else
804 {
805 class /+ Q_GUI_EXPORT +/ QStatusTipEvent : QEvent
806 {
807 public:
808     /+ explicit +/this(ref const(QString) tip);
809     ~this();
810 
811     pragma(inline, true) final QString tip() const { return *cast(QString*)&s; }
812 private:
813     QString s;
814 }
815 }
816 
817 /+ #if QT_CONFIG(whatsthis) +/
818 class /+ Q_GUI_EXPORT +/ QWhatsThisClickedEvent : QEvent
819 {
820 public:
821     /+ explicit +/this(ref const(QString) href);
822     ~this();
823 
824     pragma(inline, true) final QString href() const { return *cast(QString*)&s; }
825 private:
826     QString s;
827 }
828 /+ #endif +/
829 
830 class /+ Q_GUI_EXPORT +/ QFileOpenEvent : QEvent
831 {
832 public:
833     /+ explicit +/this(ref const(QString) file);
834     /+ explicit +/this(ref const(QUrl) url);
835     ~this();
836 
837     pragma(inline, true) final QString file() const { return *cast(QString*)&f; }
838     final QUrl url() const { return m_url; }
839     // final bool openFile(QFile &file, QIODevice.OpenMode flags) const;
840 private:
841     QString f;
842     QUrl m_url;
843 }
844 
845 version(QT_NO_TOOLBAR){}else
846 {
847 class /+ Q_GUI_EXPORT +/ QToolBarChangeEvent : QEvent
848 {
849 public:
850     /+ explicit +/this(bool t);
851     ~this();
852 
853     pragma(inline, true) final bool toggle() const { return (tog) != 0; }
854 private:
855     /+ uint tog : 1; +/
856     ubyte bitfieldData_tog;
857     uint tog() const
858     {
859         return (bitfieldData_tog >> 0) & 0x1;
860     }
861     uint tog(uint value)
862     {
863         bitfieldData_tog = (bitfieldData_tog & ~0x1) | ((value & 0x1) << 0);
864         return value;
865     }
866 }
867 }
868 
869 version(QT_NO_SHORTCUT){}else
870 {
871 class /+ Q_GUI_EXPORT +/ QShortcutEvent : QEvent
872 {
873 public:
874     this(ref const(QKeySequence) key, int id, bool ambiguous = false);
875     ~this();
876 
877     pragma(inline, true) final ref const(QKeySequence) key() const { return sequence; }
878     pragma(inline, true) final int shortcutId() const { return sid; }
879     pragma(inline, true) final bool isAmbiguous() const { return ambig; }
880 protected:
881     QKeySequence sequence;
882     bool ambig;
883     int  sid;
884 }
885 }
886 
887 class /+ Q_GUI_EXPORT +/ QWindowStateChangeEvent: QEvent
888 {
889 public:
890     /+ explicit +/this(/+ Qt:: +/qt.core.namespace.WindowStates aOldState, bool isOverride = false);
891     ~this();
892 
893     pragma(inline, true) final /+ Qt:: +/qt.core.namespace.WindowStates oldState() const { return ostate; }
894     final bool isOverride() const;
895 
896 private:
897     /+ Qt:: +/qt.core.namespace.WindowStates ostate;
898     bool m_override;
899 }
900 
901 /+ #ifndef QT_NO_DEBUG_STREAM
902 Q_GUI_EXPORT QDebug operator<<(QDebug, const QEvent *);
903 #endif +/
904 
905 version(QT_NO_SHORTCUT){}else
906 {
907 /+pragma(inline, true) bool operator ==(QKeyEvent e, QKeySequence.StandardKey key){return (e ? e.matches(key) : false);}+/
908 /+pragma(inline, true) bool operator ==(QKeySequence.StandardKey key, QKeyEvent e){return (e ? e.matches(key) : false);}+/
909 }
910 
911 @Q_MOVABLE_TYPE extern(C++, class) struct /+ Q_GUI_EXPORT +/ QPointingDeviceUniqueId
912 {
913     mixin(Q_GADGET);
914     /+ Q_PROPERTY(qint64 numericId READ numericId CONSTANT) +/
915 public:
916     @disable this();
917     /+/+ Q_ALWAYS_INLINE +/
918         pragma(inline, true) this()/+ noexcept+/
919         {
920             this.m_numericId = -1;
921         }+/
922     // compiler-generated copy/move ctor/assignment operators are ok!
923     // compiler-generated dtor is ok!
924 
925     static QPointingDeviceUniqueId fromNumericId(qint64 id);
926 
927     /+ Q_ALWAYS_INLINE +/ pragma(inline, true) bool isValid() const/+ noexcept+/ { return m_numericId != -1; }
928     qint64 numericId() const/+ noexcept+/;
929 
930 private:
931     // TODO: for TUIO 2, or any other type of complex token ID, an internal
932     // array (or hash) can be added to hold additional properties.
933     // In this case, m_numericId will then turn into an index into that array (or hash).
934     qint64 m_numericId = -1;
935 }
936 /+ Q_DECLARE_TYPEINFO(QPointingDeviceUniqueId, Q_MOVABLE_TYPE);
937 
938 #if 0
939 #pragma qt_sync_suspend_processing
940 #endif
941 template <> class QList<QPointingDeviceUniqueId> {}; // to prevent instantiation: use QVector instead
942 #if 0
943 #pragma qt_sync_resume_processing
944 #endif +/
945 
946 /+/+ Q_GUI_EXPORT +/ bool operator ==(QPointingDeviceUniqueId lhs, QPointingDeviceUniqueId rhs)/+ noexcept+/;+/
947 /+pragma(inline, true) bool operator !=(QPointingDeviceUniqueId lhs, QPointingDeviceUniqueId rhs)/+ noexcept+/
948 { return !operator==(lhs, rhs); }+/
949 /+ Q_GUI_EXPORT uint qHash(QPointingDeviceUniqueId key, uint seed = 0) noexcept; +/
950 
951 
952 
953 extern(C++, class) struct QTouchEventTouchPointPrivate;
954 class /+ Q_GUI_EXPORT +/ QTouchEvent : QInputEvent
955 {
956 public:
957     extern(C++, class) struct /+ Q_GUI_EXPORT +/ TouchPoint
958     {
959     public:
960         enum InfoFlag {
961             Pen  = 0x0001,
962             Token = 0x0002
963         }
964 /+ #ifndef Q_MOC_RUN
965         // otherwise moc gives
966         // Error: Meta object features not supported for nested classes
967         Q_DECLARE_FLAGS(InfoFlags, InfoFlag) +/
968 alias InfoFlags = QFlags!(InfoFlag);/+ #endif +/
969 
970         @disable this();
971         /+ explicit +/this(int id/+ = -1+/);
972         @disable this(this);
973         this(ref const(TouchPoint) other);
974         /+ TouchPoint(TouchPoint &&other) noexcept
975             : d(nullptr)
976         { qSwap(d, other.d); } +/
977         /+ TouchPoint &operator=(TouchPoint &&other) noexcept
978         { qSwap(d, other.d); return *this; } +/
979         ~this();
980 
981         /+ref TouchPoint operator =(ref const(TouchPoint) other)
982         { if ( d != other.d ) { auto copy = TouchPoint(other); swap(copy); } return this; }+/
983 
984         /+ void swap(TouchPoint &other) noexcept
985         { qSwap(d, other.d); } +/
986 
987         int id() const;
988         QPointingDeviceUniqueId uniqueId() const;
989 
990         /+ Qt:: +/qt.core.namespace.TouchPointState state() const;
991 
992         QPointF pos() const;
993         QPointF startPos() const;
994         QPointF lastPos() const;
995 
996         QPointF scenePos() const;
997         QPointF startScenePos() const;
998         QPointF lastScenePos() const;
999 
1000         QPointF screenPos() const;
1001         QPointF startScreenPos() const;
1002         QPointF lastScreenPos() const;
1003 
1004         QPointF normalizedPos() const;
1005         QPointF startNormalizedPos() const;
1006         QPointF lastNormalizedPos() const;
1007 
1008 /+ #if QT_DEPRECATED_SINCE(5, 15) +/
1009         // All these are actually deprecated since 5.9, in docs
1010         /+ QT_DEPRECATED_VERSION_X_5_15("Use pos() and ellipseDiameters()") +/
1011                 QRectF rect() const;
1012         /+ QT_DEPRECATED_VERSION_X_5_15("Use scenePos() and ellipseDiameters()") +/
1013                 QRectF sceneRect() const;
1014         /+ QT_DEPRECATED_VERSION_X_5_15("Use screenPos() and ellipseDiameters()") +/
1015                 QRectF screenRect() const;
1016 
1017         // internal
1018         /+ QT_DEPRECATED_VERSION_X_5_15("Use setPos() and setEllipseDiameters()") +/
1019                 void setRect(ref const(QRectF) rect); // deprecated
1020         /+ QT_DEPRECATED_VERSION_X_5_15("Use setScenePos() and setEllipseDiameters()") +/
1021                 void setSceneRect(ref const(QRectF) sceneRect); // deprecated
1022         /+ QT_DEPRECATED_VERSION_X_5_15("Use setScreenPos() and setEllipseDiameters()") +/
1023                 void setScreenRect(ref const(QRectF) screenRect); // deprecated
1024 /+ #endif +/
1025         qreal pressure() const;
1026         qreal rotation() const;
1027         QSizeF ellipseDiameters() const;
1028 
1029         QVector2D velocity() const;
1030         InfoFlags flags() const;
1031         QVector!(QPointF) rawScreenPositions() const;
1032 
1033         // internal
1034         void setId(int id);
1035         void setUniqueId(qint64 uid);
1036         void setState(/+ Qt:: +/qt.core.namespace.TouchPointStates state);
1037         void setPos(ref const(QPointF) pos);
1038         void setScenePos(ref const(QPointF) scenePos);
1039         void setScreenPos(ref const(QPointF) screenPos);
1040         void setNormalizedPos(ref const(QPointF) normalizedPos);
1041         void setStartPos(ref const(QPointF) startPos);
1042         void setStartScenePos(ref const(QPointF) startScenePos);
1043         void setStartScreenPos(ref const(QPointF) startScreenPos);
1044         void setStartNormalizedPos(ref const(QPointF) startNormalizedPos);
1045         void setLastPos(ref const(QPointF) lastPos);
1046         void setLastScenePos(ref const(QPointF) lastScenePos);
1047         void setLastScreenPos(ref const(QPointF) lastScreenPos);
1048         void setLastNormalizedPos(ref const(QPointF) lastNormalizedPos);
1049         void setPressure(qreal pressure);
1050         void setRotation(qreal angle);
1051         void setEllipseDiameters(ref const(QSizeF) dia);
1052         void setVelocity(ref const(QVector2D) v);
1053         void setFlags(InfoFlags flags);
1054         void setRawScreenPositions(ref const(QVector!(QPointF)) positions);
1055 
1056     private:
1057         QTouchEventTouchPointPrivate* d;
1058         /+ friend class QGuiApplication; +/
1059         /+ friend class QGuiApplicationPrivate; +/
1060         /+ friend class QApplication; +/
1061         /+ friend class QApplicationPrivate; +/
1062         /+ friend class QQuickPointerTouchEvent; +/
1063         /+ friend class QQuickMultiPointTouchArea; +/
1064     }
1065 
1066 /+ #if QT_DEPRECATED_SINCE(5, 0)
1067     enum DeviceType {
1068         TouchScreen,
1069         TouchPad
1070     };
1071 #endif +/
1072 
1073     /+ explicit +/this(QEvent.Type eventType,
1074                              QTouchDevice* device = null,
1075                              /+ Qt:: +/qt.core.namespace.KeyboardModifiers modifiers = /+ Qt:: +/qt.core.namespace.KeyboardModifier.NoModifier,
1076                              /+ Qt:: +/qt.core.namespace.TouchPointStates touchPointStates = /+ Qt:: +/qt.core.namespace.TouchPointStates(),
1077                              ref const(QList!(QTouchEvent.TouchPoint)) touchPoints = globalInitVar!(QList!(QTouchEvent.TouchPoint)));
1078     ~this();
1079 
1080     pragma(inline, true) final QWindow* window() const { return cast(QWindow*)_window; }
1081     pragma(inline, true) final QObject target() const { return cast(QObject)_target; }
1082 /+ #if QT_DEPRECATED_SINCE(5, 0)
1083     QT_DEPRECATED inline QTouchEvent::DeviceType deviceType() const { return static_cast<DeviceType>(int(_device->type())); }
1084 #endif +/
1085     pragma(inline, true) final /+ Qt:: +/qt.core.namespace.TouchPointStates touchPointStates() const { return _touchPointStates; }
1086     pragma(inline, true) final ref const(QList!(QTouchEvent.TouchPoint)) touchPoints() const { return _touchPoints; }
1087     pragma(inline, true) final QTouchDevice* device() const { return cast(QTouchDevice*)_device; }
1088 
1089     // internal
1090     pragma(inline, true) final void setWindow(QWindow* awindow) { _window = awindow; }
1091     pragma(inline, true) final void setTarget(QObject atarget) { _target = atarget; }
1092     pragma(inline, true) final void setTouchPointStates(/+ Qt:: +/qt.core.namespace.TouchPointStates aTouchPointStates) { _touchPointStates = aTouchPointStates; }
1093     pragma(inline, true) final void setTouchPoints(ref const(QList!(QTouchEvent.TouchPoint)) atouchPoints) { _touchPoints = *cast(QList!TouchPoint*)&atouchPoints; }
1094     pragma(inline, true) final void setDevice(QTouchDevice* adevice) { _device = adevice; }
1095 
1096 protected:
1097     QWindow* _window;
1098     QObject _target;
1099     QTouchDevice* _device;
1100     /+ Qt:: +/qt.core.namespace.TouchPointStates _touchPointStates;
1101     QList!(QTouchEvent.TouchPoint) _touchPoints;
1102 
1103     /+ friend class QGuiApplication; +/
1104     /+ friend class QGuiApplicationPrivate; +/
1105     /+ friend class QApplication; +/
1106     /+ friend class QApplicationPrivate; +/
1107     version(QT_NO_GRAPHICSVIEW){}else
1108     {
1109         /+ friend class QGraphicsScenePrivate; +/ // direct access to _touchPoints
1110     }
1111 }
1112 /+pragma(inline, true) QFlags!(QTouchEvent.TouchPoint.InfoFlags.enum_type) operator |(QTouchEvent.TouchPoint.InfoFlags.enum_type f1, QTouchEvent.TouchPoint.InfoFlags.enum_type f2)/+noexcept+/{return QFlags!(QTouchEvent.TouchPoint.InfoFlags.enum_type)(f1)|f2;}+/
1113 /+pragma(inline, true) QFlags!(QTouchEvent.TouchPoint.InfoFlags.enum_type) operator |(QTouchEvent.TouchPoint.InfoFlags.enum_type f1, QFlags!(QTouchEvent.TouchPoint.InfoFlags.enum_type) f2)/+noexcept+/{return f2|f1;}+/
1114 /+pragma(inline, true) QIncompatibleFlag operator |(QTouchEvent.TouchPoint.InfoFlags.enum_type f1, int f2)/+noexcept+/{return QIncompatibleFlag(int(f1)|f2);}+/
1115 /+ Q_DECLARE_TYPEINFO(QTouchEvent::TouchPoint, Q_MOVABLE_TYPE);
1116 Q_DECLARE_OPERATORS_FOR_FLAGS(QTouchEvent::TouchPoint::InfoFlags)
1117 #ifndef QT_NO_DEBUG_STREAM
1118 Q_GUI_EXPORT QDebug operator<<(QDebug, const QTouchEvent::TouchPoint &);
1119 #endif +/
1120 
1121 class /+ Q_GUI_EXPORT +/ QScrollPrepareEvent : QEvent
1122 {
1123 public:
1124     /+ explicit +/this(ref const(QPointF) startPos);
1125     ~this();
1126 
1127     final QPointF startPos() const;
1128 
1129     final QSizeF viewportSize() const;
1130     final QRectF contentPosRange() const;
1131     final QPointF contentPos() const;
1132 
1133     final void setViewportSize(ref const(QSizeF) size);
1134     final void setContentPosRange(ref const(QRectF) rect);
1135     final void setContentPos(ref const(QPointF) pos);
1136 
1137 private:
1138     QObject m_target; // Qt 6 remove.
1139     QPointF m_startPos;
1140     QSizeF m_viewportSize;
1141     QRectF m_contentPosRange;
1142     QPointF m_contentPos;
1143 }
1144 
1145 
1146 class /+ Q_GUI_EXPORT +/ QScrollEvent : QEvent
1147 {
1148 public:
1149     enum ScrollState
1150     {
1151         ScrollStarted,
1152         ScrollUpdated,
1153         ScrollFinished
1154     }
1155 
1156     this(ref const(QPointF) contentPos, ref const(QPointF) overshoot, ScrollState scrollState);
1157     ~this();
1158 
1159     final QPointF contentPos() const;
1160     final QPointF overshootDistance() const;
1161     final ScrollState scrollState() const;
1162 
1163 private:
1164     QPointF m_contentPos;
1165     QPointF m_overshoot;
1166     QScrollEvent.ScrollState m_state;
1167 }
1168 
1169 class /+ Q_GUI_EXPORT +/ QScreenOrientationChangeEvent : QEvent
1170 {
1171 public:
1172     this(QScreen screen, /+ Qt:: +/qt.core.namespace.ScreenOrientation orientation);
1173     ~this();
1174 
1175     final QScreen screen() const;
1176     final /+ Qt:: +/qt.core.namespace.ScreenOrientation orientation() const;
1177 
1178 private:
1179     QScreen m_screen;
1180     /+ Qt:: +/qt.core.namespace.ScreenOrientation m_orientation;
1181 }
1182 
1183 class /+ Q_GUI_EXPORT +/ QApplicationStateChangeEvent : QEvent
1184 {
1185 public:
1186     /+ explicit +/this(/+ Qt:: +/qt.core.namespace.ApplicationState state);
1187     final /+ Qt:: +/qt.core.namespace.ApplicationState applicationState() const;
1188 
1189 private:
1190     /+ Qt:: +/qt.core.namespace.ApplicationState m_applicationState;
1191 }
1192 
1193 version(QT_NO_INPUTMETHOD)
1194 {
1195 extern(C++, class) struct QInputMethodQueryEvent;
1196 }
1197 
1198 version(QT_NO_CONTEXTMENU)
1199 {
1200 class QContextMenuEvent;
1201 }
1202 
1203 version(QT_NO_INPUTMETHOD)
1204 {
1205 class QInputMethodEvent;
1206 }
1207 
1208