Tizen 2.1 base
[framework/osp/uifw.git] / src / ui / inc / FUi_TouchTapGestureDetector.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Flora License, Version 1.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 //     http://floralicense.org/license/
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an AS IS BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17 /**
18  * @file        FUi_TouchTapGestureDetector.h
19  * @brief       This is the header file for the %_TouchTapGestureDetector class.
20  *
21  * This header file contains the declarations of the %_TouchTapGestureDetector class.
22  */
23 #ifndef _FUI_INTERNAL_TOUCH_TAP_GESTURE_DETECTOR_H_
24 #define _FUI_INTERNAL_TOUCH_TAP_GESTURE_DETECTOR_H_
25
26 #include "FUi_TouchGestureDetector.h"
27 #include "FUi_UiTouchEvent.h"
28
29 namespace Tizen { namespace Ui
30 {
31 class _TouchGestureTimerManager;
32
33 /**
34  * @class               _TouchTapGestureDetector
35  * @brief
36  * @since 2.0
37  *
38  */
39 class _OSP_EXPORT_ _TouchTapGestureDetector
40         : public _TouchGestureDetector
41 {
42 public:
43         _TouchTapGestureDetector(void);
44         virtual ~_TouchTapGestureDetector(void);
45
46         result SetTapCount(int count);
47         int GetTapCount(void) const;
48
49         result SetTapInterval(long interval);
50         long GetTapInterval(void) const;
51
52         result SetTouchCount(int count);
53         int GetTouchCount(void) const;
54
55         //apply only one touch count
56         result SetMoveAllowance(int allowance);
57         int GetMoveAllowance(void) const;
58         bool IsInBounds(void);
59         void ClearTapInfoList(void);
60         bool IsAllTapped(void);
61
62         virtual bool OnTouchPressed(const Tizen::Ui::_Control& source, const Tizen::Ui::_TouchInfo& touchinfo);
63         virtual bool OnTouchMoved(const Tizen::Ui::_Control& source, const Tizen::Ui::_TouchInfo& touchinfo);
64         virtual bool OnTouchReleased(const Tizen::Ui::_Control& source, const Tizen::Ui::_TouchInfo& touchinfo);
65         virtual bool OnTouchCanceled(const Tizen::Ui::_Control& source, const Tizen::Ui::_TouchInfo& touchinfo);
66
67 private:
68         _TouchTapGestureDetector(const _TouchTapGestureDetector& value);
69         _TouchTapGestureDetector& operator =(const _TouchTapGestureDetector& value);
70
71         void RemoveTapInfoList(void);
72
73 private:
74         int __tapCount;
75         int __interval;
76         int __touchCount;
77         int __oneTapMoveAllowance;
78         bool __oneTapIsInBounds;
79         unsigned int __maxPointId;
80         Tizen::Graphics::Point __oneTapStartPoint;
81         _TouchGestureTimerManager* __pGestureTimerManager;
82
83         class _TapInfo;
84         Tizen::Base::Collection::ArrayListT<_TapInfo*>* __pTapInfoList;
85 }; // _TapGestureDetector
86
87 }} //Tizen::Ui
88
89 #endif //_FUI_INTERNAL_TOUCH_TAP_GESTURE_DETECTOR_H_