From 7c0e313624c188371dff1f9b9c2d5dc447cf2ec4 Mon Sep 17 00:00:00 2001 From: "manish.r" Date: Wed, 15 Feb 2017 15:20:51 +0530 Subject: [PATCH] [InputMethod] Base Code Change-Id: I5478dbdee8839a4318d91e2b460b615ff4e1f543 Signed-off-by: manish.r --- .../Interop/Interop.EinaList.cs | 2 + .../Interop/Interop.InputMethod.cs | 117 +- .../Interop/Interop.Libraries.cs | 3 +- .../Tizen.Uix.InputMethod.csproj | 18 + .../Tizen.Uix.InputMethod.project.json | 19 +- .../AccessibilityStateChangedEventArgs.cs | 38 + .../CursorPositionUpdatedEventArgs.cs | 38 + .../DisplayLanaguageChangedEventArgs.cs | 38 + .../Tizen.Uix.InputMethod/EditorWindow.cs | 35 + .../Tizen.Uix.InputMethod/FocusInEventArgs.cs | 38 + .../Tizen.Uix.InputMethod/FocusOutEventArgs.cs | 38 + .../Tizen.Uix.InputMethod/ImDataSetEventArgs.cs | 49 + .../Tizen.Uix.InputMethod/InputMethodContext.cs | 412 +++- .../InputMethodDeviceInformation.cs | 135 ++ .../Tizen.Uix.InputMethod/InputMethodEditor.cs | 2254 ++++++++++++++++++-- .../InputMethodExceptionFactory.cs | 83 + .../Tizen.Uix.InputMethod/LangaugeSetEventArgs.cs | 38 + .../Tizen.Uix.InputMethod/LayoutSetEventArgs.cs | 38 + .../OptionWindowCreatedEventArgs.cs | 63 + .../OptionWindowDestroyedEventArgs.cs | 38 + .../Tizen.Uix.InputMethod/PreEditAttribute.cs | 78 + .../Tizen.Uix.InputMethod/ProcessKeyEventArgs.cs | 60 + .../ReturnKeyStateSetEventArgs.cs | 38 + .../ReturnKeyTypeSetEventArgs.cs | 38 + .../RotationDegreeChangedEventArgs.cs | 38 + .../SurroundingTextUpdatedArgs.cs | 58 + .../Tizen.Uix.InputMethodNet45.csproj | 27 + 27 files changed, 3574 insertions(+), 257 deletions(-) create mode 100755 src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/AccessibilityStateChangedEventArgs.cs create mode 100755 src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/CursorPositionUpdatedEventArgs.cs create mode 100755 src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/DisplayLanaguageChangedEventArgs.cs create mode 100755 src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/EditorWindow.cs create mode 100755 src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/FocusInEventArgs.cs create mode 100755 src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/FocusOutEventArgs.cs create mode 100755 src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/ImDataSetEventArgs.cs create mode 100755 src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/InputMethodExceptionFactory.cs create mode 100755 src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/LangaugeSetEventArgs.cs create mode 100755 src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/LayoutSetEventArgs.cs create mode 100755 src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/OptionWindowCreatedEventArgs.cs create mode 100755 src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/OptionWindowDestroyedEventArgs.cs create mode 100755 src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/PreEditAttribute.cs create mode 100755 src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/ProcessKeyEventArgs.cs create mode 100755 src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/ReturnKeyStateSetEventArgs.cs create mode 100755 src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/ReturnKeyTypeSetEventArgs.cs create mode 100755 src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/RotationDegreeChangedEventArgs.cs create mode 100755 src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/SurroundingTextUpdatedArgs.cs diff --git a/src/Tizen.Uix.InputMethod/Interop/Interop.EinaList.cs b/src/Tizen.Uix.InputMethod/Interop/Interop.EinaList.cs index 1c1b686..9a8e1c1 100755 --- a/src/Tizen.Uix.InputMethod/Interop/Interop.EinaList.cs +++ b/src/Tizen.Uix.InputMethod/Interop/Interop.EinaList.cs @@ -29,5 +29,7 @@ internal static partial class Interop /// internal static class EinaList { + [DllImport(Libraries.Eina, EntryPoint = "eina_list_append")] + internal static extern IntPtr EinaListAppend(IntPtr list, IntPtr data); } } \ No newline at end of file diff --git a/src/Tizen.Uix.InputMethod/Interop/Interop.InputMethod.cs b/src/Tizen.Uix.InputMethod/Interop/Interop.InputMethod.cs index 917bf42..e710269 100755 --- a/src/Tizen.Uix.InputMethod/Interop/Interop.InputMethod.cs +++ b/src/Tizen.Uix.InputMethod/Interop/Interop.InputMethod.cs @@ -53,154 +53,259 @@ internal static partial class Interop internal ImeHideCb hide; }; - public enum ImeOptionWindowType + [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] + internal struct ImePreEditAttributeStruct { - Keyborad, /**< Open from Keyboard */ - SettingApplication /**< Open from Setting application */ + internal uint start; + internal uint length; + internal int type; + internal uint value; }; + internal sealed class ImeCallbackStructGCHandle : IDisposable + { + internal ImeCallbackStruct _imeCallbackStruct; + internal GCHandle _imeCallbackStructHandle; + public ImeCallbackStructGCHandle() + { + _imeCallbackStruct = new ImeCallbackStruct(); + _imeCallbackStructHandle = GCHandle.Alloc(_imeCallbackStruct); + } + + #region IDisposable Support + private bool disposedValue = false; + + void Dispose(bool disposing) + { + Tizen.Log.Info(LogTag, "In Dispose"); + if (!disposedValue) + { + if (disposing) + { + Tizen.Log.Info(LogTag, "In Dispose free called"); + _imeCallbackStructHandle.Free(); + } + + disposedValue = true; + } + } + + public void Dispose() + { + Dispose(true); + } + #endregion + } + [DllImport(Libraries.InputMethod, EntryPoint = "ime_run")] - internal static extern ErrorCode ImeRun(ref ImeCallbackStruct basicCB, IntPtr userData); + internal static extern ErrorCode ImeRun(IntPtr basicCB, IntPtr userData); + [DllImport(Libraries.InputMethod, EntryPoint = "ime_event_set_focus_in_cb")] internal static extern ErrorCode ImeEventSetFocusInCb(ImeFocusInCb callbackFunction, IntPtr userData); + [DllImport(Libraries.InputMethod, EntryPoint = "ime_event_set_focus_out_cb")] internal static extern ErrorCode ImeEventSetFocusOutCb(ImeFocusOutCb callbackFunction, IntPtr userData); + [DllImport(Libraries.InputMethod, EntryPoint = "ime_event_set_surrounding_text_updated_cb")] internal static extern ErrorCode ImeEventSetSurroundingTextUpdatedCb(ImeSurroundingTextUpdatedCb callbackFunction, IntPtr userData); + [DllImport(Libraries.InputMethod, EntryPoint = "ime_event_set_input_context_reset_cb")] internal static extern ErrorCode ImeEventSetInputContextResetCb(ImeInputContextResetCb callbackFunction, IntPtr userData); + [DllImport(Libraries.InputMethod, EntryPoint = "ime_event_set_cursor_position_updated_cb")] internal static extern ErrorCode ImeEventSetCursorPositionUpdatedCb(ImeCursorPositionUpdatedCb callbackFunction, IntPtr userData); + [DllImport(Libraries.InputMethod, EntryPoint = "ime_event_set_language_requested_cb")] internal static extern ErrorCode ImeEventSetLanguageRequestedCb(ImeLanguageRequestedCb callbackFunction, IntPtr userData); + [DllImport(Libraries.InputMethod, EntryPoint = "ime_event_set_language_set_cb")] internal static extern ErrorCode ImeEventSetLanguageSetCb(ImeLanguageSetCb callbackFunction, IntPtr userData); + [DllImport(Libraries.InputMethod, EntryPoint = "ime_event_set_imdata_set_cb")] internal static extern ErrorCode ImeEventSetImdataSetCb(ImeImdataSetCb callbackFunction, IntPtr userData); + [DllImport(Libraries.InputMethod, EntryPoint = "ime_event_set_imdata_requested_cb")] internal static extern ErrorCode ImeEventSetImdataRequestedCb(ImeImdataRequestedCb callbackFunction, IntPtr userData); + [DllImport(Libraries.InputMethod, EntryPoint = "ime_event_set_layout_set_cb")] internal static extern ErrorCode ImeEventSetLayoutSetCb(ImeLayoutSetCb callbackFunction, IntPtr userData); + [DllImport(Libraries.InputMethod, EntryPoint = "ime_event_set_return_key_type_set_cb")] internal static extern ErrorCode ImeEventSetReturnKeyTypeSetCb(ImeReturnKeyTypeSetCb callbackFunction, IntPtr userData); + [DllImport(Libraries.InputMethod, EntryPoint = "ime_event_set_return_key_state_set_cb")] internal static extern ErrorCode ImeEventSetReturnKeyStateSetCb(ImeReturnKeyStateSetCb callbackFunction, IntPtr userData); + [DllImport(Libraries.InputMethod, EntryPoint = "ime_event_set_geometry_requested_cb")] internal static extern ErrorCode ImeEventSetGeometryRequestedCb(ImeGeometryRequestedCb callbackFunction, IntPtr userData); + [DllImport(Libraries.InputMethod, EntryPoint = "ime_event_set_process_key_event_cb")] internal static extern ErrorCode ImeEventSetProcessKeyEventCb(ImeProcessKeyEventCb callbackFunction, IntPtr userData); + [DllImport(Libraries.InputMethod, EntryPoint = "ime_event_set_display_language_changed_cb")] internal static extern ErrorCode ImeEventSetDisplayLanguageChangedCb(ImeDisplayLanguageChangedCb callbackFunction, IntPtr userData); + [DllImport(Libraries.InputMethod, EntryPoint = "ime_event_set_rotation_degree_changed_cb")] internal static extern ErrorCode ImeEventSetRotationDegreeChangedCb(ImeRotationDegreeChangedCb callbackFunction, IntPtr userData); + [DllImport(Libraries.InputMethod, EntryPoint = "ime_event_set_accessibility_state_changed_cb")] internal static extern ErrorCode ImeEventSetAccessibilityStateChangedCb(ImeAccessibilityStateChangedCb callbackFunction, IntPtr userData); + [DllImport(Libraries.InputMethod, EntryPoint = "ime_event_set_option_window_created_cb")] internal static extern ErrorCode ImeEventSetOptionWindowCreatedCb(ImeOptionWindowCreatedCb callbackFunction, IntPtr userData); + [DllImport(Libraries.InputMethod, EntryPoint = "ime_event_set_option_window_destroyed_cb")] internal static extern ErrorCode ImeEventSetOptionWindowDestroyedCb(ImeOptionWindowDestroyedCb callbackFunction, IntPtr userData); + [DllImport(Libraries.InputMethod, EntryPoint = "ime_send_key_event")] internal static extern ErrorCode ImeSendKeyEvent(KeyCode keycode, KeyMask keymask, bool forwardKey); + [DllImport(Libraries.InputMethod, EntryPoint = "ime_commit_string")] internal static extern ErrorCode ImeCommitString(string str); + [DllImport(Libraries.InputMethod, EntryPoint = "ime_show_preedit_string")] internal static extern ErrorCode ImeShowPreeditString(); + [DllImport(Libraries.InputMethod, EntryPoint = "ime_hide_preedit_string")] internal static extern ErrorCode ImeHidePreeditString(); + [DllImport(Libraries.InputMethod, EntryPoint = "ime_update_preedit_string")] internal static extern ErrorCode ImeUpdatePreeditString(string str, IntPtr attrs); + [DllImport(Libraries.InputMethod, EntryPoint = "ime_request_surrounding_text")] internal static extern ErrorCode ImeRequestSurroundingText(int maxlenBefore, int maxlenAfter); + [DllImport(Libraries.InputMethod, EntryPoint = "ime_delete_surrounding_text")] internal static extern ErrorCode ImeDeleteSurroundingText(int offset, int len); + [DllImport(Libraries.InputMethod, EntryPoint = "ime_get_surrounding_text")] internal static extern ErrorCode ImeGetSurroundingText(int maxlenBefore, int maxlenAfter, out IntPtr text, out int cursorPos); + [DllImport(Libraries.InputMethod, EntryPoint = "ime_set_selection")] internal static extern ErrorCode ImeSetSelection(int start, int end); + [DllImport(Libraries.InputMethod, EntryPoint = "ime_get_main_window")] internal static extern IntPtr ImeGetMainWindow(); + [DllImport(Libraries.InputMethod, EntryPoint = "ime_set_size")] internal static extern ErrorCode ImeSetSize(int portraitWidth, int portraitHeight, int landscapeWidth, int landscapeHeight); + [DllImport(Libraries.InputMethod, EntryPoint = "ime_create_option_window")] internal static extern ErrorCode ImeCreateOptionWindow(); + [DllImport(Libraries.InputMethod, EntryPoint = "ime_destroy_option_window")] internal static extern ErrorCode ImeDestroyOptionWindow(IntPtr window); + [DllImport(Libraries.InputMethod, EntryPoint = "ime_context_get_layout")] internal static extern ErrorCode ImeContextGetLayout(IntPtr context, out EcoreIMFInputPanelLayout layout); + [DllImport(Libraries.InputMethod, EntryPoint = "ime_context_get_layout_variation")] internal static extern ErrorCode ImeContextGetLayoutVariation(IntPtr context, out ImeLayoutVariation layoutVariation); + [DllImport(Libraries.InputMethod, EntryPoint = "ime_context_get_cursor_position")] internal static extern ErrorCode ImeContextGetCursorPosition(IntPtr context, out int cursorPos); + [DllImport(Libraries.InputMethod, EntryPoint = "ime_context_get_autocapital_type")] internal static extern ErrorCode ImeContextGetAutocapitalType(IntPtr context, out EcoreIMFAutocapitalType autocapitalType); + [DllImport(Libraries.InputMethod, EntryPoint = "ime_context_get_return_key_type")] internal static extern ErrorCode ImeContextGetReturnKeyType(IntPtr context, out EcoreIMFInputPanelReturnKeyType returnKeyType); + [DllImport(Libraries.InputMethod, EntryPoint = "ime_context_get_return_key_state")] internal static extern ErrorCode ImeContextGetReturnKeyState(IntPtr context, out bool returnKeyState); + [DllImport(Libraries.InputMethod, EntryPoint = "ime_context_get_prediction_mode")] internal static extern ErrorCode ImeContextGetPredictionMode(IntPtr context, out bool predictionMode); + [DllImport(Libraries.InputMethod, EntryPoint = "ime_context_get_password_mode")] internal static extern ErrorCode ImeContextGetPasswordMode(IntPtr context, out bool passwordMode); + [DllImport(Libraries.InputMethod, EntryPoint = "ime_context_get_input_hint")] internal static extern ErrorCode ImeContextGetInputHint(IntPtr context, out EcoreIMFInputHints inputHint); + [DllImport(Libraries.InputMethod, EntryPoint = "ime_context_get_bidi_direction")] internal static extern ErrorCode ImeContextGetBidiDirection(IntPtr context, out EcoreIMFBiDiDirection bidi); + [DllImport(Libraries.InputMethod, EntryPoint = "ime_context_get_language")] internal static extern ErrorCode ImeContextGetLanguage(IntPtr context, out EcoreIMFInputPanelLang language); + [DllImport(Libraries.InputMethod, EntryPoint = "ime_device_info_get_name")] internal static extern ErrorCode ImeDeviceInfoGetName(IntPtr dev_info, out string devName); + [DllImport(Libraries.InputMethod, EntryPoint = "ime_device_info_get_class")] internal static extern ErrorCode ImeDeviceInfoGetClass(IntPtr dev_info, out EcoreIMFDeviceClass devClass); + [DllImport(Libraries.InputMethod, EntryPoint = "ime_device_info_get_subclass")] internal static extern ErrorCode ImeDeviceInfoGetSubclass(IntPtr dev_info, out EcoreIMFDeviceSubclass devSubClass); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] internal delegate void ImeCreateCb(IntPtr userData); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] internal delegate void ImeTerminateCb(IntPtr userData); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] internal delegate void ImeShowCb(int contextId, IntPtr context, IntPtr userData); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] internal delegate void ImeHideCb(int contextId, IntPtr userData); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] internal delegate void ImeFocusInCb(int contextId, IntPtr userData); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] internal delegate void ImeFocusOutCb(int contextId, IntPtr userData); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] internal delegate void ImeSurroundingTextUpdatedCb(int contextId, IntPtr text, int cursorPos, IntPtr userData); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] internal delegate void ImeInputContextResetCb(IntPtr userData); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] internal delegate void ImeCursorPositionUpdatedCb(int cursorPos, IntPtr userData); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] internal delegate void ImeLanguageRequestedCb(IntPtr userData, out IntPtr langCode); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] internal delegate void ImeLanguageSetCb(EcoreIMFInputPanelLang language, IntPtr userData); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] internal delegate void ImeImdataSetCb(IntPtr data, uint dataLength, IntPtr userData); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] internal delegate void ImeImdataRequestedCb(IntPtr userData, out IntPtr data, out uint dataLength); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] internal delegate void ImeLayoutSetCb(EcoreIMFInputPanelLayout layout, IntPtr userData); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] internal delegate void ImeReturnKeyTypeSetCb(EcoreIMFInputPanelReturnKeyType type, IntPtr userData); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] internal delegate void ImeReturnKeyStateSetCb(bool disabled, IntPtr userData); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] internal delegate void ImeGeometryRequestedCb(IntPtr userData, out int x, out int y, out int w, out int h); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] internal delegate bool ImeProcessKeyEventCb(KeyCode keycode, KeyMask keymask, IntPtr devInfo, IntPtr userData); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] internal delegate void ImeDisplayLanguageChangedCb(IntPtr language, IntPtr userData); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] internal delegate void ImeRotationDegreeChangedCb(int degree, IntPtr userData); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] internal delegate void ImeAccessibilityStateChangedCb(bool state, IntPtr userData); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] internal delegate void ImeOptionWindowCreatedCb(IntPtr window, ImeOptionWindowType type, IntPtr userData); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] internal delegate void ImeOptionWindowDestroyedCb(IntPtr window, IntPtr userData); } -} \ No newline at end of file +} diff --git a/src/Tizen.Uix.InputMethod/Interop/Interop.Libraries.cs b/src/Tizen.Uix.InputMethod/Interop/Interop.Libraries.cs index 38bbf24..694d429 100755 --- a/src/Tizen.Uix.InputMethod/Interop/Interop.Libraries.cs +++ b/src/Tizen.Uix.InputMethod/Interop/Interop.Libraries.cs @@ -25,6 +25,7 @@ internal static partial class Interop /// internal static partial class Libraries { - public const string InputMethod = "libcapi-ui-inputmethod.so"; + internal const string InputMethod = "libcapi-ui-inputmethod.so"; + internal const string Eina = "libeina.so.1"; } } diff --git a/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod.csproj b/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod.csproj index 70cf366..c87512f 100755 --- a/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod.csproj +++ b/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod.csproj @@ -51,9 +51,27 @@ + + + + + + + + + + + + + + + + + + diff --git a/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod.project.json b/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod.project.json index db7436c..dccafc1 100755 --- a/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod.project.json +++ b/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod.project.json @@ -1,9 +1,10 @@ -{ - "dependencies": { - "NETStandard.Library": "1.6.0", - "Tizen": "1.0.1" - }, - "frameworks": { - "netstandard1.3": {} - } -} +{ + "dependencies": { + "ElmSharp": "1.0.14", + "NETStandard.Library": "1.6.0", + "Tizen": "1.0.1" + }, + "frameworks": { + "netstandard1.3": {} + } +} \ No newline at end of file diff --git a/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/AccessibilityStateChangedEventArgs.cs b/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/AccessibilityStateChangedEventArgs.cs new file mode 100755 index 0000000..e668ea1 --- /dev/null +++ b/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/AccessibilityStateChangedEventArgs.cs @@ -0,0 +1,38 @@ +/* +* Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved +* +* Licensed under the Apache License, Version 2.0 (the License); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an AS IS BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +namespace Tizen.Uix.InputMethod +{ + /// + /// This Class contains data related to AccessibilityStateChanged Event + /// + public class AccessibilityStateChangedEventArgs + { + internal AccessibilityStateChangedEventArgs(bool state) + { + State = state; + } + + /// + /// Accessibility option state + /// + public bool State + { + get; + internal set; + } + } +} \ No newline at end of file diff --git a/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/CursorPositionUpdatedEventArgs.cs b/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/CursorPositionUpdatedEventArgs.cs new file mode 100755 index 0000000..3d8ff93 --- /dev/null +++ b/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/CursorPositionUpdatedEventArgs.cs @@ -0,0 +1,38 @@ +/* +* Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved +* +* Licensed under the Apache License, Version 2.0 (the License); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an AS IS BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +namespace Tizen.Uix.InputMethod +{ + /// + /// This Class contains data related to CursorPositionUpdated Event + /// + public class CursorPositionUpdatedEventArgs + { + internal CursorPositionUpdatedEventArgs(int cursorPos) + { + CursorPos = cursorPos; + } + + /// + /// The cursor position + /// + public int CursorPos + { + get; + internal set; + } + } +} \ No newline at end of file diff --git a/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/DisplayLanaguageChangedEventArgs.cs b/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/DisplayLanaguageChangedEventArgs.cs new file mode 100755 index 0000000..1b9df1f --- /dev/null +++ b/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/DisplayLanaguageChangedEventArgs.cs @@ -0,0 +1,38 @@ +/* +* Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved +* +* Licensed under the Apache License, Version 2.0 (the License); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an AS IS BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +namespace Tizen.Uix.InputMethod +{ + /// + /// This Class contains data related to DisplayLanaguageChanged Event + /// + public class DisplayLanaguageChangedEventArgs + { + internal DisplayLanaguageChangedEventArgs(string langauage) + { + Langauage = langauage; + } + + /// + /// The language code + /// + public string Langauage + { + get; + internal set; + } + } +} \ No newline at end of file diff --git a/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/EditorWindow.cs b/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/EditorWindow.cs new file mode 100755 index 0000000..2b65fe9 --- /dev/null +++ b/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/EditorWindow.cs @@ -0,0 +1,35 @@ +/* +* Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved +* +* Licensed under the Apache License, Version 2.0 (the License); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an AS IS BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +using System; +using ElmSharp; + +namespace Tizen.Uix.InputMethod +{ + public class EditorWindow : EvasObject + { + internal IntPtr _handle; + internal EditorWindow(IntPtr handle) + { + _handle = handle; + } + + protected override IntPtr CreateHandle(EvasObject parent) + { + return IntPtr.Zero; + } + } +} \ No newline at end of file diff --git a/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/FocusInEventArgs.cs b/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/FocusInEventArgs.cs new file mode 100755 index 0000000..1e4884e --- /dev/null +++ b/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/FocusInEventArgs.cs @@ -0,0 +1,38 @@ +/* +* Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved +* +* Licensed under the Apache License, Version 2.0 (the License); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an AS IS BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +namespace Tizen.Uix.InputMethod +{ + /// + /// This Class contains data related to FocusIn Event + /// + public class FocusInEventArgs + { + internal FocusInEventArgs(int contextId) + { + ContextId = contextId; + } + + /// + /// The input context identification value of an associated text input UI control + /// + public int ContextId + { + get; + internal set; + } + } +} \ No newline at end of file diff --git a/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/FocusOutEventArgs.cs b/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/FocusOutEventArgs.cs new file mode 100755 index 0000000..e8b5b3c --- /dev/null +++ b/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/FocusOutEventArgs.cs @@ -0,0 +1,38 @@ +/* +* Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved +* +* Licensed under the Apache License, Version 2.0 (the License); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an AS IS BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +namespace Tizen.Uix.InputMethod +{ + /// + /// This Class contains data related to FocusOut Event + /// + public class FocusOutEventArgs + { + internal FocusOutEventArgs(int contextId) + { + ContextId = contextId; + } + + /// + /// The input context identification value of an associated text input UI control + /// + public int ContextId + { + get; + internal set; + } + } +} \ No newline at end of file diff --git a/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/ImDataSetEventArgs.cs b/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/ImDataSetEventArgs.cs new file mode 100755 index 0000000..fccfc96 --- /dev/null +++ b/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/ImDataSetEventArgs.cs @@ -0,0 +1,49 @@ +/* +* Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved +* +* Licensed under the Apache License, Version 2.0 (the License); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an AS IS BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +namespace Tizen.Uix.InputMethod +{ + /// + /// This Class contains data related to ImDataSet Event + /// + public class ImDataSetEventArgs + { + internal ImDataSetEventArgs(byte[] destination, uint dataLength) + { + Data = destination; + DataLength = dataLength; + } + + /// + /// The specific data to be set to the input panel + /// + public byte[] Data + { + get; + internal set; + } + + /// + /// The length of data, in bytes, to send to the input panel + /// + public uint DataLength + { + get; + internal set; + } + + } +} \ No newline at end of file diff --git a/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/InputMethodContext.cs b/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/InputMethodContext.cs index c0f5146..bfae286 100755 --- a/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/InputMethodContext.cs +++ b/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/InputMethodContext.cs @@ -16,90 +16,478 @@ using System; -using System.Collections.Generic; -using System.Runtime.InteropServices; using static Interop.InputMethod; namespace Tizen.Uix.InputMethod { + /// + /// Enumeration for Input Panel Layout + /// public enum EcoreIMFInputPanelLayout { + /// + /// Normal + /// LayoutNormal, + /// + /// Number + /// LayoutNumber, + /// + /// Email + /// LayoutEMail, + /// + /// URL + /// LayoutURL, + /// + /// Phone Number + /// LayoutPhoneNumber, + /// + /// IP + /// LayoutIP, + /// + /// Month + /// LayoutMonth, + /// + /// Number Only + /// LayoutNumberOnly, + /// + /// Invalid + /// LayoutInvalid, + /// + /// HEX + /// LayoutHEX, + /// + /// Terminal + /// LayoutTerminal, + /// + /// Password + /// LayoutPassword, + /// + /// Date Time + /// LayoutDateTime, + /// + /// Emoticon + /// LayoutEmoticon, + /// + /// Voice + /// LayoutVoice, + /// + /// Undefined + /// Undefined }; + /// + /// Enumeration for Layout Variation + /// public enum ImeLayoutVariation { - NormalVariationNormal = 0, /**< The plain normal layout */ - NormalVariationFileName, /**< Filename layout; symbols such as '/', '\*', '\', '|', '<', '>', '?', '"' and ':' should be disabled */ - NormalVariationPersonName, /**< The name of a person */ - NumberOnlyVariationNormal = 0, /**< The plain normal number layout */ - NumberOnlyVariationSigned, /**< The number layout to allow a negative sign */ - NumberOnlyVariationDecimal, /**< The number layout to allow decimal point to provide fractional value */ - NumberOnlyVariationSignedAandDecimal, /**< The number layout to allow decimal point and negative sign */ - PasswordVariationNormal = 0, /**< The normal password layout */ - PasswordVariationNumberOnly, /**< The password layout to allow only number */ + /// + /// The plain normal layout + /// + NormalVariationNormal = 0, + /// + /// Filename layout; symbols such as '/', '\*', '\', '|', '<', '>', '?', '"' and ':' should be disabled + /// + NormalVariationFileName, + /// + /// The name of a person + /// + NormalVariationPersonName, + /// + /// The plain normal number layout + /// + NumberOnlyVariationNormal = 0, + /// + /// The number layout to allow a negative sign + /// + NumberOnlyVariationSigned, + /// + /// The number layout to allow decimal point to provide fractional value + /// + NumberOnlyVariationDecimal, + /// + /// The number layout to allow decimal point and negative sign + /// + NumberOnlyVariationSignedAandDecimal, + /// + /// The normal password layout + /// + PasswordVariationNormal = 0, + /// + /// The password layout to allow only number + /// + PasswordVariationNumberOnly, + /// + /// Undefined + /// Undefined }; + /// + /// Enumeration for AutoCapital Type + /// public enum EcoreIMFAutocapitalType { + /// + /// None + /// None, + /// + /// Word + /// Word, + /// + /// Sentence + /// Sentence, + /// + /// All Character + /// AllCharacter, + /// + /// Undefined + /// Undefined }; + /// + /// Enumeration for InputPanel ReturnKey Type + /// public enum EcoreIMFInputPanelReturnKeyType { + /// + /// Default + /// Default, + /// + /// Done + /// Done, + /// + /// Go + /// Go, + /// + /// Join + /// Join, + /// + /// Login + /// Login, + /// + /// Next + /// Next, + /// + /// Search + /// Search, + /// + /// Send + /// Send, + /// + /// SignIn + /// SignIn, + /// + /// Undefined + /// Undefined }; + /// + /// Enumeration for InputHints + /// public enum EcoreIMFInputHints { + /// + /// None + /// None, + /// + /// AutoComplete + /// AutoComplete, + /// + /// SensitiveData + /// SensitiveData, + /// + /// Multiline + /// Multiline, + /// + /// Undefined + /// Undefined }; + /// + /// Enumeration for BiDi Direction + /// public enum EcoreIMFBiDiDirection { + /// + /// Neutral + /// Neutral, + /// + /// LTR + /// LTR, + /// + /// RTL + /// RTL, + /// + /// Undefined + /// Undefined }; + /// + /// Enumeration for InputPanel Language + /// public enum EcoreIMFInputPanelLang { + /// + /// Automatic + /// Automatic, + /// + /// Alphabet + /// Alphabet, + /// + /// Undefined + /// Undefined }; -} \ No newline at end of file + + /// + /// This class represents the context of InputMethodEditor + /// + public class InputMethodContext + { + private IntPtr _handle; + internal InputMethodContext(IntPtr handle) + { + _handle = handle; + } + + /// + /// Gets the layout information. + /// + public EcoreIMFInputPanelLayout Layout + { + get + { + EcoreIMFInputPanelLayout layout; + ErrorCode error = ImeContextGetLayout(_handle, out layout); + if (error != ErrorCode.None) + { + Log.Error(LogTag, "GetLayout Failed with error " + error); + return EcoreIMFInputPanelLayout.Undefined; + } + return layout; + } + } + + /// + /// Gets the layout variation information. + /// + public ImeLayoutVariation LayoutVariation + { + get + { + ImeLayoutVariation layoutVariation; + ErrorCode error = ImeContextGetLayoutVariation(_handle, out layoutVariation); + if (error != ErrorCode.None) + { + Log.Error(LogTag, "GetLayoutVariation Failed with error " + error); + return ImeLayoutVariation.Undefined; + } + return layoutVariation; + } + } + + /// + /// Gets the cursor position information. + /// + public int CursorPosition + { + get + { + int cursorPosition; + ErrorCode error = ImeContextGetCursorPosition(_handle, out cursorPosition); + if (error != ErrorCode.None) + { + Log.Error(LogTag, "GetCursorPosition Failed with error " + error); + return -1; + } + return cursorPosition; + } + } + + /// + /// Gets the autocapital type information. + /// + public EcoreIMFAutocapitalType AutoCapitalType + { + get + { + EcoreIMFAutocapitalType autoCapitalType; + ErrorCode error = ImeContextGetAutocapitalType(_handle, out autoCapitalType); + if (error != ErrorCode.None) + { + Log.Error(LogTag, "GetAutoCapitalType Failed with error " + error); + return EcoreIMFAutocapitalType.Undefined; + } + return autoCapitalType; + } + } + + /// + /// Gets the Return key label type information. + /// + public EcoreIMFInputPanelReturnKeyType ReturnKeyType + { + get + { + EcoreIMFInputPanelReturnKeyType returnKeyType; + ErrorCode error = ImeContextGetReturnKeyType(_handle, out returnKeyType); + if (error != ErrorCode.None) + { + Log.Error(LogTag, "GetReturnKeyType Failed with error " + error); + return EcoreIMFInputPanelReturnKeyType.Undefined; + } + return returnKeyType; + } + } + + /// + /// Gets the Return key state information. + /// + public bool ReturnKeyState + { + get + { + bool returnKeyState; + ErrorCode error = ImeContextGetReturnKeyState(_handle, out returnKeyState); + if (error != ErrorCode.None) + { + Log.Error(LogTag, "GetReturnKeyState Failed with error " + error); + return false; + } + return returnKeyState; + } + } + + /// + /// Gets the prediction mode information. + /// + public bool PredictionMode + { + get + { + bool predictionMode; + ErrorCode error = ImeContextGetPredictionMode(_handle, out predictionMode); + if (error != ErrorCode.None) + { + Log.Error(LogTag, "GetPredictionMode Failed with error " + error); + return false; + } + return predictionMode; + } + } + + /// + /// Gets the password mode information. + /// + public bool PasswordMode + { + get + { + bool passwordMode; + ErrorCode error = ImeContextGetPasswordMode(_handle, out passwordMode); + if (error != ErrorCode.None) + { + Log.Error(LogTag, "GetPasswordMode Failed with error " + error); + return false; + } + return passwordMode; + } + } + + /// + /// Gets the input hint information. + /// + public EcoreIMFInputHints InputHint + { + get + { + EcoreIMFInputHints inputHint; + ErrorCode error = ImeContextGetInputHint(_handle, out inputHint); + if (error != ErrorCode.None) + { + Log.Error(LogTag, "GetInputHint Failed with error " + error); + return EcoreIMFInputHints.Undefined; + } + return inputHint; + } + } + + /// + /// Gets the text bidirectional information. + /// + public EcoreIMFBiDiDirection BiDiDirection + { + get + { + EcoreIMFBiDiDirection biDiDirection; + ErrorCode error = ImeContextGetBidiDirection(_handle, out biDiDirection); + if (error != ErrorCode.None) + { + Log.Error(LogTag, "GetBiDiDirection Failed with error " + error); + return EcoreIMFBiDiDirection.Undefined; + } + return biDiDirection; + } + } + + /// + /// Gets the preferred language information. + /// + public EcoreIMFInputPanelLang Langauge + { + get + { + EcoreIMFInputPanelLang langauge; + ErrorCode error = ImeContextGetLanguage(_handle, out langauge); + if (error != ErrorCode.None) + { + Log.Error(LogTag, "GetLangauge Failed with error " + error); + return EcoreIMFInputPanelLang.Undefined; + } + return langauge; + } + } + } +} diff --git a/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/InputMethodDeviceInformation.cs b/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/InputMethodDeviceInformation.cs index f17acd6..e86d94e 100755 --- a/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/InputMethodDeviceInformation.cs +++ b/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/InputMethodDeviceInformation.cs @@ -21,32 +21,167 @@ using static Interop.InputMethod; namespace Tizen.Uix.InputMethod { + /// + /// Enumeration for Device Class + /// public enum EcoreIMFDeviceClass { + /// + /// None + /// None, + /// + /// Seat + /// Seat, + /// + /// Keyboard + /// Keyboard, + /// + /// Mouse + /// Mouse, + /// + /// Touch + /// Touch, + /// + /// Pen + /// Pen, + /// + /// Pointer + /// Pointer, + /// + /// Gamepad + /// Gamepad, + /// + /// Undefined + /// Undefined }; + /// + /// Enumeration for Device SubClass + /// public enum EcoreIMFDeviceSubclass { + /// + /// None + /// None, + /// + /// Finger + /// Finger, + /// + /// FingerNail + /// FingerNail, + /// + /// Knuckle + /// Knuckle, + /// + /// Palm + /// Palm, + /// + /// HandSIze + /// HandSIze, + /// + /// HandFlat + /// HandFlat, + /// + /// PenTip + /// PenTip, + /// + /// Trackpad + /// Trackpad, + /// + /// Trackpoint + /// Trackpoint, + /// + /// Trackball + /// Trackball, + /// + /// Undefined + /// Undefined }; + + /// + /// this class gives the device information + /// + public class VoiceControlDeviceInformation + { + private IntPtr _handle; + internal VoiceControlDeviceInformation(IntPtr handle) + { + _handle = handle; + } + + /// + /// Gets the device name of the key event. + /// + public string Name + { + get + { + string name; + ErrorCode error = ImeDeviceInfoGetName(_handle, out name); + if (error != ErrorCode.None) + { + Log.Error(LogTag, "GetName Failed with error " + error); + return ""; + } + return name; + } + } + + /// + /// Gets the device class of the key event. + /// + public EcoreIMFDeviceClass DeviceClass + { + get + { + EcoreIMFDeviceClass devClass; + ErrorCode error = ImeDeviceInfoGetClass(_handle, out devClass); + if (error != ErrorCode.None) + { + Log.Error(LogTag, "GetClass Failed with error " + error); + return EcoreIMFDeviceClass.Undefined; + } + return devClass; + } + } + + /// + /// Gets the device subclass of the key event. + /// + public EcoreIMFDeviceSubclass Subclass + { + get + { + EcoreIMFDeviceSubclass subclass; + ErrorCode error = ImeDeviceInfoGetSubclass(_handle, out subclass); + if (error != ErrorCode.None) + { + Log.Error(LogTag, "GetSubclass Failed with error " + error); + return EcoreIMFDeviceSubclass.Undefined; + } + return subclass; + } + } + } } diff --git a/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/InputMethodEditor.cs b/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/InputMethodEditor.cs index a1522a7..048c44c 100755 --- a/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/InputMethodEditor.cs +++ b/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/InputMethodEditor.cs @@ -22,250 +22,2046 @@ using static Interop.InputMethod; namespace Tizen.Uix.InputMethod { + /// + /// Enumeration of the key codes. + /// If keycode & 0xff000000 == 0x01000000 then this key code is directly encoded 24-bit UCS character.The UCS value is keycode & 0x00ffffff. + /// Defines the list of keys supported by the system.Note that certain keys may not be available on all devices. + /// public enum KeyCode { - IME_KEY_BackSpace = 0xFF08, /**< The backspace key */ - IME_KEY_Tab = 0xFF09, /**< The tab key */ - IME_KEY_Linefeed = 0xFF0A, /**< The linefeed key */ - IME_KEY_Clear = 0xFF0B, /**< The clear key */ - IME_KEY_Return = 0xFF0D, /**< The return key */ - IME_KEY_Pause = 0xFF13, /**< The pause key */ - IME_KEY_Scroll_Lock = 0xFF14, /**< The scroll lock key */ - IME_KEY_Sys_Req = 0xFF15, /**< The sys req key */ - IME_KEY_Escape = 0xFF1B, /**< The escape key */ - IME_KEY_Delete = 0xFFFF, /**< The delete key */ + /// + /// The backspace key + /// + IME_KEY_BackSpace = 0xFF08, + /// + /// The tab key + /// + IME_KEY_Tab = 0xFF09, + /// + /// The linefeed key + /// + IME_KEY_Linefeed = 0xFF0A, + /// + /// The clear key + /// + IME_KEY_Clear = 0xFF0B, + /// + /// The return key + /// + IME_KEY_Return = 0xFF0D, + /// + /// The pause key + /// + IME_KEY_Pause = 0xFF13, + /// + /// The scroll lock key + /// + IME_KEY_Scroll_Lock = 0xFF14, + /// + /// The sys req key + /// + IME_KEY_Sys_Req = 0xFF15, + /// + /// The escape key + /// + IME_KEY_Escape = 0xFF1B, + /// + /// The delete key + /// + IME_KEY_Delete = 0xFFFF, /* Cursor control & motion */ - IME_KEY_Home = 0xFF50, /**< The home key */ - IME_KEY_Left = 0xFF51, /**< The left directional key */ - IME_KEY_Up = 0xFF52, /**< The up directional key */ - IME_KEY_Right = 0xFF53, /**< The right directional key */ - IME_KEY_Down = 0xFF54, /**< The down directional key */ - IME_KEY_Prior = 0xFF55, /**< The prior, previous key */ - IME_KEY_Page_Up = 0xFF55, /**< The page up key */ - IME_KEY_Next = 0xFF56, /**< The next key */ - IME_KEY_Page_Down = 0xFF56, /**< The page down key */ - IME_KEY_End = 0xFF57, /**< The end key */ - IME_KEY_Begin = 0xFF58, /**< The begin key */ + /// + /// The home key + /// + IME_KEY_Home = 0xFF50, + /// + /// The left directional key + /// + IME_KEY_Left = 0xFF51, + /// + /// The up directional key + /// + IME_KEY_Up = 0xFF52, + /// + /// The right directional key + /// + IME_KEY_Right = 0xFF53, + /// + /// The down directional key + /// + IME_KEY_Down = 0xFF54, + /// + /// The prior, previous key + /// + IME_KEY_Prior = 0xFF55, + /// + /// The page up key + /// + IME_KEY_Page_Up = 0xFF55, + /// + /// The next key + /// + IME_KEY_Next = 0xFF56, + /// + /// The page down key + /// + IME_KEY_Page_Down = 0xFF56, + /// + /// The end key + /// + IME_KEY_End = 0xFF57, + /// + /// The begin key + /// + IME_KEY_Begin = 0xFF58, /* Misc Functions */ - IME_KEY_Select = 0xFF60, /**< The select key */ - IME_KEY_Print = 0xFF61, /**< The print key */ - IME_KEY_Execute = 0xFF62, /**< The execute, run, do key */ - IME_KEY_Insert = 0xFF63, /**< The insert key */ - IME_KEY_Undo = 0xFF65, /**< The undo key */ - IME_KEY_Redo = 0xFF66, /**< The redo key */ - IME_KEY_Menu = 0xFF67, /**< The menu key */ - IME_KEY_Find = 0xFF68, /**< The find key */ - IME_KEY_Cancel = 0xFF69, /**< The cancel, stop, abort, exit key */ - IME_KEY_Help = 0xFF6A, /**< The help key */ - IME_KEY_Break = 0xFF6B, /**< The break key */ - IME_KEY_Mode_switch = 0xFF7E, /**< The character set switch key */ - IME_KEY_Num_Lock = 0xFF7F, /**< The num lock key */ + /// + /// The select key + /// + IME_KEY_Select = 0xFF60, + /// + /// The print key + /// + IME_KEY_Print = 0xFF61, + /// + /// The execute, run, do key + /// + IME_KEY_Execute = 0xFF62, + /// + /// The insert key + /// + IME_KEY_Insert = 0xFF63, + /// + /// The undo key + /// + IME_KEY_Undo = 0xFF65, + /// + /// The redo key + /// + IME_KEY_Redo = 0xFF66, + /// + /// The menu key + /// + IME_KEY_Menu = 0xFF67, + /// + /// The find key + /// + IME_KEY_Find = 0xFF68, + /// + /// The cancel, stop, abort, exit key + /// + IME_KEY_Cancel = 0xFF69, + /// + /// The help key + /// + IME_KEY_Help = 0xFF6A, + /// + /// The break key + /// + IME_KEY_Break = 0xFF6B, + /// + /// The character set switch key + /// + IME_KEY_Mode_switch = 0xFF7E, + /// + /// The num lock key + /// + IME_KEY_Num_Lock = 0xFF7F, /* Keypad */ - IME_KEY_KP_Space = 0xFF80, /**< The Numpad space key */ - IME_KEY_KP_Tab = 0xFF89, /**< The Numpad tab key */ - IME_KEY_KP_Enter = 0xFF8D, /**< The Numpad enter key */ - IME_KEY_KP_F1 = 0xFF91, /**< The Numpad function 1 key */ - IME_KEY_KP_F2 = 0xFF92, /**< The Numpad function 2 key */ - IME_KEY_KP_F3 = 0xFF93, /**< The Numpad function 3 key */ - IME_KEY_KP_F4 = 0xFF94, /**< The Numpad function 4 key */ - IME_KEY_KP_Home = 0xFF95, /**< The Numpad home key */ - IME_KEY_KP_Left = 0xFF96, /**< The Numpad left key */ - IME_KEY_KP_Up = 0xFF97, /**< The Numpad up key */ - IME_KEY_KP_Right = 0xFF98, /**< The Numpad right key */ - IME_KEY_KP_Down = 0xFF99, /**< The Numpad down key */ - IME_KEY_KP_Prior = 0xFF9A, /**< The Numpad prior, previous key */ - IME_KEY_KP_Page_Up = 0xFF9A, /**< The Numpad page up key */ - IME_KEY_KP_Next = 0xFF9B, /**< The Numpad next key */ - IME_KEY_KP_Page_Down = 0xFF9B, /**< The Numpad page down key */ - IME_KEY_KP_End = 0xFF9C, /**< The Numpad end key */ - IME_KEY_KP_Begin = 0xFF9D, /**< The Numpad begin key */ - IME_KEY_KP_Insert = 0xFF9E, /**< The Numpad insert key */ - IME_KEY_KP_Delete = 0xFF9F, /**< The Numpad delete key */ - IME_KEY_KP_Equal = 0xFFBD, /**< The Numpad equal key */ - IME_KEY_KP_Multiply = 0xFFAA, /**< The Numpad multiply key */ - IME_KEY_KP_Add = 0xFFAB, /**< The Numpad add key */ - IME_KEY_KP_Separator = 0xFFAC, /**< The Numpad separator key */ - IME_KEY_KP_Subtract = 0xFFAD, /**< The Numpad subtract key */ - IME_KEY_KP_Decimal = 0xFFAE, /**< The Numpad decimal key */ - IME_KEY_KP_Divide = 0xFFAF, /**< The Numpad divide key */ - - IME_KEY_KP_0 = 0xFFB0, /**< The Numpad 0 key */ - IME_KEY_KP_1 = 0xFFB1, /**< The Numpad 1 key */ - IME_KEY_KP_2 = 0xFFB2, /**< The Numpad 2 key */ - IME_KEY_KP_3 = 0xFFB3, /**< The Numpad 3 key */ - IME_KEY_KP_4 = 0xFFB4, /**< The Numpad 4 key */ - IME_KEY_KP_5 = 0xFFB5, /**< The Numpad 5 key */ - IME_KEY_KP_6 = 0xFFB6, /**< The Numpad 6 key */ - IME_KEY_KP_7 = 0xFFB7, /**< The Numpad 7 key */ - IME_KEY_KP_8 = 0xFFB8, /**< The Numpad 8 key */ - IME_KEY_KP_9 = 0xFFB9, /**< The Numpad 9 key */ + /// + /// The Numpad space key + /// + IME_KEY_KP_Space = 0xFF80, + /// + /// The Numpad tab key + /// + IME_KEY_KP_Tab = 0xFF89, + /// + /// The Numpad enter key + /// + IME_KEY_KP_Enter = 0xFF8D, + /// + /// The Numpad function 1 key + /// + IME_KEY_KP_F1 = 0xFF91, + /// + /// The Numpad function 2 key + /// + IME_KEY_KP_F2 = 0xFF92, + /// + /// The Numpad function 3 key + /// + IME_KEY_KP_F3 = 0xFF93, + /// + /// The Numpad function 4 key + /// + IME_KEY_KP_F4 = 0xFF94, + /// + /// The Numpad home key + /// + IME_KEY_KP_Home = 0xFF95, + /// + /// The Numpad left key + /// + IME_KEY_KP_Left = 0xFF96, + /// + /// The Numpad up key + /// + IME_KEY_KP_Up = 0xFF97, + /// + /// The Numpad right key + /// + IME_KEY_KP_Right = 0xFF98, + /// + /// The Numpad down key + /// + IME_KEY_KP_Down = 0xFF99, + /// + /// The Numpad prior, previous key + /// + IME_KEY_KP_Prior = 0xFF9A, + /// + /// The Numpad page up key + /// + IME_KEY_KP_Page_Up = 0xFF9A, + /// + /// The Numpad next key + /// + IME_KEY_KP_Next = 0xFF9B, + /// + /// The Numpad page down key + /// + IME_KEY_KP_Page_Down = 0xFF9B, + /// + /// The Numpad end key + /// + IME_KEY_KP_End = 0xFF9C, + /// + /// The Numpad begin key + /// + IME_KEY_KP_Begin = 0xFF9D, + /// + /// The Numpad insert key + /// + IME_KEY_KP_Insert = 0xFF9E, + /// + /// The Numpad delete key + /// + IME_KEY_KP_Delete = 0xFF9F, + /// + /// The Numpad equal key + /// + IME_KEY_KP_Equal = 0xFFBD, + /// + /// The Numpad multiply key + /// + IME_KEY_KP_Multiply = 0xFFAA, + /// + /// The Numpad add key + /// + IME_KEY_KP_Add = 0xFFAB, + /// + /// The Numpad separator key + /// + IME_KEY_KP_Separator = 0xFFAC, + /// + /// The Numpad subtract key + /// + IME_KEY_KP_Subtract = 0xFFAD, + /// + /// The Numpad decimal key + /// + IME_KEY_KP_Decimal = 0xFFAE, + /// + /// The Numpad divide key + /// + IME_KEY_KP_Divide = 0xFFAF, + /// + /// The Numpad 0 key + /// + IME_KEY_KP_0 = 0xFFB0, + /// + /// The Numpad 1 key + /// + IME_KEY_KP_1 = 0xFFB1, + /// + /// The Numpad 2 key + /// + IME_KEY_KP_2 = 0xFFB2, + /// + /// The Numpad 3 key + /// + IME_KEY_KP_3 = 0xFFB3, + /// + /// The Numpad 4 key + /// + IME_KEY_KP_4 = 0xFFB4, + /// + /// The Numpad 5 key + /// + IME_KEY_KP_5 = 0xFFB5, + /// + /// The Numpad 6 key + /// + IME_KEY_KP_6 = 0xFFB6, + /// + /// The Numpad 7 key + /// + IME_KEY_KP_7 = 0xFFB7, + /// + /// The Numpad 8 key + /// + IME_KEY_KP_8 = 0xFFB8, + /// + /// The Numpad 9 key + /// + IME_KEY_KP_9 = 0xFFB9, /* Auxilliary Functions */ - IME_KEY_F1 = 0xFFBE, /**< The function 1 key */ - IME_KEY_F2 = 0xFFBF, /**< The function 2 key */ - IME_KEY_F3 = 0xFFC0, /**< The function 3 key */ - IME_KEY_F4 = 0xFFC1, /**< The function 4 key */ - IME_KEY_F5 = 0xFFC2, /**< The function 5 key */ - IME_KEY_F6 = 0xFFC3, /**< The function 6 key */ - IME_KEY_F7 = 0xFFC4, /**< The function 7 key */ - IME_KEY_F8 = 0xFFC5, /**< The function 8 key */ - IME_KEY_F9 = 0xFFC6, /**< The function 9 key */ - IME_KEY_F10 = 0xFFC7, /**< The function 10 key */ - IME_KEY_F11 = 0xFFC8, /**< The function 11 key */ - IME_KEY_F12 = 0xFFC9, /**< The function 12 key */ - IME_KEY_F13 = 0xFFCA, /**< The function 13 key */ - IME_KEY_F14 = 0xFFCB, /**< The function 14 key */ - IME_KEY_F15 = 0xFFCC, /**< The function 15 key */ - IME_KEY_F16 = 0xFFCD, /**< The function 16 key */ - IME_KEY_F17 = 0xFFCE, /**< The function 17 key */ - IME_KEY_F18 = 0xFFCF, /**< The function 18 key */ - IME_KEY_F19 = 0xFFD0, /**< The function 19 key */ - IME_KEY_F20 = 0xFFD1, /**< The function 20 key */ - IME_KEY_F21 = 0xFFD2, /**< The function 21 key */ - IME_KEY_F22 = 0xFFD3, /**< The function 22 key */ - IME_KEY_F23 = 0xFFD4, /**< The function 23 key */ - IME_KEY_F24 = 0xFFD5, /**< The function 24 key */ - IME_KEY_F25 = 0xFFD6, /**< The function 25 key */ - IME_KEY_F26 = 0xFFD7, /**< The function 26 key */ - IME_KEY_F27 = 0xFFD8, /**< The function 27 key */ - IME_KEY_F28 = 0xFFD9, /**< The function 28 key */ - IME_KEY_F29 = 0xFFDA, /**< The function 29 key */ - IME_KEY_F30 = 0xFFDB, /**< The function 30 key */ - IME_KEY_F31 = 0xFFDC, /**< The function 31 key */ - IME_KEY_F32 = 0xFFDD, /**< The function 32 key */ - IME_KEY_F33 = 0xFFDE, /**< The function 33 key */ - IME_KEY_F34 = 0xFFDF, /**< The function 34 key */ - IME_KEY_F35 = 0xFFE0, /**< The function 35 key */ + /// + /// The function 1 key + /// + IME_KEY_F1 = 0xFFBE, + /// + /// The function 2 key + /// + IME_KEY_F2 = 0xFFBF, + /// + /// The function 3 key + /// + IME_KEY_F3 = 0xFFC0, + /// + /// The function 4 key + /// + IME_KEY_F4 = 0xFFC1, + /// + /// The function 5 key + /// + IME_KEY_F5 = 0xFFC2, + /// + /// The function 6 key + /// + IME_KEY_F6 = 0xFFC3, + /// + /// The function 7 key + /// + IME_KEY_F7 = 0xFFC4, + /// + /// The function 8 key + /// + IME_KEY_F8 = 0xFFC5, + /// + /// The function 9 key + /// + IME_KEY_F9 = 0xFFC6, + /// + /// The function 10 key + /// + IME_KEY_F10 = 0xFFC7, + /// + /// The function 11 key + /// + IME_KEY_F11 = 0xFFC8, + /// + /// The function 12 key + /// + IME_KEY_F12 = 0xFFC9, + /// + /// The function 13 key + /// + IME_KEY_F13 = 0xFFCA, + /// + /// The function 14 key + /// + IME_KEY_F14 = 0xFFCB, + /// + /// The function 15 key + /// + IME_KEY_F15 = 0xFFCC, + /// + /// The function 16 key + /// + IME_KEY_F16 = 0xFFCD, + /// + /// The function 17 key + /// + IME_KEY_F17 = 0xFFCE, + /// + /// The function 18 key + /// + IME_KEY_F18 = 0xFFCF, + /// + /// The function 19 key + /// + IME_KEY_F19 = 0xFFD0, + /// + /// The function 20 key + /// + IME_KEY_F20 = 0xFFD1, + /// + /// The function 21 key + /// + IME_KEY_F21 = 0xFFD2, + /// + /// The function 22 key + /// + IME_KEY_F22 = 0xFFD3, + /// + /// The function 23 key + /// + IME_KEY_F23 = 0xFFD4, + /// + /// The function 24 key + /// + IME_KEY_F24 = 0xFFD5, + /// + /// The function 25 key + /// + IME_KEY_F25 = 0xFFD6, + /// + /// The function 26 key + /// + IME_KEY_F26 = 0xFFD7, + /// + /// The function 27 key + /// + IME_KEY_F27 = 0xFFD8, + /// + /// The function 28 key + /// + IME_KEY_F28 = 0xFFD9, + /// + /// The function 29 key + /// + IME_KEY_F29 = 0xFFDA, + /// + /// The function 30 key + /// + IME_KEY_F30 = 0xFFDB, + /// + /// The function 31 key + /// + IME_KEY_F31 = 0xFFDC, + /// + /// The function 32 key + /// + IME_KEY_F32 = 0xFFDD, + /// + /// The function 33 key + /// + IME_KEY_F33 = 0xFFDE, + /// + /// The function 34 key + /// + IME_KEY_F34 = 0xFFDF, + /// + /// The function 35 key + /// + IME_KEY_F35 = 0xFFE0, /* Modifier keys */ - IME_KEY_Shift_L = 0xFFE1, /**< The left shift key */ - IME_KEY_Shift_R = 0xFFE2, /**< The right shift key */ - IME_KEY_Control_L = 0xFFE3, /**< The left control key */ - IME_KEY_Control_R = 0xFFE4, /**< The right control key */ - IME_KEY_Caps_Lock = 0xFFE5, /**< The caps lock key */ - IME_KEY_Shift_Lock = 0xFFE6, /**< The shift lock key */ - - IME_KEY_Meta_L = 0xFFE7, /**< The left meta key */ - IME_KEY_Meta_R = 0xFFE8, /**< The right meta key */ - IME_KEY_Alt_L = 0xFFE9, /**< The left alt key */ - IME_KEY_Alt_R = 0xFFEA, /**< The right alt key */ - IME_KEY_Super_L = 0xFFEB, /**< The left super key */ - IME_KEY_Super_R = 0xFFEC, /**< The right super key */ - IME_KEY_Hyper_L = 0xFFED, /**< The left hyper key */ - IME_KEY_Hyper_R = 0xFFEE, /**< The right hyper key */ + /// + /// The left shift key + /// + IME_KEY_Shift_L = 0xFFE1, + /// + /// The right shift key + /// + IME_KEY_Shift_R = 0xFFE2, + /// + /// The left control key + /// + IME_KEY_Control_L = 0xFFE3, + /// + /// The right control key + /// + IME_KEY_Control_R = 0xFFE4, + /// + /// The caps lock key + /// + IME_KEY_Caps_Lock = 0xFFE5, + /// + /// The shift lock key + /// + IME_KEY_Shift_Lock = 0xFFE6, + /// + /// The left meta key + /// + IME_KEY_Meta_L = 0xFFE7, + /// + /// The right meta key + /// + IME_KEY_Meta_R = 0xFFE8, + /// + /// The left alt key + /// + IME_KEY_Alt_L = 0xFFE9, + /// + /// The right alt key + /// + IME_KEY_Alt_R = 0xFFEA, + /// + /// The left super key + /// + IME_KEY_Super_L = 0xFFEB, + /// + /// The right super key + /// + IME_KEY_Super_R = 0xFFEC, + /// + /// The left hyper key + /// + IME_KEY_Hyper_L = 0xFFED, + /// + /// The right hyper key + /// + IME_KEY_Hyper_R = 0xFFEE, /* Latin 1 */ - IME_KEY_space = 0x020, /**< The space key */ - IME_KEY_exclam = 0x021, /**< The exclamation key */ - IME_KEY_quotedbl = 0x022, /**< The quotedbl key */ - IME_KEY_numbersign = 0x023, /**< The number sign key */ - IME_KEY_dollar = 0x024, /**< The dollar key */ - IME_KEY_percent = 0x025, /**< The percent key */ - IME_KEY_ampersand = 0x026, /**< The ampersand key */ - IME_KEY_apostrophe = 0x027, /**< The apostrophe key */ - IME_KEY_parenleft = 0x028, /**< The parenleft key */ - IME_KEY_parenright = 0x029, /**< The parenright key */ - IME_KEY_asterisk = 0x02a, /**< The asterisk key */ - IME_KEY_plus = 0x02b, /**< The plus key */ - IME_KEY_comma = 0x02c, /**< The comma key */ - IME_KEY_minus = 0x02d, /**< The minus key */ - IME_KEY_period = 0x02e, /**< The period key */ - IME_KEY_slash = 0x02f, /**< The slash key */ - IME_KEY_0 = 0x030, /**< The 0 key */ - IME_KEY_1 = 0x031, /**< The 1 key */ - IME_KEY_2 = 0x032, /**< The 2 key */ - IME_KEY_3 = 0x033, /**< The 3 key */ - IME_KEY_4 = 0x034, /**< The 4 key */ - IME_KEY_5 = 0x035, /**< The 5 key */ - IME_KEY_6 = 0x036, /**< The 6 key */ - IME_KEY_7 = 0x037, /**< The 7 key */ - IME_KEY_8 = 0x038, /**< The 8 key */ - IME_KEY_9 = 0x039, /**< The 9 key */ - IME_KEY_colon = 0x03a, /**< The colon key */ - IME_KEY_semicolon = 0x03b, /**< The semicolon key */ - IME_KEY_less = 0x03c, /**< The less key */ - IME_KEY_equal = 0x03d, /**< The equal key */ - IME_KEY_greater = 0x03e, /**< The greater key */ - IME_KEY_question = 0x03f, /**< The question key */ - IME_KEY_at = 0x040, /**< The at key */ - IME_KEY_A = 0x041, /**< The A key */ - IME_KEY_B = 0x042, /**< The B key */ - IME_KEY_C = 0x043, /**< The C key */ - IME_KEY_D = 0x044, /**< The D key */ - IME_KEY_E = 0x045, /**< The E key */ - IME_KEY_F = 0x046, /**< The F key */ - IME_KEY_G = 0x047, /**< The G key */ - IME_KEY_H = 0x048, /**< The H key */ - IME_KEY_I = 0x049, /**< The I key */ - IME_KEY_J = 0x04a, /**< The J key */ - IME_KEY_K = 0x04b, /**< The K key */ - IME_KEY_L = 0x04c, /**< The L key */ - IME_KEY_M = 0x04d, /**< The M key */ - IME_KEY_N = 0x04e, /**< The N key */ - IME_KEY_O = 0x04f, /**< The O key */ - IME_KEY_P = 0x050, /**< The P key */ - IME_KEY_Q = 0x051, /**< The Q key */ - IME_KEY_R = 0x052, /**< The R key */ - IME_KEY_S = 0x053, /**< The S key */ - IME_KEY_T = 0x054, /**< The T key */ - IME_KEY_U = 0x055, /**< The U key */ - IME_KEY_V = 0x056, /**< The V key */ - IME_KEY_W = 0x057, /**< The W key */ - IME_KEY_X = 0x058, /**< The X key */ - IME_KEY_Y = 0x059, /**< The Y key */ - IME_KEY_Z = 0x05a, /**< The Z key */ - IME_KEY_bracketleft = 0x05b, /**< The left bracket key */ - IME_KEY_backslash = 0x05c, /**< The backslash key */ - IME_KEY_bracketright = 0x05d, /**< The right bracket key */ - IME_KEY_asciicircum = 0x05e, /**< The circumflex key */ - IME_KEY_underscore = 0x05f, /**< The underscore key */ - IME_KEY_grave = 0x060, /**< The grave key */ - IME_KEY_a = 0x061, /**< The a key */ - IME_KEY_b = 0x062, /**< The b key */ - IME_KEY_c = 0x063, /**< The c key */ - IME_KEY_d = 0x064, /**< The d key */ - IME_KEY_e = 0x065, /**< The e key */ - IME_KEY_f = 0x066, /**< The f key */ - IME_KEY_g = 0x067, /**< The g key */ - IME_KEY_h = 0x068, /**< The h key */ - IME_KEY_i = 0x069, /**< The i key */ - IME_KEY_j = 0x06a, /**< The j key */ - IME_KEY_k = 0x06b, /**< The k key */ - IME_KEY_l = 0x06c, /**< The l key */ - IME_KEY_m = 0x06d, /**< The m key */ - IME_KEY_n = 0x06e, /**< The n key */ - IME_KEY_o = 0x06f, /**< The o key */ - IME_KEY_p = 0x070, /**< The p key */ - IME_KEY_q = 0x071, /**< The q key */ - IME_KEY_r = 0x072, /**< The r key */ - IME_KEY_s = 0x073, /**< The s key */ - IME_KEY_t = 0x074, /**< The t key */ - IME_KEY_u = 0x075, /**< The u key */ - IME_KEY_v = 0x076, /**< The v key */ - IME_KEY_w = 0x077, /**< The w key */ - IME_KEY_x = 0x078, /**< The x key */ - IME_KEY_y = 0x079, /**< The y key */ - IME_KEY_z = 0x07a, /**< The z key */ - IME_KEY_braceleft = 0x07b, /**< The left brace key */ - IME_KEY_bar = 0x07c, /**< The bar key */ - IME_KEY_braceright = 0x07d, /**< The right brace key */ - IME_KEY_asciitilde = 0x07e /**< The tilde key */ + /// + /// The space key + /// + IME_KEY_space = 0x020, + /// + /// The exclamation key + /// + IME_KEY_exclam = 0x021, + /// + /// The quotedbl key + /// + IME_KEY_quotedbl = 0x022, + /// + /// The number sign key + /// + IME_KEY_numbersign = 0x023, + /// + /// The dollar key + /// + IME_KEY_dollar = 0x024, + /// + /// The percent key + /// + IME_KEY_percent = 0x025, + /// + /// The ampersand key + /// + IME_KEY_ampersand = 0x026, + /// + /// The apostrophe key + /// + IME_KEY_apostrophe = 0x027, + /// + /// The parenleft key + /// + IME_KEY_parenleft = 0x028, + /// + /// The parenright key + /// + IME_KEY_parenright = 0x029, + /// + /// The asterisk key + /// + IME_KEY_asterisk = 0x02a, + /// + /// The plus key + /// + IME_KEY_plus = 0x02b, + /// + /// The comma key + /// + IME_KEY_comma = 0x02c, + /// + /// The minus key + /// + IME_KEY_minus = 0x02d, + /// + /// The period key + /// + IME_KEY_period = 0x02e, + /// + /// The slash key + /// + IME_KEY_slash = 0x02f, + /// + /// The 0 key + /// + IME_KEY_0 = 0x030, + /// + /// The 1 key + /// + IME_KEY_1 = 0x031, + /// + /// The 2 key + /// + IME_KEY_2 = 0x032, + /// + /// The 3 key + /// + IME_KEY_3 = 0x033, + /// + /// The 4 key + /// + IME_KEY_4 = 0x034, + /// + /// The 5 key + /// + IME_KEY_5 = 0x035, + /// + /// The 6 key + /// + IME_KEY_6 = 0x036, + /// + /// The 7 key + /// + IME_KEY_7 = 0x037, + /// + /// The 8 key + /// + IME_KEY_8 = 0x038, + /// + /// The 9 key + /// + IME_KEY_9 = 0x039, + /// + /// The colon key + /// + IME_KEY_colon = 0x03a, + /// + /// The semicolon key + /// + IME_KEY_semicolon = 0x03b, + /// + /// The less key + /// + IME_KEY_less = 0x03c, + /// + /// The equal key + /// + IME_KEY_equal = 0x03d, + /// + /// The greater key + /// + IME_KEY_greater = 0x03e, + /// + /// The question key + /// + IME_KEY_question = 0x03f, + /// + /// The at key + /// + IME_KEY_at = 0x040, + /// + /// The A key + /// + IME_KEY_A = 0x041, + /// + /// The B key + /// + IME_KEY_B = 0x042, + /// + /// The C key + /// + IME_KEY_C = 0x043, + /// + /// The D key + /// + IME_KEY_D = 0x044, + /// + /// The E key + /// + IME_KEY_E = 0x045, + /// + /// The F key + /// + IME_KEY_F = 0x046, + /// + /// The G key + /// + IME_KEY_G = 0x047, + /// + /// The H key + /// + IME_KEY_H = 0x048, + /// + /// The I key + /// + IME_KEY_I = 0x049, + /// + /// The J key + /// + IME_KEY_J = 0x04a, + /// + /// The K key + /// + IME_KEY_K = 0x04b, + /// + /// The L key + /// + IME_KEY_L = 0x04c, + /// + /// The M key + /// + IME_KEY_M = 0x04d, + /// + /// The N key + /// + IME_KEY_N = 0x04e, + /// + /// The O key + /// + IME_KEY_O = 0x04f, + /// + /// The P key + /// + IME_KEY_P = 0x050, + /// + /// The Q key + /// + IME_KEY_Q = 0x051, + /// + /// The R key + /// + IME_KEY_R = 0x052, + /// + /// The S key + /// + IME_KEY_S = 0x053, + /// + /// The T key + /// + IME_KEY_T = 0x054, + /// + /// The U key + /// + IME_KEY_U = 0x055, + /// + /// The V key + /// + IME_KEY_V = 0x056, + /// + /// The W key + /// + IME_KEY_W = 0x057, + /// + /// The X key + /// + IME_KEY_X = 0x058, + /// + /// The Y key + /// + IME_KEY_Y = 0x059, + /// + /// The Z key + /// + IME_KEY_Z = 0x05a, + /// + /// The left bracket key + /// + IME_KEY_bracketleft = 0x05b, + /// + /// The backslash key + /// + IME_KEY_backslash = 0x05c, + /// + /// The right bracket key + /// + IME_KEY_bracketright = 0x05d, + /// + /// The circumflex key + /// + IME_KEY_asciicircum = 0x05e, + /// + /// The underscore key + /// + IME_KEY_underscore = 0x05f, + /// + /// The grave key + /// + IME_KEY_grave = 0x060, + /// + /// The a key + /// + IME_KEY_a = 0x061, + /// + /// The b key + /// + IME_KEY_b = 0x062, + /// + /// The c key + /// + IME_KEY_c = 0x063, + /// + /// The d key + /// + IME_KEY_d = 0x064, + /// + /// The e key + /// + IME_KEY_e = 0x065, + /// + /// The f key + /// + IME_KEY_f = 0x066, + /// + /// The g key + /// + IME_KEY_g = 0x067, + /// + /// The h key + /// + IME_KEY_h = 0x068, + /// + /// The i key + /// + IME_KEY_i = 0x069, + /// + /// The j key + /// + IME_KEY_j = 0x06a, + /// + /// The k key + /// + IME_KEY_k = 0x06b, + /// + /// The l key + /// + IME_KEY_l = 0x06c, + /// + /// The m key + /// + IME_KEY_m = 0x06d, + /// + /// The n key + /// + IME_KEY_n = 0x06e, + /// + /// The o key + /// + IME_KEY_o = 0x06f, + /// + /// The p key + /// + IME_KEY_p = 0x070, + /// + /// The q key + /// + IME_KEY_q = 0x071, + /// + /// The r key + /// + IME_KEY_r = 0x072, + /// + /// The s key + /// + IME_KEY_s = 0x073, + /// + /// The t key + /// + IME_KEY_t = 0x074, + /// + /// The u key + /// + IME_KEY_u = 0x075, + /// + /// The v key + /// + IME_KEY_v = 0x076, + /// + /// The w key + /// + IME_KEY_w = 0x077, + /// + /// The x key + /// + IME_KEY_x = 0x078, + /// + /// The y key + /// + IME_KEY_y = 0x079, + /// + /// The z key + /// + IME_KEY_z = 0x07a, + /// + /// The left brace key + /// + IME_KEY_braceleft = 0x07b, + /// + /// The bar key + /// + IME_KEY_bar = 0x07c, + /// + /// The right brace key + /// + IME_KEY_braceright = 0x07d, + /// + /// The tilde key + /// + IME_KEY_asciitilde = 0x07e, }; + /// + /// Enumeration of the key masks. + /// The key masks indicate which modifier keys is pressed down during the keyboard hit.The special IME_KEY_MASK_RELEASED indicates the key release event. + /// public enum KeyMask { - IME_KEY_MASK_PRESSED = 0, /**< Key press event without modifier key */ - IME_KEY_MASK_SHIFT = (1 << 0), /**< The Shift key is pressed down */ - IME_KEY_MASK_CAPSLOCK = (1 << 1), /**< The CapsLock key is pressed down */ - IME_KEY_MASK_CONTROL = (1 << 2), /**< The Control key is pressed down */ - IME_KEY_MASK_ALT = (1 << 3), /**< The Alt key is pressed down */ - IME_KEY_MASK_META = (1 << 4), /**< The Meta key is pressed down */ - IME_KEY_MASK_WIN = (1 << 5), /**< The Win (between Control and Alt) is pressed down */ - IME_KEY_MASK_HYPER = (1 << 6), /**< The Hyper key is pressed down */ - IME_KEY_MASK_NUMLOCK = (1 << 7), /**< The NumLock key is pressed down */ - IME_KEY_MASK_RELEASED = (1 << 15) /**< Key release event */ - }; -} \ No newline at end of file + /// + /// Key press event without modifier key + /// + IME_KEY_MASK_PRESSED = 0, + /// + /// The Shift key is pressed down + /// + IME_KEY_MASK_SHIFT = (1 << 0), + /// + /// The CapsLock key is pressed down + /// + IME_KEY_MASK_CAPSLOCK = (1 << 1), + /// + /// The Control key is pressed down + /// + IME_KEY_MASK_CONTROL = (1 << 2), + /// + /// The Alt key is pressed down + /// + IME_KEY_MASK_ALT = (1 << 3), + /// + /// The Meta key is pressed down + /// + IME_KEY_MASK_META = (1 << 4), + /// + /// The Win (between Control and Alt) is pressed down + /// + IME_KEY_MASK_WIN = (1 << 5), + /// + /// The Hyper key is pressed down + /// + IME_KEY_MASK_HYPER = (1 << 6), + /// + /// The NumLock key is pressed down + /// + IME_KEY_MASK_NUMLOCK = (1 << 7), + /// + /// Key release event + /// + IME_KEY_MASK_RELEASED = (1 << 15), + } + + /// + /// This class contains api's related to IME(Input method editor) + /// + public static class InputMethodEditor + { + private static Object thisLock = new Object(); + private static ImeCallbackStructGCHandle _imeCallbackStructGCHandle = new ImeCallbackStructGCHandle(); + private static event EventHandler _focusIn; + private static ImeFocusInCb _imeFocusInDelegate; + private static event EventHandler _focusOut; + private static ImeFocusOutCb _imeFocusOutDelegate; + private static event EventHandler _surroundingTextUpdated; + private static ImeSurroundingTextUpdatedCb _imeSurroundingTextUpdatedDelegate; + private static event EventHandler _inputContextReset; + private static ImeInputContextResetCb _imeInputContextResetDelegate; + private static event EventHandler _cursorPositionUpdated; + private static ImeCursorPositionUpdatedCb _imeCursorPositionUpdatedDelegate; + private static event EventHandler _langaugeSet; + private static ImeLanguageSetCb _imeLangaugeSetDelegate; + private static event EventHandler _imDataSet; + private static ImeImdataSetCb _imeImDataSetDelegate; + private static event EventHandler _layoutSet; + private static ImeLayoutSetCb _imeLayoutSetDelegate; + private static event EventHandler _returnKeyTypeSet; + private static ImeReturnKeyTypeSetCb _imeReturnKeyTypeSetDelegate; + private static event EventHandler _returnKeyStateSet; + private static ImeReturnKeyStateSetCb _imeReturnKeyStateSetDelegate; + private static event ProcessKeyEventHandler _processKey; + private static ImeProcessKeyEventCb _imeProcessKeyDelegate; + private static event EventHandler _displayLanaguageChanged; + private static ImeDisplayLanguageChangedCb _imeDisplayLanaguageChangedDelegate; + private static event EventHandler _rotationDegreeChanged; + private static ImeRotationDegreeChangedCb _imeRotationDegreeChangedDelegate; + private static event EventHandler _accessibilityStateChanged; + private static ImeAccessibilityStateChangedCb _imeAccessibilityStateChangedDelegate; + private static event EventHandler _optionWindowCreated; + private static ImeOptionWindowCreatedCb _imeOptionWindowCreatedDelegate; + private static event EventHandler _optionWindowDestroyed; + private static ImeOptionWindowDestroyedCb _imeOptionWindowDestroyedDelegate; + private static ImeLanguageRequestedCb _imeLanguageRequestedDelegate; + private static OutAction _languageRequestedDelegate; + private static ImeImdataRequestedCb _imeImDataRequestedDelegate; + private static OutAction _imDataRequestedDelegate; + private static ImeGeometryRequestedCb _imeGeometryRequestedDelegate; + private static OutAction1 _geometryRequestedDelegate; + private static Action _userCreate; + private static Action _userTerminate; + private static Action _userShow; + private static Action _userHide; + private static ImeCreateCb _create = (IntPtr userData) => + { + Log.Info(LogTag, "In Create Delegate"); + _userCreate?.Invoke(); + }; + private static ImeTerminateCb _terminate = (IntPtr userData) => + { + Log.Info(LogTag, "In terminate Delegate"); + _userTerminate?.Invoke(); + }; + private static ImeShowCb _show = (int contextId, IntPtr context, IntPtr userData) => + { + Log.Info(LogTag, "In Show Delegate"); + _userShow?.Invoke(contextId, new InputMethodContext(context)); + }; + private static ImeHideCb _hide = (int contextId, IntPtr userData) => + { + Log.Info(LogTag, "In Hide Delegate"); + _userHide?.Invoke(contextId); + }; + + + /// + /// An Action with 1 out parameter + /// + /// Generic Type + /// The out parameter + public delegate void OutAction(out T a); + + /// + /// An Action with 2 out parameter's + /// + /// Generic Type + /// Generic Type + /// The out parameter 1 + /// The out parameter 2 + public delegate void OutAction(out T[] a, out T1 b); + + /// + /// An Action with 4 out parameter's + /// + /// Generic Type + /// The out parameter 1 + /// The out parameter 2 + /// The out parameter 3 + /// The out parameter 4 + public delegate void OutAction1(out T a, out T b, out T c, out T d); + + + /// + /// Called when an associated text input UI control has focus. + /// + public static event EventHandler FocusIn + { + add + { + lock (thisLock) + { + _imeFocusInDelegate = (int contextId, IntPtr userData) => + { + FocusInEventArgs args = new FocusInEventArgs(contextId); + _focusIn?.Invoke(null, args); + }; + ErrorCode error = ImeEventSetFocusInCb(_imeFocusInDelegate, IntPtr.Zero); + if (error != ErrorCode.None) + { + Log.Error(LogTag, "Add FocusIn Failed with error " + error); + } + else + { + _focusIn += value; + } + } + } + remove + { + lock (thisLock) + { + _focusIn -= value; + } + } + } + + /// + /// Called when an associated text input UI control loses focus. + /// + public static event EventHandler FocusOut + { + add + { + lock (thisLock) + { + _imeFocusOutDelegate = (int contextId, IntPtr userData) => + { + FocusOutEventArgs args = new FocusOutEventArgs(contextId); + _focusOut?.Invoke(null, args); + }; + ErrorCode error = ImeEventSetFocusOutCb(_imeFocusOutDelegate, IntPtr.Zero); + if (error != ErrorCode.None) + { + Log.Error(LogTag, "Add FocusOut Failed with error " + error); + } + else + { + _focusOut += value; + } + } + } + remove + { + lock (thisLock) + { + _focusOut -= value; + } + } + } + + /// + /// Called when an associated text input UI control responds to a request with the surrounding text. + /// + public static event EventHandler SurroundingTextUpdated + { + add + { + lock (thisLock) + { + _imeSurroundingTextUpdatedDelegate = (int contextId, IntPtr text, int cursorPos, IntPtr userData) => + { + SurroundingTextUpdatedEventArgs args = new SurroundingTextUpdatedEventArgs(contextId, Marshal.PtrToStringAnsi(text), cursorPos); + _surroundingTextUpdated?.Invoke(null, args); + }; + ErrorCode error = ImeEventSetSurroundingTextUpdatedCb(_imeSurroundingTextUpdatedDelegate, IntPtr.Zero); + if (error != ErrorCode.None) + { + Log.Error(LogTag, "Add SurroundingTextUpdated Failed with error " + error); + } + else + { + _surroundingTextUpdated += value; + } + } + } + remove + { + lock (thisLock) + { + _surroundingTextUpdated -= value; + } + } + } + + /// + /// Called to reset the input context of an associated text input UI control. + /// + public static event EventHandler InputContextReset + { + add + { + lock (thisLock) + { + _imeInputContextResetDelegate = (IntPtr userData) => + { + _inputContextReset?.Invoke(null, System.EventArgs.Empty); + }; + ErrorCode error = ImeEventSetInputContextResetCb(_imeInputContextResetDelegate, IntPtr.Zero); + if (error != ErrorCode.None) + { + Log.Error(LogTag, "Add InputContextReset Failed with error " + error); + } + else + { + _inputContextReset += value; + } + } + } + remove + { + lock (thisLock) + { + _inputContextReset -= value; + } + } + } + + /// + /// Called when the position of the cursor in an associated text input UI control changes. + /// + public static event EventHandler CursorPositionUpdated + { + add + { + lock (thisLock) + { + _imeCursorPositionUpdatedDelegate = (int cursorPos, IntPtr userData) => + { + CursorPositionUpdatedEventArgs args = new CursorPositionUpdatedEventArgs(cursorPos); + _cursorPositionUpdated?.Invoke(null, args); + }; + ErrorCode error = ImeEventSetCursorPositionUpdatedCb(_imeCursorPositionUpdatedDelegate, IntPtr.Zero); + if (error != ErrorCode.None) + { + Log.Error(LogTag, "Add CursorPositionUpdated Failed with error " + error); + } + else + { + _cursorPositionUpdated += value; + } + } + } + remove + { + lock (thisLock) + { + _cursorPositionUpdated -= value; + } + } + } + + /// + /// Called to set the preferred language to the input panel. + /// It will be only called when the client application changes the edit field's language attribute after the input panel is shown. + /// + public static event EventHandler LangaugeSet + { + add + { + lock (thisLock) + { + _imeLangaugeSetDelegate = (EcoreIMFInputPanelLang language, IntPtr userData) => + { + LangaugeSetEventArgs args = new LangaugeSetEventArgs(language); + _langaugeSet?.Invoke(null, args); + }; + ErrorCode error = ImeEventSetLanguageSetCb(_imeLangaugeSetDelegate, IntPtr.Zero); + if (error != ErrorCode.None) + { + Log.Error(LogTag, "Add LangaugeSet Failed with error " + error); + } + else + { + _langaugeSet += value; + } + } + } + remove + { + lock (thisLock) + { + _langaugeSet -= value; + } + } + } + + /// + /// Called to set the application specific data to deliver to the input panel. + /// + public static event EventHandler ImDataSet + { + add + { + lock (thisLock) + { + _imeImDataSetDelegate = (IntPtr data, uint dataLength, IntPtr userData) => + { + byte[] destination = new byte[dataLength]; + Marshal.Copy(data, destination, 0, (int)dataLength); + ImDataSetEventArgs args = new ImDataSetEventArgs(destination, dataLength); + _imDataSet?.Invoke(null, args); + }; + ErrorCode error = ImeEventSetImdataSetCb(_imeImDataSetDelegate, IntPtr.Zero); + if (error != ErrorCode.None) + { + Log.Error(LogTag, "Add ImDataSet Failed with error " + error); + } + else + { + _imDataSet += value; + } + } + } + remove + { + lock (thisLock) + { + _imDataSet -= value; + } + } + } + + /// + /// Called when an associated text input UI control requests the input panel to set its layout. + /// It will be only called when the client application changes the edit field's layout attribute after the input panel is shown. + /// + public static event EventHandler LayoutSet + { + add + { + lock (thisLock) + { + _imeLayoutSetDelegate = (EcoreIMFInputPanelLayout layout, IntPtr userData) => + { + LayoutSetEventArgs args = new LayoutSetEventArgs(layout); + _layoutSet?.Invoke(null, args); + }; + ErrorCode error = ImeEventSetLayoutSetCb(_imeLayoutSetDelegate, IntPtr.Zero); + if (error != ErrorCode.None) + { + Log.Error(LogTag, "Add LayoutSet Failed with error " + error); + } + else + { + _layoutSet += value; + } + } + } + remove + { + lock (thisLock) + { + _layoutSet -= value; + } + } + } + + /// + /// Called when an associated text input UI control requests the input panel to set the Return key label. + /// The input panel can show text or image on the Return button according to the Return key action. + /// + public static event EventHandler ReturnKeyTypeSet + { + add + { + lock (thisLock) + { + _imeReturnKeyTypeSetDelegate = (EcoreIMFInputPanelReturnKeyType type, IntPtr userData) => + { + ReturnKeyTypeSetEventArgs args = new ReturnKeyTypeSetEventArgs(type); + _returnKeyTypeSet?.Invoke(null, args); + }; + ErrorCode error = ImeEventSetReturnKeyTypeSetCb(_imeReturnKeyTypeSetDelegate, IntPtr.Zero); + if (error != ErrorCode.None) + { + Log.Error(LogTag, "Add ReturnKeyTypeSet Failed with error " + error); + } + else + { + _returnKeyTypeSet += value; + } + } + } + remove + { + lock (thisLock) + { + _returnKeyTypeSet -= value; + } + } + } + + /// + /// Called when an associated text input UI control requests the input panel to enable or disable the Return key state. + /// + public static event EventHandler ReturnKeyStateSet + { + add + { + lock (thisLock) + { + _imeReturnKeyStateSetDelegate = (bool state, IntPtr userData) => + { + ReturnKeyStateSetEventArgs args = new ReturnKeyStateSetEventArgs(state); + _returnKeyStateSet?.Invoke(null, args); + }; + ErrorCode error = ImeEventSetReturnKeyStateSetCb(_imeReturnKeyStateSetDelegate, IntPtr.Zero); + if (error != ErrorCode.None) + { + Log.Error(LogTag, "Add ReturnKeyStateSet Failed with error " + error); + } + else + { + _returnKeyStateSet += value; + } + } + } + remove + { + lock (thisLock) + { + _returnKeyStateSet -= value; + } + } + } + + /// + /// This Handler is associated with ProcessKey + /// + /// The object raising the event + /// An object of ProcessKeyEventArgs class + /// true if the event is processed, otherwise the event is not processed and is forwarded to the client application. + public delegate bool ProcessKeyEventHandler(object sender, ProcessKeyEventArgs e); + + /// + /// Called when the key event is received from the external devices or SendKey function. + /// This Event processes the key event before an associated text input UI control does. + /// + /// + /// If the key event is from the external device, DeviceInfo will have its name, class and subclass information. + /// + public static event ProcessKeyEventHandler ProcessKey + { + add + { + lock (thisLock) + { + _imeProcessKeyDelegate = (KeyCode keycode, KeyMask keymask, IntPtr devInfo, IntPtr userData) => + { + ProcessKeyEventArgs args = new ProcessKeyEventArgs(keycode, keymask, devInfo); + bool res = _processKey.Invoke(null, args); + return res; + }; + ErrorCode error = ImeEventSetProcessKeyEventCb(_imeProcessKeyDelegate, IntPtr.Zero); + if (error != ErrorCode.None) + { + Log.Error(LogTag, "Add ProcessKey Failed with error " + error); + } + else + { + _processKey += value; + } + } + } + remove + { + lock (thisLock) + { + _processKey -= value; + } + } + } + + /// + /// Called when the system display language is changed. + /// + public static event EventHandler DisplayLanaguageChanged + { + add + { + lock (thisLock) + { + _imeDisplayLanaguageChangedDelegate = (IntPtr language, IntPtr userData) => + { + DisplayLanaguageChangedEventArgs args = new DisplayLanaguageChangedEventArgs(Marshal.PtrToStringAnsi(language)); + _displayLanaguageChanged?.Invoke(null, args); + }; + ErrorCode error = ImeEventSetDisplayLanguageChangedCb(_imeDisplayLanaguageChangedDelegate, IntPtr.Zero); + if (error != ErrorCode.None) + { + Log.Error(LogTag, "Add DisplayLanaguageChanged Failed with error " + error); + } + else + { + _displayLanaguageChanged += value; + } + } + } + remove + { + lock (thisLock) + { + _displayLanaguageChanged -= value; + } + } + } + + /// + /// Called when the device is rotated. + /// + public static event EventHandler RotationDegreeChanged + { + add + { + lock (thisLock) + { + _imeRotationDegreeChangedDelegate = (int degree, IntPtr userData) => + { + RotationDegreeChangedEventArgs args = new RotationDegreeChangedEventArgs(degree); + _rotationDegreeChanged?.Invoke(null, args); + }; + ErrorCode error = ImeEventSetRotationDegreeChangedCb(_imeRotationDegreeChangedDelegate, IntPtr.Zero); + if (error != ErrorCode.None) + { + Log.Error(LogTag, "Add RotationDegreeChanged Failed with error " + error); + } + else + { + _rotationDegreeChanged += value; + } + } + } + remove + { + lock (thisLock) + { + _rotationDegreeChanged -= value; + } + } + } + + /// + /// Called when Accessibility in Settings application is on or off. + /// + public static event EventHandler AccessibilityStateChanged + { + add + { + lock (thisLock) + { + _imeAccessibilityStateChangedDelegate = (bool state, IntPtr userData) => + { + AccessibilityStateChangedEventArgs args = new AccessibilityStateChangedEventArgs(state); + _accessibilityStateChanged?.Invoke(null, args); + }; + ErrorCode error = ImeEventSetAccessibilityStateChangedCb(_imeAccessibilityStateChangedDelegate, IntPtr.Zero); + if (error != ErrorCode.None) + { + Log.Error(LogTag, "Add AccessibilityStateChanged Failed with error " + error); + } + else + { + _accessibilityStateChanged += value; + } + } + } + remove + { + lock (thisLock) + { + _accessibilityStateChanged -= value; + } + } + } + + /// + /// Called to create the option window. + /// + /// + /// if Input panel requests to open the option window, type will be ImeOptionWindowType.Keyboard. + /// And if Settings application requests to open it, type will be ImeOptionWindowType.SettingApplication. + /// + public static event EventHandler OptionWindowCreated + { + add + { + lock (thisLock) + { + _imeOptionWindowCreatedDelegate = (IntPtr window, ImeOptionWindowType type, IntPtr userData) => + { + OptionWindowCreatedEventArgs args = new OptionWindowCreatedEventArgs(new EditorWindow(window), type); + _optionWindowCreated?.Invoke(null, args); + }; + ErrorCode error = ImeEventSetOptionWindowCreatedCb(_imeOptionWindowCreatedDelegate, IntPtr.Zero); + if (error != ErrorCode.None) + { + Log.Error(LogTag, "Add OptionWindowCreated Failed with error " + error); + } + else + { + _optionWindowCreated += value; + } + } + } + remove + { + lock (thisLock) + { + _optionWindowCreated -= value; + } + } + } + + /// + /// Called to destroy the option window. + /// + public static event EventHandler OptionWindowDestroyed + { + add + { + lock (thisLock) + { + _imeOptionWindowDestroyedDelegate = (IntPtr window, IntPtr userData) => + { + OptionWindowDestroyedEventArgs args = new OptionWindowDestroyedEventArgs(new EditorWindow(window)); + _optionWindowDestroyed?.Invoke(null, args); + }; + ErrorCode error = ImeEventSetOptionWindowDestroyedCb(_imeOptionWindowDestroyedDelegate, IntPtr.Zero); + if (error != ErrorCode.None) + { + Log.Error(LogTag, "Add OptionWindowDestroyed Failed with error " + error); + } + else + { + _optionWindowDestroyed += value; + } + } + } + remove + { + lock (thisLock) + { + _optionWindowDestroyed -= value; + } + } + } + + /// + /// Sets the languageRequested Action + /// + /// + /// Called when an associated text input UI control requests the language from the input panel, requesting for language code. + /// + public static void SetLanguageRequested(OutAction languageRequested) + { + _imeLanguageRequestedDelegate = (IntPtr userData, out IntPtr langCode) => + { + string langauage; + _languageRequestedDelegate(out langauage); + char[] languageArray = langauage.ToCharArray(); + langCode = new IntPtr(); + Marshal.Copy(languageArray, 0, langCode, languageArray.Length); + }; + ErrorCode error = ImeEventSetLanguageRequestedCb(_imeLanguageRequestedDelegate, IntPtr.Zero); + if (error != ErrorCode.None) + { + Log.Error(LogTag, "Add SetLanguageRequested Failed with error " + error); + } + _languageRequestedDelegate = languageRequested; + } + + /// + /// Sets the imDataRequested Action + /// + /// + /// Called when an associated text input UI control requests the application specific data from the input panel, requesting for data array and it's length. + /// + public static void SetImDataRequested(OutAction imDataRequested) + { + _imeImDataRequestedDelegate = (IntPtr userData, out IntPtr data, out uint dataLength) => + { + byte[] dataArr; + uint lenghtArr; + _imDataRequestedDelegate(out dataArr, out lenghtArr); + data = new IntPtr(); + Marshal.Copy(dataArr, 0, data, (int)lenghtArr); + dataLength = lenghtArr; + }; + ErrorCode error = ImeEventSetImdataRequestedCb(_imeImDataRequestedDelegate, IntPtr.Zero); + if (error != ErrorCode.None) + { + Log.Error(LogTag, "Add SetImDataRequested Failed with error " + error); + } + _imDataRequestedDelegate = imDataRequested; + } + + /// + /// Sets the GeometryRequested Action + /// + /// + /// Called when an associated text input UI control requests the position and size from the input panel, requesting for x,y,w,h values. + /// + public static void SetGeometryRequested(OutAction1 GeometryRequested) + { + _imeGeometryRequestedDelegate = (IntPtr userData, out int x, out int y, out int w, out int h) => + { + int x1, y1, w1, h1; + _geometryRequestedDelegate(out x1, out y1, out w1, out h1); + x = x1; + y = y1; + w = w1; + h = h1; + }; + ErrorCode error = ImeEventSetGeometryRequestedCb(_imeGeometryRequestedDelegate, IntPtr.Zero); + if (error != ErrorCode.None) + { + Log.Error(LogTag, "Add SetGeometryRequested Failed with error " + error); + } + _geometryRequestedDelegate = GeometryRequested; + } + + /// + /// Runs the main loop of IME application. + /// This function starts to run IME application's main loop. + /// + /// + /// http://tizen.org/privilege/ime + /// + /// This is called to initialize IME application before the main loop starts up + /// This is called when IME application is terminated + /// This is called when IME application is shown + /// This is called when IME application is hidden + /// + /// This can occur due to the following reasons: + /// 1) The application does not have the privilege to call this function + /// 2) Operation failed + /// + public static void Run(Action create, Action terminate, Action show, Action hide) + { + _userCreate = create; + _userTerminate = terminate; + _userShow = show; + _userHide = hide; + + ImeCallbackStruct _imeCallbackStruct = _imeCallbackStructGCHandle._imeCallbackStruct; + _imeCallbackStruct.create = _create; + _imeCallbackStruct.terminate = _terminate; + _imeCallbackStruct.hide = _hide; + _imeCallbackStruct.show = _show; + + ErrorCode error = ImeRun(GCHandle.ToIntPtr(_imeCallbackStructGCHandle._imeCallbackStructHandle), IntPtr.Zero); + if (error != ErrorCode.None) + { + Log.Error(LogTag, "Run Failed with error " + error); + throw InputMethodExceptionFactory.CreateException(error); + } + } + + /// + /// Sends a key event to the associated text input UI control. + /// + /// + /// This function sends key down or up event with key mask to the client application. If forwardKey is true, this key event goes to the edit filed directly. + /// And if forwardKey is false, the ProcessKey event receives the key event before the edit field. + /// + /// + /// http://tizen.org/privilege/ime + /// + /// The key code to be sent + /// The modifier key mask + /// The flag to send the key event directly to the edit field + /// + /// This can occur due to the following reasons: + /// 1) The application does not have the privilege to call this function + /// 2) IME main loop isn't started yet + /// + public static void SendKeyEvent(KeyCode keyCode, KeyMask keyMask, bool forwardKey) + { + ErrorCode error = ImeSendKeyEvent(keyCode, keyMask, forwardKey); + if (error != ErrorCode.None) + { + Log.Error(LogTag, "SendEvent Failed with error " + error); + throw InputMethodExceptionFactory.CreateException(error); + } + } + + /// + /// Sends the text to the associated text input UI control. + /// + /// + /// http://tizen.org/privilege/ime + /// + /// The UTF-8 string to be committed + /// + /// This can occur due to the following reasons: + /// 1) The application does not have the privilege to call this function + /// 2) IME main loop isn't started yet + /// + public static void CommitString(string str) + { + ErrorCode error = ImeCommitString(str); + if (error != ErrorCode.None) + { + Log.Error(LogTag, "CommitString Failed with error " + error); + throw InputMethodExceptionFactory.CreateException(error); + } + } + + /// + /// Requests to show preedit string. + /// + /// + /// http://tizen.org/privilege/ime + /// + /// + /// This can occur due to the following reasons: + /// 1) The application does not have the privilege to call this function + /// 2) IME main loop isn't started yet + /// + public static void ShowPreEditString() + { + ErrorCode error = ImeShowPreeditString(); + if (error != ErrorCode.None) + { + Log.Error(LogTag, "ShowPreEditString Failed with error " + error); + throw InputMethodExceptionFactory.CreateException(error); + } + } + + /// + /// Requests to hide preedit string. + /// + /// + /// http://tizen.org/privilege/ime + /// + /// + /// This can occur due to the following reasons: + /// 1) The application does not have the privilege to call this function + /// 2) IME main loop isn't started yet + /// + public static void HidePreEditString() + { + ErrorCode error = ImeHidePreeditString(); + if (error != ErrorCode.None) + { + Log.Error(LogTag, "HidePreEditString Failed with error " + error); + throw InputMethodExceptionFactory.CreateException(error); + } + } + + /// + /// Updates a new preedit string. + /// + /// + /// http://tizen.org/privilege/ime + /// + /// The UTF-8 string to be updated in preedit + /// + /// The list which has ime_preedit_attribute lists, strings can be composed of multiple string attributes: underline, highlight color and reversal color. + /// The attrs can be null if no attributes to set + /// + /// + /// This can occur due to the following reasons: + /// 1) The application does not have the privilege to call this function + /// 2) IME main loop isn't started yet + /// 3) Invalid Parameter + /// + public static void UpdatePreEditString(string str, List attrs) + { + IntPtr einaList = IntPtr.Zero; + GCHandle einaListHandle = GCHandle.Alloc(einaList); + List attributeHandleList = new List(); + foreach (PreEditAttribute attribute in attrs) + { + ImePreEditAttributeStruct imePreEditAttribute = new ImePreEditAttributeStruct(); + imePreEditAttribute.start = attribute.Start; + imePreEditAttribute.length = attribute.Length; + imePreEditAttribute.type = (int)attribute.Type; + imePreEditAttribute.value = attribute.Value; + GCHandle attributeHandle = GCHandle.Alloc(imePreEditAttribute); + attributeHandleList.Add(attributeHandle); + einaList = Interop.EinaList.EinaListAppend(einaListHandle.AddrOfPinnedObject(),attributeHandle.AddrOfPinnedObject()); + } + ErrorCode error = ImeUpdatePreeditString(str, einaListHandle.AddrOfPinnedObject()); + einaListHandle.Free(); + foreach(GCHandle handle in attributeHandleList) + { + handle.Free(); + } + if (error != ErrorCode.None) + { + Log.Error(LogTag, "UpdatePreEditString Failed with error " + error); + throw InputMethodExceptionFactory.CreateException(error); + } + } + + /// + /// Requests the surrounding text from the position of the cursor, asynchronously. + /// + /// + /// http://tizen.org/privilege/ime + /// + /// The maximum length of string to be retrieved before the cursor, -1 means unlimited + /// The maximum length of string to be retrieved after the cursor, -1 means unlimited + /// + /// This can occur due to the following reasons: + /// 1) The application does not have the privilege to call this function + /// 2) IME main loop isn't started yet + /// + public static void RequestSurroundingText(int maxLenBefore, int maxLenAfter) + { + ErrorCode error = ImeRequestSurroundingText(maxLenBefore, maxLenAfter); + if (error != ErrorCode.None) + { + Log.Error(LogTag, "RequestSurroundingText Failed with error " + error); + throw InputMethodExceptionFactory.CreateException(error); + } + } + + /// + /// Requests to delete surrounding text. + /// + /// + /// http://tizen.org/privilege/ime + /// + /// The offset value from the cursor position + /// The length of the text to delete + /// + /// This can occur due to the following reasons: + /// 1) The application does not have the privilege to call this function + /// 2) IME main loop isn't started yet + /// 3) Invalid Parameter + /// + public static void DeleteSurroundingText(int offset, int len) + { + ErrorCode error = ImeDeleteSurroundingText(offset, len); + if (error != ErrorCode.None) + { + Log.Error(LogTag, "DeleteSurroundingText Failed with error " + error); + throw InputMethodExceptionFactory.CreateException(error); + } + } + + /// + /// Gets the surrounding text from the position of the cursor, synchronously. + /// + /// + /// http://tizen.org/privilege/ime + /// + /// The maximum length of string to be retrieved before the cursor, -1 means unlimited + /// The maximum length of string to be retrieved after the cursor, -1 means unlimited + /// The surrounding text + /// The cursor position + /// + /// This can occur due to the following reasons: + /// 1) The application does not have the privilege to call this function + /// 2) IME main loop isn't started yet + /// 3) Invalid Parameter + /// 4) Failed to obtain text due to out of memory + /// + public static void GetSurroundingText(int maxLenBefore, int maxLenAfter, out string text, out int cursorPosition) + { + IntPtr txt; + ErrorCode error = ImeGetSurroundingText(maxLenBefore, maxLenAfter, out txt, out cursorPosition); + if (error != ErrorCode.None) + { + Log.Error(LogTag, "GetSurroundingText Failed with error " + error); + throw InputMethodExceptionFactory.CreateException(error); + } + text = Marshal.PtrToStringAnsi(txt); + } + + /// + /// Requests to set selection. + /// + /// + /// http://tizen.org/privilege/ime + /// + /// The start cursor position in text (in characters not bytes) + /// The end cursor position in text (in characters not bytes) + /// + /// This can occur due to the following reasons: + /// 1) The application does not have the privilege to call this function + /// 2) IME main loop isn't started yet + /// 3) Invalid Parameter + /// + public static void SetSelection(int start, int end) + { + ErrorCode error = ImeSetSelection(start, end); + if (error != ErrorCode.None) + { + Log.Error(LogTag, "SetSelection Failed with error " + error); + throw InputMethodExceptionFactory.CreateException(error); + } + } + + /// + /// This API returns the input panel main window. + /// + /// + /// http://tizen.org/privilege/ime + /// + /// The input panel main window object on success, otherwise null + /// + /// This can occur due to the following reasons: + /// 1) The application does not have the privilege to call this function + /// 2) IME main loop isn't started yet + /// 3) Operation Failed + /// + public static EditorWindow GetMainWindow() + { + EditorWindow obj = new EditorWindow(ImeGetMainWindow()); + ErrorCode error = (ErrorCode)Tizen.Internals.Errors.ErrorFacts.GetLastResult(); + if (error != ErrorCode.None) + { + Log.Error(LogTag, "GetMainWindow Failed with error " + error); + throw InputMethodExceptionFactory.CreateException(error); + } + return obj; + } + + /// + /// This API updates the input panel window's size information. + /// + /// + /// http://tizen.org/privilege/ime + /// + /// The width in portrait mode + /// The height in portrait mode + /// The width in landscape mode + /// The height in landscape mode + /// + /// This can occur due to the following reasons: + /// 1) The application does not have the privilege to call this function + /// 2) IME main loop isn't started yet + /// + public static void SetSize(int portraitWidth, int portraitHeight, int landscapeWidth, int landscapeHeight) + { + ErrorCode error = ImeSetSize(portraitWidth, portraitHeight, landscapeWidth, landscapeHeight); + if (error != ErrorCode.None) + { + Log.Error(LogTag, "SetSize Failed with error " + error); + throw InputMethodExceptionFactory.CreateException(error); + } + } + + /// + /// Requests to create an option window from the input panel. + /// The input panel can call this function to open the option window. This function calls OptionWindowCreated Event with ImeOptionWindowType.Keyboard. + /// + /// + /// http://tizen.org/privilege/ime + /// + /// + /// This can occur due to the following reasons: + /// 1) The application does not have the privilege to call this function + /// 2) Operation failed + /// 3) IME main loop isn't started yet + /// 4) OptionWindowCreated event has not been set + /// + /// + /// OptionWindowCreated and OptionWindowDestroyed event should be set + /// + public static void CreateOptionWindow() + { + ErrorCode error = ImeCreateOptionWindow(); + if (error != ErrorCode.None) + { + Log.Error(LogTag, "CreapteOptionWindow Failed with error " + error); + throw InputMethodExceptionFactory.CreateException(error); + } + } + + /// + /// Requests to destroy an option window. + /// The input panel can call this function to close the option window which is created from either the input panel or Settings application. + /// + /// + /// http://tizen.org/privilege/ime + /// + /// The option window to destroy + /// + /// This can occur due to the following reasons: + /// 1) The application does not have the privilege to call this function + /// 2) Invalid Parameter + /// 3) IME main loop isn't started yet + /// + public static void DestroyOptionWindow(EditorWindow window) + { + ErrorCode error = ImeDestroyOptionWindow(window._handle); + if (error != ErrorCode.None) + { + Log.Error(LogTag, "DestroyOptionWindow Failed with error " + error); + throw InputMethodExceptionFactory.CreateException(error); + } + } + } +} diff --git a/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/InputMethodExceptionFactory.cs b/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/InputMethodExceptionFactory.cs new file mode 100755 index 0000000..950ba68 --- /dev/null +++ b/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/InputMethodExceptionFactory.cs @@ -0,0 +1,83 @@ +/* +* Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved +* +* Licensed under the Apache License, Version 2.0 (the License); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an AS IS BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + + +using System; +using static Interop.InputMethod; + +namespace Tizen.Uix.InputMethod +{ + internal static class InputMethodExceptionFactory + { + internal static Exception CreateException(ErrorCode err) + { + Tizen.Log.Error(LogTag, "Error " + err); + Exception exp; + switch (err) + { + case ErrorCode.OutOfMemory: + { + exp = new InvalidOperationException("Out Of Memory"); + break; + } + + + case ErrorCode.InvalidParameter: + { + exp = new InvalidOperationException("Invalid Parameters Provided"); + break; + } + + + case ErrorCode.PermissionDenied: + { + exp = new InvalidOperationException("Permission Denied"); + break; + } + + + case ErrorCode.OperationFailed: + { + exp = new InvalidOperationException("Operation Failed"); + break; + } + + + case ErrorCode.NotRunning: + { + exp = new InvalidOperationException("IME main loop isn't started yet"); + break; + } + + case ErrorCode.NoCallbackFunction: + { + exp = new InvalidOperationException("Necessary callback/events is not set"); + break; + } + + default: + { + exp = new Exception(""); + break; + } + + } + + return exp; + + } + } +} diff --git a/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/LangaugeSetEventArgs.cs b/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/LangaugeSetEventArgs.cs new file mode 100755 index 0000000..a9bb190 --- /dev/null +++ b/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/LangaugeSetEventArgs.cs @@ -0,0 +1,38 @@ +/* +* Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved +* +* Licensed under the Apache License, Version 2.0 (the License); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an AS IS BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +namespace Tizen.Uix.InputMethod +{ + /// + /// This Class contains data related to LangaugeSet Event + /// + public class LangaugeSetEventArgs + { + internal LangaugeSetEventArgs(EcoreIMFInputPanelLang language) + { + Language = language; + } + + /// + /// The preferred language that the client application wants + /// + public EcoreIMFInputPanelLang Language + { + get; + internal set; + } + } +} \ No newline at end of file diff --git a/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/LayoutSetEventArgs.cs b/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/LayoutSetEventArgs.cs new file mode 100755 index 0000000..47fa74f --- /dev/null +++ b/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/LayoutSetEventArgs.cs @@ -0,0 +1,38 @@ +/* +* Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved +* +* Licensed under the Apache License, Version 2.0 (the License); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an AS IS BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +namespace Tizen.Uix.InputMethod +{ + /// + /// This Class contains data related to LayoutSet Event + /// + public class LayoutSetEventArgs + { + internal LayoutSetEventArgs(EcoreIMFInputPanelLayout layout) + { + Layout = layout; + } + + /// + /// The input panel layout + /// + public EcoreIMFInputPanelLayout Layout + { + get; + internal set; + } + } +} \ No newline at end of file diff --git a/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/OptionWindowCreatedEventArgs.cs b/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/OptionWindowCreatedEventArgs.cs new file mode 100755 index 0000000..182268d --- /dev/null +++ b/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/OptionWindowCreatedEventArgs.cs @@ -0,0 +1,63 @@ +/* +* Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved +* +* Licensed under the Apache License, Version 2.0 (the License); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an AS IS BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +namespace Tizen.Uix.InputMethod +{ + /// + /// Enumeration of the option window type. + /// + public enum ImeOptionWindowType + { + /// + /// Open from Keyboard + /// + Keyboard, + /// + /// Open from Setting application + /// + SettingApplication + }; + + /// + /// This class information relted to OptionWindowCreated event + /// + public class OptionWindowCreatedEventArgs + { + internal OptionWindowCreatedEventArgs(EditorWindow window, ImeOptionWindowType type) + { + Window = window; + Type = type; + } + + /// + /// The type of option window + /// + public ImeOptionWindowType Type + { + get; + internal set; + } + + /// + /// The created window object + /// + public EditorWindow Window + { + get; + internal set; + } + } +} \ No newline at end of file diff --git a/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/OptionWindowDestroyedEventArgs.cs b/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/OptionWindowDestroyedEventArgs.cs new file mode 100755 index 0000000..9981ee9 --- /dev/null +++ b/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/OptionWindowDestroyedEventArgs.cs @@ -0,0 +1,38 @@ +/* +* Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved +* +* Licensed under the Apache License, Version 2.0 (the License); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an AS IS BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +namespace Tizen.Uix.InputMethod +{ + /// + /// This class contains information related to the OptionWindowDestroyed event + /// + public class OptionWindowDestroyedEventArgs + { + internal OptionWindowDestroyedEventArgs(EditorWindow window) + { + Window = window; + } + + /// + /// The window object to destroy + /// + public EditorWindow Window + { + get; + internal set; + } + } +} \ No newline at end of file diff --git a/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/PreEditAttribute.cs b/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/PreEditAttribute.cs new file mode 100755 index 0000000..42ef11b --- /dev/null +++ b/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/PreEditAttribute.cs @@ -0,0 +1,78 @@ +/* +* Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved +* +* Licensed under the Apache License, Version 2.0 (the License); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an AS IS BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +using System; +using System.Collections.Generic; +using System.Text; + +namespace Tizen.Uix.InputMethod +{ + /// + /// Enumeration for Attribute Type + /// + public enum AttributeType + { + /// + /// No attribute + /// + None, + /// + /// A font style attribute, e.g., underline, etc. + /// + FontStyle + }; + /// + /// This class represents the attributes for preedit string. + /// + public class PreEditAttribute + { + /// + /// The start position in the string of this attribute + /// + public uint Start + { + get; + set; + } + + /// + /// The character length of this attribute, the range is [Start, Start+Length] + /// + public uint Length + { + get; + set; + } + + /// + /// The type of this attribute + /// + public AttributeType Type + { + get; + set; + } + + /// + /// The value of this attribute + /// + public uint Value + { + get; + set; + } + } +} diff --git a/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/ProcessKeyEventArgs.cs b/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/ProcessKeyEventArgs.cs new file mode 100755 index 0000000..45ff7a1 --- /dev/null +++ b/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/ProcessKeyEventArgs.cs @@ -0,0 +1,60 @@ +/* +* Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved +* +* Licensed under the Apache License, Version 2.0 (the License); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an AS IS BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +using System; + +namespace Tizen.Uix.InputMethod +{ + /// + /// This Class contains data related to ProcessKey Event + /// + public class ProcessKeyEventArgs + { + internal ProcessKeyEventArgs(KeyCode keycode, KeyMask keymask, IntPtr devInfo) + { + Keycode = keycode; + Keymask = keymask; + DeviceInfo = new VoiceControlDeviceInformation(devInfo); + } + + /// + /// The device information handle + /// + public VoiceControlDeviceInformation DeviceInfo + { + get; + internal set; + } + + /// + /// The key code to be sent + /// + public KeyCode Keycode + { + get; + internal set; + } + + /// + /// The modifier key mask + /// + public KeyMask Keymask + { + get; + internal set; + } + } +} \ No newline at end of file diff --git a/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/ReturnKeyStateSetEventArgs.cs b/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/ReturnKeyStateSetEventArgs.cs new file mode 100755 index 0000000..8234311 --- /dev/null +++ b/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/ReturnKeyStateSetEventArgs.cs @@ -0,0 +1,38 @@ +/* +* Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved +* +* Licensed under the Apache License, Version 2.0 (the License); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an AS IS BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +namespace Tizen.Uix.InputMethod +{ + /// + /// This Class contains data related to ReturnKeyStateSet Event + /// + public class ReturnKeyStateSetEventArgs + { + internal ReturnKeyStateSetEventArgs(bool state) + { + State = state; + } + + /// + /// The bool state to disable Return key. The Return key is enabled by default + /// + public bool State + { + get; + internal set; + } + } +} \ No newline at end of file diff --git a/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/ReturnKeyTypeSetEventArgs.cs b/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/ReturnKeyTypeSetEventArgs.cs new file mode 100755 index 0000000..71cb8ef --- /dev/null +++ b/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/ReturnKeyTypeSetEventArgs.cs @@ -0,0 +1,38 @@ +/* +* Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved +* +* Licensed under the Apache License, Version 2.0 (the License); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an AS IS BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +namespace Tizen.Uix.InputMethod +{ + /// + /// This Class contains data related to ReturnKeyTypeSet Event + /// + public class ReturnKeyTypeSetEventArgs + { + internal ReturnKeyTypeSetEventArgs(EcoreIMFInputPanelReturnKeyType type) + { + Type = type; + } + + /// + /// The type of Return key on the input panel + /// + public EcoreIMFInputPanelReturnKeyType Type + { + get; + internal set; + } + } +} \ No newline at end of file diff --git a/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/RotationDegreeChangedEventArgs.cs b/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/RotationDegreeChangedEventArgs.cs new file mode 100755 index 0000000..ea9d1a6 --- /dev/null +++ b/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/RotationDegreeChangedEventArgs.cs @@ -0,0 +1,38 @@ +/* +* Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved +* +* Licensed under the Apache License, Version 2.0 (the License); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an AS IS BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +namespace Tizen.Uix.InputMethod +{ + /// + /// This Class contains data related to RotationDegreeChanged Event + /// + public class RotationDegreeChangedEventArgs + { + internal RotationDegreeChangedEventArgs(int degree) + { + Degree = degree; + } + + /// + /// The rotation degree + /// + public int Degree + { + get; + internal set; + } + } +} \ No newline at end of file diff --git a/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/SurroundingTextUpdatedArgs.cs b/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/SurroundingTextUpdatedArgs.cs new file mode 100755 index 0000000..d440040 --- /dev/null +++ b/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/SurroundingTextUpdatedArgs.cs @@ -0,0 +1,58 @@ +/* +* Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved +* +* Licensed under the Apache License, Version 2.0 (the License); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an AS IS BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ + +namespace Tizen.Uix.InputMethod +{ + /// + /// This Class contains data related to SurroundingTextUpdated Event + /// + public class SurroundingTextUpdatedEventArgs + { + internal SurroundingTextUpdatedEventArgs(int contextId, string text, int cursorPos) + { + ContextId = contextId; + Text = text; + CursorPos = cursorPos; + } + + /// + /// The input context identification value of an associated text input UI control + /// + public int ContextId + { + get; + internal set; + } + + /// + /// The cursor position + /// + public int CursorPos + { + get; + internal set; + } + + /// + /// The UTF-8 string requested + /// + public string Text + { + get; + internal set; + } + } +} \ No newline at end of file diff --git a/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethodNet45.csproj b/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethodNet45.csproj index f3c90f5..d53a177 100755 --- a/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethodNet45.csproj +++ b/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethodNet45.csproj @@ -44,17 +44,44 @@ + + + + + + + + + + + + + + + + + + + + + ..\..\..\packages\ElmSharp.1.0.14\lib\net45\ElmSharp.dll + True + + + ..\..\..\packages\Tizen.1.0.2\lib\net45\Tizen.dll + True +