Added device information in TouchData/KeyEvent
[platform/core/uifw/dali-core.git] / dali / internal / event / events / key-event-impl.h
1 #ifndef __DALI_INTERNAL_KEY_EVENT_H__
2 #define __DALI_INTERNAL_KEY_EVENT_H__
3
4 /*
5  * Copyright (c) 2017 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 // INTERNAL INCLUDES
22 #include <dali/public-api/events/key-event.h>
23 #include <dali/devel-api/events/key-event-devel.h>
24
25 namespace Dali
26 {
27
28 namespace Internal
29 {
30
31 struct KeyEventImpl
32 {
33 public:
34
35   /**
36    * @brief Constructor.
37    */
38   KeyEventImpl( Dali::KeyEvent* keyEvent );
39
40   /**
41    * @brief Destructor.
42    */
43   ~KeyEventImpl();
44
45   /**
46    * @brief Assignment operator.
47    * @param[in] rhs A reference to the copied handle
48    * @return A reference to this
49    */
50   KeyEventImpl& operator=( const KeyEventImpl& rhs );
51
52   /**
53    * @brief Get the device name the key event originated from
54    *
55    * @return The device name
56    */
57    std::string GetDeviceName() const;
58
59   /**
60    * @brief Set the device name to the KeyEvent
61    *
62    * @param[in] deviceName Device name string to set
63    */
64   void SetDeviceName( const std::string& deviceName );
65
66   /**
67    * @brief Get the device class the key event originated from
68    *
69    * @return The device class
70    */
71   DevelDevice::Class::Type GetDeviceClass() const;
72
73   /**
74    * @brief Set the device class to the KeyEvent
75    *
76    * @param[in] deviceClass Device class to set
77    */
78   void SetDeviceClass( DevelDevice::Class::Type deviceClass );
79
80   /**
81    * @brief Get the device subclass the key event originated from
82    *
83    * @return The device subclass
84    */
85   DevelDevice::Subclass::Type GetDeviceSubclass() const;
86
87   /**
88    * @brief Set the device subclass to the KeyEvent
89    *
90    * @param[in] deviceClass Device subclass to set
91    */
92   void SetDeviceSubclass( DevelDevice::Subclass::Type deviceSubclass );
93
94 private:
95
96   // Undefined
97   KeyEventImpl();
98
99   // Undefined
100   KeyEventImpl( const KeyEventImpl& rhs );
101
102 private:
103
104   std::string mDeviceName;
105   DevelDevice::Class::Type mDeviceClass;
106   DevelDevice::Subclass::Type mDeviceSubclass;
107 };
108
109 } // namespace Internal
110
111 // Helpers for public-api forwarding methods
112
113 Internal::KeyEventImpl* GetImplementation( KeyEvent* keyEvent );
114
115 const Internal::KeyEventImpl* GetImplementation( const KeyEvent* keyEvent );
116
117 } // namespace Dali
118
119 #endif // __DALI_INTERNAL_KEY_EVENT_H__