Revert "[Tizen] Not execute the remove callback"
[platform/core/uifw/dali-core.git] / dali / integration-api / events / key-event-integ.h
1 #ifndef DALI_INTEGRATION_KEY_EVENT_H
2 #define DALI_INTEGRATION_KEY_EVENT_H
3
4 /*
5  * Copyright (c) 2020 Samsung Electronics Co., Ltd.
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  *
19  */
20
21 // EXTERNAL INCLUDES
22 #include <string>
23
24 // INTERNAL INCLUDES
25 #include <dali/integration-api/events/event.h>
26 #include <dali/public-api/events/key-event.h>
27
28 namespace Dali
29 {
30 namespace Integration
31 {
32 /**
33  * An instance of this class should be used by the adaptor to send a key event to
34  * the Dali core.
35  *
36  */
37 struct DALI_CORE_API KeyEvent : public Event
38 {
39   // Enumerations
40   // Specifies the state of the key event.
41   enum State
42   {
43     DOWN, /**< Key down */
44     UP,   /**< Key up */
45   };
46
47   /**
48    * Default Constructor
49    */
50   KeyEvent();
51
52   /**
53    * Constructor
54    * @param[in]  keyName         The name of the key pressed or command from the IMF, if later then the some following parameters will be needed.
55    * @param[in]  logicalKey      The logical key symbol (eg. shift + 1 == "exclamation")
56    * @param[in]  keyString       The string of input characters or key pressed
57    * @param[in]  keyCode         The unique key code for the key pressed.
58    * @param[in]  keyModifier     The key modifier for special keys like shift and alt
59    * @param[in]  timeStamp       The time (in ms) that the key event occurred.
60    * @param[in]  keyState        The state of the key event.
61    * @param[in]  compose         The key compose
62    * @param[in]  deviceName      The name of device KeyEvent originated from
63    * @param[in]  deviceClass     The class of device KeyEvent originated from
64    * @param[in]  deviceSubclass  The subclass of device KeyEvent originated from
65    */
66   KeyEvent(const std::string&           keyName,
67            const std::string&           logicalKey,
68            const std::string&           keyString,
69            int                          keyCode,
70            int                          keyModifier,
71            unsigned long                timeStamp,
72            const State&                 keyState,
73            const std::string&           compose,
74            const std::string&           deviceName,
75            const Device::Class::Type    deviceClass,
76            const Device::Subclass::Type deviceSubclass);
77
78   /**
79    * Virtual destructor
80    */
81   ~KeyEvent() override;
82
83   // Data
84
85   /**
86    * The name of the key pressed or command from the IMF
87    */
88   std::string keyName;
89
90   /**
91    * The logical key symbol
92    */
93   std::string logicalKey;
94
95   /**
96    * The string of input characters or key pressed
97    */
98   std::string keyString;
99
100   /**
101    * The unique key code for the key pressed.
102    */
103   int keyCode;
104
105   /**
106    * The key modifier for special keys like shift and alt
107    */
108   int keyModifier;
109
110   /**
111    * The time (in ms) that the key event occurred.
112    */
113   unsigned long time;
114
115   /**
116    * State of the key event.
117    * @see State
118    */
119   State state;
120
121   /**
122    * If this keystroke has modified a string in the middle of being composed - this string replaces the previous one.
123    */
124   std::string compose;
125
126   /**
127    * The name of device KeyEvent originated from
128    */
129   std::string deviceName;
130
131   /**
132    * The class of device KeyEvent originated from
133    */
134   Device::Class::Type deviceClass;
135
136   /**
137    * The subclass of device KeyEvent originated from
138    */
139   Device::Subclass::Type deviceSubclass;
140 };
141
142 } // namespace Integration
143
144 } // namespace Dali
145
146 #endif // DALI_INTEGRATION_KEY_EVENT_H