X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Fpublic-api%2Fevents%2Fkey-event.h;h=336e737280ccfc0d9237a21d071071e575bb8ef4;hb=646f736e77b085c86e982c0d1d4b895c2a431330;hp=4458c685cf31cbfc85b1ecc98e0dc53ee4736c14;hpb=b1597f868be26141018cf638ad01963531c1992b;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/public-api/events/key-event.h b/dali/public-api/events/key-event.h old mode 100644 new mode 100755 index 4458c68..336e737 --- a/dali/public-api/events/key-event.h +++ b/dali/public-api/events/key-event.h @@ -2,7 +2,7 @@ #define __DALI_KEY_EVENT_H__ /* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * Copyright (c) 2018 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,12 +20,18 @@ // EXTERNAL INCLUDES #include +#include // int32_t // INTERNAL INCLUDES #include +#include namespace Dali { +/** + * @addtogroup dali_core_events + * @{ + */ /** * @brief The key event structure is used to store a key press. @@ -38,70 +44,127 @@ namespace Dali * pressed. * * Currently KeyEvent is also being used to relay messages from the - * IMF keyboard to Core. In future IMF may communicate via its own + * IMF(Input Method Framework) keyboard to the internal core. In future IMF may communicate via its own * module. + * @SINCE_1_0.0 */ -struct DALI_IMPORT_API KeyEvent +struct DALI_CORE_API KeyEvent { // Enumerations /** - * @brief Specifies the state of the key event. + * @brief Enumeration for specifying the state of the key event. + * @SINCE_1_0.0 */ enum State { - Down, ///< Key down - Up, ///< Key up + Down, ///< Key down @SINCE_1_0.0 + Up, ///< Key up @SINCE_1_0.0 Last }; /** - * @brief Default constructor + * @brief Default constructor. + * @SINCE_1_0.0 */ KeyEvent(); /** * @brief Constructor. * - * @param[in] keyName The name of the key pressed or command from the IMF, if later then the some following parameters will be needed. - * @param[in] keyString A string of input characters or key pressed - * @param[in] keyCode The unique key code for the key pressed. - * @param[in] keyModifier The key modifier for special keys like shift and alt - * @param[in] timeStamp The time (in ms) that the key event occurred. - * @param[in] keyState The state of the key event. + * @SINCE_1_0.0 + * @param[in] keyName The name of the key pressed or command from the IMF, if later then the some following parameters will be needed + * @param[in] keyString A string of input characters or key pressed + * @param[in] keyCode The unique key code for the key pressed + * @param[in] keyModifier The key modifier for special keys like shift and alt + * @param[in] timeStamp The time (in ms) that the key event occurred + * @param[in] keyState The state of the key event + */ + KeyEvent(const std::string& keyName, const std::string& keyString, int32_t keyCode, int32_t keyModifier, unsigned long timeStamp, const State& keyState); + + /** + * @brief Copy constructor. + * @SINCE_1_2.36 + * @param[in] rhs A reference to the copied handle + */ + KeyEvent( const KeyEvent& rhs ); + + /** + * @brief Assignment operator. + * @SINCE_1_2.36 + * @param[in] rhs A reference to the copied handle + * @return A reference to this */ - KeyEvent(const std::string& keyName, const std::string& keyString, int keyCode, int keyModifier, unsigned long timeStamp, const State& keyState); + KeyEvent& operator=( const KeyEvent& rhs ); /** * @brief Destructor. + * @SINCE_1_0.0 */ ~KeyEvent(); /** - * @brief Check to see if Shift key modifier has been supplied. + * @brief Checks to see if Shift key modifier has been supplied. * - * @return bool true if shift modifier + * @SINCE_1_0.0 + * @return True if shift modifier */ bool IsShiftModifier() const; /** - * @brief Check to see if Ctrl (control) key modifier has been supplied. + * @brief Checks to see if Ctrl (control) key modifier has been supplied. * - * @return bool true if ctrl modifier + * @SINCE_1_0.0 + * @return True if ctrl modifier */ bool IsCtrlModifier() const; /** - * @brief Check to see if Alt key modifier has been supplied. + * @brief Checks to see if Alt key modifier has been supplied. * - * @return bool true if alt modifier + * @SINCE_1_0.0 + * @return True if alt modifier */ bool IsAltModifier() const; + /** + * @brief Get the key compose string. + * + * @SINCE_1_3.22 + * @return The compose string + */ + std::string GetCompose() const; + + /** + * @brief Get the device name the key event originated from. + * + * @SINCE_1_2.60 + * @return The device name + */ + std::string GetDeviceName() const; + + /** + * @brief Get the device class the key event originated from. + * + * The device class type is classification type of the input device of event received + * @SINCE_1_2.60 + * @return The type of the device class + */ + Device::Class::Type GetDeviceClass() const; + + /** + * @brief Get the device subclass the key event originated from. + * + * The device subclass type is subclassification type of the input device of event received. + * @SINCE_1_2.60 + * @return The type of the device subclass + */ + Device::Subclass::Type GetDeviceSubclass() const; + // Data /** - * @brief name given to the key pressed. + * @brief Name given to the key pressed. */ std::string keyPressedName; @@ -112,13 +175,18 @@ struct DALI_IMPORT_API KeyEvent /** * @brief Keycode for the key pressed. + * + * @remarks We recommend not to use this key code value + * directly because its meaning might be changed in the future. Currently, it means a + * platform-specific key code. You need to use IsKey() to know what a key event means + * instead of direct comparison of key code value. */ - int keyCode; + int32_t keyCode; /** * @brief special keys like shift, alt and control which modify the next key pressed. */ - int keyModifier; + int32_t keyModifier; /** * @brief The time (in ms) that the key event occurred. @@ -134,6 +202,9 @@ struct DALI_IMPORT_API KeyEvent }; +/** + * @} + */ } // namespace Dali #endif // __DALI_KEY_EVENT_H__