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.widgets.gesturerecognizer;
15 extern(C++):
16 
17 import qt.config;
18 import qt.helpers;
19 version(QT_NO_GESTURES){}else
20 {
21     import qt.core.coreevent;
22     import qt.core.flags;
23     import qt.core.namespace;
24     import qt.core.object;
25     import qt.widgets.gesture;
26 }
27 
28 version(QT_NO_GESTURES){}else
29 {
30 
31 
32 
33 /+ class QObject;
34 class QEvent;
35 class QGesture; +/
36 class /+ Q_WIDGETS_EXPORT +/ QGestureRecognizer
37 {
38 public:
39     enum ResultFlag
40     {
41         Ignore           = 0x0001,
42 
43         MayBeGesture     = 0x0002,
44         TriggerGesture   = 0x0004,
45         FinishGesture    = 0x0008,
46         CancelGesture    = 0x0010,
47 
48         ResultState_Mask = 0x00ff,
49 
50         ConsumeEventHint        = 0x0100,
51         // StoreEventHint          = 0x0200,
52         // ReplayStoredEventsHint  = 0x0400,
53         // DiscardStoredEventsHint = 0x0800,
54 
55         ResultHint_Mask = 0xff00
56     }
57     /+ Q_DECLARE_FLAGS(Result, ResultFlag) +/
58 alias Result = QFlags!(ResultFlag);
59     this();
60     /+ virtual +/~this();
61 
62     /+ virtual +/ QGesture create(QObject target);
63     /+ virtual +/ abstract Result recognize(QGesture state, QObject watched,
64                                  QEvent event);
65     /+ virtual +/ void reset(QGesture state);
66 
67     static /+ Qt:: +/qt.core.namespace.GestureType registerRecognizer(QGestureRecognizer recognizer);
68     static void unregisterRecognizer(/+ Qt:: +/qt.core.namespace.GestureType type);
69 }
70 /+pragma(inline, true) QFlags!(QGestureRecognizer.Result.enum_type) operator |(QGestureRecognizer.Result.enum_type f1, QGestureRecognizer.Result.enum_type f2)/+noexcept+/{return QFlags!(QGestureRecognizer.Result.enum_type)(f1)|f2;}+/
71 /+pragma(inline, true) QFlags!(QGestureRecognizer.Result.enum_type) operator |(QGestureRecognizer.Result.enum_type f1, QFlags!(QGestureRecognizer.Result.enum_type) f2)/+noexcept+/{return f2|f1;}+/
72 /+pragma(inline, true) QIncompatibleFlag operator |(QGestureRecognizer.Result.enum_type f1, int f2)/+noexcept+/{return QIncompatibleFlag(int(f1)|f2);}+/
73 
74 /+ Q_DECLARE_OPERATORS_FOR_FLAGS(QGestureRecognizer::Result) +/
75 
76 }
77