Revert " modify license, permission and remove ^M char"
[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
59         result SetMoveAllowance(float allowance);
60         float GetMoveAllowanceF(void) const;
61         
62         bool IsInBounds(void);
63         void ClearTapInfoList(void);
64         bool IsAllTapped(void);
65
66         virtual bool OnTouchPressed(const Tizen::Ui::_Control& source, const Tizen::Ui::_TouchInfo& touchinfo);
67         virtual bool OnTouchMoved(const Tizen::Ui::_Control& source, const Tizen::Ui::_TouchInfo& touchinfo);
68         virtual bool OnTouchReleased(const Tizen::Ui::_Control& source, const Tizen::Ui::_TouchInfo& touchinfo);
69         virtual bool OnTouchCanceled(const Tizen::Ui::_Control& source, const Tizen::Ui::_TouchInfo& touchinfo);
70
71 private:
72         _TouchTapGestureDetector(const _TouchTapGestureDetector& value);
73         _TouchTapGestureDetector& operator =(const _TouchTapGestureDetector& value);
74
75         void RemoveTapInfoList(void);
76
77 private:
78         int __tapCount;
79         int __interval;
80         int __touchCount;
81         float __oneTapMoveAllowance;
82         bool __oneTapIsInBounds;
83         unsigned int __maxPointId;
84         Tizen::Graphics::FloatPoint __oneTapStartPoint;
85         _TouchGestureTimerManager* __pGestureTimerManager;
86
87         class _TapInfo;
88         Tizen::Base::Collection::ArrayListT<_TapInfo*>* __pTapInfoList;
89 }; // _TapGestureDetector
90
91 }} //Tizen::Ui
92
93 #endif //_FUI_INTERNAL_TOUCH_TAP_GESTURE_DETECTOR_H_