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_TouchRotationGestureDetector.h
19 * @brief This is the header file for the %_TouchRotationGestureDetector class.
21 * This header file contains the declarations of the %_TouchRotationGestureDetector class.
23 #ifndef _FUI_INTERNAL_TOUCH_ROTATION_GESTURE_DETECTOR_H_
24 #define _FUI_INTERNAL_TOUCH_ROTATION_GESTURE_DETECTOR_H_
26 #include "FUi_TouchGestureDetector.h"
28 namespace Tizen { namespace Ui
31 * @class _TouchRotationGestureDetector
36 class _OSP_EXPORT_ _TouchRotationGestureDetector
37 : public _TouchGestureDetector
38 , public Tizen::Base::Runtime::ITimerEventListener
41 _TouchRotationGestureDetector(void);
42 ~_TouchRotationGestureDetector(void);
44 virtual bool OnTouchPressed(const Tizen::Ui::_Control& source, const Tizen::Ui::_TouchInfo& touchinfo);
45 virtual bool OnTouchMoved(const Tizen::Ui:: _Control& source, const Tizen::Ui::_TouchInfo& touchinfo);
46 virtual bool OnTouchReleased(const Tizen::Ui::_Control& source, const Tizen::Ui::_TouchInfo& touchinfo);
47 virtual bool OnTouchCanceled(const Tizen::Ui::_Control& source, const Tizen::Ui::_TouchInfo& touchinfo);
49 float GetAngle(void) const;
50 int GetDistance(void) const;
53 _TouchRotationGestureDetector(const _TouchRotationGestureDetector&);
54 _TouchRotationGestureDetector& operator =(const _TouchRotationGestureDetector&);
56 double GetAngle(int x1, int y1, int x2, int y2) const;
57 virtual void OnTimerExpired(Tizen::Base::Runtime::Timer& timer);
58 void SetDetectorStateChanged(void);
64 Tizen::Graphics::Point __firstPoint;
65 Tizen::Graphics::Point __secondPoint;
66 Tizen::Graphics::Point __firstPrevPoint;
67 Tizen::Graphics::Point __secondPrevPoint;
68 int __firstMovedDirection;
69 int __secondMovedDirection;
70 Tizen::Base::Runtime::Timer* __pTimer;
71 unsigned long __firstPointId;
72 unsigned long __secondPointId;
73 }; // _TouchRotationGestureDetector
77 #endif //_FUI_INTERNAL_TOUCH_ROTATION_GESTURE_DETECTOR_H_