Adding deviceClass to KeyEvent Integ
[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    * @param[in] keyEvent The KeyEvent to retrieve the device name from
56    * @return The device name
57    */
58    std::string GetDeviceName() const;
59
60   /**
61    * @brief Set the device name to the KeyEvent
62    *
63    * @param[in] keyEvent The KeyEvent to set the device name on
64    * @param[in] deviceName Device name string to set
65    */
66   void SetDeviceName( const std::string& deviceName );
67
68   /**
69    * @brief Get the device class the key event originated from
70    *
71    * @param[in] keyEvent The KeyEvent to retrieve the device class from
72    * @return The device class
73    */
74   DevelKeyEvent::DeviceClass::Type GetDeviceClass() const;
75
76   /**
77    * @brief Set the device class to the KeyEvent
78    *
79    * @param[in] keyEvent The KeyEvent to set the device class on
80    * @param[in] deviceClass Device class to set
81    */
82   void SetDeviceClass( const DevelKeyEvent::DeviceClass::Type& deviceClass );
83
84 private:
85
86   // Undefined
87   KeyEventImpl();
88
89   // Undefined
90   KeyEventImpl( const KeyEventImpl& rhs );
91
92 private:
93
94   std::string mDeviceName;
95   DevelKeyEvent::DeviceClass::Type mDeviceClass;
96 };
97
98 } // namespace Internal
99
100 // Helpers for public-api forwarding methods
101
102 Internal::KeyEventImpl* GetImplementation( KeyEvent* keyEvent );
103
104 const Internal::KeyEventImpl* GetImplementation( const KeyEvent* keyEvent );
105
106 } // namespace Dali
107
108 #endif // __DALI_INTERNAL_KEY_EVENT_H__