Krita Source Code Documentation
Loading...
Searching...
No Matches
kis_touch_shortcut.h
Go to the documentation of this file.
1/*
2 * This file is part of the KDE project
3 * SPDX-FileCopyrightText: 2012 Arjen Hiemstra <ahiemstra@heimr.nl>
4 *
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 *
7 */
8
9#ifndef KISTOUCHSHORTCUT_H
10#define KISTOUCHSHORTCUT_H
11
14
15class QTouchEvent;
21class KRITAUI_EXPORT KisTouchShortcut : public KisAbstractShortcut
22{
24
25 public:
27 ~KisTouchShortcut() override;
28
29 int priority() const override;
30 bool isHoldType() const;
31 bool isAvailable(KisInputActionGroupsMask mask) const override;
32
33 void setMinimumTouchPoints( int min );
34 void setMaximumTouchPoints( int max );
35
36 void setIsTouchPainting(bool value);
37
38 bool matchTapType(const QTouchEvent *event, Qt::TouchPointStates allowedStates);
39 bool matchDragType(const QTouchEvent *event, Qt::TouchPointStates allowedStates);
40 bool matchHoldType(const QTouchEvent *event, Qt::TouchPointStates allowedStates);
41 bool matchTouchPoint(const QTouchEvent *event, Qt::TouchPointStates allowedStates);
42
43 qreal minDragThreshold() const;
44 void setMinDragThreshold(qreal value);
45
46 static inline Qt::TouchPointStates allTouchStates() {
47 return Qt::TouchPointStationary | Qt::TouchPointPressed | Qt::TouchPointMoved | Qt::TouchPointReleased;
48 }
49
50 static inline Qt::TouchPointStates pressedOnlyTouchStates() {
51 return Qt::TouchPointStationary | Qt::TouchPointPressed | Qt::TouchPointMoved;
52 }
53
54 static int countTouchPoints(const QTouchEvent *event, Qt::TouchPointStates allowedStates);
55
56 static qreal touchDragDistance(const QTouchEvent *event, Qt::TouchPointStates allowedStates);
57
58 private:
59 class Private;
60 Private * const d;
61};
62
63#endif // KISTOUCHSHORTCUT_H
float value(const T *src, size_t ch)
Abstract base class for input actions.
virtual int priority() const =0
virtual bool isAvailable(KisInputActionGroupsMask mask) const
The KisTouchShortcut class only handles touch gestures it does not handle tool invocation i....
static Qt::TouchPointStates pressedOnlyTouchStates()
static Qt::TouchPointStates allTouchStates()