Tizen 2.1 base
[framework/osp/uifw.git] / inc / FUiTouchPanningGestureDetector.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                        FUiTouchPanningGestureDetector.h
20  * @brief               This is the header file for the %TouchPanningGestureDetector class.
21  *
22  * This header file contains the declarations of the %TouchPanningGestureDetector class.
23  *
24  */
25
26 #ifndef _FUI_TOUCH_PANNING_GESTURE_DETECTOR_H_
27 #define _FUI_TOUCH_PANNING_GESTURE_DETECTOR_H_
28
29 #include <FUiTouchGestureDetector.h>
30
31 namespace Tizen { namespace Ui
32 {
33
34 class ITouchPanningGestureEventListener;
35
36 /**
37  * @class               TouchPanningGestureDetector
38  * @brief               This class stores the information of a panning gesture detector.
39  *
40  * @since 2.0
41  *
42  * @final        This class is not intended for extension.
43  *
44  * The %TouchPanningGestureDetector class supports changing condition of panning gesture, and provides information about panning gesture detector.
45  *
46  */
47 class _OSP_EXPORT_ TouchPanningGestureDetector
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         TouchPanningGestureDetector(void);
57
58         /**
59          * This destructor overrides Tizen::Base::Object::~Object().
60          *
61          * @since 2.0
62          */
63         virtual ~TouchPanningGestureDetector(void);
64
65         /**
66          * Initializes this instance of %TouchPanningGestureDetector.
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 ITouchPanningGestureEventListener instance to the panning 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 AddPanningGestureEventListener(Tizen::Ui::ITouchPanningGestureEventListener& listener);
87
88         /**
89          * Removes the ITouchPanningGestureEventListener instance from the panning 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 RemovePanningGestureEventListener(Tizen::Ui::ITouchPanningGestureEventListener& listener);
100
101         /**
102          * Gets the list of the touched points represented by TouchInfo.
103          *
104          * @since 2.0
105          *
106          * @return              A list of the TouchInfo
107          * @exception   E_SUCCESS                                       The method is successful.
108          * @remarks     If an error occurs, this method returns @c null.
109          * @see                         Tizen::Ui::TouchInfo
110          */
111         Tizen::Base::Collection::IList* GetTouchInfoListN(void) const;
112
113         /**
114          * Sets the finger count for the recognition of panning gesture at the same time.
115          *
116          * @since 2.0
117          *
118          * @param[in]           count                                                           The finger count for panning gesture
119          * @exception           E_SUCCESS                                       The method is successful.
120          * @exception           E_INVALID_ARG                           The specified @c count is less than @c 0.
121          * @remarks             The default value is @c 1.
122          *                              It is recommended to check the maximum touch count of a device before changing the touch count of a gesture detector.
123          *                              You can set the gesture touch count to more than the maximum device touch count, but the gesture recognition may not work as you expected.
124          * @see                         GetTouchCount()
125          *
126          */
127         result SetTouchCount(int count);
128
129         /**
130          * Gets the finger count for the recognition of panning gesture at the same time.
131          *
132          * @since 2.0
133          *
134          * @return                      The finger count for panning gesture
135          * @exception           E_SUCCESS                                       The method is successful.
136          * @remarks             If an error occurs, this method returns -1.
137          * @see                         SetTouchCount()
138          *
139          */
140         int GetTouchCount(void) const;
141
142 private:
143         //
144         // This is the copy constructor for this class.
145         //
146         TouchPanningGestureDetector(const TouchPanningGestureDetector& rhs);
147
148         //
149         // Assigns the value of the specified instance to the current instance of %TouchPanningGestureDetector.
150         //
151         TouchPanningGestureDetector& operator =(const TouchPanningGestureDetector& rhs);
152
153 protected:
154         friend class _TouchPanningGestureDetectorImpl;
155 }; // TouchPanningGestureDetector
156
157 }} // Tizen::Ui
158
159 #endif  //_FUI_TOUCH_PANNING_GESTURE_DETECTOR_H_