2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
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
9 // http://floralicense.org/license/
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.
18 * @file FUi_TouchFlickGestureDetector.h
19 * @brief This is the header file for the %_TouchFlickGestureDetector class.
21 * This header file contains the declarations of the %_TouchFlickGestureDetector class.
25 #ifndef _FUI_INTERNAL_TOUCH_FLICK_GESTURE_DETECTOR_H_
26 #define _FUI_INTERNAL_TOUCH_FLICK_GESTURE_DETECTOR_H_
28 #include "FUi_TouchGestureDetector.h"
29 #include "FUi_UiTouchEvent.h"
31 namespace Tizen { namespace Ui
36 _FLICK_DIRECTION_NONE = -1,
37 _FLICK_DIRECTION_RIGHT,
39 _FLICK_DIRECTION_LEFT,
48 _TouchStatus touchStatus;
52 * @class _TouchFlickGestureDetector
57 class _OSP_EXPORT_ _TouchFlickGestureDetector
58 : public _TouchGestureDetector
61 _TouchFlickGestureDetector(void);
62 virtual ~_TouchFlickGestureDetector(void);
64 virtual bool OnTouchPressed(const Tizen::Ui::_Control& source, const Tizen::Ui::_TouchInfo& touchinfo);
65 virtual bool OnTouchMoved(const Tizen::Ui::_Control& source, const Tizen::Ui::_TouchInfo& touchinfo);
66 virtual bool OnTouchReleased(const Tizen::Ui::_Control& source, const Tizen::Ui::_TouchInfo& touchinfo);
67 virtual bool OnTouchCanceled(const Tizen::Ui::_Control& source, const Tizen::Ui::_TouchInfo& touchinfo);
69 void GetDistance(int& x, int &y) const;
70 int GetDuration(void) const;
71 _FlickDirection GetDirection(void) const;
74 void CheckMoveMinMax(const int x, const int y);
75 void ClearVariables(void);
76 bool FindFlickWindow(const Tizen::Base::Collection::ArrayListT<_FlickInfo*>* pList, const _FlickInfo* pFlickInfo, int* pStartIndex, int* pEndIndex);
77 bool CalculateFlick(const Tizen::Base::Collection::ArrayListT<_FlickInfo*>* pList, const _FlickInfo* pFlickInfo, _FlickInfo* pReturnFlick);
78 result OnTouchDown(Tizen::Base::Collection::ArrayListT<_FlickInfo*>* pList, const _FlickInfo* pFlickInfo);
79 result OnTouchMove(Tizen::Base::Collection::ArrayListT<_FlickInfo*>* pList, const _FlickInfo* pFlickInfo);
80 result OnTouchUp(Tizen::Base::Collection::ArrayListT<_FlickInfo*>* pList, const _FlickInfo* pFlickInfo, _FlickInfo* pReturnFlick, bool& isFlicked);
82 _TouchFlickGestureDetector(const _TouchFlickGestureDetector&);
83 _TouchFlickGestureDetector& operator =(const _TouchFlickGestureDetector&);
89 _FlickDirection __direction;
94 Tizen::Base::Collection::ArrayListT<_FlickInfo*>* __pFlickInfoList;
95 }; // _TouchFlickGestureDetector
99 #endif // _FUI_INTERNAL_TOUCH_FLICK_GESTURE_DETECTOR_H_