Merge "Fix Ime Rotation" into tizen_2.1
[platform/framework/native/uifw.git] / inc / FUiTouchPinchGestureDetector.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
4 //
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
8 //
9 //     http://floralicense.org/license/
10 //
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.
16 //
17
18 /**
19  * @file                        FUiTouchPinchGestureDetector.h
20  * @brief               This is the header file for the %TouchPinchGestureDetector class.
21  *
22  * This header file contains the declarations of the %TouchPinchGestureDetector class.
23  *
24  */
25
26 #ifndef _FUI_TOUCH_PINCH_GESTURE_DETECTOR_H_
27 #define _FUI_TOUCH_PINCH_GESTURE_DETECTOR_H_
28
29 #include <FUiTouchGestureDetector.h>
30 #include <FGrpPoint.h>
31 #include <FGrpFloatPoint.h>
32
33 namespace Tizen { namespace Ui
34 {
35
36 class ITouchPinchGestureEventListener;
37
38 /**
39  * @class               TouchPinchGestureDetector
40  * @brief               This class stores the information of a pinch gesture detector.
41  *
42  * @since 2.0
43  *
44  * @final        This class is not intended for extension.
45  *
46  * The %TouchPinchGestureDetector class provides information about pinch gesture detector.
47  *
48  */
49 class _OSP_EXPORT_ TouchPinchGestureDetector
50         : public Tizen::Ui::TouchGestureDetector
51 {
52 public:
53         /**
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.
55          *
56          * @since 2.0
57          */
58         TouchPinchGestureDetector(void);
59
60         /**
61          * This destructor overrides Tizen::Base::Object::~Object().
62          *
63          * @since 2.0
64          */
65         virtual ~TouchPinchGestureDetector(void);
66
67         /**
68          * Initializes this instance of %TouchPinchGestureDetector.
69          *
70          * @since 2.0
71          * @feature     %http://tizen.org/feature/multi_point_touch.pinch_zoom
72          *
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()
81          *              methods.
82         */
83         result Construct(void);
84
85
86         /**
87         * Adds the ITouchPinchGestureEventListener instance to the pinch gesture detector instance. @n
88         * The added listener gets notified when a gesture is recognized.
89         *
90         * @since 2.0
91         *
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()
97         */
98         result AddPinchGestureEventListener(Tizen::Ui::ITouchPinchGestureEventListener& listener);
99
100         /**
101         * Removes the ITouchPinchGestureEventListener instance from the pinch gesture detector instance.
102         *
103         * @since 2.0
104         *
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()
110         */
111         result RemovePinchGestureEventListener(Tizen::Ui::ITouchPinchGestureEventListener& listener);
112
113         /**
114          * Gets the center position of two touch points.
115          *
116          * @since 2.0
117          *
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).
121          */
122         Tizen::Graphics::Point GetCenterPoint(void) const;
123
124         /**
125          * Gets the center position of two touch points.
126          *
127          * @since 2.1
128          *
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).
132          */
133         Tizen::Graphics::FloatPoint GetCenterPointF(void) const;
134
135         /**
136          * Gets the scale factor among touched points.
137          *
138          * @since 2.0
139          *
140          * @return                      The scale factor among touched points
141          * @remarks             Gets the scale factor for a pinch gesture in progress.
142          */
143         int GetScale(void) const;
144
145         /**
146          * Gets the scale factor among touched point
147          *
148          * @since 2.1
149          *
150          * @return                      The scale factor among touched points
151          * @remarks             Get scale factor for a pinch gesture in progress
152          */
153         float GetScaleF(void) const;
154
155 private:
156         //
157         // This is the copy constructor for this class.
158         //
159         TouchPinchGestureDetector(const TouchPinchGestureDetector& rhs);
160
161         //
162         // Assigns the value of the specified instance to the current instance of %TouchPinchGestureDetector.
163         //
164         TouchPinchGestureDetector& operator =(const TouchPinchGestureDetector& rhs);
165
166 protected:
167         friend class _TouchPinchGestureDetectorImpl;
168 }; // TouchPinchGestureDetector
169
170 }} // Tizen::Ui
171
172 #endif  //_FUI_TOUCH_PINCH_GESTURE_DETECTOR_H_