Dali 3D User Interface Engine
tap-gesture-detector.h
Go to the documentation of this file.
1 #ifndef __DALI_INTERNAL_TAP_GESTURE_DETECTOR_H__
2 #define __DALI_INTERNAL_TAP_GESTURE_DETECTOR_H__
3 
4 /*
5  * Copyright (c) 2014 Samsung Electronics Co., Ltd.
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  *
19  */
20 
21 // EXTERNAL INCLUDES
25 
26 // INTERNAL INCLUDES
27 #include <events/gesture-detector.h>
28 
29 namespace Dali
30 {
31 
32 namespace Integration
33 {
34 struct TouchEvent;
35 struct TapGestureRequest;
36 }
37 
38 namespace Internal
39 {
40 
41 namespace Adaptor
42 {
43 
44 class CoreEventInterface;
45 
50 {
51 public:
52 
59  TapGestureDetector(CoreEventInterface& coreEventInterface, Vector2 screenSize, const Integration::TapGestureRequest& request);
60 
64  virtual ~TapGestureDetector();
65 
66 public:
67 
71  virtual void SendEvent(const Integration::TouchEvent& event);
72 
76  virtual void Update(const Integration::GestureRequest& request);
77 
78 private:
79 
86  void EmitGesture( Gesture::State state, unsigned int time );
87 
94  void SetupForTouchDown( const Integration::TouchEvent& event, const TouchPoint& point );
95 
101  void EmitPossibleState( const Integration::TouchEvent& event );
102 
109  void EmitSingleTap( unsigned int time, const TouchPoint& point );
110 
117  void EmitTap( unsigned int time, Integration::TapGestureEvent& event );
118 
119 private:
120 
124  enum State
125  {
130  };
131 
134 
138 
140  unsigned long mTouchTime;
141  unsigned long mLastTapTime;
142 
143 };
144 
145 } // namespace Adaptor
146 
147 } // namespace Internal
148 
149 } // namespace Dali
150 
151 #endif // __DALI_INTERNAL_TAP_GESTURE_DETECTOR_H__
Dali Docs Home
Read more about Dali