Dali 3D User Interface Engine
pan-gesture-detector-base.h
Go to the documentation of this file.
1 #ifndef __DALI_INTERNAL_PAN_GESTURE_DETECTOR_BASE_H__
2 #define __DALI_INTERNAL_PAN_GESTURE_DETECTOR_BASE_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 class Core;
35 struct TouchEvent;
36 struct PanGestureRequest;
37 }
38 
39 namespace Internal
40 {
41 
42 namespace Adaptor
43 {
44 
45 class EnvironmentOptions;
46 
51 {
52 public:
53 
57  virtual ~PanGestureDetectorBase();
58 
59 public:
60 
64  virtual void SendEvent(const Integration::TouchEvent& event);
65 
69  virtual void Update(const Integration::GestureRequest& request);
70 
71 protected:
72 
78  PanGestureDetectorBase(Vector2 screenSize, const Integration::PanGestureRequest& request, EnvironmentOptions* environmentOptions);
79 
80 private:
81 
87  void SendPan(Gesture::State state, const Integration::TouchEvent& currentEvent);
88 
93  virtual void EmitPan(const Integration::PanGestureEvent gesture) = 0;
94 
95 private:
96 
100  enum State
101  {
107  };
108 
110  std::vector<Integration::TouchEvent> mTouchEvents;
111 
115 
118 
119  unsigned long mPrimaryTouchDownTime;
120  unsigned int mMinimumTouchesRequired;
121  unsigned int mMaximumTouchesRequired;
122 
123  unsigned int mMinimumDistanceSquared;
124  unsigned int mMinimumMotionEvents;
125  unsigned int mMotionEvents;
126 };
127 
128 } // namespace Adaptor
129 
130 } // namespace Internal
131 
132 } // namespace Dali
133 
134 #endif // __DALI_INTERNAL_PAN_GESTURE_DETECTOR_BASE_H__
Dali Docs Home
Read more about Dali