Tizen 2.1 base
[framework/osp/uifw.git] / src / ui / inc / FUi_ITouchEventListener.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  * @file        FUi_ITouchEventListener.h
19  * @brief       This is the header file for the _ITouchEventListener class.
20  *
21  * This header file contains the declarations of the %_ITouchEventListener class.
22  */
23
24 #ifndef _FUI_INTERNAL_ITOUCH_EVENT_LISTENER_H_
25 #define _FUI_INTERNAL_ITOUCH_EVENT_LISTENER_H_
26
27 #include <FBaseTypes.h>
28 #include <FGraphics.h>
29 #include "FUi_IUiEventListener.h"
30
31 namespace Tizen { namespace Ui
32 {
33
34 class _Control;
35 class _TouchInfo;
36
37 /**
38  * @interface   _ITouchEventListener
39  * @brief                       This interface is used as the argument to the touch event listener.
40  * @since                       2.0
41  *
42  * The listener interface for receiving touch events. The class that processes a touch event
43  * implements this interface, and the instance created with that class is registered with a UI control, using the control's
44  * AddTouchEventListener() method. When the touch event occurs, the OnTouchDoublePressed(), OnTouchFocusIn(), OnTouchFocusOut(), OnTouchLongPressed(), OnTouchLongPressed(), OnTouchMoved(), OnTouchPressed(), or OnTouchReleased() method of that instance is invoked.
45  */
46 class _ITouchEventListener
47         : virtual public _IUiEventListener
48         , virtual public Tizen::Base::Runtime::IEventListener
49 {
50 // Operation
51 public:
52         /**
53         * This is the destructor for this class.
54         *
55         * @since                        2.0
56         */
57         virtual ~_ITouchEventListener(void) {}
58
59         /**
60          * Notifies when an entity is touch pressed.
61          *
62          * @since                               2.0
63          * @param[in]   source                  The source of the event
64          * @param[in]   currentPosition The current position
65          * @param[in]   touchInfo               The touch event information
66          */
67         virtual bool OnTouchPressed(const _Control& source, const _TouchInfo& touchinfo) = 0;
68
69         /**
70          * Notifies when an entity is touch released.
71          *
72          * @since                               2.0
73          * @param[in]   source                  The source of the event
74          * @param[in]   currentPosition The current position
75          * @param[in]   touchInfo               The touch event information
76          */
77         virtual bool OnTouchReleased(const _Control& source, const _TouchInfo& touchinfo) = 0;
78
79         /**
80          * Notifies when an entity is touch moved.
81          *
82          * @since                               2.0
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          */
87         virtual bool OnTouchMoved(const _Control& source, const _TouchInfo& touchinfo) = 0;
88
89         /**
90          * Notifies when an entity is touch cancelled.
91          *
92          * @since                               2.0
93          * @param[in]   source                  The source of the event
94          * @param[in]   currentPosition The current position
95          * @param[in]   touchInfo               The touch event information
96          */
97         virtual bool OnTouchCanceled(const _Control& source, const _TouchInfo& touchinfo) = 0;
98 }; // _ITouchEventListener
99
100 }} // Tizen::Ui
101
102 #endif // _FUI_INTERNAL_ITOUCH_EVENT_LISTENER_H_