private static ImeSurroundingTextUpdatedCb _imeSurroundingTextUpdatedDelegate;
private static event EventHandler<EventArgs> _inputContextReset;
private static ImeInputContextResetCb _imeInputContextResetDelegate;
- private static event EventHandler<CursorPositionitionUpdatedEventArgs> _cursorPositionUpdated;
- private static ImeCursorPositionitionUpdatedCb _imeCursorPositionitionUpdatedDelegate;
+ private static event EventHandler<CursorPositionUpdatedEventArgs> _cursorPositionUpdated;
+ private static ImeCursorPositionUpdatedCb _imeCursorPositionUpdatedDelegate;
private static event EventHandler<LanguageSetEventArgs> _langaugeSet;
private static ImeLanguageSetCb _imeLanguageSetDelegate;
private static event EventHandler<SetDataEventArgs> _imDataSet;
private static event EventHandler<ReturnKeyStateSetEventArgs> _returnKeyStateSet;
private static ImeReturnKeyStateSetCb _imeReturnKeyStateSetDelegate;
private static ImeProcessKeyEventCb _imeProcessKeyDelegate;
- private static event EventHandler<DisplayLanaguageChangedEventArgs> _displayLanaguageChanged;
- private static ImeDisplayLanguageChangedCb _imeDisplayLanaguageChangedDelegate;
+ private static event EventHandler<DisplayLanguageChangedEventArgs> _displayLanguageChanged;
+ private static ImeDisplayLanguageChangedCb _imeDisplayLanguageChangedDelegate;
private static event EventHandler<RotationChangedEventArgs> _rotationDegreeChanged;
private static ImeRotationChangedCb _imeRotationChangedDelegate;
private static event EventHandler<AccessibilityStateChangedEventArgs> _accessibilityStateChanged;
private static ImeAccessibilityStateChangedCb _imeAccessibilityStateChangedDelegate;
- private static event EventHandler<OptionWindowCreatedEventArgs> _optionWindowCreated;
- private static ImeOptionWindowCreatedCb _imeOptionWindowCreatedDelegate;
- private static event EventHandler<OptionWindowDestroyedEventArgs> _optionWindowDestroyed;
- private static ImeOptionWindowDestroyedCb _imeOptionWindowDestroyedDelegate;
private static ImeLanguageRequestedCb _imeLanguageRequestedDelegate;
private static OutAction<string> _languageRequestedDelegate;
- private static BoolAction<KeyCode, KeyMask, VoiceControlDeviceInformation> _processKeyDelagate;
+ private static BoolAction<KeyCode, KeyMask, InputMethodDeviceInformation> _processKeyDelagate;
private static ImeImdataRequestedCb _imeImDataRequestedDelegate;
private static OutArrayAction<byte> _imDataRequestedDelegate;
private static ImeGeometryRequestedCb _imeGeometryRequestedDelegate;
/// <summary>
/// Called when the position of the cursor in an associated text input UI control changes.
/// </summary>
- public static event EventHandler<CursorPositionitionUpdatedEventArgs> CursorPositionitionUpdated
+ public static event EventHandler<CursorPositionUpdatedEventArgs> CursorPositionUpdated
{
add
{
lock (thisLock)
{
- _imeCursorPositionitionUpdatedDelegate = (int cursorPos, IntPtr userData) =>
+ _imeCursorPositionUpdatedDelegate = (int cursorPos, IntPtr userData) =>
{
- CursorPositionitionUpdatedEventArgs args = new CursorPositionitionUpdatedEventArgs(cursorPos);
+ CursorPositionUpdatedEventArgs args = new CursorPositionUpdatedEventArgs(cursorPos);
_cursorPositionUpdated?.Invoke(null, args);
};
- ErrorCode error = ImeEventSetCursorPositionitionUpdatedCb(_imeCursorPositionitionUpdatedDelegate, IntPtr.Zero);
+ ErrorCode error = ImeEventSetCursorPositionUpdatedCb(_imeCursorPositionUpdatedDelegate, IntPtr.Zero);
if (error != ErrorCode.None)
{
- Log.Error(LogTag, "Add CursorPositionitionUpdated Failed with error " + error);
+ Log.Error(LogTag, "Add CursorPositionUpdated Failed with error " + error);
}
else
{
}
/// <summary>
- /// Called when the system display language is changed.
+ /// Called when the system display Language is changed.
/// </summary>
- public static event EventHandler<DisplayLanaguageChangedEventArgs> DisplayLanaguageChanged
+ public static event EventHandler<DisplayLanguageChangedEventArgs> DisplayLanguageChanged
{
add
{
lock (thisLock)
{
- _imeDisplayLanaguageChangedDelegate = (IntPtr language, IntPtr userData) =>
+ _imeDisplayLanguageChangedDelegate = (IntPtr language, IntPtr userData) =>
{
- DisplayLanaguageChangedEventArgs args = new DisplayLanaguageChangedEventArgs(Marshal.PtrToStringAnsi(language));
- _displayLanaguageChanged?.Invoke(null, args);
+ DisplayLanguageChangedEventArgs args = new DisplayLanguageChangedEventArgs(Marshal.PtrToStringAnsi(language));
+ _displayLanguageChanged?.Invoke(null, args);
};
- ErrorCode error = ImeEventSetDisplayLanguageChangedCb(_imeDisplayLanaguageChangedDelegate, IntPtr.Zero);
+ ErrorCode error = ImeEventSetDisplayLanguageChangedCb(_imeDisplayLanguageChangedDelegate, IntPtr.Zero);
if (error != ErrorCode.None)
{
- Log.Error(LogTag, "Add DisplayLanaguageChanged Failed with error " + error);
+ Log.Error(LogTag, "Add DisplayLanguageChanged Failed with error " + error);
}
else
{
- _displayLanaguageChanged += value;
+ _displayLanguageChanged += value;
}
}
}
{
lock (thisLock)
{
- _displayLanaguageChanged -= value;
+ _displayLanguageChanged -= value;
}
}
}
}
/// <summary>
- /// Called to create the option window.
- /// </summary>
- /// <remarks>
- /// if Input panel requests to open the option window, type will be OptionWindowType.Keyboard.
- /// And if Settings application requests to open it, type will be OptionWindowType.SettingApplication.
- /// </remarks>
- public static event EventHandler<OptionWindowCreatedEventArgs> OptionWindowCreated
- {
- add
- {
- lock (thisLock)
- {
- _imeOptionWindowCreatedDelegate = (IntPtr window, OptionWindowType type, IntPtr userData) =>
- {
- OptionWindow._handle = window;
- OptionWindowCreatedEventArgs args = new OptionWindowCreatedEventArgs(new OptionWindow(), 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;
- }
- }
- }
-
- /// <summary>
- /// Called to destroy the option window.
- /// </summary>
- public static event EventHandler<OptionWindowDestroyedEventArgs> OptionWindowDestroyed
- {
- add
- {
- lock (thisLock)
- {
- _imeOptionWindowDestroyedDelegate = (IntPtr window, IntPtr userData) =>
- {
- OptionWindow._handle = window;
- OptionWindowDestroyedEventArgs args = new OptionWindowDestroyedEventArgs(new OptionWindow());
- _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;
- }
- }
- }
-
- /// <summary>
/// Sets the languageRequested Action
/// </summary>
/// <param name="languageRequested">
/// The Action is alled 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.
/// </param>
- public static void SetProcessKeyCallback(BoolAction<KeyCode, KeyMask, VoiceControlDeviceInformation> processKey)
+ public static void SetProcessKeyCallback(BoolAction<KeyCode, KeyMask, InputMethodDeviceInformation> processKey)
{
_imeProcessKeyDelegate = (KeyCode keyCode, KeyMask keyMask, IntPtr devInfo, IntPtr userData) =>
{
- return _processKeyDelagate(keyCode, keyMask, new VoiceControlDeviceInformation(devInfo));
+ return _processKeyDelagate(keyCode, keyMask, new InputMethodDeviceInformation(devInfo));
};
ErrorCode error = ImeEventSetProcessKeyEventCb(_imeProcessKeyDelegate, IntPtr.Zero);
if (error != ErrorCode.None)
throw InputMethodExceptionFactory.CreateException(error);
}
}
-
- /// <summary>
- /// 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 OptionWindowType.Keyboard.
- /// </summary>
- /// <privilege>
- /// http://tizen.org/privilege/ime
- /// </privilege>
- /// <exception cref="InvalidOperationException">
- /// 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
- /// </exception>
- /// <precondition>
- /// OptionWindowCreated and OptionWindowDestroyed event should be set
- /// </precondition>
- public static void CreateOptionWindow()
- {
- ErrorCode error = ImeCreateOptionWindow();
- if (error != ErrorCode.None)
- {
- Log.Error(LogTag, "CreapteOptionWindow Failed with error " + error);
- throw InputMethodExceptionFactory.CreateException(error);
- }
- }
-
- /// <summary>
- /// 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.
- /// </summary>
- /// <privilege>
- /// http://tizen.org/privilege/ime
- /// </privilege>
- /// <param name="window">The option window to destroy</param>
- /// <exception cref="InvalidOperationException">
- /// 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
- /// </exception>
- /// <precondition>
- /// OptionWindowDestroyed Event must be set.
- /// </precondition>
- /// <postcondition>
- /// This function triggers the OptionWindowDestroyed Event if it is set.
- /// </postcondition>
- public static void DestroyOptionWindow(OptionWindow window)
- {
- ErrorCode error = ImeDestroyOptionWindow(window);
- if (error != ErrorCode.None)
- {
- Log.Error(LogTag, "DestroyOptionWindow Failed with error " + error);
- throw InputMethodExceptionFactory.CreateException(error);
- }
- }
}
}