Tizen 2.1 base
[framework/osp/uifw.git] / inc / FUiTouchRotationGestureDetector.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                        FUiTouchRotationGestureDetector.h
20  * @brief               This is the header file for the %TouchRotationGestureDetector class.
21  *
22  * This header file contains the declarations of the %TouchRotationGestureDetector class.
23  *
24  */
25
26 #ifndef _FUI_TOUCH_ROTATION_GESTURE_DETECTOR_H_
27 #define _FUI_TOUCH_ROTATION_GESTURE_DETECTOR_H_
28
29 #include <FUiTouchGestureDetector.h>
30
31 namespace Tizen { namespace Ui
32 {
33
34 class ITouchRotationGestureEventListener;
35
36 /**
37  * @class               TouchRotationGestureDetector
38  * @brief               This class stores the information of a rotation gesture detector.
39  *
40  * @since 2.0
41  *
42  * @final        This class is not intended for extension.
43  *
44  * The %TouchRotationGestureDetector class provides information about rotation gesture detector.
45  *
46  */
47 class _OSP_EXPORT_ TouchRotationGestureDetector
48         : public Tizen::Ui::TouchGestureDetector
49 {
50 public:
51         /**
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.
53          *
54          * @since 2.0
55          */
56         TouchRotationGestureDetector(void);
57
58         /**
59          * This destructor overrides Tizen::Base::Object::~Object().
60          *
61          * @since 2.0
62          */
63         virtual ~TouchRotationGestureDetector(void);
64
65         /**
66          * Initializes this instance of %TouchRotationGestureDetector.
67          *
68          * @since 2.0
69          * @exception   E_SUCCESS                                       The method is successful.
70          * @exception   E_OUT_OF_MEMORY         The memory is insufficient.
71          */
72         result Construct(void);
73
74         /**
75          * Adds the ITouchRotationGestureEventListener instance to the rotation gesture detector instance. @n
76          * The added listener gets notified when a gesture is recognized.
77          *
78          * @since 2.0
79          *
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()
85          */
86         result AddRotationGestureEventListener(Tizen::Ui::ITouchRotationGestureEventListener& listener);
87
88         /**
89          * Removes the ITouchRotationGestureEventListener instance from the rotation gesture detector instance.
90          *
91          * @since 2.0
92          *
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()
98          */
99         result RemoveRotationGestureEventListener(Tizen::Ui::ITouchRotationGestureEventListener& listener);
100
101         /**
102          * Gets the angle between the previous touch points and the current touch points.
103          *
104          * @since 2.0
105          *
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 -1.
109          */
110         float GetAngle(void) const;
111
112         /**
113          * Gets the distance between two touch points.
114          *
115          * @since 2.0
116          *
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 -1.
120          */
121         int GetDistance(void) const;
122
123 private:
124         //
125         // This is the copy constructor for this class.
126         //
127         TouchRotationGestureDetector(const TouchRotationGestureDetector& rhs);
128
129         //
130         // Assigns the value of the specified instance to the current instance of %TouchRotationGestureDetector.
131         //
132         TouchRotationGestureDetector& operator =(const TouchRotationGestureDetector& rhs);
133
134 protected:
135         friend class _TouchRotationGestureDetectorImpl;
136 }; // TouchRotationGestureDetector
137
138 }} // Tizen::Ui
139
140 #endif  //_FUI_TOUCH_ROTATION_GESTURE_DETECTOR_H_