File indexing completed on 2024-12-22 04:12:44
0001 /* 0002 * This file is part of the KDE project 0003 * SPDX-FileCopyrightText: 2012 Arjen Hiemstra <ahiemstra@heimr.nl> 0004 * 0005 * SPDX-License-Identifier: GPL-2.0-or-later 0006 * 0007 */ 0008 0009 #ifndef KISTOUCHSHORTCUT_H 0010 #define KISTOUCHSHORTCUT_H 0011 0012 #include "kis_abstract_shortcut.h" 0013 #include "kis_shortcut_configuration.h" 0014 0015 class QTouchEvent; 0016 /** 0017 * @brief The KisTouchShortcut class only handles touch gestures 0018 * it _does not_ handle tool invocation i.e painting (which is being 0019 * handled in KisShortcutMatcher). 0020 */ 0021 class KisTouchShortcut : public KisAbstractShortcut 0022 { 0023 using GestureAction = KisShortcutConfiguration::GestureAction; 0024 0025 public: 0026 KisTouchShortcut(KisAbstractInputAction* action, int index, GestureAction type); 0027 ~KisTouchShortcut() override; 0028 0029 int priority() const override; 0030 0031 void setMinimumTouchPoints( int min ); 0032 void setMaximumTouchPoints( int max ); 0033 0034 bool matchTapType(QTouchEvent *event); 0035 bool matchDragType(QTouchEvent *event); 0036 bool matchTouchPoint(QTouchEvent *event); 0037 0038 private: 0039 class Private; 0040 Private * const d; 0041 }; 0042 0043 #endif // KISTOUCHSHORTCUT_H