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.
19 * @file FUiTouchRotationGestureDetector.h
20 * @brief This is the header file for the %TouchRotationGestureDetector class.
22 * This header file contains the declarations of the %TouchRotationGestureDetector class.
26 #ifndef _FUI_TOUCH_ROTATION_GESTURE_DETECTOR_H_
27 #define _FUI_TOUCH_ROTATION_GESTURE_DETECTOR_H_
29 #include <FUiTouchGestureDetector.h>
31 namespace Tizen { namespace Ui
34 class ITouchRotationGestureEventListener;
37 * @class TouchRotationGestureDetector
38 * @brief This class stores the information of a rotation gesture detector.
42 * @final This class is not intended for extension.
44 * The %TouchRotationGestureDetector class provides information about rotation gesture detector.
47 class _OSP_EXPORT_ TouchRotationGestureDetector
48 : public Tizen::Ui::TouchGestureDetector
52 * The object is not fully constructed after this constructor is called. For full construction, the Construct() method must be called right after calling this constructor.
56 TouchRotationGestureDetector(void);
59 * This destructor overrides Tizen::Base::Object::~Object().
63 virtual ~TouchRotationGestureDetector(void);
66 * Initializes this instance of %TouchRotationGestureDetector.
69 * @exception E_SUCCESS The method is successful.
70 * @exception E_OUT_OF_MEMORY The memory is insufficient.
72 result Construct(void);
75 * Adds the ITouchRotationGestureEventListener instance to the rotation gesture detector instance. @n
76 * The added listener gets notified when a gesture is recognized.
80 * @return An error code
81 * @param[in] listener The event listener to add
82 * @exception E_SUCCESS The method is successful.
83 * @exception E_OBJ_ALREADY_EXIST The listener is already added.
84 * @see RemoveRotationGestureEventListener()
86 result AddRotationGestureEventListener(Tizen::Ui::ITouchRotationGestureEventListener& listener);
89 * Removes the ITouchRotationGestureEventListener instance from the rotation gesture detector instance.
93 * @return An error code
94 * @param[in] listener The listener to remove
95 * @exception E_SUCCESS The method is successful.
96 * @exception E_OBJ_NOT_FOUND The specified @c listener is not found.
97 * @see AddRotationGestureEventListener()
99 result RemoveRotationGestureEventListener(Tizen::Ui::ITouchRotationGestureEventListener& listener);
102 * Gets the angle between the previous touch points and the current touch points.
106 * @return The angle between two touch points
107 * @exception E_SUCCESS The method is successful.
108 * @remarks If an error occurs, this method returns @c -1.
110 float GetAngle(void) const;
113 * Gets the distance between two touch points.
117 * @return The distance between two touch points
118 * @exception E_SUCCESS The method is successful.
119 * @remarks If an error occurs, this method returns @c -1.
121 int GetDistance(void) const;
124 * Gets the distance between two touch points.
128 * @return The distance between two touch points
129 * @exception E_SUCCESS The method is successful.
130 * @remarks If an error occurs, this method returns @c -1.
132 float GetDistanceF(void) const;
136 // This is the copy constructor for this class.
138 TouchRotationGestureDetector(const TouchRotationGestureDetector& rhs);
141 // Assigns the value of the specified instance to the current instance of %TouchRotationGestureDetector.
143 TouchRotationGestureDetector& operator =(const TouchRotationGestureDetector& rhs);
146 friend class _TouchRotationGestureDetectorImpl;
147 }; // TouchRotationGestureDetector
151 #endif //_FUI_TOUCH_ROTATION_GESTURE_DETECTOR_H_