Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-07-30 09:19:46

0001 // Copyright (C) 2016 The Qt Company Ltd.
0002 // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
0003 // Qt-Security score:significant reason:default
0004 
0005 #ifndef QGESTURERECOGNIZER_H
0006 #define QGESTURERECOGNIZER_H
0007 
0008 #include <QtWidgets/qtwidgetsglobal.h>
0009 #include <QtCore/qnamespace.h>
0010 
0011 #ifndef QT_NO_GESTURES
0012 
0013 QT_BEGIN_NAMESPACE
0014 
0015 
0016 class QObject;
0017 class QEvent;
0018 class QGesture;
0019 class Q_WIDGETS_EXPORT QGestureRecognizer
0020 {
0021 public:
0022     enum ResultFlag
0023     {
0024         Ignore           = 0x0001,
0025 
0026         MayBeGesture     = 0x0002,
0027         TriggerGesture   = 0x0004,
0028         FinishGesture    = 0x0008,
0029         CancelGesture    = 0x0010,
0030 
0031         ResultState_Mask = 0x00ff,
0032 
0033         ConsumeEventHint        = 0x0100,
0034         // StoreEventHint          = 0x0200,
0035         // ReplayStoredEventsHint  = 0x0400,
0036         // DiscardStoredEventsHint = 0x0800,
0037 
0038         ResultHint_Mask = 0xff00
0039     };
0040     Q_DECLARE_FLAGS(Result, ResultFlag)
0041 
0042     QGestureRecognizer();
0043     virtual ~QGestureRecognizer();
0044 
0045     virtual QGesture *create(QObject *target);
0046     virtual Result recognize(QGesture *state, QObject *watched,
0047                              QEvent *event) = 0;
0048     virtual void reset(QGesture *state);
0049 
0050     static Qt::GestureType registerRecognizer(QGestureRecognizer *recognizer);
0051     static void unregisterRecognizer(Qt::GestureType type);
0052 };
0053 
0054 Q_DECLARE_OPERATORS_FOR_FLAGS(QGestureRecognizer::Result)
0055 
0056 QT_END_NAMESPACE
0057 
0058 #endif // QT_NO_GESTURES
0059 
0060 #endif // QGESTURERECOGNIZER_H