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.
18 * @file FUi_IKeyEventListener.h
19 * @brief This is the header file for the _IKeyEventListener class.
21 * This header file contains the declarations of the %_IKeyEventListener class.
24 #ifndef _FUI_INTERNAL_IKEY_EVENT_LISTENER_H_
25 #define _FUI_INTERNAL_IKEY_EVENT_LISTENER_H_
27 #include "FUi_IUiEventListener.h"
28 #include "FUi_UiKeyEvent.h"
30 namespace Tizen {namespace Ui
36 * @interface _IKeyEventListener
37 * @brief This interface implements the listener for the key event.
40 * @remarks A key event callback is called when key codes corresponding to the physical keys are
41 * pressed or released. ITextEventListener can be used to get the text value of the key in EditField and EditArea.
43 * The listener interface for receiving key events. The class that
44 * processes a key event implements this interface, and the instance created with
45 * that class is registered with a UI control, using the control's AddKeyEventListener()
46 * method. When the key event occurs, the OnKeyPressed(), OnKeyReleased(), or
47 * OnKeyLongPressed() method of that instance is invoked. @n
49 * Only the current focus owner can listen to key events. Use the control's SetFocus()
50 * method to give the input focus to a UI control.
53 class _IKeyEventListener
54 : virtual public _IUiEventListener
55 , virtual public Tizen::Base::Runtime::IEventListener
60 * This is internal. If used in an application, the application can get rejected during the certification process.
61 * This is the destructor for this class.
65 virtual ~_IKeyEventListener(void) {}
68 * Notifies when a key is pressed.
71 * @param[in] source The source of the event
72 * @param[in] keyCode The key code
74 virtual bool OnKeyPressed(const _Control& source, const _KeyInfo& keyInfo) = 0;
77 * Notifies when a key is released.
80 * @param[in] source The source of the event
81 * @param[in] keyCode The key code
83 virtual bool OnKeyReleased(const _Control& source, const _KeyInfo& keyInfo) = 0;
84 }; // _IKeyEventListener
88 #endif //_FUI_INTERNAL_IKEY_EVENT_LISTENER_H_