2
* CompoundGestureRecognizer.h
3
* This file is part of Unity
5
* Copyright (C) 2012 - Canonical Ltd.
7
* Unity is free software; you can redistribute it and/or modify
8
* it under the terms of the GNU General Public License as published by
9
* the Free Software Foundation; either version 2 of the License, or
10
* (at your option) any later version.
12
* Unity is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
* GNU General Public License for more details.
17
* You should have received a copy of the GNU General Public License
18
* along with this program. If not, see <http://www.gnu.org/licenses/>.
20
* Authored by: Daniel d'Andrada <daniel.dandrada@canonical.com>
23
#ifndef COMPOUND_GESTURE_RECOGNIZER_H
24
#define COMPOUND_GESTURE_RECOGNIZER_H
26
#include <sigc++/sigc++.h>
36
enum class RecognitionResult
39
DOUBLE_TAP_RECOGNIZED, /*! Returned when a double-tap is recognized */
40
TAP_AND_HOLD_RECOGNIZED, /*!< Returned when a "tap and hold" is recognized
41
At this point the user is still "holding". I.e.,
42
his fingers are still on the touchscreen or
46
class CompoundGestureRecognizerPrivate;
49
Recognizes compound gestures. I.e. high level gestures that are maded up by
50
two sequencial regular gestures (like a tap followed by a second tap).
52
class CompoundGestureRecognizer
56
static const int MAX_TIME_BETWEEN_GESTURES = 600;
57
static const int MAX_TAP_TIME = 300;
58
static const int HOLD_TIME = 600;
60
CompoundGestureRecognizer();
61
virtual ~CompoundGestureRecognizer();
63
virtual RecognitionResult GestureEvent(nux::GestureEvent const& event);
66
CompoundGestureRecognizerPrivate* p;
71
#endif // COMPOUND_GESTURE_RECOGNIZER_H