2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
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
9 // http://floralicense.org/license/
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 FUiITouchEventListener.h
20 * @brief This is the header file for the %ITouchEventListener interface.
22 * This header file contains the declarations of the %ITouchEventListener interface.
25 #ifndef _FUI_ITOUCH_EVENT_LISTENER_H_
26 #define _FUI_ITOUCH_EVENT_LISTENER_H_
28 #include <FBaseRtIEventListener.h>
29 #include <FBaseTypes.h>
30 #include <FGraphics.h>
33 namespace Tizen { namespace Ui
39 * @interface ITouchEventListener
40 * @brief This interface is used as the argument to the touch event listener.
44 * The %ITouchEventListener interface is the listener interface for receiving touch events.
45 * The class that processes a touch event implements this interface, and the instance created with that class is registered with a
46 * UI control, using the control's AddTouchEventListener() method. When the touch event occurs, a method of that instance is
49 * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/ui/event_listener.htm">Event Listeners</a>.
51 class _OSP_EXPORT_ ITouchEventListener
52 : virtual public Tizen::Base::Runtime::IEventListener
56 * This polymorphic destructor should be overridden if required. This way, the destructors of the derived classes are called when the destructor of this interface is called.
61 virtual ~ITouchEventListener(void) {}
64 * Called when an entity is touch pressed.
68 * @param[in] source The source of the event
69 * @param[in] currentPosition The current position
70 * @param[in] touchInfo The touch event information
72 virtual void OnTouchPressed(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo & touchInfo) = 0;
76 * Called when an entity is touched and held for a long time.
78 * @brief <i> [Deprecated] </i>
79 * @deprecated This callback is deprecated.
80 * If you want to listen to "long press" touch event, it is recommended to use TouchLongPressGestureDetector class.
83 * @param[in] source The source of the event
84 * @param[in] currentPosition The current position
85 * @param[in] touchInfo The touch event information
88 virtual void OnTouchLongPressed(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo) {}
91 * Called when an entity is touch released.
95 * @param[in] source The source of the event
96 * @param[in] currentPosition The current position
97 * @param[in] touchInfo The touch event information
99 virtual void OnTouchReleased(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo) = 0;
102 * Called when an entity is touch moved.
106 * @param[in] source The source of the event
107 * @param[in] currentPosition The current position
108 * @param[in] touchInfo The touch event information
110 virtual void OnTouchMoved(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo) = 0;
114 * Called when an entity is touched and double-pressed.
116 * @brief <i> [Deprecated] </i>
117 * @deprecated This callback is deprecated.
118 * If you want to listen to "double press" touch event, it is recommended to use TouchTapGestureDetector class.
121 * @param[in] source The source of the event
122 * @param[in] currentPosition The current position
123 * @param[in] touchInfo The touch event information
126 virtual void OnTouchDoublePressed(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo) {}
129 * Called when the user has touched down on a control, drags finger out of control's bounds, and then drags finger back in to the control's bounds.
133 * @param[in] source The source of the event
134 * @param[in] currentPosition The current position
135 * @param[in] touchInfo The touch event information
137 virtual void OnTouchFocusIn(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo) = 0;
140 * Called when the user touches down on a control and drags finger out of control's bounds
144 * @param[in] source The source of the event
145 * @param[in] currentPosition The current position
146 * @param[in] touchInfo The touch event information
148 virtual void OnTouchFocusOut(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo) = 0;
151 * Called when the touch is canceled.
155 * @param[in] source The source of the event
156 * @param[in] currentPosition The current position
157 * @param[in] touchInfo The touch event information
159 virtual void OnTouchCanceled(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo) {}
163 // This method is for internal use only. Using this method can cause behavioral, security-related,
164 // and consistency-related issues in the application.
166 // This method is reserved and may change its name at any time without
169 virtual void ITouchEventListener_Reserved1(void) {}
172 // This method is for internal use only. Using this method can cause behavioral, security-related,
173 // and consistency-related issues in the application.
175 // This method is reserved and may change its name at any time without
178 virtual void ITouchEventListener_Reserved2(void) {}
181 // This method is for internal use only. Using this method can cause behavioral, security-related,
182 // and consistency-related issues in the application.
184 // This method is reserved and may change its name at any time without
187 virtual void ITouchEventListener_Reserved3(void) {}
189 }; // ITouchEventListener
193 #endif // _FUI_ITOUCH_EVENT_LISTENER_H_