N_SE-47263 : reset touch cancel when indicator touch released/N_SE-51832 : fix checki...
[platform/framework/native/uifw.git] / inc / FUiIKeyEventListener.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  * @file                FUiIKeyEventListener.h
19  * @brief               This is the header file for the %IKeyEventListener interface.
20  *
21  * This header file contains the declarations of the %IKeyEventListener interface. @n
22  * If a key event is generated, a method of this interface is called. @n
23  * If an application performs tasks related to the key event, use the methods of this interface.
24  */
25 #ifndef _FUI_IKEY_EVENT_LISTENER_H_
26 #define _FUI_IKEY_EVENT_LISTENER_H_
27
28 #include <FBaseRtIEventListener.h>
29 #include <FBaseTypes.h>
30 #include <FUiKeyTypes.h>
31
32 namespace Tizen {namespace Ui
33 {
34 class Control;
35
36 /**
37  * @interface   IKeyEventListener
38  * @brief               This interface implements the listener for the key event.
39  *
40  * @since               2.0
41  *
42  * @remarks     Use the ITextEventListener interface to listen to key events related to the virtual keypad used with EditField and EditArea.
43  *
44  * The %IKeyEventListener interface is the listener interface for receiving key events, which are fired when hardware keyboard keys are pressed or
45  * released. The class that processes a key event implements this interface, and the instance created with that class is
46  * registered with a UI control, using the Control::AddKeyEventListener() method. When the key event occurs, a method of that
47  * instance is invoked.
48  *
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  *
52  */
53 class _OSP_EXPORT_ IKeyEventListener
54         : virtual public Tizen::Base::Runtime::IEventListener
55 {
56 // Operation
57 public:
58          //
59          // This method is for internal use only.
60          // Using this method can cause behavioral, security-related, and consistency-related issues in the application.
61          //
62          // This is the destructor for this class.
63          //
64          // @since                              2.0
65          //
66         virtual ~IKeyEventListener(void) {}
67
68
69         /**
70          * Called when a key is pressed.
71          *
72          * @since               2.0
73          *
74          * @param[in]   source          The source of the event
75          * @param[in]   keyCode         The key code
76          */
77         virtual void OnKeyPressed(const Tizen::Ui::Control& source, Tizen::Ui::KeyCode keyCode) = 0;
78
79
80         /**
81          * Called when a key is released.
82          *
83          * @since               2.0
84          *
85          * @param[in]   source          The source of the event
86          * @param[in]   keyCode         The key code
87          */
88         virtual void OnKeyReleased(const Tizen::Ui::Control& source, Tizen::Ui::KeyCode keyCode) = 0;
89
90
91         /**
92          * Called when a key is pressed and held down for some time.
93          *
94          * @since               2.0
95          *
96          * @param[in]   source          The source of the event
97          * @param[in]   keyCode         The key code
98          * @remarks     The key long pressed event is fired after the key pressed event is initially generated.
99          */
100         virtual void OnKeyLongPressed(const Tizen::Ui::Control& source, Tizen::Ui::KeyCode keyCode) = 0;
101
102 protected:
103         // Reserved virtual methods for later extension
104         //
105         //  The following methods are reserved and may change its name at any time without prior notice.
106         //
107         virtual void IKeyEventListener_Reserved1(void) {}
108
109         // Reserved virtual methods for later extension
110         //
111         //  The following methods are reserved and may change its name at any time without prior notice.
112         //
113         virtual void IKeyEventListener_Reserved2(void) {}
114
115         // Reserved virtual methods for later extension
116         //
117         //  The following methods are reserved and may change its name at any time without prior notice.
118         //
119         virtual void IKeyEventListener_Reserved3(void) {}
120
121 }; // IKeyEventListener
122
123 } } // Tizen::Ui
124
125 #endif //_FUI_IKEY_EVENT_LISTENER_H_