-/** Copyright (c) 2017 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.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*
-*/
+/*
+ * 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
using System;
using System.Runtime.InteropServices;
using System.ComponentModel;
namespace Tizen.NUI
{
/// <summary>
- /// Specifically manages the ecore input method framework which enables the virtual or hardware keyboards.
+ /// 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();
}
- protected override void Dispose(DisposeTypes type)
+ internal ImfManager(IntPtr cPtr, bool cMemoryOwn) : base(NDalicManualPINVOKE.InputMethodContext_SWIGUpcast(cPtr), cMemoryOwn)
{
- 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.
-
- }
+ swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
+ }
- //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.
+ [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);
- if (_keyboardTypeChangedEventCallback != null)
+ /// <summary>
+ /// ImfManager activated.
+ /// </summary>
+ /// <since_tizen> 4 </since_tizen>
+ public event EventHandler<ActivatedEventArgs> Activated
+ {
+ add
{
- KeyboardTypeChangedSignal().Disconnect(_keyboardTypeChangedEventCallback);
- }
+ if (_activatedEventHandler == null)
+ {
+ _activatedEventCallback = OnActivated;
+ ActivatedSignal().Connect(_activatedEventCallback);
+ }
- if (_imfManagerLanguageChangedEventCallback != null)
- {
- LanguageChangedSignal().Disconnect(_imfManagerLanguageChangedEventCallback);
+ _activatedEventHandler += value;
}
-
- if (_imfManagerResizedEventCallback != null)
+ remove
{
- ResizedSignal().Disconnect(_imfManagerResizedEventCallback);
- }
+ _activatedEventHandler -= value;
- if (_imfManagerStatusChangedEventCallback != null)
- {
- StatusChangedSignal().Disconnect(_imfManagerStatusChangedEventCallback);
+ if (_activatedEventHandler == null && _activatedEventCallback != null)
+ {
+ ActivatedSignal().Disconnect(_activatedEventCallback);
+ }
}
+ }
- if (_imfManagerEventReceivedEventCallback != null)
+ /// <summary>
+ /// ImfManager event received.
+ /// </summary>
+ /// <since_tizen> 4 </since_tizen>
+ public event EventHandlerWithReturnType<object, EventReceivedEventArgs, ImfCallbackData> EventReceived
+ {
+ add
{
- EventReceivedSignal().Disconnect(_imfManagerEventReceivedEventCallback);
- }
+ if (_eventReceivedEventHandler == null)
+ {
+ _eventReceivedEventCallback = OnEventReceived;
+ EventReceivedSignal().Connect(_eventReceivedEventCallback);
+ }
- if (_imfManagerActivatedEventCallback != null)
- {
- ActivatedSignal().Disconnect(_imfManagerActivatedEventCallback);
+ _eventReceivedEventHandler += value;
}
-
- if (swigCPtr.Handle != global::System.IntPtr.Zero)
+ remove
{
- if (swigCMemOwn)
+ _eventReceivedEventHandler -= value;
+
+ if (_eventReceivedEventHandler == null && _eventReceivedEventCallback != null)
{
- swigCMemOwn = false;
- NDalicManualPINVOKE.delete_ImfManager(swigCPtr);
+ EventReceivedSignal().Disconnect(_eventReceivedEventCallback);
}
- 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 status changed.
/// </summary>
- public class ImfEventData : global::System.IDisposable
+ /// <since_tizen> 4 </since_tizen>
+ public event EventHandler<StatusChangedEventArgs> StatusChanged
{
- private global::System.Runtime.InteropServices.HandleRef swigCPtr;
- protected bool swigCMemOwn;
-
- internal ImfEventData(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(ImfEventData obj)
- {
- return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+ _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.
- protected bool disposed = false;
-
-
- ~ImfEventData()
+ remove
{
- if (!isDisposeQueued)
+ _statusChangedEventHandler -= value;
+
+ if (_statusChangedEventHandler == null && _statusChangedEventCallback != null)
{
- isDisposeQueued = true;
- DisposeQueue.Instance.Add(this);
+ StatusChangedSignal().Disconnect(_statusChangedEventCallback);
}
}
+ }
- /// <summary>
- /// The dispose pattern.
- /// </summary>
- public void Dispose()
+ /// <summary>
+ /// ImfManager resized.
+ /// </summary>
+ /// <since_tizen> 4 </since_tizen>
+ public event EventHandler<ResizedEventArgs> Resized
+ {
+ add
{
- //Throw excpetion if Dispose() is called in separate thread.
- if (!Window.IsInstalled())
+ if (_resizedEventHandler == null)
{
- throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread.");
+ _resizedEventCallback = OnResized;
+ ResizedSignal().Connect(_resizedEventCallback);
}
- if (isDisposeQueued)
- {
- Dispose(DisposeTypes.Implicit);
- }
- else
+ _resizedEventHandler += value;
+ }
+ remove
+ {
+ _resizedEventHandler -= value;
+
+ if (_resizedEventHandler == null && _resizedEventCallback != null)
{
- Dispose(DisposeTypes.Explicit);
- System.GC.SuppressFinalize(this);
+ ResizedSignal().Disconnect(_resizedEventCallback);
}
}
+ }
- protected virtual void Dispose(DisposeTypes type)
+ /// <summary>
+ /// ImfManager language changed.
+ /// </summary>
+ /// <since_tizen> 4 </since_tizen>
+ public event EventHandler<LanguageChangedEventArgs> LanguageChanged
+ {
+ add
{
- if (disposed)
+ if (_languageChangedEventHandler == null)
{
- return;
+ _languageChangedEventCallback = OnLanguageChanged;
+ LanguageChangedSignal().Connect(_languageChangedEventCallback);
}
- if (type == DisposeTypes.Explicit)
- {
- //Called by User
- //Release your own managed resources here.
- //You should release all of your own disposable objects here.
+ _languageChangedEventHandler += value;
+ }
+ remove
+ {
+ _languageChangedEventHandler -= value;
+ if (_languageChangedEventHandler == null && _languageChangedEventCallback != null)
+ {
+ LanguageChangedSignal().Disconnect(_languageChangedEventCallback);
}
+ }
+ }
- //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)
+ /// <summary>
+ /// ImfManager keyboard type changed.
+ /// </summary>
+ /// <since_tizen> 4 </since_tizen>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public event EventHandler<KeyboardTypeChangedEventArgs> KeyboardTypeChanged
+ {
+ add
+ {
+ if (_keyboardTypeChangedEventHandler == null)
{
- if (swigCMemOwn)
- {
- swigCMemOwn = false;
- NDalicManualPINVOKE.delete_ImfManager_ImfEventData(swigCPtr);
- }
- swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero);
+ _keyboardTypeChangedEventCallback = OnKeyboardTypeChanged;
+ KeyboardTypeChangedSignal().Connect(_keyboardTypeChangedEventCallback);
}
- disposed = true;
+ _keyboardTypeChangedEventHandler += value;
}
-
- internal static ImfEventData GetImfEventDataFromPtr(IntPtr cPtr)
+ remove
{
- ImfEventData ret = new ImfEventData(cPtr, false);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
+ _keyboardTypeChangedEventHandler -= value;
+
+ if (_keyboardTypeChangedEventHandler == null && _keyboardTypeChangedEventCallback != null)
+ {
+ KeyboardTypeChangedSignal().Disconnect(_keyboardTypeChangedEventCallback);
+ }
}
+ }
+
+ 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 default constructor.
+ /// Left to right.
/// </summary>
- public ImfEventData() : this(NDalicManualPINVOKE.new_ImfManager_ImfEventData__SWIG_0(), true)
- {
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- }
-
+ LeftToRight,
/// <summary>
- /// The constructor.
+ /// Right to left.
/// </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>
- 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();
- }
+ 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>
- //Please do not use! this will be deprecated
- [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;
- }
- }
-
- /// <summary>
- /// The pre-edit or the commit string.
- /// </summary>
- 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
- [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;
- }
- }
-
+ /// <since_tizen> 4 </since_tizen>
+ Void,
/// <summary>
- /// The name of the event from the IMF.
+ /// Pre-Edit changed.
/// </summary>
- 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;
- }
- }
-
+ /// <since_tizen> 4 </since_tizen>
+ 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
- [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>
- 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>
+ 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
- [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>
- 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>
+ PrivateCommand
}
/// <summary>
- /// Data required by the IMF from the callback.
+ /// Enumeration for the state of the input panel.
/// </summary>
- public class ImfCallbackData : global::System.IDisposable
+ /// <since_tizen> 3 </since_tizen>
+ public enum State
{
- private global::System.Runtime.InteropServices.HandleRef swigCPtr;
- 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;
- //A Flat to check if it is already disposed.
- protected bool disposed = false;
-
-
- ~ImfCallbackData()
- {
- if (!isDisposeQueued)
- {
- isDisposeQueued = true;
- DisposeQueue.Instance.Add(this);
- }
- }
-
- /// <summary>
- /// The dispose pattern.
- /// </summary>
- 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);
- }
- }
-
- 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>
- 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>
- 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
- [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>
- 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;
- }
- }
-
+ /// <since_tizen> 4 </since_tizen>
+ Default = 0,
/// <summary>
- /// The current text string.
+ /// Input panel is shown.
/// </summary>
- //Please do not use! this will be deprecated
- [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;
- }
- }
-
+ /// <since_tizen> 4 </since_tizen>
+ Show,
/// <summary>
- /// The current text string.
+ /// Input panel is hidden.
/// </summary>
- 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;
- }
- }
-
+ /// <since_tizen> 4 </since_tizen>
+ Hide,
/// <summary>
- /// If the cursor position needs to be updated.
+ /// Input panel in process of being shown.
/// </summary>
- //Please do not use! this will be deprecated
- [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>
+ WillShow
+ }
+ /// <summary>
+ /// Enumeration for the types of keyboard.
+ /// </summary>
+ /// <since_tizen> 4 </since_tizen>
+ public enum KeyboardType
+ {
/// <summary>
- /// If the cursor position needs to be updated.
+ /// Software keyboard (virtual keyboard) is default.
/// </summary>
- 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>
+ SoftwareKeyboard,
/// <summary>
- /// Flags if preedit reset is required.
+ /// Hardware keyboard.
/// </summary>
- //Please do not use! this will be deprecated
- [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>
+ HardwareKeyboard
+ }
- /// <summary>
- /// Flags if preedit reset is required.
- /// </summary>
- public bool PreeditResetRequired
+ /// <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()
{
- ImfManager ret = new ImfManager(NDalicManualPINVOKE.ImfManager_Get(), true);
+ return new ImfManager();
+ }
+
+ /// <summary>
+ /// Destroys the context of the IMF.<br/>
+ /// </summary>
+ /// <since_tizen> 5 </since_tizen>
+ public void DestroyContext()
+ {
+ NDalicManualPINVOKE.InputMethodContext_Finalize(swigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
}
/// <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();
+ }
+#pragma warning restore 0465
+
+ /// <summary>
/// Activates the IMF.<br/>
/// It means that the text editing is started somewhere.<br/>
/// If the hardware keyboard isn't connected, then it will show the virtual keyboard.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public void Activate()
{
- NDalicManualPINVOKE.ImfManager_Activate(swigCPtr);
+ NDalicManualPINVOKE.InputMethodContext_Activate(swigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
/// Deactivates the IMF.<br/>
/// It means that the text editing is finished somewhere.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public void Deactivate()
{
- NDalicManualPINVOKE.ImfManager_Deactivate(swigCPtr);
+ NDalicManualPINVOKE.InputMethodContext_Deactivate(swigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
/// If true, then the keyboard will be restored (activated) after focus is regained.
/// </summary>
/// <returns>The restoration status.</returns>
+ /// <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;
}
/// Sets the status whether the IMF has to restore the keyboard after losing focus.
/// </summary>
/// <param name="toggle">True means that keyboard should be restored after the focus is lost and regained.</param>
+ /// <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();
}
/// <summary>
/// Sends a message reset to the preedit state or the IMF module.
/// </summary>
+ /// <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();
}
/// <summary>
/// Notifies the IMF context that the cursor position has changed, required for features like auto-capitalization.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public void NotifyCursorPosition()
{
- NDalicManualPINVOKE.ImfManager_NotifyCursorPosition(swigCPtr);
+ NDalicManualPINVOKE.InputMethodContext_NotifyCursorPosition(swigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
/// Sets the cursor position stored in VirtualKeyboard, this is required by the IMF context.
/// </summary>
/// <param name="cursorPosition">The position of the cursor.</param>
+ /// <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();
}
/// Gets the cursor position stored in VirtualKeyboard, this is required by the IMF context.
/// </summary>
/// <returns>The current position of the cursor.</returns>
+ /// <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;
}
/// A method to store the string required by the IMF, this is used to provide predictive word suggestions.
/// </summary>
/// <param name="text">The text string surrounding the current cursor point.</param>
+ /// <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();
}
/// Gets the current text string set within the IMF manager, this is used to offer predictive suggestions.
/// </summary>
/// <returns>The surrounding text.</returns>
+ /// <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;
}
/// Notifies the IMF context that text input is set to multiline or not.
/// </summary>
/// <param name="multiLine">True if multiline text input is used.</param>
+ /// <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();
}
/// Returns the text direction of the keyboard's current input language.
/// </summary>
/// <returns>The direction of the text.</returns>
+ /// <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;
}
/// the values then taken down. So ideally, GetInputMethodArea() should be called after Show().
/// </summary>
/// <returns>Rectangle which is keyboard panel x, y, width, height.</returns>
+ /// <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>
/// <param name="text">The specific data to be set to the input panel.</param>
+ /// <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();
}
/// Gets the specific data of the current active input panel.
/// </summary>
/// <param name="text">The specific data to be received from the input panel.</param>
+ /// <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();
}
/// Gets the state of the current active input panel.
/// </summary>
/// <returns>The state of the input panel.</returns>
+ /// <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;
}
/// The default is true.
/// </summary>
/// <param name="visible">True if the return key is visible (enabled), false otherwise.</param>
+ /// <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();
}
/// Enables to show the input panel automatically when focused.
/// </summary>
/// <param name="enabled">If true, the input panel will be shown when focused.</param>
+ /// <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();
}
/// <summary>
/// Shows the input panel.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public void ShowInputPanel()
{
- NDalicManualPINVOKE.ImfManager_ShowInputPanel(swigCPtr);
+ NDalicManualPINVOKE.InputMethodContext_ShowInputPanel(swigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
/// <summary>
/// Hides the input panel.
/// </summary>
+ /// <since_tizen> 3 </since_tizen>
public void HideInputPanel()
{
- NDalicManualPINVOKE.ImfManager_HideInputPanel(swigCPtr);
+ NDalicManualPINVOKE.InputMethodContext_HideInputPanel(swigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
/// The default keyboard type is SoftwareKeyboard.
/// </summary>
/// <returns>The keyboard type.</returns>
+ /// <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;
}
/// For example, en_US, en_GB, en_PH, fr_FR, ...
/// </summary>
/// <returns>The current language locale of the input panel.</returns>
+ /// <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>
- 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
- [EditorBrowsable(EditorBrowsableState.Never)]
- public class ImfManagerActivatedEventArgs : EventArgs
+ internal static ImfManager DownCast(BaseHandle handle)
{
- 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
- [EditorBrowsable(EditorBrowsableState.Never)]
- public event EventHandler<ImfManagerActivatedEventArgs> ImfManagerActivated
+ internal void ApplyOptions(InputMethodOptions options)
{
- add
- {
- if (_imfManagerActivatedEventHandler == null)
- {
- _imfManagerActivatedEventCallback = OnImfManagerActivated;
- ActivatedSignal().Connect(_imfManagerActivatedEventCallback);
- }
+ NDalicManualPINVOKE.InputMethodContext_ApplyOptions(swigCPtr, InputMethodOptions.getCPtr(options));
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
- _imfManagerActivatedEventHandler += value;
- }
- remove
- {
- _imfManagerActivatedEventHandler -= value;
+ internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ImfManager obj)
+ {
+ return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
+ }
- if (_imfManagerActivatedEventHandler == null && _imfManagerActivatedEventCallback != null)
- {
- ActivatedSignal().Disconnect(_imfManagerActivatedEventCallback);
- }
- }
+ internal ActivatedSignalType ActivatedSignal()
+ {
+ ActivatedSignalType ret = new ActivatedSignalType(NDalicManualPINVOKE.InputMethodContext_ActivatedSignal(swigCPtr), false);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
}
- private void OnImfManagerActivated(global::System.IntPtr data)
+ internal KeyboardEventSignalType EventReceivedSignal()
{
- ImfManagerActivatedEventArgs e = new ImfManagerActivatedEventArgs();
+ KeyboardEventSignalType ret = new KeyboardEventSignalType(NDalicManualPINVOKE.InputMethodContext_EventReceivedSignal(swigCPtr), false);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
- if (data != null)
- {
- e.ImfManager = Registry.GetManagedBaseHandleFromNativePtr(data) as ImfManager;
- }
+ internal StatusSignalType StatusChangedSignal()
+ {
+ StatusSignalType ret = new StatusSignalType(NDalicManualPINVOKE.InputMethodContext_StatusChangedSignal(swigCPtr), false);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
- if (_imfManagerActivatedEventHandler != null)
- {
- _imfManagerActivatedEventHandler(this, e);
- }
+ internal KeyboardResizedSignalType ResizedSignal()
+ {
+ KeyboardResizedSignalType ret = new KeyboardResizedSignalType(NDalicManualPINVOKE.InputMethodContext_ResizedSignal(swigCPtr), false);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
}
- /// <summary>
- /// ImfManager activated event arguments.
- /// </summary>
- public class ActivatedEventArgs : EventArgs
+ internal LanguageChangedSignalType LanguageChangedSignal()
{
- public ImfManager ImfManager
- {
- get;
- set;
- }
+ LanguageChangedSignalType ret = new LanguageChangedSignalType(NDalicManualPINVOKE.InputMethodContext_LanguageChangedSignal(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;
+ internal KeyboardTypeSignalType KeyboardTypeChangedSignal()
+ {
+ KeyboardTypeSignalType ret = new KeyboardTypeSignalType(NDalicManualPINVOKE.InputMethodContext_KeyboardTypeChangedSignal(swigCPtr), false);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
/// <summary>
- /// ImfManager activated.
+ /// Dispose.
/// </summary>
- public event EventHandler<ActivatedEventArgs> Activated
+ /// <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)]
+ protected override void Dispose(DisposeTypes type)
{
- add
+ if (disposed)
{
- if (_activatedEventHandler == null)
- {
- _activatedEventCallback = OnActivated;
- ActivatedSignal().Connect(_activatedEventCallback);
- }
+ return;
+ }
+
+ if (type == DisposeTypes.Explicit)
+ {
+ //Called by User
+ //Release your own managed resources here.
+ //You should release all of your own disposable objects here.
- _activatedEventHandler += value;
}
- remove
+
+ //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)
{
- _activatedEventHandler -= value;
+ KeyboardTypeChangedSignal().Disconnect(_keyboardTypeChangedEventCallback);
+ }
- if (_activatedEventHandler == null && _activatedEventCallback != null)
+ if (swigCPtr.Handle != global::System.IntPtr.Zero)
+ {
+ if (swigCMemOwn)
{
- ActivatedSignal().Disconnect(_activatedEventCallback);
+ swigCMemOwn = false;
+ NDalicManualPINVOKE.delete_InputMethodContext(swigCPtr);
}
+ swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero);
}
+
+ base.Dispose(type);
}
private void OnActivated(IntPtr data)
}
}
- /// <summary>
- /// ImfManager activated signal.
- /// </summary>
- //Please do not use! this will be internal
- [EditorBrowsable(EditorBrowsableState.Never)]
- public ActivatedSignalType ActivatedSignal()
+ private IntPtr OnEventReceived(IntPtr imfManager, IntPtr imfEventData)
{
- ActivatedSignalType ret = new ActivatedSignalType(NDalicManualPINVOKE.ImfManager_ActivatedSignal(swigCPtr), false);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
- }
+ ImfCallbackData imfCallbackData = null;
- /// <summary>
- /// ImfManager event received event arguments.
- /// </summary>
- //Please do not use! this will be deprecated
- [EditorBrowsable(EditorBrowsableState.Never)]
- public class ImfManagerEventReceivedEventArgs : EventArgs
- {
- public ImfManager ImfManager
+ EventReceivedEventArgs e = new EventReceivedEventArgs();
+
+ if (imfManager != null)
{
- get;
- set;
+ e.ImfManager = Registry.GetManagedBaseHandleFromNativePtr(imfManager) as ImfManager;
}
- }
-
- private delegate void ImfManagerEventReceivedEventCallbackType(global::System.IntPtr data);
- private ImfManagerEventReceivedEventCallbackType _imfManagerEventReceivedEventCallback;
- private event EventHandler<ImfManagerEventReceivedEventArgs> _imfManagerEventReceivedEventHandler;
-
- /// <summary>
- /// ImfManager event received.
- /// </summary>
- //Please do not use! this will be deprecated
- [EditorBrowsable(EditorBrowsableState.Never)]
- public event EventHandler<ImfManagerEventReceivedEventArgs> ImfManagerEventReceived
- {
- add
+ if (imfEventData != null)
{
- if (_imfManagerEventReceivedEventHandler == null)
- {
- _imfManagerEventReceivedEventCallback = OnImfManagerEventReceived;
- EventReceivedSignal().Connect(_imfManagerEventReceivedEventCallback);
- }
+ e.ImfEventData = ImfEventData.GetImfEventDataFromPtr(imfEventData);
+ }
- _imfManagerEventReceivedEventHandler += value;
+ if (_eventReceivedEventHandler != null)
+ {
+ imfCallbackData = _eventReceivedEventHandler(this, e);
}
- remove
+ if (imfCallbackData != null)
{
- _imfManagerEventReceivedEventHandler -= value;
-
- if (_imfManagerEventReceivedEventHandler == null && _imfManagerEventReceivedEventCallback != null)
- {
- EventReceivedSignal().Disconnect(_imfManagerEventReceivedEventCallback);
- }
+ return imfCallbackData.GetImfCallbackDataPtr();
+ }
+ else
+ {
+ return new ImfCallbackData().GetImfCallbackDataPtr();
}
}
- private void OnImfManagerEventReceived(global::System.IntPtr data)
+ private void OnStatusChanged(bool statusChanged)
{
- ImfManagerEventReceivedEventArgs e = new ImfManagerEventReceivedEventArgs();
+ StatusChangedEventArgs e = new StatusChangedEventArgs();
- if (data != null)
- {
- e.ImfManager = Registry.GetManagedBaseHandleFromNativePtr(data) as ImfManager;
- }
+ e.StatusChanged = statusChanged;
- if (_imfManagerEventReceivedEventHandler != null)
+ if (_statusChangedEventHandler != null)
{
- _imfManagerEventReceivedEventHandler(this, e);
+ _statusChangedEventHandler(this, e);
}
}
- /// <summary>
- /// ImfManager event received event arguments.
- /// </summary>
- public class EventReceivedEventArgs : EventArgs
+ private void OnResized(int resized)
{
- public ImfManager ImfManager
+ ResizedEventArgs e = new ResizedEventArgs();
+ e.Resized = resized;
+
+ if (_resizedEventHandler != null)
{
- get;
- set;
+ _resizedEventHandler(this, e);
}
+ }
- public ImfEventData ImfEventData
+ private void OnLanguageChanged(int languageChanged)
+ {
+ LanguageChangedEventArgs e = new LanguageChangedEventArgs();
+ e.LanguageChanged = languageChanged;
+
+ if (_languageChangedEventHandler != null)
{
- get;
- set;
+ _languageChangedEventHandler(this, e);
}
}
- private delegate IntPtr EventReceivedEventCallbackType(IntPtr imfManager, IntPtr imfEventData);
- private EventReceivedEventCallbackType _eventReceivedEventCallback;
- private event EventHandlerWithReturnType<object, EventReceivedEventArgs, ImfCallbackData> _eventReceivedEventHandler;
-
- /// <summary>
- /// ImfManager event received.
- /// </summary>
- public event EventHandlerWithReturnType<object, EventReceivedEventArgs, ImfCallbackData> EventReceived
+ private void OnKeyboardTypeChanged(KeyboardType type)
{
- add
- {
- if (_eventReceivedEventHandler == null)
- {
- _eventReceivedEventCallback = OnEventReceived;
- EventReceivedSignal().Connect(_eventReceivedEventCallback);
- }
+ KeyboardTypeChangedEventArgs e = new KeyboardTypeChangedEventArgs();
- _eventReceivedEventHandler += value;
- }
- remove
- {
- _eventReceivedEventHandler -= value;
+ e.KeyboardType = type;
- if (_eventReceivedEventHandler == null && _eventReceivedEventCallback != null)
- {
- EventReceivedSignal().Disconnect(_eventReceivedEventCallback);
- }
+ if (_keyboardTypeChangedEventHandler != null)
+ {
+ _keyboardTypeChangedEventHandler(this, e);
}
}
- private IntPtr OnEventReceived(IntPtr imfManager, IntPtr imfEventData)
+ /// <summary>
+ /// This structure is used to pass on data from the IMF regarding predictive text.
+ /// </summary>
+ /// <since_tizen> 3 </since_tizen>
+ public class ImfEventData : global::System.IDisposable
{
- ImfCallbackData imfCallbackData = null;
+ /// <summary>
+ /// swigCMemOwn
+ /// </summary>
+ /// <since_tizen> 3 </since_tizen>
+ protected bool swigCMemOwn;
- EventReceivedEventArgs e = new EventReceivedEventArgs();
+ /// <summary>
+ /// A Flat to check if it is already disposed.
+ /// </summary>
+ /// <since_tizen> 3 </since_tizen>
+ protected bool disposed = false;
- if (imfManager != null)
+ 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)
{
- e.ImfManager = Registry.GetManagedBaseHandleFromNativePtr(imfManager) as ImfManager;
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
- if (imfEventData != null)
+
+ /// <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)
{
- e.ImfEventData = ImfEventData.GetImfEventDataFromPtr(imfEventData);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
- if (_eventReceivedEventHandler != null)
+ internal ImfEventData(IntPtr cPtr, bool cMemoryOwn)
{
- imfCallbackData = _eventReceivedEventHandler(this, e);
+ swigCMemOwn = cMemoryOwn;
+ swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
}
- if (imfCallbackData != null)
+
+ /// <summary>
+ /// Dispose.
+ /// </summary>
+ /// <since_tizen> 3 </since_tizen>
+ ~ImfEventData()
{
- return imfCallbackData.GetImfCallbackDataPtr();
+ if (!isDisposeQueued)
+ {
+ isDisposeQueued = true;
+ DisposeQueue.Instance.Add(this);
+ }
}
- else
+
+ /// <summary>
+ /// The pre-edit or the commit string.
+ /// </summary>
+ /// <since_tizen> 4 </since_tizen>
+ public string PredictiveString
{
- return new ImfCallbackData().GetImfCallbackDataPtr();
+ 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;
+ }
}
- }
-
- /// <summary>
- /// ImfManager event received signal.
- /// </summary>
- //Please do not use! this will be internal
- [EditorBrowsable(EditorBrowsableState.Never)]
- public ImfEventSignalType EventReceivedSignal()
- {
- ImfEventSignalType ret = new ImfEventSignalType(NDalicManualPINVOKE.ImfManager_EventReceivedSignal(swigCPtr), false);
- if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return ret;
- }
- /// <summary>
- /// ImfManager status changed event arguments.
- /// </summary>
- //Please do not use! this will be deprecated
- [EditorBrowsable(EditorBrowsableState.Never)]
- public class ImfManagerStatusChangedEventArgs : EventArgs
- {
- public ImfManager ImfManager
+ /// <summary>
+ /// The name of the event from the IMF.
+ /// </summary>
+ /// <since_tizen> 4 </since_tizen>
+ public ImfManager.ImfEvent EventName
{
- get;
- set;
+ 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;
+ }
}
- }
- private delegate void ImfManagerStatusChangedEventCallbackType(global::System.IntPtr data);
- private ImfManagerStatusChangedEventCallbackType _imfManagerStatusChangedEventCallback;
- private event EventHandler<ImfManagerStatusChangedEventArgs> _imfManagerStatusChangedEventHandler;
-
- /// <summary>
- /// ImfManager status changed.
- /// </summary>
- //Please do not use! this will be deprecated
- [EditorBrowsable(EditorBrowsableState.Never)]
- public event EventHandler<ImfManagerStatusChangedEventArgs> ImfManagerStatusChanged
- {
- add
+ /// <summary>
+ /// The start position from the current cursor position to start deleting characters.
+ /// </summary>
+ /// <since_tizen> 4 </since_tizen>
+ public int CursorOffset
{
- if (_imfManagerStatusChangedEventHandler == null)
+ set
{
- _imfManagerStatusChangedEventCallback = OnImfManagerStatusChanged;
- StatusChangedSignal().Connect(_imfManagerStatusChangedEventCallback);
+ 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;
}
-
- _imfManagerStatusChangedEventHandler += value;
}
- remove
- {
- _imfManagerStatusChangedEventHandler -= value;
- if (_imfManagerStatusChangedEventHandler == null && _imfManagerStatusChangedEventCallback != null)
+ /// <summary>
+ /// The number of characters to delete from the cursorOffset.
+ /// </summary>
+ /// <since_tizen> 4 </since_tizen>
+ public int NumberOfChars
+ {
+ set
+ {
+ NDalicManualPINVOKE.InputMethodContext_EventData_numberOfChars_set(swigCPtr, value);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+ get
{
- StatusChangedSignal().Disconnect(_imfManagerStatusChangedEventCallback);
+ int ret = NDalicManualPINVOKE.InputMethodContext_EventData_numberOfChars_get(swigCPtr);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
}
}
- }
- private void OnImfManagerStatusChanged(global::System.IntPtr data)
- {
- ImfManagerStatusChangedEventArgs e = new ImfManagerStatusChangedEventArgs();
-
- if (data != null)
+ /// <summary>
+ /// The dispose pattern.
+ /// </summary>
+ /// <since_tizen> 3 </since_tizen>
+ public void Dispose()
{
- e.ImfManager = Registry.GetManagedBaseHandleFromNativePtr(data) as ImfManager;
+ //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 (_imfManagerStatusChangedEventHandler != null)
+ internal static ImfEventData GetImfEventDataFromPtr(IntPtr cPtr)
{
- _imfManagerStatusChangedEventHandler(this, e);
+ ImfEventData ret = new ImfEventData(cPtr, false);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
}
- }
- /// <summary>
- /// ImfManager status changed event arguments.
- /// </summary>
- public class StatusChangedEventArgs : EventArgs
- {
- public bool StatusChanged
+ internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ImfEventData obj)
{
- get;
- set;
+ return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
}
- }
-
- private delegate void StatusChangedEventCallbackType(bool statusChanged);
- private StatusChangedEventCallbackType _statusChangedEventCallback;
- private event EventHandler<StatusChangedEventArgs> _statusChangedEventHandler;
- /// <summary>
- /// ImfManager status changed.
- /// </summary>
- public event EventHandler<StatusChangedEventArgs> StatusChanged
- {
- add
+ /// <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
- [EditorBrowsable(EditorBrowsableState.Never)]
- public StatusSignalType StatusChangedSignal()
+ /// <since_tizen> 3 </since_tizen>
+ 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
- [EditorBrowsable(EditorBrowsableState.Never)]
- public class ImfManagerResizedEventArgs : EventArgs
- {
- public ImfManager ImfManager
- {
- get;
- set;
- }
- }
+ /// <summary>
+ /// A Flat to check if it is already disposed.
+ /// </summary>
+ /// <since_tizen> 3 </since_tizen>
+ 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
- [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);
}
- }
-
- private delegate void ResizedEventCallbackType();
- private ResizedEventCallbackType _resizedEventCallback;
- private event EventHandler _resizedEventHandler;
- /// <summary>
- /// ImfManager resized.
- /// </summary>
- public event EventHandler Resized
- {
- add
+ /// <summary>
+ /// Dispose.
+ /// </summary>
+ /// <since_tizen> 3 </since_tizen>
+ ~ImfCallbackData()
{
- if (_resizedEventHandler == null)
+ if (!isDisposeQueued)
{
- _resizedEventCallback = OnResized;
- ResizedSignal().Connect(_resizedEventCallback);
+ isDisposeQueued = true;
+ DisposeQueue.Instance.Add(this);
}
-
- _resizedEventHandler += value;
}
- remove
- {
- _resizedEventHandler -= value;
- if (_resizedEventHandler == null && _resizedEventCallback != null)
+ /// <summary>
+ /// The current text string.
+ /// </summary>
+ /// <since_tizen> 4 </since_tizen>
+ public string CurrentText
+ {
+ set
{
- ResizedSignal().Disconnect(_resizedEventCallback);
+ 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;
}
}
- }
-
- private void OnResized()
- {
- if (_resizedEventHandler != null)
- {
- _resizedEventHandler(this, null);
- }
- }
-
- /// <summary>
- /// ImfManager resized signal.
- /// </summary>
- //Please do not use! this will be internal
- [EditorBrowsable(EditorBrowsableState.Never)]
- public ImfVoidSignalType ResizedSignal()
- {
- ImfVoidSignalType ret = new ImfVoidSignalType(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
- [EditorBrowsable(EditorBrowsableState.Never)]
- public class ImfManagerLanguageChangedEventArgs : EventArgs
- {
- public ImfManager ImfManager
+ /// <summary>
+ /// The current text string.
+ /// </summary>
+ /// <since_tizen> 4 </since_tizen>
+ public int CursorPosition
{
- get;
- set;
+ 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;
+ }
}
- }
- 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
- [EditorBrowsable(EditorBrowsableState.Never)]
- public event EventHandler<ImfManagerLanguageChangedEventArgs> ImfManagerLanguageChanged
- {
- add
+ /// <summary>
+ /// If the cursor position needs to be updated.
+ /// </summary>
+ /// <since_tizen> 4 </since_tizen>
+ public bool Update
{
- if (_imfManagerLanguageChangedEventHandler == null)
+ set
+ {
+ NDalicManualPINVOKE.InputMethodContext_CallbackData_update_set(swigCPtr, value);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ }
+ get
{
- _imfManagerLanguageChangedEventCallback = OnImfManagerLanguageChanged;
- LanguageChangedSignal().Connect(_imfManagerLanguageChangedEventCallback);
+ bool ret = NDalicManualPINVOKE.InputMethodContext_CallbackData_update_get(swigCPtr);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
}
+ }
- _imfManagerLanguageChangedEventHandler += value;
+ /// <summary>
+ /// Flags if preedit reset is required.
+ /// </summary>
+ /// <since_tizen> 4 </since_tizen>
+ 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;
+ }
}
- 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();
- if (data != null)
+ internal IntPtr GetImfCallbackDataPtr()
{
- e.ImfManager = Registry.GetManagedBaseHandleFromNativePtr(data) as ImfManager;
+ return (IntPtr)swigCPtr;
}
- if (_imfManagerLanguageChangedEventHandler != null)
+ internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ImfCallbackData obj)
{
- _imfManagerLanguageChangedEventHandler(this, e);
+ return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
}
- }
- private delegate void LanguageChangedEventCallbackType();
- private LanguageChangedEventCallbackType _languageChangedEventCallback;
- private event EventHandler _languageChangedEventHandler;
+ internal static ImfCallbackData GetImfCallbackDataFromPtr(IntPtr cPtr)
+ {
+ ImfCallbackData ret = new ImfCallbackData(cPtr, false);
+ if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
+ return ret;
+ }
- /// <summary>
- /// ImfManager language changed.
- /// </summary>
- public event EventHandler LanguageChanged
- {
- add
+ /// <summary>
+ /// Dispose.
+ /// </summary>
+ /// <since_tizen> 3 </since_tizen>
+ protected virtual void Dispose(DisposeTypes type)
{
- if (_languageChangedEventHandler == null)
+ if (disposed)
{
- _languageChangedEventCallback = OnLanguageChanged;
- LanguageChangedSignal().Connect(_languageChangedEventCallback);
+ return;
}
- _languageChangedEventHandler += value;
- }
- remove
- {
- _languageChangedEventHandler -= value;
+ if (type == DisposeTypes.Explicit)
+ {
+ //Called by User
+ //Release your own managed resources here.
+ //You should release all of your own disposable objects here.
- if (_languageChangedEventHandler == null && _languageChangedEventCallback != null)
+ }
+
+ //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)
{
- 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()
- {
- if (_languageChangedEventHandler != null)
- {
- _languageChangedEventHandler(this, null);
+ disposed = true;
}
}
/// <summary>
- /// ImfManager language changed signal.
- /// </summary>
- //Please do not use! this will be internal
- [EditorBrowsable(EditorBrowsableState.Never)]
- public ImfVoidSignalType LanguageChangedSignal()
- {
- ImfVoidSignalType ret = new ImfVoidSignalType(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>
- public class KeyboardTypeChangedEventArgs : EventArgs
+ /// <since_tizen> 4 </since_tizen>
+ public class ActivatedEventArgs : EventArgs
{
- public KeyboardType KeyboardType
+ /// <summary>
+ /// ImfManager
+ /// </summary>
+ /// <since_tizen> 4 </since_tizen>
+ 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>
- public event EventHandler<KeyboardTypeChangedEventArgs> KeyboardTypeChanged
+ /// <since_tizen> 4 </since_tizen>
+ 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>
- 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>
- public enum ImfEvent
+ /// <since_tizen> 4 </since_tizen>
+ public class ResizedEventArgs : EventArgs
{
/// <summary>
- /// No event.
- /// </summary>
- Void,
- /// <summary>
- /// Pre-Edit changed.
- /// </summary>
- Preedit,
- /// <summary>
- /// Commit recieved.
- /// </summary>
- Commit,
- /// <summary>
- /// An event to delete a range of characters from the string.
- /// </summary>
- DeleteSurrounding,
- /// <summary>
- /// An event to query string and the cursor position.
- /// </summary>
- GetSurrounding,
- /// <summary>
- /// Private command sent from the input panel.
+ /// resized.
/// </summary>
- PrivateCommand
+ /// <since_tizen> 4 </since_tizen>
+ public int Resized
+ {
+ get;
+ set;
+ }
}
/// <summary>
- /// Enumeration for the state of the input panel.
+ /// ImfManager language changed event args.
/// </summary>
- public enum State
+ /// <since_tizen> 4 </since_tizen>
+ public class LanguageChangedEventArgs : EventArgs
{
/// <summary>
- /// Unknown state.
- /// </summary>
- Default = 0,
- /// <summary>
- /// Input panel is shown.
- /// </summary>
- Show,
- /// <summary>
- /// Input panel is hidden.
- /// </summary>
- Hide,
- /// <summary>
- /// Input panel in process of being shown.
+ /// language changed.
/// </summary>
- WillShow
+ /// <since_tizen> 4 </since_tizen>
+ public int LanguageChanged
+ {
+ get;
+ set;
+ }
}
/// <summary>
- /// Enumeration for the types of keyboard.
+ /// ImfManager keyboard type changed event arguments.
/// </summary>
- public enum KeyboardType
+ /// <since_tizen> 4 </since_tizen>
+ public class KeyboardTypeChangedEventArgs : EventArgs
{
/// <summary>
- /// Software keyboard (virtual keyboard) is default.
- /// </summary>
- SoftwareKeyboard,
- /// <summary>
- /// Hardware keyboard.
+ /// ImfManager keyboard type
/// </summary>
- HardwareKeyboard
+ /// <since_tizen> 4 </since_tizen>
+ public KeyboardType KeyboardType
+ {
+ get;
+ set;
+ }
}
}
}