X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2FTizen.NUI%2Fsrc%2Fpublic%2FInputMethodContext.cs;h=5d8acd2d6c740f043cb90c5165138e053289695a;hb=46b8a31f5c1c75a22b648ca394a4de8a50898513;hp=11240edc7647c0828e84bb2cac497cc1db11bea5;hpb=b3605d7ee0ea1bc0de484c1451b87756874b2b04;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git diff --git a/src/Tizen.NUI/src/public/InputMethodContext.cs b/src/Tizen.NUI/src/public/InputMethodContext.cs index 11240ed..5d8acd2 100755 --- a/src/Tizen.NUI/src/public/InputMethodContext.cs +++ b/src/Tizen.NUI/src/public/InputMethodContext.cs @@ -22,576 +22,402 @@ using System.ComponentModel; namespace Tizen.NUI { /// - /// Specifically manages the input method framework which enables the virtual or hardware keyboards. + /// Specifically manages the input method framework (IMF) that enables the virtual or hardware keyboards. /// - /// 3 + /// 5 public class InputMethodContext : BaseHandle { private global::System.Runtime.InteropServices.HandleRef swigCPtr; - internal InputMethodContext(IntPtr cPtr, bool cMemoryOwn) : base(NDalicManualPINVOKE.InputMethodContext_SWIGUpcast(cPtr), cMemoryOwn) + private ActivatedEventCallbackType _activatedEventCallback; + private EventReceivedEventCallbackType _eventReceivedEventCallback; + private StatusChangedEventCallbackType _statusChangedEventCallback; + private ResizedEventCallbackType _resizedEventCallback; + private LanguageChangedEventCallbackType _languageChangedEventCallback; + private KeyboardTypeChangedEventCallbackType _keyboardTypeChangedEventCallback; + private ContentReceivedCallbackType _contentReceivedEventCallback; + + /// + /// Constructor.
+ ///
+ /// 5 + public InputMethodContext() : this(Interop.InputMethodContext.InputMethodContext_New(), true) { - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(InputMethodContext obj) + internal InputMethodContext(IntPtr cPtr, bool cMemoryOwn) : base(Interop.InputMethodContext.InputMethodContext_SWIGUpcast(cPtr), cMemoryOwn) { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero) : obj.swigCPtr; + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); } + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + private delegate void ActivatedEventCallbackType(IntPtr data); + private delegate IntPtr EventReceivedEventCallbackType(IntPtr inputMethodContext, IntPtr eventData); + private delegate void StatusChangedEventCallbackType(bool statusChanged); + private delegate void ResizedEventCallbackType(int resized); + private delegate void LanguageChangedEventCallbackType(int languageChanged); + private delegate void KeyboardTypeChangedEventCallbackType(KeyboardType type); + private delegate void ContentReceivedCallbackType(string content, string description, string mimeType); + + private event EventHandler _activatedEventHandler; + private event EventHandlerWithReturnType _eventReceivedEventHandler; + private event EventHandler _statusChangedEventHandler; + private event EventHandler _resizedEventHandler; + private event EventHandler _languageChangedEventHandler; + private event EventHandler _keyboardTypeChangedEventHandler; + private event EventHandler _contentReceivedEventHandler; /// - /// Dispose + /// InputMethodContext activated. /// - /// Dispose Type - /// 3 - /// Please DO NOT use! This will be deprecated! - /// Dispose() method in Singletone classes (ex: FocusManager, StyleManager, VisualFactory, InputMethodContext, TtsPlayer, Window) is not required. - [EditorBrowsable(EditorBrowsableState.Never)] - protected override void Dispose(DisposeTypes type) + /// 5 + public event EventHandler Activated { - if (disposed) + add { - return; - } + if (_activatedEventHandler == null) + { + _activatedEventCallback = OnActivated; + ActivatedSignal().Connect(_activatedEventCallback); + } - if (type == DisposeTypes.Explicit) + _activatedEventHandler += value; + } + remove { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. + _activatedEventHandler -= value; + if (_activatedEventHandler == null && _activatedEventCallback != null) + { + ActivatedSignal().Disconnect(_activatedEventCallback); + } } + } - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. - - if (_keyboardTypeChangedEventCallback != null) + /// + /// InputMethodContext event received. + /// + /// 5 + public event EventHandlerWithReturnType EventReceived + { + add { - KeyboardTypeChangedSignal().Disconnect(_keyboardTypeChangedEventCallback); - } + if (_eventReceivedEventHandler == null) + { + _eventReceivedEventCallback = OnEventReceived; + EventReceivedSignal().Connect(_eventReceivedEventCallback); + } - if (swigCPtr.Handle != global::System.IntPtr.Zero) + _eventReceivedEventHandler += value; + } + remove { - if (swigCMemOwn) + _eventReceivedEventHandler -= value; + + if (_eventReceivedEventHandler == null && _eventReceivedEventCallback != null) { - swigCMemOwn = false; - NDalicManualPINVOKE.delete_InputMethodContext(swigCPtr); + EventReceivedSignal().Disconnect(_eventReceivedEventCallback); } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero); } - - base.Dispose(type); } /// - /// This structure is used to pass on data from the IMF regarding predictive text. + /// InputMethodContext status changed. /// - /// 3 - public class EventData : global::System.IDisposable + /// 5 + public event EventHandler StatusChanged { - private global::System.Runtime.InteropServices.HandleRef swigCPtr; - /// - /// swigCMemOwn - /// - /// 3 - protected bool swigCMemOwn; - - internal EventData(IntPtr cPtr, bool cMemoryOwn) + add { - swigCMemOwn = cMemoryOwn; - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } + if (_statusChangedEventHandler == null) + { + _statusChangedEventCallback = OnStatusChanged; + StatusChangedSignal().Connect(_statusChangedEventCallback); + } - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(EventData obj) - { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero) : obj.swigCPtr; + _statusChangedEventHandler += value; } + remove + { + _statusChangedEventHandler -= value; - //A Flag to check who called Dispose(). (By User or DisposeQueue) - private bool isDisposeQueued = false; - /// - /// A Flat to check if it is already disposed. - /// - /// 3 - protected bool disposed = false; + if (_statusChangedEventHandler == null && _statusChangedEventCallback != null) + { + StatusChangedSignal().Disconnect(_statusChangedEventCallback); + } + } + } - /// - /// Dispose. - /// - /// 3 - ~EventData() + /// + /// InputMethodContext resized. + /// + /// 5 + public event EventHandler Resized + { + add { - if (!isDisposeQueued) + if (_resizedEventHandler == null) { - isDisposeQueued = true; - DisposeQueue.Instance.Add(this); + _resizedEventCallback = OnResized; + ResizedSignal().Connect(_resizedEventCallback); } - } - /// - /// The dispose pattern. - /// - /// 3 - public void Dispose() + _resizedEventHandler += value; + } + remove { - //Throw excpetion if Dispose() is called in separate thread. - if (!Window.IsInstalled()) + _resizedEventHandler -= value; + + if (_resizedEventHandler == null && _resizedEventCallback != null) { - throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread."); + ResizedSignal().Disconnect(_resizedEventCallback); } + } + } - if (isDisposeQueued) + /// + /// InputMethodContext language changed. + /// + /// 5 + public event EventHandler LanguageChanged + { + add + { + if (_languageChangedEventHandler == null) { - Dispose(DisposeTypes.Implicit); + _languageChangedEventCallback = OnLanguageChanged; + LanguageChangedSignal().Connect(_languageChangedEventCallback); } - else + + _languageChangedEventHandler += value; + } + remove + { + _languageChangedEventHandler -= value; + + if (_languageChangedEventHandler == null && _languageChangedEventCallback != null) { - Dispose(DisposeTypes.Explicit); - System.GC.SuppressFinalize(this); + LanguageChangedSignal().Disconnect(_languageChangedEventCallback); } } + } - /// - /// Dispose. - /// - /// 3 - protected virtual void Dispose(DisposeTypes type) + /// + /// InputMethodContext keyboard type changed. + /// + /// 5 + public event EventHandler KeyboardTypeChanged + { + add { - if (disposed) + if (_keyboardTypeChangedEventHandler == null) { - return; + _keyboardTypeChangedEventCallback = OnKeyboardTypeChanged; + KeyboardTypeChangedSignal().Connect(_keyboardTypeChangedEventCallback); } - if (type == DisposeTypes.Explicit) - { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. + _keyboardTypeChangedEventHandler += value; + } + remove + { + _keyboardTypeChangedEventHandler -= value; + if (_keyboardTypeChangedEventHandler == null && _keyboardTypeChangedEventCallback != null) + { + KeyboardTypeChangedSignal().Disconnect(_keyboardTypeChangedEventCallback); } + } + } - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. - - if (swigCPtr.Handle != IntPtr.Zero) + /// + /// InputMethodContext content received. + /// + /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public event EventHandler ContentReceived + { + add + { + if (_contentReceivedEventHandler == null) { - if (swigCMemOwn) - { - swigCMemOwn = false; - NDalicManualPINVOKE.delete_InputMethodContext_EventData(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero); + _contentReceivedEventCallback = OnContentReceived; + ContentReceivedSignal().Connect(_contentReceivedEventCallback); } - disposed = true; + _contentReceivedEventHandler += value; } - - internal static EventData GetEventDataFromPtr(IntPtr cPtr) + remove { - EventData ret = new EventData(cPtr, false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + _contentReceivedEventHandler -= value; + + if (_contentReceivedEventHandler == null && _contentReceivedEventCallback != null) + { + ContentReceivedSignal().Disconnect(_contentReceivedEventCallback); + } } + } + /// + /// The direction of the text. + /// + /// 5 + public enum TextDirection + { /// - /// The default constructor. + /// Left to right. /// - /// 3 - public EventData() : this(NDalicManualPINVOKE.new_InputMethodContext_EventData__SWIG_0(), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - + LeftToRight, /// - /// The constructor. + /// Right to left. /// - /// The name of the event from the IMF. - /// The pre-edit or the commit string. - /// Start the position from the current cursor position to start deleting characters. - /// The number of characters to delete from the cursorOffset. - /// 3 - public EventData(InputMethodContext.EventType aEventName, string aPredictiveString, int aCursorOffset, int aNumberOfChars) : this(NDalicManualPINVOKE.new_InputMethodContext_EventData__SWIG_1((int)aEventName, aPredictiveString, aCursorOffset, aNumberOfChars), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// The pre-edit or the commit string. - /// - /// 4 - public string PredictiveString - { - set - { - NDalicManualPINVOKE.InputMethodContext_EventData_predictiveString_set(swigCPtr, value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - get - { - string ret = NDalicManualPINVOKE.InputMethodContext_EventData_predictiveString_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } - - /// - /// The name of the event from the IMF. - /// - /// 4 - public InputMethodContext.EventType EventName - { - set - { - NDalicManualPINVOKE.InputMethodContext_EventData_eventName_set(swigCPtr, (int)value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - get - { - InputMethodContext.EventType ret = (InputMethodContext.EventType)NDalicManualPINVOKE.InputMethodContext_EventData_eventName_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } - - /// - /// The start position from the current cursor position to start deleting characters. - /// - /// 4 - public int CursorOffset - { - set - { - NDalicManualPINVOKE.InputMethodContext_EventData_cursorOffset_set(swigCPtr, value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - get - { - int ret = NDalicManualPINVOKE.InputMethodContext_EventData_cursorOffset_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } - - /// - /// The number of characters to delete from the cursorOffset. - /// - /// 4 - public int NumberOfChars - { - set - { - NDalicManualPINVOKE.InputMethodContext_EventData_numberOfChars_set(swigCPtr, value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - get - { - int ret = NDalicManualPINVOKE.InputMethodContext_EventData_numberOfChars_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } - + RightToLeft } /// - /// Data required by the IMF from the callback. + /// Events that are generated by the IMF. /// - /// 3 - public class CallbackData : global::System.IDisposable + /// 5 + public enum EventType { - private global::System.Runtime.InteropServices.HandleRef swigCPtr; /// - /// swigCMemOwn - /// - /// 3 - protected bool swigCMemOwn; - - internal IntPtr GetCallbackDataPtr() - { - return (IntPtr)swigCPtr; - } - - internal CallbackData(IntPtr cPtr, bool cMemoryOwn) - { - swigCMemOwn = cMemoryOwn; - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(CallbackData obj) - { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero) : obj.swigCPtr; - } - - //A Flag to check who called Dispose(). (By User or DisposeQueue) - private bool isDisposeQueued = false; - /// - /// A Flat to check if it is already disposed. + /// No event. /// - /// 3 - protected bool disposed = false; - - + /// 5 + Void, /// - /// Dispose. + /// Pre-edit changed. /// - /// 3 - ~CallbackData() - { - if (!isDisposeQueued) - { - isDisposeQueued = true; - DisposeQueue.Instance.Add(this); - } - } - + /// 5 + Preedit, /// - /// The dispose pattern. + /// Commit received. /// - /// 3 - public void Dispose() - { - //Throw excpetion if Dispose() is called in separate thread. - if (!Window.IsInstalled()) - { - throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread."); - } - - if (isDisposeQueued) - { - Dispose(DisposeTypes.Implicit); - } - else - { - Dispose(DisposeTypes.Explicit); - System.GC.SuppressFinalize(this); - } - } - + /// 5 + Commit, /// - /// Dispose. + /// An event to delete a range of characters from the string. /// - /// 3 - protected virtual void Dispose(DisposeTypes type) - { - if (disposed) - { - return; - } - - if (type == DisposeTypes.Explicit) - { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. - - } - - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. - - if (swigCPtr.Handle != IntPtr.Zero) - { - if (swigCMemOwn) - { - swigCMemOwn = false; - NDalicManualPINVOKE.delete_InputMethodContext_CallbackData(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero); - } - - disposed = true; - } - - internal static CallbackData GetCallbackDataFromPtr(IntPtr cPtr) - { - CallbackData ret = new CallbackData(cPtr, false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - + /// 5 + DeleteSurrounding, /// - /// The default constructor. + /// An event to query string and the cursor position. /// - /// 3 - public CallbackData() : this(NDalicManualPINVOKE.new_InputMethodContext_CallbackData__SWIG_0(), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - + /// 5 + GetSurrounding, /// - /// The constructor. + /// Private command sent from the input panel. /// - /// True if the cursor position needs to be updated. - /// The new position of the cursor. - /// The current text string. - /// Flag if preedit reset is required. - /// 3 - public CallbackData(bool aUpdate, int aCursorPosition, string aCurrentText, bool aPreeditResetRequired) : this(NDalicManualPINVOKE.new_InputMethodContext_CallbackData__SWIG_1(aUpdate, aCursorPosition, aCurrentText, aPreeditResetRequired), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } + /// 5 + PrivateCommand + } + /// + /// Enumeration for the state of the input panel. + /// + /// 5 + public enum State + { /// - /// The current text string. + /// Unknown state. /// - /// 4 - public string CurrentText - { - set - { - NDalicManualPINVOKE.InputMethodContext_CallbackData_currentText_set(swigCPtr, value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - get - { - string ret = NDalicManualPINVOKE.InputMethodContext_CallbackData_currentText_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } - + /// 5 + Default = 0, /// - /// The current text string. + /// Input panel is shown. /// - /// 4 - public int CursorPosition - { - set - { - NDalicManualPINVOKE.InputMethodContext_CallbackData_cursorPosition_set(swigCPtr, value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - get - { - int ret = NDalicManualPINVOKE.InputMethodContext_CallbackData_cursorPosition_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } - + /// 5 + Show, /// - /// If the cursor position needs to be updated. + /// Input panel is hidden. /// - /// 4 - public bool Update - { - set - { - NDalicManualPINVOKE.InputMethodContext_CallbackData_update_set(swigCPtr, value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - get - { - bool ret = NDalicManualPINVOKE.InputMethodContext_CallbackData_update_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } - + /// 5 + Hide, /// - /// Flags if preedit reset is required. + /// Input panel in process of being shown. /// - /// 4 - public bool PreeditResetRequired - { - set - { - NDalicManualPINVOKE.InputMethodContext_CallbackData_preeditResetRequired_set(swigCPtr, value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - get - { - bool ret = NDalicManualPINVOKE.InputMethodContext_CallbackData_preeditResetRequired_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } - + /// 5 + WillShow } /// - /// Destroy the context of the IMF.
+ /// Enumeration for the types of keyboard. ///
/// 5 - public void DestroyContext() + public enum KeyboardType { - NDalicManualPINVOKE.InputMethodContext_Finalize(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + /// + /// Software keyboard (virtual keyboard) is default. + /// + /// 5 + SoftwareKeyboard, + /// + /// Hardware keyboard. + /// + /// 5 + HardwareKeyboard } /// - /// Destroy the context of the IMF.
+ /// Gets or sets whether the IM context allows to use the text prediction. ///
- /// 4 - /// Please do not use! This will be deprecated, instead please USE Tizen.NUI.InputMethodContext.Instance.DestroyContext()! - [Obsolete("Please do not use! This will be deprecated! Please use InputMethodContext.Instance.DestroyContext() instead!")] + /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. [EditorBrowsable(EditorBrowsableState.Never)] - public void Finalize() + public bool TextPrediction { - DestroyContext(); + get + { + return IsTextPredictionAllowed(); + } + set + { + AllowTextPrediction(value); + } } /// - /// Constructor.
+ /// Destroys the context of the IMF.
///
/// 5 - public InputMethodContext () : this (NDalicManualPINVOKE.InputMethodContext_New(), true) { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - - } - - internal InputMethodContext(InputMethodContext inputMethodContext) : this(NDalicManualPINVOKE.new_InputMethodContext__SWIG_1(InputMethodContext.getCPtr(inputMethodContext)), true) { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - internal InputMethodContext Assign(InputMethodContext inputMethodContext) { - InputMethodContext ret = new InputMethodContext(NDalicManualPINVOKE.InputMethodContext_Assign(swigCPtr, InputMethodContext.getCPtr(inputMethodContext)), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal static InputMethodContext DownCast(BaseHandle handle) { - InputMethodContext ret = new InputMethodContext(NDalicManualPINVOKE.InputMethodContext_DownCast(BaseHandle.getCPtr(handle)), true); + public void DestroyContext() + { + Interop.InputMethodContext.InputMethodContext_Finalize(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; } /// /// Activates the IMF.
- /// It means that the text editing is started somewhere.
- /// If the hardware keyboard isn't connected, then it will show the virtual keyboard. + /// It means that the text editing has started.
+ /// If the hardware keyboard is not connected, then it shows the virtual keyboard. ///
- /// 3 + /// 5 public void Activate() { - NDalicManualPINVOKE.InputMethodContext_Activate(swigCPtr); + Interop.InputMethodContext.InputMethodContext_Activate(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } /// /// Deactivates the IMF.
- /// It means that the text editing is finished somewhere. + /// It means that the text editing is complete. ///
- /// 3 + /// 5 public void Deactivate() { - NDalicManualPINVOKE.InputMethodContext_Deactivate(swigCPtr); + Interop.InputMethodContext.InputMethodContext_Deactivate(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } /// - /// Gets the restoration status which controls if the keyboard is restored after the focus is lost and then regained.
- /// If true, then the keyboard will be restored (activated) after focus is regained. + /// Gets the restoration status, which controls if the keyboard is restored after the focus is lost and then regained.
+ /// If true, then the keyboard will be restored (activated) after the focus is regained. ///
/// The restoration status. - /// 3 + /// 5 public bool RestoreAfterFocusLost() { - bool ret = NDalicManualPINVOKE.InputMethodContext_RestoreAfterFocusLost(swigCPtr); + bool ret = Interop.InputMethodContext.InputMethodContext_RestoreAfterFocusLost(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } @@ -599,31 +425,31 @@ namespace Tizen.NUI /// /// Sets the status whether the IMF has to restore the keyboard after losing focus. /// - /// True means that keyboard should be restored after the focus is lost and regained. - /// 3 + /// True means that keyboard must be restored after the focus is lost and regained. + /// 5 public void SetRestoreAfterFocusLost(bool toggle) { - NDalicManualPINVOKE.InputMethodContext_SetRestoreAfterFocusLost(swigCPtr, toggle); + Interop.InputMethodContext.InputMethodContext_SetRestoreAfterFocusLost(swigCPtr, toggle); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } /// - /// Sends a message reset to the preedit state or the IMF module. + /// Sends a message reset to the pre-edit state or the IMF module. /// - /// 3 + /// 5 public new void Reset() { - NDalicManualPINVOKE.InputMethodContext_Reset(swigCPtr); + Interop.InputMethodContext.InputMethodContext_Reset(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } /// - /// Notifies the IMF context that the cursor position has changed, required for features like auto-capitalization. + /// Notifies the IMF context that the cursor position has changed, required for features such as auto-capitalization. /// - /// 3 + /// 5 public void NotifyCursorPosition() { - NDalicManualPINVOKE.InputMethodContext_NotifyCursorPosition(swigCPtr); + Interop.InputMethodContext.InputMethodContext_NotifyCursorPosition(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } @@ -631,10 +457,10 @@ namespace Tizen.NUI /// Sets the cursor position stored in VirtualKeyboard, this is required by the IMF context. /// /// The position of the cursor. - /// 3 + /// 5 public void SetCursorPosition(uint cursorPosition) { - NDalicManualPINVOKE.InputMethodContext_SetCursorPosition(swigCPtr, cursorPosition); + Interop.InputMethodContext.InputMethodContext_SetCursorPosition(swigCPtr, cursorPosition); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } @@ -642,10 +468,10 @@ namespace Tizen.NUI /// Gets the cursor position stored in VirtualKeyboard, this is required by the IMF context. /// /// The current position of the cursor. - /// 3 + /// 5 public uint GetCursorPosition() { - uint ret = NDalicManualPINVOKE.InputMethodContext_GetCursorPosition(swigCPtr); + uint ret = Interop.InputMethodContext.InputMethodContext_GetCursorPosition(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } @@ -654,10 +480,10 @@ namespace Tizen.NUI /// A method to store the string required by the IMF, this is used to provide predictive word suggestions. /// /// The text string surrounding the current cursor point. - /// 3 + /// 5 public void SetSurroundingText(string text) { - NDalicManualPINVOKE.InputMethodContext_SetSurroundingText(swigCPtr, text); + Interop.InputMethodContext.InputMethodContext_SetSurroundingText(swigCPtr, text); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } @@ -665,10 +491,10 @@ namespace Tizen.NUI /// Gets the current text string set within the IMF manager, this is used to offer predictive suggestions. /// /// The surrounding text. - /// 3 + /// 5 public string GetSurroundingText() { - string ret = NDalicManualPINVOKE.InputMethodContext_GetSurroundingText(swigCPtr); + string ret = Interop.InputMethodContext.InputMethodContext_GetSurroundingText(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } @@ -677,21 +503,21 @@ namespace Tizen.NUI /// Notifies the IMF context that text input is set to multiline or not. /// /// True if multiline text input is used. - /// 3 + /// 5 public void NotifyTextInputMultiLine(bool multiLine) { - NDalicManualPINVOKE.InputMethodContext_NotifyTextInputMultiLine(swigCPtr, multiLine); + Interop.InputMethodContext.InputMethodContext_NotifyTextInputMultiLine(swigCPtr, multiLine); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } /// - /// Returns the text direction of the keyboard's current input language. + /// Returns the text direction of the current input language of the keyboard. /// /// The direction of the text. - /// 3 + /// 5 public InputMethodContext.TextDirection GetTextDirection() { - InputMethodContext.TextDirection ret = (InputMethodContext.TextDirection)NDalicManualPINVOKE.InputMethodContext_GetTextDirection(swigCPtr); + InputMethodContext.TextDirection ret = (InputMethodContext.TextDirection)Interop.InputMethodContext.InputMethodContext_GetTextDirection(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } @@ -701,685 +527,943 @@ namespace Tizen.NUI /// The position is relative to whether the keyboard is visible or not.
/// If the keyboard is not visible, then the position will be off the screen.
/// If the keyboard is not being shown when this method is called, the keyboard is partially setup (IMFContext) to get/> - /// the values then taken down. So ideally, GetInputMethodArea() should be called after Show(). + /// the values then taken down. So ideally, GetInputMethodArea() must be called after Show(). /// - /// Rectangle which is keyboard panel x, y, width, height. - /// 3 + /// Rectangle which is keyboard panel x, y, width, and height. + /// 5 public Rectangle GetInputMethodArea() { - Rectangle ret = new Rectangle(NDalicManualPINVOKE.InputMethodContext_GetInputMethodArea(swigCPtr), true); + Rectangle ret = new Rectangle(Interop.InputMethodContext.InputMethodContext_GetInputMethodArea(swigCPtr), true); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } - internal void ApplyOptions(InputMethodOptions options) + /// + /// Sets up the input panel specific data. + /// + /// The specific data to be set to the input panel. + /// 5 + public void SetInputPanelUserData(string text) { - NDalicManualPINVOKE.InputMethodContext_ApplyOptions(swigCPtr, InputMethodOptions.getCPtr(options)); + Interop.InputMethodContext.InputMethodContext_SetInputPanelUserData(swigCPtr, text); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } /// - /// Sets up the input-panel specific data. + /// Gets the specific data of the current active input panel. /// - /// The specific data to be set to the input panel. - /// 3 - public void SetInputPanelUserData(string text) + /// The specific data to be received from the input panel. + /// 5 + public void GetInputPanelUserData(out string text) + { + Interop.InputMethodContext.InputMethodContext_GetInputPanelUserData(swigCPtr, out text); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Gets the state of the current active input panel. + /// + /// The state of the input panel. + /// 5 + public InputMethodContext.State GetInputPanelState() + { + InputMethodContext.State ret = (InputMethodContext.State)Interop.InputMethodContext.InputMethodContext_GetInputPanelState(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Sets the return key on the input panel to be visible or invisible.
+ /// The default value is true. + ///
+ /// True if the return key is visible (enabled), false otherwise. + /// 5 + public void SetReturnKeyState(bool visible) + { + Interop.InputMethodContext.InputMethodContext_SetReturnKeyState(swigCPtr, visible); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Enables to show the input panel automatically when focused. + /// + /// If true, the input panel will be shown when focused. + /// 5 + public void AutoEnableInputPanel(bool enabled) + { + Interop.InputMethodContext.InputMethodContext_AutoEnableInputPanel(swigCPtr, enabled); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Shows the input panel. + /// + /// 5 + public void ShowInputPanel() + { + Interop.InputMethodContext.InputMethodContext_ShowInputPanel(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Hides the input panel. + /// + /// 5 + public void HideInputPanel() + { + Interop.InputMethodContext.InputMethodContext_HideInputPanel(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Gets the keyboard type.
+ /// The default keyboard type is SoftwareKeyboard. + ///
+ /// The keyboard type. + /// 5 + public InputMethodContext.KeyboardType GetKeyboardType() + { + InputMethodContext.KeyboardType ret = (InputMethodContext.KeyboardType)Interop.InputMethodContext.InputMethodContext_GetKeyboardType(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Gets the current language locale of the input panel.
+ /// For example, en_US, en_GB, en_PH, fr_FR, and so on. + ///
+ /// The current language locale of the input panel. + /// 5 + public string GetInputPanelLocale() + { + string ret = Interop.InputMethodContext.InputMethodContext_GetInputPanelLocale(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Sets the allowed MIME Type to deliver to the input panel.
+ /// For example, string mimeType = "text/plain,image/png,image/gif,application/pdf"; + ///
+ /// The allowed MIME type. + /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public void SetMIMEType(string mimeType) + { + Interop.InputMethodContext.InputMethodContext_SetMIMEType(swigCPtr, mimeType); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(InputMethodContext obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero) : obj.swigCPtr; + } + + internal InputMethodContext(InputMethodContext inputMethodContext) : this(Interop.InputMethodContext.new_InputMethodContext__SWIG_1(InputMethodContext.getCPtr(inputMethodContext)), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal InputMethodContext Assign(InputMethodContext inputMethodContext) + { + InputMethodContext ret = new InputMethodContext(Interop.InputMethodContext.InputMethodContext_Assign(swigCPtr, InputMethodContext.getCPtr(inputMethodContext)), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal static InputMethodContext DownCast(BaseHandle handle) + { + InputMethodContext ret = new InputMethodContext(Interop.InputMethodContext.InputMethodContext_DownCast(BaseHandle.getCPtr(handle)), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal void ApplyOptions(InputMethodOptions options) + { + Interop.InputMethodContext.InputMethodContext_ApplyOptions(swigCPtr, InputMethodOptions.getCPtr(options)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal void AllowTextPrediction(bool prediction) + { + Interop.InputMethodContext.InputMethodContext_AllowTextPrediction(swigCPtr, prediction); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + internal bool IsTextPredictionAllowed() + { + bool ret = Interop.InputMethodContext.InputMethodContext_IsTextPredictionAllowed(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal ActivatedSignalType ActivatedSignal() + { + ActivatedSignalType ret = new ActivatedSignalType(Interop.InputMethodContext.InputMethodContext_ActivatedSignal(swigCPtr), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal KeyboardEventSignalType EventReceivedSignal() + { + KeyboardEventSignalType ret = new KeyboardEventSignalType(Interop.InputMethodContext.InputMethodContext_EventReceivedSignal(swigCPtr), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal StatusSignalType StatusChangedSignal() + { + StatusSignalType ret = new StatusSignalType(Interop.InputMethodContext.InputMethodContext_StatusChangedSignal(swigCPtr), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal KeyboardResizedSignalType ResizedSignal() + { + KeyboardResizedSignalType ret = new KeyboardResizedSignalType(Interop.InputMethodContext.InputMethodContext_ResizedSignal(swigCPtr), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal LanguageChangedSignalType LanguageChangedSignal() + { + LanguageChangedSignalType ret = new LanguageChangedSignalType(Interop.InputMethodContext.InputMethodContext_LanguageChangedSignal(swigCPtr), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal KeyboardTypeSignalType KeyboardTypeChangedSignal() + { + KeyboardTypeSignalType ret = new KeyboardTypeSignalType(Interop.InputMethodContext.InputMethodContext_KeyboardTypeChangedSignal(swigCPtr), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal ContentReceivedSignalType ContentReceivedSignal() { - NDalicManualPINVOKE.InputMethodContext_SetInputPanelUserData(swigCPtr, text); + ContentReceivedSignalType ret = new ContentReceivedSignalType(Interop.InputMethodContext.InputMethodContext_ContentReceivedSignal(swigCPtr), false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// You can override it to clean-up your own resources. + /// + /// Dispose Type + /// 5 + /// Please do not use! This will be deprecated! + /// Dispose() method in Singletone classes (ex: FocusManager, StyleManager, VisualFactory, InputMethodContext, TtsPlayer, Window) is not required. + [EditorBrowsable(EditorBrowsableState.Never)] + protected override void Dispose(DisposeTypes type) + { + if (disposed) + { + return; + } + + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance + //because the execution order of Finalizes is non-deterministic. + + if (_keyboardTypeChangedEventCallback != null) + { + KeyboardTypeChangedSignal().Disconnect(_keyboardTypeChangedEventCallback); + } + + if (swigCPtr.Handle != global::System.IntPtr.Zero) + { + if (swigCMemOwn) + { + swigCMemOwn = false; + Interop.InputMethodContext.delete_InputMethodContext(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero); + } + + base.Dispose(type); + } + + private void OnActivated(IntPtr data) + { + ActivatedEventArgs e = new ActivatedEventArgs(); + + if (data != null) + { + e.InputMethodContext = Registry.GetManagedBaseHandleFromNativePtr(data) as InputMethodContext; + } + + if (_activatedEventHandler != null) + { + _activatedEventHandler(this, e); + } + } + + private IntPtr OnEventReceived(IntPtr inputMethodContext, IntPtr eventData) + { + CallbackData callbackData = null; + + EventReceivedEventArgs e = new EventReceivedEventArgs(); + + if (inputMethodContext != null) + { + e.InputMethodContext = Registry.GetManagedBaseHandleFromNativePtr(inputMethodContext) as InputMethodContext; + } + if (eventData != null) + { + e.EventData = EventData.GetEventDataFromPtr(eventData); + } + + if (_eventReceivedEventHandler != null) + { + callbackData = _eventReceivedEventHandler(this, e); + } + if (callbackData != null) + { + return callbackData.GetCallbackDataPtr(); + } + else + { + return new CallbackData().GetCallbackDataPtr(); + } } - /// - /// Gets the specific data of the current active input panel. - /// - /// The specific data to be received from the input panel. - /// 4 - public void GetInputPanelUserData(out string text) + private void OnStatusChanged(bool statusChanged) { - NDalicManualPINVOKE.InputMethodContext_GetInputPanelUserData(swigCPtr, out text); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } + StatusChangedEventArgs e = new StatusChangedEventArgs(); - /// - /// Gets the state of the current active input panel. - /// - /// The state of the input panel. - /// 3 - public InputMethodContext.State GetInputPanelState() - { - InputMethodContext.State ret = (InputMethodContext.State)NDalicManualPINVOKE.InputMethodContext_GetInputPanelState(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } + e.StatusChanged = statusChanged; - /// - /// Sets the return key on the input panel to be visible or invisible.
- /// The default is true. - ///
- /// True if the return key is visible (enabled), false otherwise. - /// 3 - public void SetReturnKeyState(bool visible) - { - NDalicManualPINVOKE.InputMethodContext_SetReturnKeyState(swigCPtr, visible); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + if (_statusChangedEventHandler != null) + { + _statusChangedEventHandler(this, e); + } } - /// - /// Enables to show the input panel automatically when focused. - /// - /// If true, the input panel will be shown when focused. - /// 3 - public void AutoEnableInputPanel(bool enabled) + private void OnResized(int resized) { - NDalicManualPINVOKE.InputMethodContext_AutoEnableInputPanel(swigCPtr, enabled); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } + ResizedEventArgs e = new ResizedEventArgs(); + e.Resized = resized; - /// - /// Shows the input panel. - /// - /// 3 - public void ShowInputPanel() - { - NDalicManualPINVOKE.InputMethodContext_ShowInputPanel(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + if (_resizedEventHandler != null) + { + _resizedEventHandler(this, e); + } } - /// - /// Hides the input panel. - /// - /// 3 - public void HideInputPanel() + private void OnLanguageChanged(int languageChanged) { - NDalicManualPINVOKE.InputMethodContext_HideInputPanel(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } + LanguageChangedEventArgs e = new LanguageChangedEventArgs(); + e.LanguageChanged = languageChanged; - /// - /// Gets the keyboard type.
- /// The default keyboard type is SoftwareKeyboard. - ///
- /// The keyboard type. - /// 4 - public InputMethodContext.KeyboardType GetKeyboardType() - { - InputMethodContext.KeyboardType ret = (InputMethodContext.KeyboardType)NDalicManualPINVOKE.InputMethodContext_GetKeyboardType(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + if (_languageChangedEventHandler != null) + { + _languageChangedEventHandler(this, e); + } } - /// - /// Gets the current language locale of the input panel.
- /// For example, en_US, en_GB, en_PH, fr_FR, ... - ///
- /// The current language locale of the input panel. - /// 4 - public string GetInputPanelLocale() + private void OnKeyboardTypeChanged(KeyboardType type) { - string ret = NDalicManualPINVOKE.InputMethodContext_GetInputPanelLocale(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } + KeyboardTypeChangedEventArgs e = new KeyboardTypeChangedEventArgs(); - internal void AllowTextPrediction(bool prediction) - { - NDalicManualPINVOKE.InputMethodContext_AllowTextPrediction(swigCPtr, prediction); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } + e.KeyboardType = type; - internal bool IsTextPredictionAllowed() - { - bool ret = NDalicManualPINVOKE.InputMethodContext_IsTextPredictionAllowed(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + if (_keyboardTypeChangedEventHandler != null) + { + _keyboardTypeChangedEventHandler(this, e); + } } - /// - /// Gets/Sets whether the IM context allow to use the text prediction. - /// - /// This will be public opened in tizen_5.0 after ACR done. Before ACR, need to be hidden as inhouse API. - [EditorBrowsable(EditorBrowsableState.Never)] - public bool TextPrediction + private void OnContentReceived(string content, string description, string mimeType) { - get - { - return IsTextPredictionAllowed(); - } - set + ContentReceivedEventArgs e = new ContentReceivedEventArgs(); + e.Content = content; + e.Description = description; + e.MimeType = mimeType; + + if (_contentReceivedEventHandler != null) { - AllowTextPrediction(value); + _contentReceivedEventHandler(this, e); } } /// - /// InputMethodContext activated event arguments. + /// This structure is used to pass on data from the IMF regarding predictive text. /// - /// 4 - public class ActivatedEventArgs : EventArgs + /// 5 + public class EventData : global::System.IDisposable { /// - /// InputMethodContext + /// The state if it owns memory /// - /// 4 - public InputMethodContext InputMethodContext + /// 5 + protected bool swigCMemOwn; + + /// + /// A flag to check if it is already disposed. + /// + /// 5 + protected bool disposed = false; + + private global::System.Runtime.InteropServices.HandleRef swigCPtr; + + //A flag to check who called Dispose(). (By User or DisposeQueue) + private bool isDisposeQueued = false; + + /// + /// The default constructor. + /// + /// 5 + public EventData() : this(Interop.InputMethodContext.new_InputMethodContext_EventData__SWIG_0(), true) { - get; - set; + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - } - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - private delegate void ActivatedEventCallbackType(IntPtr data); - private ActivatedEventCallbackType _activatedEventCallback; - private event EventHandler _activatedEventHandler; + /// + /// The constructor. + /// + /// The name of the event from the IMF. + /// The pre-edit or the commit string. + /// Start the position from the current cursor position to start deleting characters. + /// The number of characters to delete from the cursorOffset. + /// 5 + public EventData(InputMethodContext.EventType aEventName, string aPredictiveString, int aCursorOffset, int aNumberOfChars) : this(Interop.InputMethodContext.new_InputMethodContext_EventData__SWIG_1((int)aEventName, aPredictiveString, aCursorOffset, aNumberOfChars), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } - /// - /// InputMethodContext activated. - /// - /// 4 - public event EventHandler Activated - { - add + internal EventData(IntPtr cPtr, bool cMemoryOwn) { - if (_activatedEventHandler == null) + swigCMemOwn = cMemoryOwn; + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + } + + /// + /// Releases the resource. + /// + /// 5 + ~EventData() + { + if (!isDisposeQueued) { - _activatedEventCallback = OnActivated; - ActivatedSignal().Connect(_activatedEventCallback); + isDisposeQueued = true; + DisposeQueue.Instance.Add(this); } + } - _activatedEventHandler += value; + /// + /// The pre-edit or the commit string. + /// + /// 5 + public string PredictiveString + { + set + { + Interop.InputMethodContext.InputMethodContext_EventData_predictiveString_set(swigCPtr, value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + get + { + string ret = Interop.InputMethodContext.InputMethodContext_EventData_predictiveString_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } } - remove + + /// + /// The name of the event from the IMF. + /// + /// 5 + public InputMethodContext.EventType EventName { - _activatedEventHandler -= value; + set + { + Interop.InputMethodContext.InputMethodContext_EventData_eventName_set(swigCPtr, (int)value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + get + { + InputMethodContext.EventType ret = (InputMethodContext.EventType)Interop.InputMethodContext.InputMethodContext_EventData_eventName_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } - if (_activatedEventHandler == null && _activatedEventCallback != null) + /// + /// The start position from the current cursor position to start deleting characters. + /// + /// 5 + public int CursorOffset + { + set { - ActivatedSignal().Disconnect(_activatedEventCallback); + Interop.InputMethodContext.InputMethodContext_EventData_cursorOffset_set(swigCPtr, value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + get + { + int ret = Interop.InputMethodContext.InputMethodContext_EventData_cursorOffset_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } } - } - private void OnActivated(IntPtr data) - { - ActivatedEventArgs e = new ActivatedEventArgs(); + /// + /// The number of characters to delete from the cursorOffset. + /// + /// 5 + public int NumberOfChars + { + set + { + Interop.InputMethodContext.InputMethodContext_EventData_numberOfChars_set(swigCPtr, value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + get + { + int ret = Interop.InputMethodContext.InputMethodContext_EventData_numberOfChars_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + } - if (data != null) + /// + /// The dispose pattern. + /// + /// 5 + public void Dispose() { - e.InputMethodContext = Registry.GetManagedBaseHandleFromNativePtr(data) as InputMethodContext; + //Throw excpetion if Dispose() is called in separate thread. + if (!Window.IsInstalled()) + { + throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread."); + } + + if (isDisposeQueued) + { + Dispose(DisposeTypes.Implicit); + } + else + { + Dispose(DisposeTypes.Explicit); + System.GC.SuppressFinalize(this); + } } - if (_activatedEventHandler != null) + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(EventData obj) { - _activatedEventHandler(this, e); + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero) : obj.swigCPtr; } - } - - internal ActivatedSignalType ActivatedSignal() - { - ActivatedSignalType ret = new ActivatedSignalType(NDalicManualPINVOKE.InputMethodContext_ActivatedSignal(swigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - /// - /// InputMethodContext event received event arguments. - /// - /// 4 - public class EventReceivedEventArgs : EventArgs - { - /// - /// InputMethodContext - /// - /// 4 - public InputMethodContext InputMethodContext + internal static EventData GetEventDataFromPtr(IntPtr cPtr) { - get; - set; + EventData ret = new EventData(cPtr, false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } /// - /// EventData + /// You can override it to clean-up your own resources. /// - /// 4 - public EventData EventData + /// 5 + protected virtual void Dispose(DisposeTypes type) { - get; - set; - } - } - - private delegate IntPtr EventReceivedEventCallbackType(IntPtr inputMethodContext, IntPtr eventData); - private EventReceivedEventCallbackType _eventReceivedEventCallback; - private event EventHandlerWithReturnType _eventReceivedEventHandler; + if (disposed) + { + return; + } - /// - /// InputMethodContext event received. - /// - /// 4 - public event EventHandlerWithReturnType EventReceived - { - add - { - if (_eventReceivedEventHandler == null) + if (type == DisposeTypes.Explicit) { - _eventReceivedEventCallback = OnEventReceived; - EventReceivedSignal().Connect(_eventReceivedEventCallback); + //Called by User. + //Release your own managed resources here. + //You should release all of your own disposable objects here. + } - _eventReceivedEventHandler += value; - } - remove - { - _eventReceivedEventHandler -= value; + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //because the execution order of Finalizes is non-deterministic. - if (_eventReceivedEventHandler == null && _eventReceivedEventCallback != null) + if (swigCPtr.Handle != IntPtr.Zero) { - EventReceivedSignal().Disconnect(_eventReceivedEventCallback); + if (swigCMemOwn) + { + swigCMemOwn = false; + Interop.InputMethodContext.delete_InputMethodContext_EventData(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero); } + + disposed = true; } } - private IntPtr OnEventReceived(IntPtr inputMethodContext, IntPtr eventData) + /// + /// Data required by the IMF from the callback. + /// + /// 5 + public class CallbackData : global::System.IDisposable { - CallbackData callbackData = null; + /// + /// The state if it owns memory + /// + /// 5 + protected bool swigCMemOwn; - EventReceivedEventArgs e = new EventReceivedEventArgs(); + /// + /// A Flag to check if it is already disposed. + /// + /// 5 + protected bool disposed = false; - if (inputMethodContext != null) - { - e.InputMethodContext = Registry.GetManagedBaseHandleFromNativePtr(inputMethodContext) as InputMethodContext; - } - if (eventData != null) - { - e.EventData = EventData.GetEventDataFromPtr(eventData); - } + private global::System.Runtime.InteropServices.HandleRef swigCPtr; - if (_eventReceivedEventHandler != null) - { - callbackData = _eventReceivedEventHandler(this, e); - } - if (callbackData != null) + //A flag to check who called Dispose(). (By User or DisposeQueue) + private bool isDisposeQueued = false; + + /// + /// The default constructor. + /// + /// 5 + public CallbackData() : this(Interop.InputMethodContext.new_InputMethodContext_CallbackData__SWIG_0(), true) { - return callbackData.GetCallbackDataPtr(); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - else + + /// + /// The constructor. + /// + /// True if the cursor position needs to be updated. + /// The new position of the cursor. + /// The current text string. + /// Flag if preedit reset is required. + /// 5 + public CallbackData(bool aUpdate, int aCursorPosition, string aCurrentText, bool aPreeditResetRequired) : this(Interop.InputMethodContext.new_InputMethodContext_CallbackData__SWIG_1(aUpdate, aCursorPosition, aCurrentText, aPreeditResetRequired), true) { - return new CallbackData().GetCallbackDataPtr(); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - } - - internal KeyboardEventSignalType EventReceivedSignal() - { - KeyboardEventSignalType ret = new KeyboardEventSignalType(NDalicManualPINVOKE.InputMethodContext_EventReceivedSignal(swigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - /// - /// InputMethodContext status changed event arguments. - /// - /// 4 - public class StatusChangedEventArgs : EventArgs - { /// - /// InputMethodContext status + /// Releases the resource. /// - /// 4 - public bool StatusChanged + /// 5 + ~CallbackData() { - get; - set; + if (!isDisposeQueued) + { + isDisposeQueued = true; + DisposeQueue.Instance.Add(this); + } } - } - - private delegate void StatusChangedEventCallbackType(bool statusChanged); - private StatusChangedEventCallbackType _statusChangedEventCallback; - private event EventHandler _statusChangedEventHandler; - /// - /// InputMethodContext status changed. - /// - /// 4 - public event EventHandler StatusChanged - { - add + /// + /// The current text string. + /// + /// 5 + public string CurrentText { - if (_statusChangedEventHandler == null) + set { - _statusChangedEventCallback = OnStatusChanged; - StatusChangedSignal().Connect(_statusChangedEventCallback); + Interop.InputMethodContext.InputMethodContext_CallbackData_currentText_set(swigCPtr, value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + get + { + string ret = Interop.InputMethodContext.InputMethodContext_CallbackData_currentText_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } - - _statusChangedEventHandler += value; } - remove - { - _statusChangedEventHandler -= value; - if (_statusChangedEventHandler == null && _statusChangedEventCallback != null) + /// + /// The current cursor position. + /// + /// 5 + public int CursorPosition + { + set { - StatusChangedSignal().Disconnect(_statusChangedEventCallback); + Interop.InputMethodContext.InputMethodContext_CallbackData_cursorPosition_set(swigCPtr, value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + get + { + int ret = Interop.InputMethodContext.InputMethodContext_CallbackData_cursorPosition_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; } } - } - - private void OnStatusChanged(bool statusChanged) - { - StatusChangedEventArgs e = new StatusChangedEventArgs(); - - e.StatusChanged = statusChanged; - if (_statusChangedEventHandler != null) + /// + /// The state if the cursor position needs to be updated. + /// + /// 5 + public bool Update { - _statusChangedEventHandler(this, e); + set + { + Interop.InputMethodContext.InputMethodContext_CallbackData_update_set(swigCPtr, value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + get + { + bool ret = Interop.InputMethodContext.InputMethodContext_CallbackData_update_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } } - } - - internal StatusSignalType StatusChangedSignal() - { - StatusSignalType ret = new StatusSignalType(NDalicManualPINVOKE.InputMethodContext_StatusChangedSignal(swigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - /// - /// InputMethodContext resized event. - /// - /// 4 - public class ResizedEventArgs : EventArgs - { /// - /// resized. + /// Flags if the pre-edit reset is required. /// - /// 4 - public int Resized + /// 5 + public bool PreeditResetRequired { - get; - set; + set + { + Interop.InputMethodContext.InputMethodContext_CallbackData_preeditResetRequired_set(swigCPtr, value); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + get + { + bool ret = Interop.InputMethodContext.InputMethodContext_CallbackData_preeditResetRequired_get(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } } - } - - private delegate void ResizedEventCallbackType(int resized); - private ResizedEventCallbackType _resizedEventCallback; - private event EventHandler _resizedEventHandler; - /// - /// InputMethodContext resized. - /// - /// 4 - public event EventHandler Resized - { - add + /// + /// The dispose pattern. + /// + /// 5 + public void Dispose() { - if (_resizedEventHandler == null) + //Throw excpetion if Dispose() is called in separate thread. + if (!Window.IsInstalled()) { - _resizedEventCallback = OnResized; - ResizedSignal().Connect(_resizedEventCallback); + throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread."); + } + + if (isDisposeQueued) + { + Dispose(DisposeTypes.Implicit); + } + else + { + Dispose(DisposeTypes.Explicit); + System.GC.SuppressFinalize(this); } - - _resizedEventHandler += value; } - remove - { - _resizedEventHandler -= value; - if (_resizedEventHandler == null && _resizedEventCallback != null) - { - ResizedSignal().Disconnect(_resizedEventCallback); - } + internal IntPtr GetCallbackDataPtr() + { + return (IntPtr)swigCPtr; } - } - private void OnResized(int resized) - { - ResizedEventArgs e = new ResizedEventArgs(); - e.Resized = resized; + internal CallbackData(IntPtr cPtr, bool cMemoryOwn) + { + swigCMemOwn = cMemoryOwn; + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + } - if (_resizedEventHandler != null) + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(CallbackData obj) { - _resizedEventHandler(this, e); + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero) : obj.swigCPtr; } - } - internal KeyboardResizedSignalType ResizedSignal() - { - KeyboardResizedSignalType ret = new KeyboardResizedSignalType(NDalicManualPINVOKE.InputMethodContext_ResizedSignal(swigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } + internal static CallbackData GetCallbackDataFromPtr(IntPtr cPtr) + { + CallbackData ret = new CallbackData(cPtr, false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } - /// - /// InputMethodContext language changed event args. - /// - /// 4 - public class LanguageChangedEventArgs : EventArgs - { /// - /// language changed. + /// You can override it to clean-up your own resources. /// - /// 4 - public int LanguageChanged + /// 5 + protected virtual void Dispose(DisposeTypes type) { - get; - set; - } - } - - private delegate void LanguageChangedEventCallbackType(int languageChanged); - private LanguageChangedEventCallbackType _languageChangedEventCallback; - private event EventHandler _languageChangedEventHandler; + if (disposed) + { + return; + } - /// - /// InputMethodContext language changed. - /// - /// 4 - public event EventHandler LanguageChanged - { - add - { - if (_languageChangedEventHandler == null) + if (type == DisposeTypes.Explicit) { - _languageChangedEventCallback = OnLanguageChanged; - LanguageChangedSignal().Connect(_languageChangedEventCallback); + //Called by User. + //Release your own managed resources here. + //You should release all of your own disposable objects here. + } - _languageChangedEventHandler += value; - } - remove - { - _languageChangedEventHandler -= value; + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //Because the execution order of Finalizes is non-deterministic. - if (_languageChangedEventHandler == null && _languageChangedEventCallback != null) + if (swigCPtr.Handle != IntPtr.Zero) { - LanguageChangedSignal().Disconnect(_languageChangedEventCallback); + if (swigCMemOwn) + { + swigCMemOwn = false; + Interop.InputMethodContext.delete_InputMethodContext_CallbackData(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero); } - } - } - - private void OnLanguageChanged(int languageChanged) - { - LanguageChangedEventArgs e = new LanguageChangedEventArgs(); - e.LanguageChanged = languageChanged; - if (_languageChangedEventHandler != null) - { - _languageChangedEventHandler(this, e); + disposed = true; } } - internal LanguageChangedSignalType LanguageChangedSignal() - { - LanguageChangedSignalType ret = new LanguageChangedSignalType(NDalicManualPINVOKE.InputMethodContext_LanguageChangedSignal(swigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - /// - /// InputMethodContext keyboard type changed event arguments. + /// InputMethodContext activated event arguments. /// - /// 4 - public class KeyboardTypeChangedEventArgs : EventArgs + /// 5 + public class ActivatedEventArgs : EventArgs { /// - /// InputMethodContext keyboard type + /// The instance of InputMethodContext /// - /// 4 - public KeyboardType KeyboardType + /// 5 + public InputMethodContext InputMethodContext { get; set; } } - private delegate void KeyboardTypeChangedEventCallbackType(KeyboardType type); - private KeyboardTypeChangedEventCallbackType _keyboardTypeChangedEventCallback; - private event EventHandler _keyboardTypeChangedEventHandler; - /// - /// InputMethodContext keyboard type changed. + /// InputMethodContext event receives event arguments. /// - /// 4 - public event EventHandler KeyboardTypeChanged + /// 5 + public class EventReceivedEventArgs : EventArgs { - add + /// + /// The instance of InputMethodContext + /// + /// 5 + public InputMethodContext InputMethodContext { - if (_keyboardTypeChangedEventHandler == null) - { - _keyboardTypeChangedEventCallback = OnKeyboardTypeChanged; - KeyboardTypeChangedSignal().Connect(_keyboardTypeChangedEventCallback); - } - - _keyboardTypeChangedEventHandler += value; + get; + set; } - remove - { - _keyboardTypeChangedEventHandler -= value; - if (_keyboardTypeChangedEventHandler == null && _keyboardTypeChangedEventCallback != null) - { - KeyboardTypeChangedSignal().Disconnect(_keyboardTypeChangedEventCallback); - } + /// + /// The event data of IMF + /// + /// 5 + public EventData EventData + { + get; + set; } } - private void OnKeyboardTypeChanged(KeyboardType type) + /// + /// InputMethodContext status changed event arguments. + /// + /// 5 + public class StatusChangedEventArgs : EventArgs { - KeyboardTypeChangedEventArgs e = new KeyboardTypeChangedEventArgs(); - - e.KeyboardType = type; - - if (_keyboardTypeChangedEventHandler != null) + /// + /// InputMethodContext status. + /// + /// 5 + public bool StatusChanged { - _keyboardTypeChangedEventHandler(this, e); + get; + set; } } - internal KeyboardTypeSignalType KeyboardTypeChangedSignal() - { - KeyboardTypeSignalType ret = new KeyboardTypeSignalType(NDalicManualPINVOKE.InputMethodContext_KeyboardTypeChangedSignal(swigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - /// - /// The direction of the text. + /// InputMethodContext resized event arguments. /// - /// 3 - public enum TextDirection + /// 5 + public class ResizedEventArgs : EventArgs { /// - /// Left to right. - /// - LeftToRight, - /// - /// Right to left. + /// The state if the IMF resized. /// - RightToLeft + /// 5 + public int Resized + { + get; + set; + } } /// - /// Events that are generated by the IMF. + /// InputMethodContext language changed event arguments. /// - /// 3 - public enum EventType + /// 5 + public class LanguageChangedEventArgs : EventArgs { /// - /// No event. - /// - /// 4 - Void, - /// - /// Pre-Edit changed. - /// - /// 4 - Preedit, - /// - /// Commit received. - /// - /// 4 - Commit, - /// - /// An event to delete a range of characters from the string. - /// - /// 4 - DeleteSurrounding, - /// - /// An event to query string and the cursor position. - /// - /// 4 - GetSurrounding, - /// - /// Private command sent from the input panel. + /// Language changed. /// - /// 4 - PrivateCommand + /// 5 + public int LanguageChanged + { + get; + set; + } } /// - /// Enumeration for the state of the input panel. + /// InputMethodContext keyboard type changed event arguments. /// - /// 3 - public enum State + /// 5 + public class KeyboardTypeChangedEventArgs : EventArgs { /// - /// Unknown state. - /// - /// 4 - Default = 0, - /// - /// Input panel is shown. - /// - /// 4 - Show, - /// - /// Input panel is hidden. - /// - /// 4 - Hide, - /// - /// Input panel in process of being shown. + /// InputMethodContext keyboard type. /// - /// 4 - WillShow + /// 5 + public KeyboardType KeyboardType + { + get; + set; + } } /// - /// Enumeration for the types of keyboard. + /// InputMethodContext content received event arguments. /// - /// 4 - public enum KeyboardType + /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public class ContentReceivedEventArgs : EventArgs { /// - /// Software keyboard (virtual keyboard) is default. + /// The content, such as images, of input method /// - /// 4 - SoftwareKeyboard, + /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public string Content + { + get; + set; + } /// - /// Hardware keyboard. + /// The description of content /// - /// 4 - HardwareKeyboard + /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public string Description + { + get; + set; + } + /// + /// The mime type of content, such as jpg, png, and so on + /// + /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API. + [EditorBrowsable(EditorBrowsableState.Never)] + public string MimeType + { + get; + set; + } } } }