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 * @feature %http://tizen.org/feature/multi_point_touch.pinch_zoom
73 * @return An error code
74 * @exception E_SUCCESS The method is successful.
75 * @exception E_OUT_OF_MEMORY The memory is insufficient.
76 * @exception E_UNSUPPORTED_OPERATION The Emulator or target device does not support the required feature. @b Since: @b 2.1
77 * For more information, see
78 * <a href=?../org.tizen.gettingstarted/html/tizen_overview/application_filtering.htm?>
79 * Application Filtering</a>.
80 * @remarks Before calling this method, check whether the feature is supported by %Tizen::System::SystemInfo::GetValue()
83 result Construct(void);
87 * Adds the ITouchPinchGestureEventListener instance to the pinch gesture detector instance. @n
88 * The added listener gets notified when a gesture is recognized.
92 * @return An error code
93 * @param[in] listener The event listener to add
94 * @exception E_SUCCESS The method is successful.
95 * @exception E_OBJ_ALREADY_EXIST The listener is already added.
96 * @see RemoveRotationGestureEventListener()
98 result AddPinchGestureEventListener(Tizen::Ui::ITouchPinchGestureEventListener& listener);
101 * Removes the ITouchPinchGestureEventListener instance from the pinch gesture detector instance.
105 * @return An error code
106 * @param[in] listener The listener to remove
107 * @exception E_SUCCESS The method is successful.
108 * @exception E_OBJ_NOT_FOUND The specified @c listener is not found.
109 * @see AddRotationGestureEventListener()
111 result RemovePinchGestureEventListener(Tizen::Ui::ITouchPinchGestureEventListener& listener);
114 * Gets the center position of two touch points.
118 * @return The center point
119 * @exception E_SUCCESS The method is successful.
120 * @remarks If an error occurs, this method returns Point(-1, -1).
122 Tizen::Graphics::Point GetCenterPoint(void) const;
125 * Gets the center position of two touch points.
129 * @return The center point
130 * @exception E_SUCCESS The method is successful.
131 * @remarks If an error occurs, this method returns Point(-1, -1).
133 Tizen::Graphics::FloatPoint GetCenterPointF(void) const;
136 * Gets the scale factor among touched points.
140 * @return The scale factor among touched points
141 * @remarks Gets the scale factor for a pinch gesture in progress.
143 int GetScale(void) const;
146 * Gets the scale factor among touched point
150 * @return The scale factor among touched points
151 * @remarks Get scale factor for a pinch gesture in progress
153 float GetScaleF(void) const;
157 // This is the copy constructor for this class.
159 TouchPinchGestureDetector(const TouchPinchGestureDetector& rhs);
162 // Assigns the value of the specified instance to the current instance of %TouchPinchGestureDetector.
164 TouchPinchGestureDetector& operator =(const TouchPinchGestureDetector& rhs);
167 friend class _TouchPinchGestureDetectorImpl;
168 }; // TouchPinchGestureDetector
172 #endif //_FUI_TOUCH_PINCH_GESTURE_DETECTOR_H_