/*
- * Copyright(c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright(c) 2018 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
/// Specifically manages the input method framework which enables the virtual or hardware keyboards.
/// </summary>
/// <since_tizen> 3 </since_tizen>
+ [Obsolete("Please do not use! This will be deprecated! Please use InputMethodContext instead!")]
+ [EditorBrowsable(EditorBrowsableState.Never)]
public class ImfManager : BaseHandle
{
private global::System.Runtime.InteropServices.HandleRef swigCPtr;
- internal ImfManager(IntPtr cPtr, bool cMemoryOwn) : base(NDalicManualPINVOKE.ImfManager_SWIGUpcast(cPtr), cMemoryOwn)
+ private ActivatedEventCallbackType _activatedEventCallback;
+ private EventReceivedEventCallbackType _eventReceivedEventCallback;
+ private StatusChangedEventCallbackType _statusChangedEventCallback;
+ private ResizedEventCallbackType _resizedEventCallback;
+ private LanguageChangedEventCallbackType _languageChangedEventCallback;
+ private KeyboardTypeChangedEventCallbackType _keyboardTypeChangedEventCallback;
+
+ /// <summary>
+ /// Constructor.<br/>
+ /// </summary>
+ /// <since_tizen> 5 </since_tizen>
+ public ImfManager() : this(NDalicManualPINVOKE.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(ImfManager obj)
+ internal ImfManager(ImfManager imfManager) : this(NDalicManualPINVOKE.new_InputMethodContext__SWIG_1(ImfManager.getCPtr(imfManager)), true)
{
- return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
- private static readonly ImfManager instance = ImfManager.Get();
-
- /// <summary>
- /// Gets the singleton of the ImfManager object.
- /// </summary>
- /// <since_tizen> 5 </since_tizen>
- public static ImfManager Instance
+ internal ImfManager(IntPtr cPtr, bool cMemoryOwn) : base(NDalicManualPINVOKE.InputMethodContext_SWIGUpcast(cPtr), cMemoryOwn)
{
- get
- {
- return instance;
- }
+ swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
}
+ [UnmanagedFunctionPointer(CallingConvention.StdCall)]
+ private delegate void ActivatedEventCallbackType(IntPtr data);
+ private delegate IntPtr EventReceivedEventCallbackType(IntPtr imfManager, IntPtr imfEventData);
+ private delegate void StatusChangedEventCallbackType(bool statusChanged);
+ private delegate void ResizedEventCallbackType(int resized);
+ private delegate void LanguageChangedEventCallbackType(int languageChanged);
+ private delegate void KeyboardTypeChangedEventCallbackType(KeyboardType type);
+
/// <summary>
- /// Dispose
+ /// ImfManager activated.
/// </summary>
- /// <param name="type">Dispose Type</param>
- /// <since_tizen> 3 </since_tizen>
- /// Please DO NOT use! This will be deprecated!
- /// Dispose() method in Singletone classes (ex: FocusManager, StyleManager, VisualFactory, IMFManager, TtsPlayer, Window) is not required.
- /// Because it is Sigletone, so it is alive for one thread until the NUI is terminated, so it never be disposed.
- [EditorBrowsable(EditorBrowsableState.Never)]
- protected override void Dispose(DisposeTypes type)
+ /// <since_tizen> 4 </since_tizen>
+ public event EventHandler<ActivatedEventArgs> 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)
+ /// <summary>
+ /// ImfManager event received.
+ /// </summary>
+ /// <since_tizen> 4 </since_tizen>
+ public event EventHandlerWithReturnType<object, EventReceivedEventArgs, ImfCallbackData> EventReceived
+ {
+ add
{
- KeyboardTypeChangedSignal().Disconnect(_keyboardTypeChangedEventCallback);
- }
+ if (_eventReceivedEventHandler == null)
+ {
+ _eventReceivedEventCallback = OnEventReceived;
+ EventReceivedSignal().Connect(_eventReceivedEventCallback);
+ }
- if (_imfManagerLanguageChangedEventCallback != null)
- {
- LanguageChangedSignal().Disconnect(_imfManagerLanguageChangedEventCallback);
+ _eventReceivedEventHandler += value;
}
-
- if (_imfManagerResizedEventCallback != null)
+ remove
{
- ResizedSignal().Disconnect(_imfManagerResizedEventCallback);
- }
+ _eventReceivedEventHandler -= value;
- if (_imfManagerStatusChangedEventCallback != null)
- {
- StatusChangedSignal().Disconnect(_imfManagerStatusChangedEventCallback);
+ if (_eventReceivedEventHandler == null && _eventReceivedEventCallback != null)
+ {
+ EventReceivedSignal().Disconnect(_eventReceivedEventCallback);
+ }
}
+ }
- if (_imfManagerEventReceivedEventCallback != null)
+ /// <summary>
+ /// ImfManager status changed.
+ /// </summary>
+ /// <since_tizen> 4 </since_tizen>
+ public event EventHandler<StatusChangedEventArgs> StatusChanged
+ {
+ add
{
- EventReceivedSignal().Disconnect(_imfManagerEventReceivedEventCallback);
- }
+ if (_statusChangedEventHandler == null)
+ {
+ _statusChangedEventCallback = OnStatusChanged;
+ StatusChangedSignal().Connect(_statusChangedEventCallback);
+ }
- if (_imfManagerActivatedEventCallback != null)
- {
- ActivatedSignal().Disconnect(_imfManagerActivatedEventCallback);
+ _statusChangedEventHandler += value;
}
-
- if (swigCPtr.Handle != global::System.IntPtr.Zero)
+ remove
{
- if (swigCMemOwn)
+ _statusChangedEventHandler -= value;
+
+ if (_statusChangedEventHandler == null && _statusChangedEventCallback != null)
{
- swigCMemOwn = false;
- NDalicManualPINVOKE.delete_ImfManager(swigCPtr);
+ StatusChangedSignal().Disconnect(_statusChangedEventCallback);
}
- swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero);
}
-
- base.Dispose(type);
}
/// <summary>
- /// This structure is used to pass on data from the IMF regarding predictive text.
+ /// ImfManager resized.
/// </summary>
- /// <since_tizen> 3 </since_tizen>
- public class ImfEventData : global::System.IDisposable
+ /// <since_tizen> 4 </since_tizen>
+ public event EventHandler<ResizedEventArgs> Resized
{
- private global::System.Runtime.InteropServices.HandleRef swigCPtr;
- /// <summary>
- /// swigCMemOwn
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- protected bool swigCMemOwn;
-
- internal ImfEventData(IntPtr cPtr, bool cMemoryOwn)
+ add
{
- swigCMemOwn = cMemoryOwn;
- swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
- }
+ if (_resizedEventHandler == null)
+ {
+ _resizedEventCallback = OnResized;
+ ResizedSignal().Connect(_resizedEventCallback);
+ }
- internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ImfEventData obj)
- {
- return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+ _resizedEventHandler += value;
}
-
- //A Flag to check who called Dispose(). (By User or DisposeQueue)
- private bool isDisposeQueued = false;
- /// <summary>
- /// A Flat to check if it is already disposed.
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- protected bool disposed = false;
-
- /// <summary>
- /// Dispose.
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- ~ImfEventData()
+ remove
{
- if (!isDisposeQueued)
+ _resizedEventHandler -= value;
+
+ if (_resizedEventHandler == null && _resizedEventCallback != null)
{
- isDisposeQueued = true;
- DisposeQueue.Instance.Add(this);
+ ResizedSignal().Disconnect(_resizedEventCallback);
}
}
+ }
- /// <summary>
- /// The dispose pattern.
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- public void Dispose()
+ /// <summary>
+ /// ImfManager language changed.
+ /// </summary>
+ /// <since_tizen> 4 </since_tizen>
+ public event EventHandler<LanguageChangedEventArgs> LanguageChanged
+ {
+ add
{
- //Throw excpetion if Dispose() is called in separate thread.
- if (!Window.IsInstalled())
+ if (_languageChangedEventHandler == null)
{
- throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread.");
+ _languageChangedEventCallback = OnLanguageChanged;
+ LanguageChangedSignal().Connect(_languageChangedEventCallback);
}
- if (isDisposeQueued)
- {
- Dispose(DisposeTypes.Implicit);
- }
- else
- {
- Dispose(DisposeTypes.Explicit);
- System.GC.SuppressFinalize(this);
- }
+ _languageChangedEventHandler += value;
}
-
- /// <summary>
- /// Dispose.
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- protected virtual void Dispose(DisposeTypes type)
+ remove
{
- if (disposed)
+ _languageChangedEventHandler -= value;
+
+ if (_languageChangedEventHandler == null && _languageChangedEventCallback != null)
{
- return;
+ LanguageChangedSignal().Disconnect(_languageChangedEventCallback);
}
+ }
+ }
- if (type == DisposeTypes.Explicit)
+ /// <summary>
+ /// ImfManager keyboard type changed.
+ /// </summary>
+ /// <since_tizen> 4 </since_tizen>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public event EventHandler<KeyboardTypeChangedEventArgs> KeyboardTypeChanged
+ {
+ add
+ {
+ if (_keyboardTypeChangedEventHandler == null)
{
- //Called by User
- //Release your own managed resources here.
- //You should release all of your own disposable objects here.
-
+ _keyboardTypeChangedEventCallback = OnKeyboardTypeChanged;
+ KeyboardTypeChangedSignal().Connect(_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.
+ _keyboardTypeChangedEventHandler += value;
+ }
+ remove
+ {
+ _keyboardTypeChangedEventHandler -= value;
- if (swigCPtr.Handle != IntPtr.Zero)
+ if (_keyboardTypeChangedEventHandler == null && _keyboardTypeChangedEventCallback != null)
{
- if (swigCMemOwn)
- {
- swigCMemOwn = false;
- NDalicManualPINVOKE.delete_ImfManager_ImfEventData(swigCPtr);
- }
- swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero);
+ KeyboardTypeChangedSignal().Disconnect(_keyboardTypeChangedEventCallback);
}
-
- disposed = true;
}
+ }
- internal static ImfEventData GetImfEventDataFromPtr(IntPtr cPtr)
- {
- ImfEventData ret = new ImfEventData(cPtr, false);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
- }
-
- /// <summary>
- /// The default constructor.
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- public ImfEventData() : this(NDalicManualPINVOKE.new_ImfManager_ImfEventData__SWIG_0(), true)
- {
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- }
+ private event EventHandler<ActivatedEventArgs> _activatedEventHandler;
+ private event EventHandlerWithReturnType<object, EventReceivedEventArgs, ImfCallbackData> _eventReceivedEventHandler;
+ private event EventHandler<StatusChangedEventArgs> _statusChangedEventHandler;
+ private event EventHandler<ResizedEventArgs> _resizedEventHandler;
+ private event EventHandler<LanguageChangedEventArgs> _languageChangedEventHandler;
+ private event EventHandler<KeyboardTypeChangedEventArgs> _keyboardTypeChangedEventHandler;
+ /// <summary>
+ /// The direction of the text.
+ /// </summary>
+ /// <since_tizen> 3 </since_tizen>
+ public enum TextDirection
+ {
/// <summary>
- /// The constructor.
+ /// Left to right.
/// </summary>
- /// <param name="aEventName">The name of the event from the IMF.</param>
- /// <param name="aPredictiveString">The pre-edit or the commit string.</param>
- /// <param name="aCursorOffset">Start the position from the current cursor position to start deleting characters.</param>
- /// <param name="aNumberOfChars">The number of characters to delete from the cursorOffset.</param>
- /// <since_tizen> 3 </since_tizen>
- public ImfEventData(ImfManager.ImfEvent aEventName, string aPredictiveString, int aCursorOffset, int aNumberOfChars) : this(NDalicManualPINVOKE.new_ImfManager_ImfEventData__SWIG_1((int)aEventName, aPredictiveString, aCursorOffset, aNumberOfChars), true)
- {
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- }
-
+ LeftToRight,
/// <summary>
- /// The pre-edit or the commit string.
+ /// Right to left.
/// </summary>
- /// /// <since_tizen> 3 </since_tizen>
- [EditorBrowsable(EditorBrowsableState.Never)]
- public string predictiveString
- {
- set
- {
- NDalicManualPINVOKE.ImfManager_ImfEventData_predictiveString_set(swigCPtr, value);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- }
- get
- {
- string ret = NDalicManualPINVOKE.ImfManager_ImfEventData_predictiveString_get(swigCPtr);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
- }
- }
+ RightToLeft
+ }
+ /// <summary>
+ /// Events that are generated by the IMF.
+ /// </summary>
+ /// <since_tizen> 3 </since_tizen>
+ public enum ImfEvent
+ {
/// <summary>
- /// The pre-edit or the commit string.
+ /// No event.
/// </summary>
/// <since_tizen> 4 </since_tizen>
- public string PredictiveString
- {
- set
- {
- NDalicManualPINVOKE.ImfManager_ImfEventData_predictiveString_set(swigCPtr, value);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- }
- get
- {
- string ret = NDalicManualPINVOKE.ImfManager_ImfEventData_predictiveString_get(swigCPtr);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
- }
- }
-
- /// <summary>
- /// The name of the event from the IMF.
- /// </summary>
- //Please do not use! this will be deprecated
- /// <since_tizen> 3 </since_tizen>
- [EditorBrowsable(EditorBrowsableState.Never)]
- public ImfManager.ImfEvent eventName
- {
- set
- {
- NDalicManualPINVOKE.ImfManager_ImfEventData_eventName_set(swigCPtr, (int)value);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- }
- get
- {
- ImfManager.ImfEvent ret = (ImfManager.ImfEvent)NDalicManualPINVOKE.ImfManager_ImfEventData_eventName_get(swigCPtr);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
- }
- }
-
+ Void,
/// <summary>
- /// The name of the event from the IMF.
+ /// Pre-Edit changed.
/// </summary>
/// <since_tizen> 4 </since_tizen>
- public ImfManager.ImfEvent EventName
- {
- set
- {
- NDalicManualPINVOKE.ImfManager_ImfEventData_eventName_set(swigCPtr, (int)value);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- }
- get
- {
- ImfManager.ImfEvent ret = (ImfManager.ImfEvent)NDalicManualPINVOKE.ImfManager_ImfEventData_eventName_get(swigCPtr);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
- }
- }
-
+ Preedit,
/// <summary>
- /// The start position from the current cursor position to start deleting characters.
+ /// Commit received.
/// </summary>
- //Please do not use! this will be deprecated
- /// <since_tizen> 3 </since_tizen>
- [EditorBrowsable(EditorBrowsableState.Never)]
- public int cursorOffset
- {
- set
- {
- NDalicManualPINVOKE.ImfManager_ImfEventData_cursorOffset_set(swigCPtr, value);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- }
- get
- {
- int ret = NDalicManualPINVOKE.ImfManager_ImfEventData_cursorOffset_get(swigCPtr);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
- }
- }
-
+ /// <since_tizen> 4 </since_tizen>
+ Commit,
/// <summary>
- /// The start position from the current cursor position to start deleting characters.
+ /// An event to delete a range of characters from the string.
/// </summary>
/// <since_tizen> 4 </since_tizen>
- public int CursorOffset
- {
- set
- {
- NDalicManualPINVOKE.ImfManager_ImfEventData_cursorOffset_set(swigCPtr, value);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- }
- get
- {
- int ret = NDalicManualPINVOKE.ImfManager_ImfEventData_cursorOffset_get(swigCPtr);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
- }
- }
-
+ DeleteSurrounding,
/// <summary>
- /// The number of characters to delete from the cursorOffset.
+ /// An event to query string and the cursor position.
/// </summary>
- //Please do not use! this will be deprecated
- /// <since_tizen> 3 </since_tizen>
- [EditorBrowsable(EditorBrowsableState.Never)]
- public int numberOfChars
- {
- set
- {
- NDalicManualPINVOKE.ImfManager_ImfEventData_numberOfChars_set(swigCPtr, value);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- }
- get
- {
- int ret = NDalicManualPINVOKE.ImfManager_ImfEventData_numberOfChars_get(swigCPtr);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
- }
- }
-
+ /// <since_tizen> 4 </since_tizen>
+ GetSurrounding,
/// <summary>
- /// The number of characters to delete from the cursorOffset.
+ /// Private command sent from the input panel.
/// </summary>
/// <since_tizen> 4 </since_tizen>
- public int NumberOfChars
- {
- set
- {
- NDalicManualPINVOKE.ImfManager_ImfEventData_numberOfChars_set(swigCPtr, value);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- }
- get
- {
- int ret = NDalicManualPINVOKE.ImfManager_ImfEventData_numberOfChars_get(swigCPtr);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
- }
- }
-
+ PrivateCommand
}
/// <summary>
- /// Data required by the IMF from the callback.
+ /// Enumeration for the state of the input panel.
/// </summary>
/// <since_tizen> 3 </since_tizen>
- public class ImfCallbackData : global::System.IDisposable
+ public enum State
{
- private global::System.Runtime.InteropServices.HandleRef swigCPtr;
- /// <summary>
- /// swigCMemOwn
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- protected bool swigCMemOwn;
-
- internal IntPtr GetImfCallbackDataPtr()
- {
- return (IntPtr)swigCPtr;
- }
-
- internal ImfCallbackData(IntPtr cPtr, bool cMemoryOwn)
- {
- swigCMemOwn = cMemoryOwn;
- swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
- }
-
- internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ImfCallbackData 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;
- /// <summary>
- /// A Flat to check if it is already disposed.
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- protected bool disposed = false;
-
-
- /// <summary>
- /// Dispose.
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- ~ImfCallbackData()
- {
- if (!isDisposeQueued)
- {
- isDisposeQueued = true;
- DisposeQueue.Instance.Add(this);
- }
- }
-
- /// <summary>
- /// The dispose pattern.
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- 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);
- }
- }
-
- /// <summary>
- /// Dispose.
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- 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_ImfManager_ImfCallbackData(swigCPtr);
- }
- swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero);
- }
-
- disposed = true;
- }
-
- internal static ImfCallbackData GetImfCallbackDataFromPtr(IntPtr cPtr)
- {
- ImfCallbackData ret = new ImfCallbackData(cPtr, false);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
- }
-
- /// <summary>
- /// The default constructor.
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- public ImfCallbackData() : this(NDalicManualPINVOKE.new_ImfManager_ImfCallbackData__SWIG_0(), true)
- {
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- }
-
- /// <summary>
- /// The constructor.
- /// </summary>
- /// <param name="aUpdate">True if the cursor position needs to be updated.</param>
- /// <param name="aCursorPosition">The new position of the cursor.</param>
- /// <param name="aCurrentText">The current text string.</param>
- /// <param name="aPreeditResetRequired">Flag if preedit reset is required.</param>
- /// <since_tizen> 3 </since_tizen>
- public ImfCallbackData(bool aUpdate, int aCursorPosition, string aCurrentText, bool aPreeditResetRequired) : this(NDalicManualPINVOKE.new_ImfManager_ImfCallbackData__SWIG_1(aUpdate, aCursorPosition, aCurrentText, aPreeditResetRequired), true)
- {
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- }
-
- /// <summary>
- /// The current text string.
- /// </summary>
- //Please do not use! this will be deprecated
- /// <since_tizen> 3 </since_tizen>
- [EditorBrowsable(EditorBrowsableState.Never)]
- public string currentText
- {
- set
- {
- NDalicManualPINVOKE.ImfManager_ImfCallbackData_currentText_set(swigCPtr, value);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- }
- get
- {
- string ret = NDalicManualPINVOKE.ImfManager_ImfCallbackData_currentText_get(swigCPtr);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
- }
- }
-
/// <summary>
- /// The current text string.
+ /// Unknown state.
/// </summary>
/// <since_tizen> 4 </since_tizen>
- public string CurrentText
- {
- set
- {
- NDalicManualPINVOKE.ImfManager_ImfCallbackData_currentText_set(swigCPtr, value);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- }
- get
- {
- string ret = NDalicManualPINVOKE.ImfManager_ImfCallbackData_currentText_get(swigCPtr);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
- }
- }
-
- /// <summary>
- /// The current text string.
- /// </summary>
- //Please do not use! this will be deprecated
- /// <since_tizen> 3 </since_tizen>
- [EditorBrowsable(EditorBrowsableState.Never)]
- public int cursorPosition
- {
- set
- {
- NDalicManualPINVOKE.ImfManager_ImfCallbackData_cursorPosition_set(swigCPtr, value);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- }
- get
- {
- int ret = NDalicManualPINVOKE.ImfManager_ImfCallbackData_cursorPosition_get(swigCPtr);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
- }
- }
-
+ Default = 0,
/// <summary>
- /// The current text string.
+ /// Input panel is shown.
/// </summary>
/// <since_tizen> 4 </since_tizen>
- public int CursorPosition
- {
- set
- {
- NDalicManualPINVOKE.ImfManager_ImfCallbackData_cursorPosition_set(swigCPtr, value);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- }
- get
- {
- int ret = NDalicManualPINVOKE.ImfManager_ImfCallbackData_cursorPosition_get(swigCPtr);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
- }
- }
-
+ Show,
/// <summary>
- /// If the cursor position needs to be updated.
+ /// Input panel is hidden.
/// </summary>
- //Please do not use! this will be deprecated
- /// <since_tizen> 3 </since_tizen>
- [EditorBrowsable(EditorBrowsableState.Never)]
- public bool update
- {
- set
- {
- NDalicManualPINVOKE.ImfManager_ImfCallbackData_update_set(swigCPtr, value);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- }
- get
- {
- bool ret = NDalicManualPINVOKE.ImfManager_ImfCallbackData_update_get(swigCPtr);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
- }
- }
-
+ /// <since_tizen> 4 </since_tizen>
+ Hide,
/// <summary>
- /// If the cursor position needs to be updated.
+ /// Input panel in process of being shown.
/// </summary>
/// <since_tizen> 4 </since_tizen>
- public bool Update
- {
- set
- {
- NDalicManualPINVOKE.ImfManager_ImfCallbackData_update_set(swigCPtr, value);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- }
- get
- {
- bool ret = NDalicManualPINVOKE.ImfManager_ImfCallbackData_update_get(swigCPtr);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
- }
- }
+ WillShow
+ }
+ /// <summary>
+ /// Enumeration for the types of keyboard.
+ /// </summary>
+ /// <since_tizen> 4 </since_tizen>
+ public enum KeyboardType
+ {
/// <summary>
- /// Flags if preedit reset is required.
+ /// Software keyboard (virtual keyboard) is default.
/// </summary>
- //Please do not use! this will be deprecated
- /// <since_tizen> 3 </since_tizen>
- [EditorBrowsable(EditorBrowsableState.Never)]
- public bool preeditResetRequired
- {
- set
- {
- NDalicManualPINVOKE.ImfManager_ImfCallbackData_preeditResetRequired_set(swigCPtr, value);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- }
- get
- {
- bool ret = NDalicManualPINVOKE.ImfManager_ImfCallbackData_preeditResetRequired_get(swigCPtr);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
- }
- }
-
+ /// <since_tizen> 4 </since_tizen>
+ SoftwareKeyboard,
/// <summary>
- /// Flags if preedit reset is required.
+ /// Hardware keyboard.
/// </summary>
/// <since_tizen> 4 </since_tizen>
- public bool PreeditResetRequired
+ HardwareKeyboard
+ }
+
+ /// <summary>
+ /// Gets the singleton of the ImfManager object.
+ /// </summary>
+ /// <since_tizen> 5 </since_tizen>
+ public static ImfManager Instance
+ {
+ get
{
- set
- {
- NDalicManualPINVOKE.ImfManager_ImfCallbackData_preeditResetRequired_set(swigCPtr, value);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- }
- get
- {
- bool ret = NDalicManualPINVOKE.ImfManager_ImfCallbackData_preeditResetRequired_get(swigCPtr);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
- }
+ return new ImfManager();
}
+ }
+ /// <summary>
+ /// Retrieves a handle to the instance of the ImfManager.
+ /// </summary>
+ /// <returns>A handle to the ImfManager.</returns>
+ /// <since_tizen> 3 </since_tizen>
+ public static ImfManager Get()
+ {
+ return new ImfManager();
}
/// <summary>
- /// Destroy the context of the IMF.<br/>
+ /// Destroys the context of the IMF.<br/>
/// </summary>
/// <since_tizen> 5 </since_tizen>
public void DestroyContext()
{
- NDalicManualPINVOKE.ImfManager_Finalize(swigCPtr);
+ NDalicManualPINVOKE.InputMethodContext_Finalize(swigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
- /// Please DO NOT use! This will be deprecated, instead please USE Tizen.NUI.ImfManager.Instance.DestroyContext()!
- [Obsolete("Please DO NOT use! This will be deprecated, instead please USE Tizen.NUI.ImfManager.Instance.DestroyContext()!")]
+ /// <summary>
+ /// Destroy the context of the IMF.<br/>
+ /// </summary>
+ /// <since_tizen> 4 </since_tizen>
+ /// Please do not use! This will be deprecated, instead please USE Tizen.NUI.ImfManager.Instance.DestroyContext()!
+#pragma warning disable 0465
+ [Obsolete("Please do not use! This will be deprecated! Please use ImfManager.Instance.DestroyContext() instead!")]
[EditorBrowsable(EditorBrowsableState.Never)]
public void Finalize()
{
DestroyContext();
}
-
- /// <summary>
- /// Retrieves a handle to the instance of the ImfManager.
- /// </summary>
- /// <returns>A handle to the ImfManager.</returns>
- /// <since_tizen> 3 </since_tizen>
- public static ImfManager Get()
- {
- ImfManager ret = new ImfManager(NDalicManualPINVOKE.ImfManager_Get(), true);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
- }
+#pragma warning restore 0465
/// <summary>
/// Activates the IMF.<br/>
/// <since_tizen> 3 </since_tizen>
public void Activate()
{
- NDalicManualPINVOKE.ImfManager_Activate(swigCPtr);
+ NDalicManualPINVOKE.InputMethodContext_Activate(swigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
/// <since_tizen> 3 </since_tizen>
public void Deactivate()
{
- NDalicManualPINVOKE.ImfManager_Deactivate(swigCPtr);
+ NDalicManualPINVOKE.InputMethodContext_Deactivate(swigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
/// <since_tizen> 3 </since_tizen>
public bool RestoreAfterFocusLost()
{
- bool ret = NDalicManualPINVOKE.ImfManager_RestoreAfterFocusLost(swigCPtr);
+ bool ret = NDalicManualPINVOKE.InputMethodContext_RestoreAfterFocusLost(swigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
/// <since_tizen> 3 </since_tizen>
public void SetRestoreAfterFocusLost(bool toggle)
{
- NDalicManualPINVOKE.ImfManager_SetRestoreAfterFocusLost(swigCPtr, toggle);
+ NDalicManualPINVOKE.InputMethodContext_SetRestoreAfterFocusLost(swigCPtr, toggle);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
/// <since_tizen> 3 </since_tizen>
public new void Reset()
{
- NDalicManualPINVOKE.ImfManager_Reset(swigCPtr);
+ NDalicManualPINVOKE.InputMethodContext_Reset(swigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
/// <since_tizen> 3 </since_tizen>
public void NotifyCursorPosition()
{
- NDalicManualPINVOKE.ImfManager_NotifyCursorPosition(swigCPtr);
+ NDalicManualPINVOKE.InputMethodContext_NotifyCursorPosition(swigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
/// <since_tizen> 3 </since_tizen>
public void SetCursorPosition(uint cursorPosition)
{
- NDalicManualPINVOKE.ImfManager_SetCursorPosition(swigCPtr, cursorPosition);
+ NDalicManualPINVOKE.InputMethodContext_SetCursorPosition(swigCPtr, cursorPosition);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
/// <since_tizen> 3 </since_tizen>
public uint GetCursorPosition()
{
- uint ret = NDalicManualPINVOKE.ImfManager_GetCursorPosition(swigCPtr);
+ uint ret = NDalicManualPINVOKE.InputMethodContext_GetCursorPosition(swigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
/// <since_tizen> 3 </since_tizen>
public void SetSurroundingText(string text)
{
- NDalicManualPINVOKE.ImfManager_SetSurroundingText(swigCPtr, text);
+ NDalicManualPINVOKE.InputMethodContext_SetSurroundingText(swigCPtr, text);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
/// <since_tizen> 3 </since_tizen>
public string GetSurroundingText()
{
- string ret = NDalicManualPINVOKE.ImfManager_GetSurroundingText(swigCPtr);
+ string ret = NDalicManualPINVOKE.InputMethodContext_GetSurroundingText(swigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
/// <since_tizen> 3 </since_tizen>
public void NotifyTextInputMultiLine(bool multiLine)
{
- NDalicManualPINVOKE.ImfManager_NotifyTextInputMultiLine(swigCPtr, multiLine);
+ NDalicManualPINVOKE.InputMethodContext_NotifyTextInputMultiLine(swigCPtr, multiLine);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
/// <since_tizen> 3 </since_tizen>
public ImfManager.TextDirection GetTextDirection()
{
- ImfManager.TextDirection ret = (ImfManager.TextDirection)NDalicManualPINVOKE.ImfManager_GetTextDirection(swigCPtr);
+ ImfManager.TextDirection ret = (ImfManager.TextDirection)NDalicManualPINVOKE.InputMethodContext_GetTextDirection(swigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
/// <since_tizen> 3 </since_tizen>
public Rectangle GetInputMethodArea()
{
- Rectangle ret = new Rectangle(NDalicManualPINVOKE.ImfManager_GetInputMethodArea(swigCPtr), true);
+ Rectangle ret = new Rectangle(NDalicManualPINVOKE.InputMethodContext_GetInputMethodArea(swigCPtr), true);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
- internal void ApplyOptions(InputMethodOptions options)
- {
- NDalicManualPINVOKE.ImfManager_ApplyOptions(swigCPtr, InputMethodOptions.getCPtr(options));
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- }
-
/// <summary>
/// Sets up the input-panel specific data.
/// </summary>
/// <since_tizen> 3 </since_tizen>
public void SetInputPanelUserData(string text)
{
- NDalicManualPINVOKE.ImfManager_SetInputPanelUserData(swigCPtr, text);
+ NDalicManualPINVOKE.InputMethodContext_SetInputPanelUserData(swigCPtr, text);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
/// <since_tizen> 4 </since_tizen>
public void GetInputPanelUserData(out string text)
{
- NDalicManualPINVOKE.ImfManager_GetInputPanelUserData(swigCPtr, out text);
+ NDalicManualPINVOKE.InputMethodContext_GetInputPanelUserData(swigCPtr, out text);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
/// <since_tizen> 3 </since_tizen>
public ImfManager.State GetInputPanelState()
{
- ImfManager.State ret = (ImfManager.State)NDalicManualPINVOKE.ImfManager_GetInputPanelState(swigCPtr);
+ ImfManager.State ret = (ImfManager.State)NDalicManualPINVOKE.InputMethodContext_GetInputPanelState(swigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
/// <since_tizen> 3 </since_tizen>
public void SetReturnKeyState(bool visible)
{
- NDalicManualPINVOKE.ImfManager_SetReturnKeyState(swigCPtr, visible);
+ NDalicManualPINVOKE.InputMethodContext_SetReturnKeyState(swigCPtr, visible);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
/// <since_tizen> 3 </since_tizen>
public void AutoEnableInputPanel(bool enabled)
{
- NDalicManualPINVOKE.ImfManager_AutoEnableInputPanel(swigCPtr, enabled);
+ NDalicManualPINVOKE.InputMethodContext_AutoEnableInputPanel(swigCPtr, enabled);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
/// <since_tizen> 3 </since_tizen>
public void ShowInputPanel()
{
- NDalicManualPINVOKE.ImfManager_ShowInputPanel(swigCPtr);
+ NDalicManualPINVOKE.InputMethodContext_ShowInputPanel(swigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
/// <since_tizen> 3 </since_tizen>
public void HideInputPanel()
{
- NDalicManualPINVOKE.ImfManager_HideInputPanel(swigCPtr);
+ NDalicManualPINVOKE.InputMethodContext_HideInputPanel(swigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
/// <since_tizen> 4 </since_tizen>
public ImfManager.KeyboardType GetKeyboardType()
{
- ImfManager.KeyboardType ret = (ImfManager.KeyboardType)NDalicManualPINVOKE.ImfManager_GetKeyboardType(swigCPtr);
+ ImfManager.KeyboardType ret = (ImfManager.KeyboardType)NDalicManualPINVOKE.InputMethodContext_GetKeyboardType(swigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
/// <since_tizen> 4 </since_tizen>
public string GetInputPanelLocale()
{
- string ret = NDalicManualPINVOKE.ImfManager_GetInputPanelLocale(swigCPtr);
+ string ret = NDalicManualPINVOKE.InputMethodContext_GetInputPanelLocale(swigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
- /// <summary>
- /// The constructor.
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- public ImfManager() : this(NDalicManualPINVOKE.new_ImfManager(), true)
+ internal ImfManager Assign(ImfManager imfManager)
{
+ ImfManager ret = new ImfManager(NDalicManualPINVOKE.InputMethodContext_Assign(swigCPtr, ImfManager.getCPtr(imfManager)), false);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
}
- /// <summary>
- /// ImfManager activated event arguments.
- /// </summary>
- //Please do not use! this will be deprecated
- /// <since_tizen> 3 </since_tizen>
- [EditorBrowsable(EditorBrowsableState.Never)]
- public class ImfManagerActivatedEventArgs : EventArgs
+ internal static ImfManager DownCast(BaseHandle handle)
{
- /// <summary>
- /// ImfManager
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- public ImfManager ImfManager
- {
- get;
- set;
- }
+ ImfManager ret = new ImfManager(NDalicManualPINVOKE.InputMethodContext_DownCast(BaseHandle.getCPtr(handle)), true);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
}
- [UnmanagedFunctionPointer(CallingConvention.StdCall)]
- private delegate void ImfManagerActivatedEventCallbackType(global::System.IntPtr data);
- private ImfManagerActivatedEventCallbackType _imfManagerActivatedEventCallback;
- private event EventHandler<ImfManagerActivatedEventArgs> _imfManagerActivatedEventHandler;
-
- /// <summary>
- /// ImfManager activated event.
- /// </summary>
- //Please do not use! this will be deprecated
- /// <since_tizen> 3 </since_tizen>
- [EditorBrowsable(EditorBrowsableState.Never)]
- public event EventHandler<ImfManagerActivatedEventArgs> ImfManagerActivated
+ internal void ApplyOptions(InputMethodOptions options)
{
- add
- {
- if (_imfManagerActivatedEventHandler == null)
- {
- _imfManagerActivatedEventCallback = OnImfManagerActivated;
- ActivatedSignal().Connect(_imfManagerActivatedEventCallback);
- }
-
- _imfManagerActivatedEventHandler += value;
- }
- remove
- {
- _imfManagerActivatedEventHandler -= value;
-
- if (_imfManagerActivatedEventHandler == null && _imfManagerActivatedEventCallback != null)
- {
- ActivatedSignal().Disconnect(_imfManagerActivatedEventCallback);
- }
- }
+ NDalicManualPINVOKE.InputMethodContext_ApplyOptions(swigCPtr, InputMethodOptions.getCPtr(options));
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
- private void OnImfManagerActivated(global::System.IntPtr data)
+ internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ImfManager obj)
{
- ImfManagerActivatedEventArgs e = new ImfManagerActivatedEventArgs();
-
- if (data != null)
- {
- e.ImfManager = Registry.GetManagedBaseHandleFromNativePtr(data) as ImfManager;
- }
-
- if (_imfManagerActivatedEventHandler != null)
- {
- _imfManagerActivatedEventHandler(this, e);
- }
+ return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
}
- /// <summary>
- /// ImfManager activated event arguments.
- /// </summary>
- /// <since_tizen> 4 </since_tizen>
- public class ActivatedEventArgs : EventArgs
+ internal ActivatedSignalType ActivatedSignal()
{
- /// <summary>
- /// ImfManager
- /// </summary>
- /// <since_tizen> 4 </since_tizen>
- public ImfManager ImfManager
- {
- get;
- set;
- }
+ ActivatedSignalType ret = new ActivatedSignalType(NDalicManualPINVOKE.InputMethodContext_ActivatedSignal(swigCPtr), false);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
}
- [UnmanagedFunctionPointer(CallingConvention.StdCall)]
- private delegate void ActivatedEventCallbackType(IntPtr data);
- private ActivatedEventCallbackType _activatedEventCallback;
- private event EventHandler<ActivatedEventArgs> _activatedEventHandler;
-
- /// <summary>
- /// ImfManager activated.
- /// </summary>
- /// <since_tizen> 4 </since_tizen>
- public event EventHandler<ActivatedEventArgs> Activated
+ internal KeyboardEventSignalType EventReceivedSignal()
{
- add
- {
- if (_activatedEventHandler == null)
- {
- _activatedEventCallback = OnActivated;
- ActivatedSignal().Connect(_activatedEventCallback);
- }
-
- _activatedEventHandler += value;
- }
- remove
- {
- _activatedEventHandler -= value;
-
- if (_activatedEventHandler == null && _activatedEventCallback != null)
- {
- ActivatedSignal().Disconnect(_activatedEventCallback);
- }
- }
+ KeyboardEventSignalType ret = new KeyboardEventSignalType(NDalicManualPINVOKE.InputMethodContext_EventReceivedSignal(swigCPtr), false);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
}
- private void OnActivated(IntPtr data)
+ internal StatusSignalType StatusChangedSignal()
{
- ActivatedEventArgs e = new ActivatedEventArgs();
-
- if (data != null)
- {
- e.ImfManager = Registry.GetManagedBaseHandleFromNativePtr(data) as ImfManager;
- }
-
- if (_activatedEventHandler != null)
- {
- _activatedEventHandler(this, e);
- }
+ StatusSignalType ret = new StatusSignalType(NDalicManualPINVOKE.InputMethodContext_StatusChangedSignal(swigCPtr), false);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
}
- /// <summary>
- /// ImfManager activated signal.
- /// </summary>
- //Please do not use! this will be internal
- /// <since_tizen> 3 </since_tizen>
- [EditorBrowsable(EditorBrowsableState.Never)]
- public ActivatedSignalType ActivatedSignal()
+ internal KeyboardResizedSignalType ResizedSignal()
{
- ActivatedSignalType ret = new ActivatedSignalType(NDalicManualPINVOKE.ImfManager_ActivatedSignal(swigCPtr), false);
+ KeyboardResizedSignalType ret = new KeyboardResizedSignalType(NDalicManualPINVOKE.InputMethodContext_ResizedSignal(swigCPtr), false);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
- /// <summary>
- /// ImfManager event received event arguments.
- /// </summary>
- //Please do not use! this will be deprecated
- /// <since_tizen> 3 </since_tizen>
- [EditorBrowsable(EditorBrowsableState.Never)]
- public class ImfManagerEventReceivedEventArgs : EventArgs
+ internal LanguageChangedSignalType LanguageChangedSignal()
{
- /// <summary>
- /// ImfManager
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- public ImfManager ImfManager
- {
- get;
- set;
- }
+ LanguageChangedSignalType ret = new LanguageChangedSignalType(NDalicManualPINVOKE.InputMethodContext_LanguageChangedSignal(swigCPtr), false);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
}
- private delegate void ImfManagerEventReceivedEventCallbackType(global::System.IntPtr data);
- private ImfManagerEventReceivedEventCallbackType _imfManagerEventReceivedEventCallback;
- private event EventHandler<ImfManagerEventReceivedEventArgs> _imfManagerEventReceivedEventHandler;
+ internal KeyboardTypeSignalType KeyboardTypeChangedSignal()
+ {
+ KeyboardTypeSignalType ret = new KeyboardTypeSignalType(NDalicManualPINVOKE.InputMethodContext_KeyboardTypeChangedSignal(swigCPtr), false);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
/// <summary>
- /// ImfManager event received.
+ /// Dispose.
/// </summary>
- //Please do not use! this will be deprecated
+ /// <param name="type">Dispose Type</param>
/// <since_tizen> 3 </since_tizen>
+ /// Please DO NOT use! This will be deprecated!
+ /// Dispose() method in Singletone classes (ex: FocusManager, StyleManager, VisualFactory, ImfManager, TtsPlayer, Window) is not required.
[EditorBrowsable(EditorBrowsableState.Never)]
- public event EventHandler<ImfManagerEventReceivedEventArgs> ImfManagerEventReceived
+ protected override void Dispose(DisposeTypes type)
{
- add
- {
- if (_imfManagerEventReceivedEventHandler == null)
- {
- _imfManagerEventReceivedEventCallback = OnImfManagerEventReceived;
- EventReceivedSignal().Connect(_imfManagerEventReceivedEventCallback);
- }
-
- _imfManagerEventReceivedEventHandler += value;
- }
- remove
+ if (disposed)
{
- _imfManagerEventReceivedEventHandler -= value;
-
- if (_imfManagerEventReceivedEventHandler == null && _imfManagerEventReceivedEventCallback != null)
- {
- EventReceivedSignal().Disconnect(_imfManagerEventReceivedEventCallback);
- }
+ return;
}
- }
-
- private void OnImfManagerEventReceived(global::System.IntPtr data)
- {
- ImfManagerEventReceivedEventArgs e = new ImfManagerEventReceivedEventArgs();
- if (data != null)
+ if (type == DisposeTypes.Explicit)
{
- e.ImfManager = Registry.GetManagedBaseHandleFromNativePtr(data) as ImfManager;
- }
+ //Called by User
+ //Release your own managed resources here.
+ //You should release all of your own disposable objects here.
- if (_imfManagerEventReceivedEventHandler != null)
- {
- _imfManagerEventReceivedEventHandler(this, e);
}
- }
- /// <summary>
- /// ImfManager event received event arguments.
- /// </summary>
- /// <since_tizen> 4 </since_tizen>
- public class EventReceivedEventArgs : EventArgs
- {
- /// <summary>
- /// ImfManager
- /// </summary>
- /// <since_tizen> 4 </since_tizen>
- public ImfManager ImfManager
- {
- get;
- set;
- }
+ //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.
- /// <summary>
- /// ImfEventData
- /// </summary>
- /// <since_tizen> 4 </since_tizen>
- public ImfEventData ImfEventData
+ if (_keyboardTypeChangedEventCallback != null)
{
- get;
- set;
+ KeyboardTypeChangedSignal().Disconnect(_keyboardTypeChangedEventCallback);
}
- }
-
- private delegate IntPtr EventReceivedEventCallbackType(IntPtr imfManager, IntPtr imfEventData);
- private EventReceivedEventCallbackType _eventReceivedEventCallback;
- private event EventHandlerWithReturnType<object, EventReceivedEventArgs, ImfCallbackData> _eventReceivedEventHandler;
- /// <summary>
- /// ImfManager event received.
- /// </summary>
- /// <since_tizen> 4 </since_tizen>
- public event EventHandlerWithReturnType<object, EventReceivedEventArgs, ImfCallbackData> EventReceived
- {
- add
+ if (swigCPtr.Handle != global::System.IntPtr.Zero)
{
- if (_eventReceivedEventHandler == null)
+ if (swigCMemOwn)
{
- _eventReceivedEventCallback = OnEventReceived;
- EventReceivedSignal().Connect(_eventReceivedEventCallback);
+ swigCMemOwn = false;
+ NDalicManualPINVOKE.delete_InputMethodContext(swigCPtr);
}
-
- _eventReceivedEventHandler += value;
+ swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero);
}
- remove
+
+ base.Dispose(type);
+ }
+
+ private void OnActivated(IntPtr data)
+ {
+ ActivatedEventArgs e = new ActivatedEventArgs();
+
+ if (data != null)
{
- _eventReceivedEventHandler -= value;
+ e.ImfManager = Registry.GetManagedBaseHandleFromNativePtr(data) as ImfManager;
+ }
- if (_eventReceivedEventHandler == null && _eventReceivedEventCallback != null)
- {
- EventReceivedSignal().Disconnect(_eventReceivedEventCallback);
- }
+ if (_activatedEventHandler != null)
+ {
+ _activatedEventHandler(this, e);
}
}
}
}
- /// <summary>
- /// ImfManager event received signal.
- /// </summary>
- //Please do not use! this will be internal
- /// <since_tizen> 3 </since_tizen>
- [EditorBrowsable(EditorBrowsableState.Never)]
- public ImfEventSignalType EventReceivedSignal()
+ private void OnStatusChanged(bool statusChanged)
{
- ImfEventSignalType ret = new ImfEventSignalType(NDalicManualPINVOKE.ImfManager_EventReceivedSignal(swigCPtr), false);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
+ StatusChangedEventArgs e = new StatusChangedEventArgs();
+
+ e.StatusChanged = statusChanged;
+
+ if (_statusChangedEventHandler != null)
+ {
+ _statusChangedEventHandler(this, e);
+ }
}
- /// <summary>
- /// ImfManager status changed event arguments.
- /// </summary>
- //Please do not use! this will be deprecated
- /// <since_tizen> 3 </since_tizen>
- [EditorBrowsable(EditorBrowsableState.Never)]
- public class ImfManagerStatusChangedEventArgs : EventArgs
+ private void OnResized(int resized)
{
- /// <summary>
- /// ImfManager
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- public ImfManager ImfManager
+ ResizedEventArgs e = new ResizedEventArgs();
+ e.Resized = resized;
+
+ if (_resizedEventHandler != null)
{
- get;
- set;
+ _resizedEventHandler(this, e);
+ }
+ }
+
+ private void OnLanguageChanged(int languageChanged)
+ {
+ LanguageChangedEventArgs e = new LanguageChangedEventArgs();
+ e.LanguageChanged = languageChanged;
+
+ if (_languageChangedEventHandler != null)
+ {
+ _languageChangedEventHandler(this, e);
}
}
- private delegate void ImfManagerStatusChangedEventCallbackType(global::System.IntPtr data);
- private ImfManagerStatusChangedEventCallbackType _imfManagerStatusChangedEventCallback;
- private event EventHandler<ImfManagerStatusChangedEventArgs> _imfManagerStatusChangedEventHandler;
+ private void OnKeyboardTypeChanged(KeyboardType type)
+ {
+ KeyboardTypeChangedEventArgs e = new KeyboardTypeChangedEventArgs();
+
+ e.KeyboardType = type;
+
+ if (_keyboardTypeChangedEventHandler != null)
+ {
+ _keyboardTypeChangedEventHandler(this, e);
+ }
+ }
/// <summary>
- /// ImfManager status changed.
+ /// This structure is used to pass on data from the IMF regarding predictive text.
/// </summary>
- //Please do not use! this will be deprecated
/// <since_tizen> 3 </since_tizen>
- [EditorBrowsable(EditorBrowsableState.Never)]
- public event EventHandler<ImfManagerStatusChangedEventArgs> ImfManagerStatusChanged
+ public class ImfEventData : global::System.IDisposable
{
- add
+ /// <summary>
+ /// swigCMemOwn
+ /// </summary>
+ /// <since_tizen> 3 </since_tizen>
+ protected bool swigCMemOwn;
+
+ /// <summary>
+ /// A Flat to check if it is already disposed.
+ /// </summary>
+ /// <since_tizen> 3 </since_tizen>
+ 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;
+
+ /// <summary>
+ /// The default constructor.
+ /// </summary>
+ /// <since_tizen> 3 </since_tizen>
+ public ImfEventData() : this(NDalicManualPINVOKE.new_InputMethodContext_EventData__SWIG_0(), true)
{
- if (_imfManagerStatusChangedEventHandler == null)
- {
- _imfManagerStatusChangedEventCallback = OnImfManagerStatusChanged;
- StatusChangedSignal().Connect(_imfManagerStatusChangedEventCallback);
- }
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
- _imfManagerStatusChangedEventHandler += value;
+ /// <summary>
+ /// The constructor.
+ /// </summary>
+ /// <param name="aEventName">The name of the event from the IMF.</param>
+ /// <param name="aPredictiveString">The pre-edit or the commit string.</param>
+ /// <param name="aCursorOffset">Start the position from the current cursor position to start deleting characters.</param>
+ /// <param name="aNumberOfChars">The number of characters to delete from the cursorOffset.</param>
+ /// <since_tizen> 3 </since_tizen>
+ public ImfEventData(ImfManager.ImfEvent 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();
}
- remove
+
+ internal ImfEventData(IntPtr cPtr, bool cMemoryOwn)
{
- _imfManagerStatusChangedEventHandler -= value;
+ swigCMemOwn = cMemoryOwn;
+ swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
+ }
- if (_imfManagerStatusChangedEventHandler == null && _imfManagerStatusChangedEventCallback != null)
+ /// <summary>
+ /// Dispose.
+ /// </summary>
+ /// <since_tizen> 3 </since_tizen>
+ ~ImfEventData()
+ {
+ if (!isDisposeQueued)
{
- StatusChangedSignal().Disconnect(_imfManagerStatusChangedEventCallback);
+ isDisposeQueued = true;
+ DisposeQueue.Instance.Add(this);
}
}
- }
- private void OnImfManagerStatusChanged(global::System.IntPtr data)
- {
- ImfManagerStatusChangedEventArgs e = new ImfManagerStatusChangedEventArgs();
+ /// <summary>
+ /// The pre-edit or the commit string.
+ /// </summary>
+ /// <since_tizen> 4 </since_tizen>
+ 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;
+ }
+ }
- if (data != null)
+ /// <summary>
+ /// The name of the event from the IMF.
+ /// </summary>
+ /// <since_tizen> 4 </since_tizen>
+ public ImfManager.ImfEvent EventName
{
- e.ImfManager = Registry.GetManagedBaseHandleFromNativePtr(data) as ImfManager;
+ set
+ {
+ NDalicManualPINVOKE.InputMethodContext_EventData_eventName_set(swigCPtr, (int)value);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+ get
+ {
+ ImfManager.ImfEvent ret = (ImfManager.ImfEvent)NDalicManualPINVOKE.InputMethodContext_EventData_eventName_get(swigCPtr);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
}
- if (_imfManagerStatusChangedEventHandler != null)
+ /// <summary>
+ /// The start position from the current cursor position to start deleting characters.
+ /// </summary>
+ /// <since_tizen> 4 </since_tizen>
+ public int CursorOffset
{
- _imfManagerStatusChangedEventHandler(this, e);
+ 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;
+ }
}
- }
- /// <summary>
- /// ImfManager status changed event arguments.
- /// </summary>
- /// <since_tizen> 4 </since_tizen>
- public class StatusChangedEventArgs : EventArgs
- {
/// <summary>
- /// ImfManager status
+ /// The number of characters to delete from the cursorOffset.
/// </summary>
/// <since_tizen> 4 </since_tizen>
- public bool StatusChanged
+ public int NumberOfChars
{
- get;
- set;
+ 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;
+ }
}
- }
- private delegate void StatusChangedEventCallbackType(bool statusChanged);
- private StatusChangedEventCallbackType _statusChangedEventCallback;
- private event EventHandler<StatusChangedEventArgs> _statusChangedEventHandler;
+ /// <summary>
+ /// The dispose pattern.
+ /// </summary>
+ /// <since_tizen> 3 </since_tizen>
+ 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.");
+ }
- /// <summary>
- /// ImfManager status changed.
- /// </summary>
- /// <since_tizen> 4 </since_tizen>
- public event EventHandler<StatusChangedEventArgs> StatusChanged
- {
- add
+ if (isDisposeQueued)
+ {
+ Dispose(DisposeTypes.Implicit);
+ }
+ else
+ {
+ Dispose(DisposeTypes.Explicit);
+ System.GC.SuppressFinalize(this);
+ }
+ }
+
+ internal static ImfEventData GetImfEventDataFromPtr(IntPtr cPtr)
+ {
+ ImfEventData ret = new ImfEventData(cPtr, false);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
+
+ internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ImfEventData obj)
+ {
+ return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+ }
+
+ /// <summary>
+ /// Dispose.
+ /// </summary>
+ /// <since_tizen> 3 </since_tizen>
+ protected virtual void Dispose(DisposeTypes type)
{
- if (_statusChangedEventHandler == null)
+ if (disposed)
{
- _statusChangedEventCallback = OnStatusChanged;
- StatusChangedSignal().Connect(_statusChangedEventCallback);
+ return;
}
- _statusChangedEventHandler += value;
- }
- remove
- {
- _statusChangedEventHandler -= value;
-
- if (_statusChangedEventHandler == null && _statusChangedEventCallback != null)
+ if (type == DisposeTypes.Explicit)
{
- StatusChangedSignal().Disconnect(_statusChangedEventCallback);
+ //Called by User
+ //Release your own managed resources here.
+ //You should release all of your own disposable objects here.
+
}
- }
- }
- private void OnStatusChanged(bool statusChanged)
- {
- StatusChangedEventArgs e = new StatusChangedEventArgs();
+ //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.
- e.StatusChanged = statusChanged;
+ if (swigCPtr.Handle != IntPtr.Zero)
+ {
+ if (swigCMemOwn)
+ {
+ swigCMemOwn = false;
+ NDalicManualPINVOKE.delete_InputMethodContext_EventData(swigCPtr);
+ }
+ swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero);
+ }
- if (_statusChangedEventHandler != null)
- {
- _statusChangedEventHandler(this, e);
+ disposed = true;
}
}
/// <summary>
- /// ImfManager status changed signal.
+ /// Data required by the IMF from the callback.
/// </summary>
- //Please do not use! this will be internal
/// <since_tizen> 3 </since_tizen>
- [EditorBrowsable(EditorBrowsableState.Never)]
- public StatusSignalType StatusChangedSignal()
+ public class ImfCallbackData : global::System.IDisposable
{
- StatusSignalType ret = new StatusSignalType(NDalicManualPINVOKE.ImfManager_StatusChangedSignal(swigCPtr), false);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
- }
+ /// <summary>
+ /// swigCMemOwn
+ /// </summary>
+ /// <since_tizen> 3 </since_tizen>
+ protected bool swigCMemOwn;
- /// <summary>
- /// ImfManager resized event arguments.
- /// </summary>
- //Please do not use! this will be deprecated
- /// <since_tizen> 3 </since_tizen>
- [EditorBrowsable(EditorBrowsableState.Never)]
- public class ImfManagerResizedEventArgs : EventArgs
- {
/// <summary>
- /// ImfManager
+ /// A Flat to check if it is already disposed.
/// </summary>
/// <since_tizen> 3 </since_tizen>
- public ImfManager ImfManager
- {
- get;
- set;
- }
- }
+ protected bool disposed = false;
- private delegate void ImfManagerResizedEventCallbackType(IntPtr data);
- private ImfManagerResizedEventCallbackType _imfManagerResizedEventCallback;
- private event EventHandler<ImfManagerResizedEventArgs> _imfManagerResizedEventHandler;
+ private global::System.Runtime.InteropServices.HandleRef swigCPtr;
- /// <summary>
- /// ImfManager resized event.
- /// </summary>
- //Please do not use! this will be deprecated
- /// <since_tizen> 3 </since_tizen>
- [EditorBrowsable(EditorBrowsableState.Never)]
- public event EventHandler<ImfManagerResizedEventArgs> ImfManagerResized
- {
- add
- {
- if (_imfManagerResizedEventHandler == null)
- {
- _imfManagerResizedEventCallback = OnImfManagerResized;
- ResizedSignal().Connect(_imfManagerResizedEventCallback);
- }
+ //A Flag to check who called Dispose(). (By User or DisposeQueue)
+ private bool isDisposeQueued = false;
- _imfManagerResizedEventHandler += value;
- }
- remove
+ /// <summary>
+ /// The default constructor.
+ /// </summary>
+ /// <since_tizen> 3 </since_tizen>
+ public ImfCallbackData() : this(NDalicManualPINVOKE.new_InputMethodContext_CallbackData__SWIG_0(), true)
{
- _imfManagerResizedEventHandler -= value;
-
- if (_imfManagerResizedEventHandler == null && _imfManagerResizedEventCallback != null)
- {
- ResizedSignal().Disconnect(_imfManagerResizedEventCallback);
- }
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
- }
-
- private void OnImfManagerResized(IntPtr data)
- {
- ImfManagerResizedEventArgs e = new ImfManagerResizedEventArgs();
- if (data != null)
+ /// <summary>
+ /// The constructor.
+ /// </summary>
+ /// <param name="aUpdate">True if the cursor position needs to be updated.</param>
+ /// <param name="aCursorPosition">The new position of the cursor.</param>
+ /// <param name="aCurrentText">The current text string.</param>
+ /// <param name="aPreeditResetRequired">Flag if preedit reset is required.</param>
+ /// <since_tizen> 3 </since_tizen>
+ public ImfCallbackData(bool aUpdate, int aCursorPosition, string aCurrentText, bool aPreeditResetRequired) : this(NDalicManualPINVOKE.new_InputMethodContext_CallbackData__SWIG_1(aUpdate, aCursorPosition, aCurrentText, aPreeditResetRequired), true)
{
- e.ImfManager = Registry.GetManagedBaseHandleFromNativePtr(data) as ImfManager;
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
- if (_imfManagerResizedEventHandler != null)
+ internal ImfCallbackData(IntPtr cPtr, bool cMemoryOwn)
{
- _imfManagerResizedEventHandler(this, e);
+ swigCMemOwn = cMemoryOwn;
+ swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
}
- }
- /// <summary>
- /// ImfManager resized event.
- /// </summary>
- /// <since_tizen> 4 </since_tizen>
- public class ResizedEventArgs : EventArgs
- {
/// <summary>
- /// resized.
+ /// Dispose.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
- public int Resized
+ /// <since_tizen> 3 </since_tizen>
+ ~ImfCallbackData()
{
- get;
- set;
+ if (!isDisposeQueued)
+ {
+ isDisposeQueued = true;
+ DisposeQueue.Instance.Add(this);
+ }
}
- }
- private delegate void ResizedEventCallbackType(int resized);
- private ResizedEventCallbackType _resizedEventCallback;
- private event EventHandler<ResizedEventArgs> _resizedEventHandler;
-
- /// <summary>
- /// ImfManager resized.
- /// </summary>
- /// <since_tizen> 4 </since_tizen>
- public event EventHandler<ResizedEventArgs> Resized
- {
- add
+ /// <summary>
+ /// The current text string.
+ /// </summary>
+ /// <since_tizen> 4 </since_tizen>
+ public string CurrentText
{
- if (_resizedEventHandler == null)
+ set
{
- _resizedEventCallback = OnResized;
- ResizedSignal().Connect(_resizedEventCallback);
+ NDalicManualPINVOKE.InputMethodContext_CallbackData_currentText_set(swigCPtr, value);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
-
- _resizedEventHandler += value;
- }
- remove
- {
- _resizedEventHandler -= value;
-
- if (_resizedEventHandler == null && _resizedEventCallback != null)
+ get
{
- ResizedSignal().Disconnect(_resizedEventCallback);
+ string ret = NDalicManualPINVOKE.InputMethodContext_CallbackData_currentText_get(swigCPtr);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
}
}
- }
-
- private void OnResized(int resized)
- {
- ResizedEventArgs e = new ResizedEventArgs();
- e.Resized = resized;
- if (_resizedEventHandler != null)
+ /// <summary>
+ /// The current text string.
+ /// </summary>
+ /// <since_tizen> 4 </since_tizen>
+ public int CursorPosition
{
- _resizedEventHandler(this, e);
+ 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;
+ }
}
- }
-
- /// <summary>
- /// ImfManager resized signal.
- /// </summary>
- //Please do not use! this will be internal
- /// <since_tizen> 3 </since_tizen>
- [EditorBrowsable(EditorBrowsableState.Never)]
- public KeyboardResizedSignalType ResizedSignal()
- {
- KeyboardResizedSignalType ret = new KeyboardResizedSignalType(NDalicManualPINVOKE.ImfManager_ResizedSignal(swigCPtr), false);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
- }
- /// <summary>
- /// ImfManager language changed event arguments.
- /// </summary>
- //Please do not use! this will be deprecated
- /// <since_tizen> 3 </since_tizen>
- [EditorBrowsable(EditorBrowsableState.Never)]
- public class ImfManagerLanguageChangedEventArgs : EventArgs
- {
/// <summary>
- /// ImfManager
+ /// If the cursor position needs to be updated.
/// </summary>
- /// <since_tizen> 3 </since_tizen>
- public ImfManager ImfManager
+ /// <since_tizen> 4 </since_tizen>
+ public bool Update
{
- get;
- set;
+ 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;
+ }
}
- }
- private delegate void ImfManagerLanguageChangedEventCallbackType(IntPtr data);
- private ImfManagerLanguageChangedEventCallbackType _imfManagerLanguageChangedEventCallback;
- private event EventHandler<ImfManagerLanguageChangedEventArgs> _imfManagerLanguageChangedEventHandler;
-
- /// <summary>
- /// ImfManager language changed event.
- /// </summary>
- //Please do not use! this will be deprecated
- /// <since_tizen> 3 </since_tizen>
- [EditorBrowsable(EditorBrowsableState.Never)]
- public event EventHandler<ImfManagerLanguageChangedEventArgs> ImfManagerLanguageChanged
- {
- add
+ /// <summary>
+ /// Flags if preedit reset is required.
+ /// </summary>
+ /// <since_tizen> 4 </since_tizen>
+ public bool PreeditResetRequired
{
- if (_imfManagerLanguageChangedEventHandler == null)
+ set
{
- _imfManagerLanguageChangedEventCallback = OnImfManagerLanguageChanged;
- LanguageChangedSignal().Connect(_imfManagerLanguageChangedEventCallback);
+ 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;
}
-
- _imfManagerLanguageChangedEventHandler += value;
}
- remove
+
+ /// <summary>
+ /// The dispose pattern.
+ /// </summary>
+ /// <since_tizen> 3 </since_tizen>
+ public void Dispose()
{
- _imfManagerLanguageChangedEventHandler -= value;
+ //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 (_imfManagerLanguageChangedEventHandler == null && _imfManagerLanguageChangedEventCallback != null)
+ if (isDisposeQueued)
+ {
+ Dispose(DisposeTypes.Implicit);
+ }
+ else
{
- LanguageChangedSignal().Disconnect(_imfManagerLanguageChangedEventCallback);
+ Dispose(DisposeTypes.Explicit);
+ System.GC.SuppressFinalize(this);
}
}
- }
- private void OnImfManagerLanguageChanged(IntPtr data)
- {
- ImfManagerLanguageChangedEventArgs e = new ImfManagerLanguageChangedEventArgs();
+ internal IntPtr GetImfCallbackDataPtr()
+ {
+ return (IntPtr)swigCPtr;
+ }
- if (data != null)
+ internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ImfCallbackData obj)
{
- e.ImfManager = Registry.GetManagedBaseHandleFromNativePtr(data) as ImfManager;
+ return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
}
- if (_imfManagerLanguageChangedEventHandler != null)
+ internal static ImfCallbackData GetImfCallbackDataFromPtr(IntPtr cPtr)
{
- _imfManagerLanguageChangedEventHandler(this, e);
+ ImfCallbackData ret = new ImfCallbackData(cPtr, false);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
}
- }
- /// <summary>
- /// ImfManager language changed event args.
- /// </summary>
- /// <since_tizen> 4 </since_tizen>
- public class LanguageChangedEventArgs : EventArgs
- {
/// <summary>
- /// language changed.
+ /// Dispose.
/// </summary>
- /// <since_tizen> 4 </since_tizen>
- public int LanguageChanged
+ /// <since_tizen> 3 </since_tizen>
+ protected virtual void Dispose(DisposeTypes type)
{
- get;
- set;
- }
- }
-
- private delegate void LanguageChangedEventCallbackType(int languageChanged);
- private LanguageChangedEventCallbackType _languageChangedEventCallback;
- private event EventHandler<LanguageChangedEventArgs> _languageChangedEventHandler;
+ if (disposed)
+ {
+ return;
+ }
- /// <summary>
- /// ImfManager language changed.
- /// </summary>
- /// <since_tizen> 4 </since_tizen>
- public event EventHandler<LanguageChangedEventArgs> 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;
+ NDalicManualPINVOKE.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;
}
}
/// <summary>
- /// ImfManager language changed signal.
- /// </summary>
- //Please do not use! this will be internal
- /// <since_tizen> 3 </since_tizen>
- [EditorBrowsable(EditorBrowsableState.Never)]
- public LanguageChangedSignalType LanguageChangedSignal()
- {
- LanguageChangedSignalType ret = new LanguageChangedSignalType(NDalicManualPINVOKE.ImfManager_LanguageChangedSignal(swigCPtr), false);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
- }
-
- /// <summary>
- /// ImfManager keyboard type changed event arguments.
+ /// ImfManager activated event arguments.
/// </summary>
/// <since_tizen> 4 </since_tizen>
- public class KeyboardTypeChangedEventArgs : EventArgs
+ public class ActivatedEventArgs : EventArgs
{
/// <summary>
- /// ImfManager keyboard type
+ /// ImfManager
/// </summary>
/// <since_tizen> 4 </since_tizen>
- public KeyboardType KeyboardType
+ public ImfManager ImfManager
{
get;
set;
}
}
- private delegate void KeyboardTypeChangedEventCallbackType(KeyboardType type);
- private KeyboardTypeChangedEventCallbackType _keyboardTypeChangedEventCallback;
- private event EventHandler<KeyboardTypeChangedEventArgs> _keyboardTypeChangedEventHandler;
-
/// <summary>
- /// ImfManager keyboard type changed.
+ /// ImfManager event received event arguments.
/// </summary>
/// <since_tizen> 4 </since_tizen>
- public event EventHandler<KeyboardTypeChangedEventArgs> KeyboardTypeChanged
+ public class EventReceivedEventArgs : EventArgs
{
- add
- {
- if (_keyboardTypeChangedEventHandler == null)
- {
- _keyboardTypeChangedEventCallback = OnKeyboardTypeChanged;
- KeyboardTypeChangedSignal().Connect(_keyboardTypeChangedEventCallback);
- }
-
- _keyboardTypeChangedEventHandler += value;
- }
- remove
+ /// <summary>
+ /// ImfManager
+ /// </summary>
+ /// <since_tizen> 4 </since_tizen>
+ public ImfManager ImfManager
{
- _keyboardTypeChangedEventHandler -= value;
-
- if (_keyboardTypeChangedEventHandler == null && _keyboardTypeChangedEventCallback != null)
- {
- KeyboardTypeChangedSignal().Disconnect(_keyboardTypeChangedEventCallback);
- }
+ get;
+ set;
}
- }
-
- private void OnKeyboardTypeChanged(KeyboardType type)
- {
- KeyboardTypeChangedEventArgs e = new KeyboardTypeChangedEventArgs();
-
- e.KeyboardType = type;
- if (_keyboardTypeChangedEventHandler != null)
+ /// <summary>
+ /// ImfEventData
+ /// </summary>
+ /// <since_tizen> 4 </since_tizen>
+ public ImfEventData ImfEventData
{
- _keyboardTypeChangedEventHandler(this, e);
+ get;
+ set;
}
}
- internal KeyboardTypeSignalType KeyboardTypeChangedSignal()
- {
- KeyboardTypeSignalType ret = new KeyboardTypeSignalType(NDalicManualPINVOKE.ImfManager_KeyboardTypeChangedSignal(swigCPtr), false);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
- }
-
/// <summary>
- /// The direction of the text.
+ /// ImfManager status changed event arguments.
/// </summary>
- /// <since_tizen> 3 </since_tizen>
- public enum TextDirection
+ /// <since_tizen> 4 </since_tizen>
+ public class StatusChangedEventArgs : EventArgs
{
/// <summary>
- /// Left to right.
- /// </summary>
- LeftToRight,
- /// <summary>
- /// Right to left.
+ /// ImfManager status
/// </summary>
- RightToLeft
+ /// <since_tizen> 4 </since_tizen>
+ public bool StatusChanged
+ {
+ get;
+ set;
+ }
}
/// <summary>
- /// Events that are generated by the IMF.
+ /// ImfManager resized event.
/// </summary>
- /// <since_tizen> 3 </since_tizen>
- public enum ImfEvent
+ /// <since_tizen> 4 </since_tizen>
+ public class ResizedEventArgs : EventArgs
{
/// <summary>
- /// No event.
- /// </summary>
- /// <since_tizen> 4 </since_tizen>
- Void,
- /// <summary>
- /// Pre-Edit changed.
- /// </summary>
- /// <since_tizen> 4 </since_tizen>
- Preedit,
- /// <summary>
- /// Commit received.
- /// </summary>
- /// <since_tizen> 4 </since_tizen>
- Commit,
- /// <summary>
- /// An event to delete a range of characters from the string.
- /// </summary>
- /// <since_tizen> 4 </since_tizen>
- DeleteSurrounding,
- /// <summary>
- /// An event to query string and the cursor position.
- /// </summary>
- /// <since_tizen> 4 </since_tizen>
- GetSurrounding,
- /// <summary>
- /// Private command sent from the input panel.
+ /// resized.
/// </summary>
/// <since_tizen> 4 </since_tizen>
- PrivateCommand
+ public int Resized
+ {
+ get;
+ set;
+ }
}
/// <summary>
- /// Enumeration for the state of the input panel.
+ /// ImfManager language changed event args.
/// </summary>
- /// <since_tizen> 3 </since_tizen>
- public enum State
+ /// <since_tizen> 4 </since_tizen>
+ public class LanguageChangedEventArgs : EventArgs
{
/// <summary>
- /// Unknown state.
- /// </summary>
- /// <since_tizen> 4 </since_tizen>
- Default = 0,
- /// <summary>
- /// Input panel is shown.
- /// </summary>
- /// <since_tizen> 4 </since_tizen>
- Show,
- /// <summary>
- /// Input panel is hidden.
- /// </summary>
- /// <since_tizen> 4 </since_tizen>
- Hide,
- /// <summary>
- /// Input panel in process of being shown.
+ /// language changed.
/// </summary>
/// <since_tizen> 4 </since_tizen>
- WillShow
+ public int LanguageChanged
+ {
+ get;
+ set;
+ }
}
/// <summary>
- /// Enumeration for the types of keyboard.
+ /// ImfManager keyboard type changed event arguments.
/// </summary>
/// <since_tizen> 4 </since_tizen>
- public enum KeyboardType
+ public class KeyboardTypeChangedEventArgs : EventArgs
{
/// <summary>
- /// Software keyboard (virtual keyboard) is default.
- /// </summary>
- /// <since_tizen> 4 </since_tizen>
- SoftwareKeyboard,
- /// <summary>
- /// Hardware keyboard.
+ /// ImfManager keyboard type
/// </summary>
/// <since_tizen> 4 </since_tizen>
- HardwareKeyboard
+ public KeyboardType KeyboardType
+ {
+ get;
+ set;
+ }
}
}
}