Adjust the position of the partial Frame
[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          * @exception   E_SUCCESS                                       The method is successful.
72          * @exception   E_OUT_OF_MEMORY         The memory is insufficient.
73          */
74         result Construct(void);
75
76         /**
77         * Adds the ITouchPinchGestureEventListener instance to the pinch gesture detector instance. @n
78         * The added listener gets notified when a gesture is recognized.
79         *
80         * @since 2.0
81         *
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()
87         */
88         result AddPinchGestureEventListener(Tizen::Ui::ITouchPinchGestureEventListener& listener);
89
90         /**
91         * Removes the ITouchPinchGestureEventListener instance from the pinch gesture detector instance.
92         *
93         * @since 2.0
94         *
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()
100         */
101         result RemovePinchGestureEventListener(Tizen::Ui::ITouchPinchGestureEventListener& listener);
102
103         /**
104          * Gets the center position of two touch points.
105          *
106          * @since 2.0
107          *
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).
111          */
112         Tizen::Graphics::Point GetCenterPoint(void) const;
113
114         /**
115          * Gets the center position of two touch points.
116          *
117          * @since 2.1
118          *
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).
122          */
123         Tizen::Graphics::FloatPoint GetCenterPointF(void) const;
124
125         /**
126          * Gets the scale factor among touched points.
127          *
128          * @since 2.0
129          *
130          * @return                      The scale factor among touched points
131          * @remarks             Gets the scale factor for a pinch gesture in progress.
132          */
133         int GetScale(void) const;
134
135         /**
136          * Gets the scale factor among touched point
137          *
138          * @since 2.1
139          *
140          * @return                      The scale factor among touched points
141          * @remarks             Get scale factor for a pinch gesture in progress
142          */
143         float GetScaleF(void) const;
144
145 private:
146         //
147         // This is the copy constructor for this class.
148         //
149         TouchPinchGestureDetector(const TouchPinchGestureDetector& rhs);
150
151         //
152         // Assigns the value of the specified instance to the current instance of %TouchPinchGestureDetector.
153         //
154         TouchPinchGestureDetector& operator =(const TouchPinchGestureDetector& rhs);
155
156 protected:
157         friend class _TouchPinchGestureDetectorImpl;
158 }; // TouchPinchGestureDetector
159
160 }} // Tizen::Ui
161
162 #endif  //_FUI_TOUCH_PINCH_GESTURE_DETECTOR_H_