2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
5 // Licensed under the Apache License, Version 2.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://www.apache.org/licenses/LICENSE-2.0/
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 FUiTouchPanningGestureDetector.h
20 * @brief This is the header file for the %TouchPanningGestureDetector class.
22 * This header file contains the declarations of the %TouchPanningGestureDetector class.
26 #ifndef _FUI_TOUCH_PANNING_GESTURE_DETECTOR_H_
27 #define _FUI_TOUCH_PANNING_GESTURE_DETECTOR_H_
29 #include <FUiTouchGestureDetector.h>
31 namespace Tizen { namespace Ui
34 class ITouchPanningGestureEventListener;
37 * @class TouchPanningGestureDetector
38 * @brief This class stores the information of a panning gesture detector.
42 * @final This class is not intended for extension.
44 * The %TouchPanningGestureDetector class supports changing condition of panning gesture, and provides information about panning gesture detector.
47 class _OSP_EXPORT_ TouchPanningGestureDetector
48 : public Tizen::Ui::TouchGestureDetector
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.
56 TouchPanningGestureDetector(void);
59 * This destructor overrides Tizen::Base::Object::~Object().
63 virtual ~TouchPanningGestureDetector(void);
66 * Initializes this instance of %TouchPanningGestureDetector.
69 * @exception E_SUCCESS The method is successful.
70 * @exception E_OUT_OF_MEMORY The memory is insufficient.
72 result Construct(void);
75 * Adds the ITouchPanningGestureEventListener instance to the panning gesture detector instance. @n
76 * The added listener gets notified when a gesture is recognized.
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 RemovePanningGestureEventListener()
86 result AddPanningGestureEventListener(Tizen::Ui::ITouchPanningGestureEventListener& listener);
89 * Removes the ITouchPanningGestureEventListener instance from the panning gesture detector instance.
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 AddPanningGestureEventListener()
99 result RemovePanningGestureEventListener(Tizen::Ui::ITouchPanningGestureEventListener& listener);
102 * Gets the list of the touched points represented by TouchInfo.
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
111 Tizen::Base::Collection::IList* GetTouchInfoListN(void) const;
114 * Sets the finger count for the recognition of panning gesture at the same time.
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()
127 result SetTouchCount(int count);
130 * Gets the finger count for the recognition of panning gesture at the same time.
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 @c -1.
137 * @see SetTouchCount()
140 int GetTouchCount(void) const;
144 // This is the copy constructor for this class.
146 TouchPanningGestureDetector(const TouchPanningGestureDetector& rhs);
149 // Assigns the value of the specified instance to the current instance of %TouchPanningGestureDetector.
151 TouchPanningGestureDetector& operator =(const TouchPanningGestureDetector& rhs);
154 friend class _TouchPanningGestureDetectorImpl;
155 }; // TouchPanningGestureDetector
159 #endif //_FUI_TOUCH_PANNING_GESTURE_DETECTOR_H_