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 FUiTouchPinchGestureDetector.h
20 * @brief This is the header file for the %TouchPinchGestureDetector class.
22 * This header file contains the declarations of the %TouchPinchGestureDetector class.
26 #ifndef _FUI_TOUCH_PINCH_GESTURE_DETECTOR_H_
27 #define _FUI_TOUCH_PINCH_GESTURE_DETECTOR_H_
29 #include <FUiTouchGestureDetector.h>
30 #include <FGrpPoint.h>
31 #include <FGrpFloatPoint.h>
33 namespace Tizen { namespace Ui
36 class ITouchPinchGestureEventListener;
39 * @class TouchPinchGestureDetector
40 * @brief This class stores the information of a pinch gesture detector.
44 * @final This class is not intended for extension.
46 * The %TouchPinchGestureDetector class provides information about pinch gesture detector.
49 class _OSP_EXPORT_ TouchPinchGestureDetector
50 : public Tizen::Ui::TouchGestureDetector
54 * 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.
58 TouchPinchGestureDetector(void);
61 * This destructor overrides Tizen::Base::Object::~Object().
65 virtual ~TouchPinchGestureDetector(void);
68 * Initializes this instance of %TouchPinchGestureDetector.
71 * @exception E_SUCCESS The method is successful.
72 * @exception E_OUT_OF_MEMORY The memory is insufficient.
74 result Construct(void);
77 * Adds the ITouchPinchGestureEventListener instance to the pinch gesture detector instance. @n
78 * The added listener gets notified when a gesture is recognized.
82 * @return An error code
83 * @param[in] listener The event listener to add
84 * @exception E_SUCCESS The method is successful.
85 * @exception E_OBJ_ALREADY_EXIST The listener is already added.
86 * @see RemoveRotationGestureEventListener()
88 result AddPinchGestureEventListener(Tizen::Ui::ITouchPinchGestureEventListener& listener);
91 * Removes the ITouchPinchGestureEventListener instance from the pinch gesture detector instance.
95 * @return An error code
96 * @param[in] listener The listener to remove
97 * @exception E_SUCCESS The method is successful.
98 * @exception E_OBJ_NOT_FOUND The specified @c listener is not found.
99 * @see AddRotationGestureEventListener()
101 result RemovePinchGestureEventListener(Tizen::Ui::ITouchPinchGestureEventListener& listener);
104 * Gets the center position of two touch points.
108 * @return The center point
109 * @exception E_SUCCESS The method is successful.
110 * @remarks If an error occurs, this method returns Point(-1, -1).
112 Tizen::Graphics::Point GetCenterPoint(void) const;
115 * Gets the center position of two touch points.
119 * @return The center point
120 * @exception E_SUCCESS The method is successful.
121 * @remarks If an error occurs, this method returns Point(-1, -1).
123 Tizen::Graphics::FloatPoint GetCenterPointF(void) const;
126 * Gets the scale factor among touched points.
130 * @return The scale factor among touched points
131 * @remarks Gets the scale factor for a pinch gesture in progress.
133 int GetScale(void) const;
136 * Gets the scale factor among touched point
140 * @return The scale factor among touched points
141 * @remarks Get scale factor for a pinch gesture in progress
143 float GetScaleF(void) const;
147 // This is the copy constructor for this class.
149 TouchPinchGestureDetector(const TouchPinchGestureDetector& rhs);
152 // Assigns the value of the specified instance to the current instance of %TouchPinchGestureDetector.
154 TouchPinchGestureDetector& operator =(const TouchPinchGestureDetector& rhs);
157 friend class _TouchPinchGestureDetectorImpl;
158 }; // TouchPinchGestureDetector
162 #endif //_FUI_TOUCH_PINCH_GESTURE_DETECTOR_H_