[dali_1.9.27] Merge branch 'devel/master'
[platform/core/uifw/dali-core.git] / dali / devel-api / events / key-event-devel.h
1 #ifndef DALI_KEY_EVENT_DEVEL_H\r
2 #define DALI_KEY_EVENT_DEVEL_H\r
3 \r
4 /*\r
5  * Copyright (c) 2020 Samsung Electronics Co., Ltd.\r
6  *\r
7  * Licensed under the Apache License, Version 2.0 (the "License");\r
8  * you may not use this file except in compliance with the License.\r
9  * You may obtain a copy of the License at\r
10  *\r
11  * http://www.apache.org/licenses/LICENSE-2.0\r
12  *\r
13  * Unless required by applicable law or agreed to in writing, software\r
14  * distributed under the License is distributed on an "AS IS" BASIS,\r
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
16  * See the License for the specific language governing permissions and\r
17  * limitations under the License.\r
18  *\r
19  */\r
20 \r
21 // INTERNAL INCLUDES\r
22 #include <dali/public-api/events/key-event.h>\r
23 \r
24 namespace Dali\r
25 {\r
26 \r
27 namespace DevelKeyEvent\r
28 {\r
29 \r
30 /**\r
31  * @brief Creates an initialized WheelEvent.\r
32  *\r
33  * @SINCE_1_9.27\r
34  * @param[in]  keyName         The name of the key pressed or command from the IMF, if later then the some following parameters will be needed.\r
35  * @param[in]  logicalKey      The logical key symbol (eg. shift + 1 == "exclamation")\r
36  * @param[in]  keyString       The string of input characters or key pressed\r
37  * @param[in]  keyCode         The unique key code for the key pressed.\r
38  * @param[in]  keyModifier     The key modifier for special keys like shift and alt\r
39  * @param[in]  timeStamp       The time (in ms) that the key event occurred.\r
40  * @param[in]  keyState        The state of the key event.\r
41  * @param[in]  compose         The key compose\r
42  * @param[in]  deviceName      The name of device the key event originated from\r
43  * @param[in]  deviceClass     The class of device the key event originated from\r
44  * @param[in]  deviceSubclass  The subclass of device the key event originated from\r
45  * @return A handle to a newly allocated Dali resource\r
46  */\r
47 DALI_CORE_API KeyEvent New( const std::string& keyName,\r
48                             const std::string& logicalKey,\r
49                             const std::string& keyString,\r
50                             int keyCode,\r
51                             int keyModifier,\r
52                             unsigned long timeStamp,\r
53                             const Dali::KeyEvent::State& keyState,\r
54                             const std::string& compose,\r
55                             const std::string& deviceName,\r
56                             const Device::Class::Type deviceClass,\r
57                             const Device::Subclass::Type deviceSubclass );\r
58 \r
59 /**\r
60  * @brief Set the name given to the key pressed\r
61  *\r
62  * @SINCE_1_9.27\r
63  * @param[in] keyEvent The instance of KeyEvent.\r
64  * @param[in] keyName The name given to the key pressed.\r
65  */\r
66 void SetKeyName( KeyEvent keyEvent, const std::string& keyName );\r
67 \r
68 /**\r
69  * @brief Set the actual string of input characters that should be used for input editors.\r
70  *\r
71  * @SINCE_1_9.27\r
72  * @param[in] keyEvent The instance of KeyEvent.\r
73  * @param[in] keyString The actual string of input characters\r
74  */\r
75 void SetKeyString( KeyEvent keyEvent, const std::string& keyString );\r
76 \r
77 /**\r
78  * @brief Set the unique key code for the key pressed.\r
79  *\r
80  * @SINCE_1_9.27\r
81  * @param[in] keyEvent The instance of KeyEvent.\r
82  * @param[in] keyCode The unique key code for the key pressed\r
83  */\r
84 void SetKeyCode( KeyEvent keyEvent, int32_t keyCode );\r
85 \r
86 /**\r
87  * @brief Set the key modifier for special keys like Shift, Alt and Ctrl which modify the next key pressed.\r
88  *\r
89  * @SINCE_1_9.27\r
90  * @param[in] keyEvent The instance of KeyEvent.\r
91  * @param[in] keyModifier The key modifier\r
92  */\r
93 void SetKeyModifier( KeyEvent keyEvent, int32_t keyModifier );\r
94 \r
95 /**\r
96  * @brief Set the time (in ms) that the key event occurred.\r
97  *\r
98  * @SINCE_1_9.27\r
99  * @param[in] keyEvent The instance of KeyEvent.\r
100  * @param[in] time The time (in ms)\r
101  */\r
102 void SetTime( KeyEvent keyEvent, unsigned long time );\r
103 \r
104 /**\r
105  * @brief Set the state of the key event.\r
106  *\r
107  * @SINCE_1_9.27\r
108  * @param[in] keyEvent The instance of KeyEvent.\r
109  * @param[in] state The state of the key event\r
110  */\r
111 void SetState( KeyEvent keyEvent, const KeyEvent::State& state );\r
112 \r
113 } // namespace DevelKeyEvent\r
114 \r
115 } // namespace Dali\r
116 \r
117 #endif // DALI_KEY_EVENT_DEVEL_H\r