Dali 3D User Interface Engine
long-press-gesture-detector.h
Go to the documentation of this file.
1 #ifndef __DALI_INTERNAL_LONG_PRESS_GESTURE_DETECTOR_H__
2 #define __DALI_INTERNAL_LONG_PRESS_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
22 #include <map>
23 #include <timer.h>
24 
25 // INTERNAL INCLUDES
26 #include <events/gesture-detector.h>
27 
28 namespace Dali
29 {
30 
31 namespace Integration
32 {
33 struct TouchEvent;
34 struct LongPressGestureRequest;
35 }
36 
37 namespace Internal
38 {
39 
40 namespace Adaptor
41 {
42 
43 class CoreEventInterface;
44 
51 {
52 public:
53 
60  LongPressGestureDetector(CoreEventInterface& coreEventInterface, Vector2 screenSize, const Integration::LongPressGestureRequest& request);
61 
65  virtual ~LongPressGestureDetector();
66 
67 public:
68 
72  virtual void SendEvent(const Integration::TouchEvent& event);
73 
77  virtual void Update(const Integration::GestureRequest& request);
78 
79 private:
80 
85  bool TimerCallback();
86 
91  void EmitGesture(Gesture::State state);
92 
97  int GetSystemValue();
98 
99 private:
100 
104  enum State
105  {
110  };
111 
114 
115  unsigned int mMinimumTouchesRequired;
116  unsigned int mMaximumTouchesRequired;
117 
118  std::map<int, Vector2> mTouchPositions;
119  unsigned long mTouchTime;
120 
123 };
124 
125 } // namespace Adaptor
126 
127 } // namespace Internal
128 
129 } // namespace Dali
130 
131 #endif // __DALI_INTERNAL_LONG_PRESS_GESTURE_DETECTOR_H__
Dali Docs Home
Read more about Dali