[dali_1.2.34] Merge branch 'devel/master'
[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) 2014 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
27 namespace Dali DALI_IMPORT_API
28 {
29
30 namespace Integration
31 {
32
33 /**
34  * An instance of this class should be used by the adaptor to send a key event to
35  * the Dali core.
36  *
37  */
38 struct KeyEvent : public Event
39 {
40   // Enumerations
41   // Specifies the state of the key event.
42   enum State
43   {
44     Down,        /**< Key down */
45     Up,          /**< Key up */
46
47     Last
48   };
49
50   /**
51    * Default Constructor
52    */
53   KeyEvent();
54
55   /**
56    * Constructor
57    * @param[in]  keyName       The name of the key pressed or command from the IMF, if later then the some following parameters will be needed.
58    * @param[in]  keyString     A string of input characters or key pressed
59    * @param[in]  keyCode       The unique key code for the key pressed.
60    * @param[in]  keyModifier   The key modifier for special keys like shift and alt
61    * @param[in]  timeStamp The time (in ms) that the key event occurred.
62    * @param[in]  keyState The state of the key event.
63    */
64   KeyEvent(const std::string& keyName,
65            const std::string& keyString,
66            int keyCode,
67            int keyModifier,
68            unsigned long timeStamp,
69            const State& keyState);
70
71   /**
72    * Virtual destructor
73    */
74   virtual ~KeyEvent();
75
76   // Data
77
78   /**
79    *@copydoc Dali::KeyEvent::keyPressedName
80    */
81   std::string keyName;
82
83   /**
84    *@copydoc Dali::KeyEvent::keyPressed
85    */
86   std::string keyString;
87
88   /**
89    * @copydoc Dali::KeyEvent::keyCode
90    */
91   int  keyCode;
92
93   /**
94    *@copydoc Dali::KeyEvent::keyModifier
95    */
96   int  keyModifier;
97
98   /**
99    *@copydoc Dali::KeyEvent::time
100    */
101   unsigned long time;
102
103   /**
104    * State of the key event.
105    * @see State
106    */
107   State state;
108
109 };
110
111 } // namespace Integration
112
113 } // namespace Dali
114
115 #endif // __DALI_INTEGRATION_KEY_EVENT_H__