fe8246768709742c744dd463bf6cfd5fddade6cf
[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
24 namespace Dali
25 {
26
27 namespace Internal
28 {
29
30 struct KeyEventImpl
31 {
32 public:
33
34   /**
35    * @brief Constructor.
36    */
37   KeyEventImpl( Dali::KeyEvent* keyEvent );
38
39   /**
40    * @brief Destructor.
41    */
42   ~KeyEventImpl();
43
44   /**
45    * @brief Assignment operator.
46    * @param[in] rhs A reference to the copied handle
47    * @return A reference to this
48    */
49   KeyEventImpl& operator=( const KeyEventImpl& rhs );
50
51   /**
52    * @brief Get the key symbol string.
53    * @return The key symbol
54    */
55   std::string GetKey() const;
56
57   /**
58    * @brief Set the key symbol string to the KeyEvent.
59    * @param[in] key The key symbol to set
60    */
61   void SetKey( const std::string& key );
62
63   /**
64    * @brief Get the compose string.
65    *
66    * @return The compose string.
67    */
68    std::string GetCompose() const;
69
70   /**
71    * @brief Set the compose string to the KeyEvent
72    * A string if this keystroke has modified a string in the middle of being composed,
73    * this string replaces the previous one.
74    *
75    * @param[in] compose The compose string to set
76    */
77   void SetCompose( const std::string& compose );
78
79   /**
80    * @brief Get the device name the key event originated from
81    *
82    * @return The device name
83    */
84    std::string GetDeviceName() const;
85
86   /**
87    * @brief Set the device name to the KeyEvent
88    *
89    * @param[in] deviceName Device name string to set
90    */
91   void SetDeviceName( const std::string& deviceName );
92
93   /**
94    * @brief Get the device class the key event originated from
95    *
96    * @return The device class
97    */
98   Device::Class::Type GetDeviceClass() const;
99
100   /**
101    * @brief Set the device class to the KeyEvent
102    *
103    * @param[in] deviceClass Device class to set
104    */
105   void SetDeviceClass( Device::Class::Type deviceClass );
106
107   /**
108    * @brief Get the device subclass the key event originated from
109    *
110    * @return The device subclass
111    */
112   Device::Subclass::Type GetDeviceSubclass() const;
113
114   /**
115    * @brief Set the device subclass to the KeyEvent
116    *
117    * @param[in] deviceClass Device subclass to set
118    */
119   void SetDeviceSubclass( Device::Subclass::Type deviceSubclass );
120
121 private:
122
123   // Undefined
124   KeyEventImpl();
125
126   // Undefined
127   KeyEventImpl( const KeyEventImpl& rhs );
128
129 private:
130
131   std::string mKey;
132   std::string mCompose;
133   std::string mDeviceName;
134   Device::Class::Type mDeviceClass;
135   Device::Subclass::Type mDeviceSubclass;
136 };
137
138 } // namespace Internal
139
140 // Helpers for public-api forwarding methods
141
142 Internal::KeyEventImpl* GetImplementation( KeyEvent* keyEvent );
143
144 const Internal::KeyEventImpl* GetImplementation( const KeyEvent* keyEvent );
145
146 } // namespace Dali
147
148 #endif // __DALI_INTERNAL_KEY_EVENT_H__