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 FUiIKeyEventListener.h
20 * @brief This is the header file for the %IKeyEventListener interface.
22 * This header file contains the declarations of the %IKeyEventListener interface. @n
23 * If a key event is generated, a method of this interface is called. @n
24 * If an application performs tasks related to the key event, use the methods of this interface.
27 #ifndef _FUI_IKEY_EVENT_LISTENER_H_
28 #define _FUI_IKEY_EVENT_LISTENER_H_
30 #include <FBaseRtIEventListener.h>
31 #include <FBaseTypes.h>
33 namespace Tizen {namespace Ui
39 * Defines the list of keys supported by the system. @n
40 * Note that certain keys may not be available on all devices. @n
41 * Please use the Tizen::Ui::KeyboardMap class to query the availability of a specific key on the target device.
78 * The task switcher key
143 * The left directional key
148 * The up directional key
153 * The down directional key
158 * The right directional key
328 * The Language Symbol key
333 * The Language Setting key
353 * The camera half shutter key
355 KEY_CAMERA_HALF_SHUTTER,
358 * The Character symbol 1 key
363 * The Character symbol 2 key
368 * The Character symbol 3 key
373 * The Character symbol 4 key
378 * The Character symbol 5 key
383 * The Character symbol 6 key
388 * The Character symbol 7 key
393 * The Character symbol 8 key
398 * The Character symbol 9 key
403 * The Character symbol A key
408 * The Character symbol B key
413 * The Character symbol C key
418 * The Character symbol D key
423 * The Character symbol E key
428 * The Character symbol F key
433 * The Special function 1 key
438 * The Special function 2 key
443 * The Special function 3 key
448 * The Special function 4 key
453 * The Special function 5 key
477 * Defines the state of the key.
483 KEY_PRESSED = 0x0001, /**< The key is pressed */
484 KEY_RELEASED = 0x0002, /**< The key is released */
485 KEY_LONGPRESSED = 0x0003 /**< The key pressed and held down over a predefined duration */
489 * @interface IKeyEventListener
490 * @brief This interface implements the listener for the key event.
494 * @remarks Use the ITextEventListener interface to listen to key events related to the virtual keypad used with EditField and EditArea.
496 * The %IKeyEventListener interface is the listener interface for receiving key events, which are fired when hardware keyboard keys are pressed or
497 * released. The class that processes a key event implements this interface, and the instance created with that class is
498 * registered with a UI control, using the control's AddKeyEventListener() method. When the key event occurs, a method of that
499 * instance is invoked.
501 * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/ui/event_listener.htm">Event Listeners</a>.
505 class _OSP_EXPORT_ IKeyEventListener
506 : virtual public Tizen::Base::Runtime::IEventListener
510 * 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.
515 virtual ~IKeyEventListener(void) {}
518 * Called when a key is pressed.
522 * @param[in] source The source of the event
523 * @param[in] keyCode The key code
525 virtual void OnKeyPressed(const Tizen::Ui::Control& source, Tizen::Ui::KeyCode keyCode) = 0;
528 * Called when a key is released.
532 * @param[in] source The source of the event
533 * @param[in] keyCode The key code
535 virtual void OnKeyReleased(const Tizen::Ui::Control& source, Tizen::Ui::KeyCode keyCode) = 0;
538 * Called when a key is pressed and held down for some time.
542 * @param[in] source The source of the event
543 * @param[in] keyCode The key code
544 * @remarks The key long pressed event is fired after the key pressed event is initially generated.
546 virtual void OnKeyLongPressed(const Tizen::Ui::Control& source, Tizen::Ui::KeyCode keyCode) = 0;
550 // This method is for internal use only. Using this method can cause behavioral, security-related,
551 // and consistency-related issues in the application.
553 // This method is reserved and may change its name at any time without
556 virtual void IKeyEventListener_Reserved1(void) {}
559 // This method is for internal use only. Using this method can cause behavioral, security-related,
560 // and consistency-related issues in the application.
562 // This method is reserved and may change its name at any time without
565 virtual void IKeyEventListener_Reserved2(void) {}
568 // This method is for internal use only. Using this method can cause behavioral, security-related,
569 // and consistency-related issues in the application.
571 // This method is reserved and may change its name at any time without
574 virtual void IKeyEventListener_Reserved3(void) {}
576 }; // IKeyEventListener
580 #endif //_FUI_IKEY_EVENT_LISTENER_H_