File indexing completed on 2024-05-12 04:19:51

0001 /*
0002 Gwenview: an image viewer
0003 Copyright 2019 Steffen Hartleib <steffenhartleib@t-online.de>
0004 
0005 This program is free software; you can redistribute it and/or
0006 modify it under the terms of the GNU General Public License
0007 as published by the Free Software Foundation; either version 2
0008 of the License, or (at your option) any later version.
0009 
0010 This program is distributed in the hope that it will be useful,
0011 but WITHOUT ANY WARRANTY; without even the implied warranty of
0012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0013 GNU General Public License for more details.
0014 
0015 You should have received a copy of the GNU General Public License
0016 along with this program; if not, write to the Free Software
0017 Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA.
0018 
0019 */
0020 #ifndef DOUBLETAP_H
0021 #define DOUBLETAP_H
0022 
0023 #include <lib/gwenviewlib_export.h>
0024 // Qt
0025 #include <QGesture>
0026 #include <QGestureRecognizer>
0027 
0028 // KF
0029 
0030 // Local
0031 
0032 namespace Gwenview
0033 {
0034 struct DoubleTapRecognizerPrivate;
0035 
0036 class GWENVIEWLIB_EXPORT DoubleTap : public QGesture
0037 {
0038     Q_PROPERTY(QPointF pos READ pos WRITE pos)
0039 public:
0040     explicit DoubleTap(QObject *parent = nullptr);
0041 
0042 private:
0043     QPointF pos;
0044 };
0045 
0046 class GWENVIEWLIB_EXPORT DoubleTapRecognizer : public QGestureRecognizer
0047 {
0048 public:
0049     explicit DoubleTapRecognizer();
0050     ~DoubleTapRecognizer() override;
0051 
0052 private:
0053     DoubleTapRecognizerPrivate *d;
0054 
0055     virtual QGesture *create(QObject *) override;
0056     virtual Result recognize(QGesture *, QObject *, QEvent *) override;
0057 };
0058 
0059 } // namespace
0060 #endif /* DOUBLETAP_H */