2 * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 using System.Collections.Generic;
20 using static Interop.InputMethod;
22 namespace Tizen.Uix.InputMethod
25 /// Enumeration for the device class.
27 /// <since_tizen> 4 </since_tizen>
28 public enum DeviceClass
69 /// Enumeration for the device subclass.
71 /// <since_tizen> 4 </since_tizen>
72 public enum DeviceSubclass
125 /// This class gives the device information, like the name, class, and subclass.
127 /// <since_tizen> 4 </since_tizen>
128 public class InputMethodDeviceInformation
130 private IntPtr _handle;
131 internal InputMethodDeviceInformation(IntPtr handle)
137 /// Gets the device name of the key event.
139 /// <since_tizen> 4 </since_tizen>
145 ErrorCode error = ImeDeviceInfoGetName(_handle, out name);
146 if (error != ErrorCode.None)
148 Log.Error(LogTag, "GetName Failed with error " + error);
156 /// Gets the device class of the key event.
158 /// <since_tizen> 4 </since_tizen>
159 public DeviceClass DeviceClass
163 DeviceClass devClass;
164 ErrorCode error = ImeDeviceInfoGetClass(_handle, out devClass);
165 if (error != ErrorCode.None)
167 Log.Error(LogTag, "GetClass Failed with error " + error);
168 return DeviceClass.Undefined;
175 /// Gets the device subclass of the key event.
177 /// <since_tizen> 4 </since_tizen>
178 public DeviceSubclass DeviceSubclass
182 DeviceSubclass subclass;
183 ErrorCode error = ImeDeviceInfoGetSubclass(_handle, out subclass);
184 if (error != ErrorCode.None)
186 Log.Error(LogTag, "GetSubclass Failed with error " + error);
187 return DeviceSubclass.Undefined;