Merge "Unchecked GetCharacter func when index is over string length" into tizen_2.2
[platform/framework/native/uifw.git] / inc / FUiITouchEventListener.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
4 //
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
8 //
9 //     http://www.apache.org/licenses/LICENSE-2.0/
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         FUiITouchEventListener.h
20 * @brief        This is the header file for the %ITouchEventListener interface.
21 *
22 * This header file contains the declarations of the %ITouchEventListener interface.
23 */
24
25 #ifndef _FUI_ITOUCH_EVENT_LISTENER_H_
26 #define _FUI_ITOUCH_EVENT_LISTENER_H_
27
28 #include <FBaseRtIEventListener.h>
29 #include <FBaseTypes.h>
30 #include <FGraphics.h>
31 #include <FUiTouch.h>
32
33 namespace Tizen { namespace Ui
34 {
35
36 class Control;
37
38 /**
39  * @interface           ITouchEventListener
40  * @brief                       This interface is used as the argument to the touch event listener.
41  *
42  * @since                       2.0
43  *
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::AddTouchEventListener() method. When the touch event occurs, a method of that instance is
47  * invoked.
48  * @n
49  * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/ui/event_listener.htm">Event Listeners</a>.
50  */
51 class _OSP_EXPORT_ ITouchEventListener
52         : virtual public Tizen::Base::Runtime::IEventListener
53 {
54 public:
55         /**
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.
57          *
58          * @since               2.0
59          *
60          */
61         virtual ~ITouchEventListener(void) {}
62
63         /**
64          * Called when an entity is touch pressed.
65          *
66          * @since               2.0
67          *
68          * @param[in]   source                  The source of the event
69          * @param[in]   currentPosition The current position
70          * @param[in]   touchInfo               The touch event information
71          */
72         virtual void OnTouchPressed(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo & touchInfo) = 0;
73
74         /**
75          * @if OSPDEPREC
76          * Called when an entity is touched and held for a long time.
77          *
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 the TouchLongPressGestureDetector class.
81          * @since               2.0
82          *
83          * @param[in]   source                  The source of the event
84          * @param[in]   currentPosition The current position
85          * @param[in]   touchInfo               The touch event information
86          * @endif
87          */
88         virtual void OnTouchLongPressed(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo) {}
89
90         /**
91          * Called when an entity is touch released.
92          *
93          * @since               2.0
94          *
95          * @param[in]   source                  The source of the event
96          * @param[in]   currentPosition The current position
97          * @param[in]   touchInfo               The touch event information
98          */
99         virtual void OnTouchReleased(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo) = 0;
100
101         /**
102          * Called when an entity is touch moved.
103          *
104          * @since               2.0
105          *
106          * @param[in]   source                  The source of the event
107          * @param[in]   currentPosition The current position
108          * @param[in]   touchInfo               The touch event information
109          */
110         virtual void OnTouchMoved(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo) = 0;
111
112         /**
113          * @if OSPDEPREC
114          * Called when an entity is touched and double-pressed.
115          *
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 the TouchTapGestureDetector class.
119          * @since               2.0
120          *
121          * @param[in]   source                  The source of the event
122          * @param[in]   currentPosition The current position
123          * @param[in]   touchInfo               The touch event information
124          * @endif
125          */
126         virtual void OnTouchDoublePressed(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo) {}
127
128         /**
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.
130          *
131          * @since               2.0
132          *
133          * @param[in]   source                  The source of the event
134          * @param[in]   currentPosition The current position
135          * @param[in]   touchInfo               The touch event information
136          */
137         virtual void OnTouchFocusIn(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo) = 0;
138
139         /**
140          * Called when the user touches down on a control and drags finger out of control's bounds.
141          *
142          * @since               2.0
143          *
144          * @param[in]   source                  The source of the event
145          * @param[in]   currentPosition The current position
146          * @param[in]   touchInfo               The touch event information
147          */
148         virtual void OnTouchFocusOut(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo) = 0;
149
150         /**
151          * Called when the touch is canceled.
152          *
153          * @since               2.0
154          *
155          * @param[in]   source                  The source of the event
156          * @param[in]   currentPosition The current position
157          * @param[in]   touchInfo               The touch event information
158          */
159         virtual void OnTouchCanceled(const Tizen::Ui::Control& source, const Tizen::Graphics::Point& currentPosition, const Tizen::Ui::TouchEventInfo& touchInfo) {}
160
161 protected:
162         //
163         // This method is for internal use only. Using this method can cause behavioral, security-related,
164         // and consistency-related issues in the application.
165         //
166         // This method is reserved and may change its name at any time without
167         // prior notice.
168         //
169         virtual void ITouchEventListener_Reserved1(void) {}
170
171         //
172         // This method is for internal use only. Using this method can cause behavioral, security-related,
173         // and consistency-related issues in the application.
174         //
175         // This method is reserved and may change its name at any time without
176         // prior notice.
177         //
178         virtual void ITouchEventListener_Reserved2(void) {}
179
180         //
181         // This method is for internal use only. Using this method can cause behavioral, security-related,
182         // and consistency-related issues in the application.
183         //
184         // This method is reserved and may change its name at any time without
185         // prior notice.
186         //
187         virtual void ITouchEventListener_Reserved3(void) {}
188
189 }; // ITouchEventListener
190
191 }} // Tizen::Ui
192
193 #endif // _FUI_ITOUCH_EVENT_LISTENER_H_