[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_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 InputPanelLayout layout);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
internal delegate void ImeAccessibilityStateChangedCb(bool state, IntPtr userData);
-
- [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
- internal delegate void ImeOptionWindowCreatedCb(IntPtr window, OptionWindowType type, IntPtr userData);
-
- [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
- internal delegate void ImeOptionWindowDestroyedCb(IntPtr window, IntPtr userData);
}
}
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;
}
/// <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">
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);
- }
- }
}
}
+++ /dev/null
-/*
-* 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 Tizen;
-using System;
-using ElmSharp;
-using static Interop.InputMethod;
-
-namespace Tizen.Uix.InputMethod
-{
- /// <summary>
- /// Option window Class
- /// </summary>
- public class OptionWindow : Window
- {
- internal static IntPtr _handle = IntPtr.Zero;
- private IntPtr _realHandle = IntPtr.Zero;
-
- internal OptionWindow():base("Option")
- {
- _realHandle = _handle;
- }
-
- protected override IntPtr CreateHandle(EvasObject parent)
- {
- return _handle;
- }
-
- /// <summary>
- /// The type of option window
- /// </summary>
- public OptionWindowType Type
- {
- get;
- internal set;
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-/*
-* 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
-{
- /// <summary>
- /// Enumeration of the option window type.
- /// </summary>
- public enum OptionWindowType
- {
- /// <summary>
- /// Open from Keyboard
- /// </summary>
- Keyboard,
- /// <summary>
- /// Open from Setting application
- /// </summary>
- SettingApplication
- };
-
- /// <summary>
- /// This class contains information related to OptionWindowCreated event
- /// </summary>
- public class OptionWindowCreatedEventArgs
- {
- internal OptionWindowCreatedEventArgs(OptionWindow window, OptionWindowType type)
- {
- Window = window;
- Window.Type = type;
- }
-
- /// <summary>
- /// The created window object
- /// </summary>
- public OptionWindow Window
- {
- get;
- internal set;
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-/*
-* 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
-{
- /// <summary>
- /// This class contains information related to the OptionWindowDestroyed event
- /// </summary>
- public class OptionWindowDestroyedEventArgs
- {
- internal OptionWindowDestroyedEventArgs(OptionWindow window)
- {
- Window = window;
- }
-
- /// <summary>
- /// The window object to destroy
- /// </summary>
- public OptionWindow Window
- {
- get;
- internal set;
- }
- }
-}
\ No newline at end of file