/*
* 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.
*
*/
using System;
using System.Runtime.InteropServices;
using System.ComponentModel;
namespace Tizen.NUI
{
///
/// Specifically manages the input method framework which enables the virtual or hardware keyboards.
///
public class ImfManager : BaseHandle
{
private global::System.Runtime.InteropServices.HandleRef swigCPtr;
internal ImfManager(IntPtr cPtr, bool cMemoryOwn) : base(NDalicManualPINVOKE.ImfManager_SWIGUpcast(cPtr), cMemoryOwn)
{
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
}
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ImfManager obj)
{
return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
}
///
/// Dispose
///
/// Dispose Type
/// 3
protected override 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 (_keyboardTypeChangedEventCallback != null)
{
KeyboardTypeChangedSignal().Disconnect(_keyboardTypeChangedEventCallback);
}
if (_imfManagerLanguageChangedEventCallback != null)
{
LanguageChangedSignal().Disconnect(_imfManagerLanguageChangedEventCallback);
}
if (_imfManagerResizedEventCallback != null)
{
ResizedSignal().Disconnect(_imfManagerResizedEventCallback);
}
if (_imfManagerStatusChangedEventCallback != null)
{
StatusChangedSignal().Disconnect(_imfManagerStatusChangedEventCallback);
}
if (_imfManagerEventReceivedEventCallback != null)
{
EventReceivedSignal().Disconnect(_imfManagerEventReceivedEventCallback);
}
if (_imfManagerActivatedEventCallback != null)
{
ActivatedSignal().Disconnect(_imfManagerActivatedEventCallback);
}
if (swigCPtr.Handle != global::System.IntPtr.Zero)
{
if (swigCMemOwn)
{
swigCMemOwn = false;
NDalicManualPINVOKE.delete_ImfManager(swigCPtr);
}
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero);
}
base.Dispose(type);
}
///
/// This structure is used to pass on data from the IMF regarding predictive text.
///
public class ImfEventData : global::System.IDisposable
{
private global::System.Runtime.InteropServices.HandleRef swigCPtr;
///
/// swigCMemOwn
///
/// 3
protected bool swigCMemOwn;
internal ImfEventData(IntPtr cPtr, bool cMemoryOwn)
{
swigCMemOwn = cMemoryOwn;
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
}
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ImfEventData 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.
///
/// 3
protected bool disposed = false;
///
/// Dispose.
///
/// 3
~ImfEventData()
{
if (!isDisposeQueued)
{
isDisposeQueued = true;
DisposeQueue.Instance.Add(this);
}
}
///
/// The dispose pattern.
///
/// 3
public void Dispose()
{
//Throw excpetion if Dispose() is called in separate thread.
if (!Window.IsInstalled())
{
throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread.");
}
if (isDisposeQueued)
{
Dispose(DisposeTypes.Implicit);
}
else
{
Dispose(DisposeTypes.Explicit);
System.GC.SuppressFinalize(this);
}
}
///
/// Dispose.
///
/// 3
protected virtual void Dispose(DisposeTypes type)
{
if (disposed)
{
return;
}
if (type == DisposeTypes.Explicit)
{
//Called by User
//Release your own managed resources here.
//You should release all of your own disposable objects here.
}
//Release your own unmanaged resources here.
//You should not access any managed member here except static instance.
//because the execution order of Finalizes is non-deterministic.
if (swigCPtr.Handle != IntPtr.Zero)
{
if (swigCMemOwn)
{
swigCMemOwn = false;
NDalicManualPINVOKE.delete_ImfManager_ImfEventData(swigCPtr);
}
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero);
}
disposed = true;
}
internal static ImfEventData GetImfEventDataFromPtr(IntPtr cPtr)
{
ImfEventData ret = new ImfEventData(cPtr, false);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
///
/// The default constructor.
///
/// 3
public ImfEventData() : this(NDalicManualPINVOKE.new_ImfManager_ImfEventData__SWIG_0(), true)
{
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
///
/// The constructor.
///
/// The name of the event from the IMF.
/// The pre-edit or the commit string.
/// Start the position from the current cursor position to start deleting characters.
/// The number of characters to delete from the cursorOffset.
/// 3
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();
}
///
/// The pre-edit or the commit string.
///
/// /// 3
[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;
}
}
///
/// The pre-edit or the commit string.
///
/// 4
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;
}
}
///
/// The name of the event from the IMF.
///
//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;
}
}
///
/// The name of the event from the IMF.
///
/// 4
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;
}
}
///
/// The start position from the current cursor position to start deleting characters.
///
//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;
}
}
///
/// The start position from the current cursor position to start deleting characters.
///
/// 4
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;
}
}
///
/// The number of characters to delete from the cursorOffset.
///
//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;
}
}
///
/// The number of characters to delete from the cursorOffset.
///
/// 4
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;
}
}
}
///
/// Data required by the IMF from the callback.
///
public class ImfCallbackData : global::System.IDisposable
{
private global::System.Runtime.InteropServices.HandleRef swigCPtr;
///
/// swigCMemOwn
///
/// 3
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.
///
/// 3
protected bool disposed = false;
///
/// Dispose.
///
/// 3
~ImfCallbackData()
{
if (!isDisposeQueued)
{
isDisposeQueued = true;
DisposeQueue.Instance.Add(this);
}
}
///
/// The dispose pattern.
///
/// 3
public void Dispose()
{
//Throw excpetion if Dispose() is called in separate thread.
if (!Window.IsInstalled())
{
throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread.");
}
if (isDisposeQueued)
{
Dispose(DisposeTypes.Implicit);
}
else
{
Dispose(DisposeTypes.Explicit);
System.GC.SuppressFinalize(this);
}
}
///
/// Dispose.
///
/// 3
protected virtual void Dispose(DisposeTypes type)
{
if (disposed)
{
return;
}
if (type == DisposeTypes.Explicit)
{
//Called by User
//Release your own managed resources here.
//You should release all of your own disposable objects here.
}
//Release your own unmanaged resources here.
//You should not access any managed member here except static instance.
//because the execution order of Finalizes is non-deterministic.
if (swigCPtr.Handle != IntPtr.Zero)
{
if (swigCMemOwn)
{
swigCMemOwn = false;
NDalicManualPINVOKE.delete_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;
}
///
/// The default constructor.
///
/// 3
public ImfCallbackData() : this(NDalicManualPINVOKE.new_ImfManager_ImfCallbackData__SWIG_0(), true)
{
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
///
/// The constructor.
///
/// True if the cursor position needs to be updated.
/// The new position of the cursor.
/// The current text string.
/// Flag if preedit reset is required.
/// 3
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();
}
///
/// The current text string.
///
//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;
}
}
///
/// The current text string.
///
/// 4
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;
}
}
///
/// The current text string.
///
//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;
}
}
///
/// The current text string.
///
/// 4
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;
}
}
///
/// If the cursor position needs to be updated.
///
//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;
}
}
///
/// If the cursor position needs to be updated.
///
/// 4
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;
}
}
///
/// Flags if preedit reset is required.
///
//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;
}
}
///
/// Flags if preedit reset is required.
///
/// 4
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;
}
}
}
///
/// Finalize the IMF.
///
public void Finalize()
{
NDalicManualPINVOKE.ImfManager_Finalize(swigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
///
/// Retrieves a handle to the instance of the ImfManager.
///
/// A handle to the ImfManager.
/// 3
public static ImfManager Get()
{
ImfManager ret = new ImfManager(NDalicManualPINVOKE.ImfManager_Get(), true);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
///
/// Activates the IMF.
/// It means that the text editing is started somewhere.
/// If the hardware keyboard isn't connected, then it will show the virtual keyboard.
///
/// 3
public void Activate()
{
NDalicManualPINVOKE.ImfManager_Activate(swigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
///
/// Deactivates the IMF.
/// It means that the text editing is finished somewhere.
///
/// 3
public void Deactivate()
{
NDalicManualPINVOKE.ImfManager_Deactivate(swigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
///
/// Gets the restoration status which controls if the keyboard is restored after the focus is lost and then regained.
/// If true, then the keyboard will be restored (activated) after focus is regained.
///
/// The restoration status.
/// 3
public bool RestoreAfterFocusLost()
{
bool ret = NDalicManualPINVOKE.ImfManager_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.
///
/// True means that keyboard should be restored after the focus is lost and regained.
/// 3
public void SetRestoreAfterFocusLost(bool toggle)
{
NDalicManualPINVOKE.ImfManager_SetRestoreAfterFocusLost(swigCPtr, toggle);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
///
/// Sends a message reset to the preedit state or the IMF module.
///
/// 3
public new void Reset()
{
NDalicManualPINVOKE.ImfManager_Reset(swigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
///
/// Notifies the IMF context that the cursor position has changed, required for features like auto-capitalization.
///
/// 3
public void NotifyCursorPosition()
{
NDalicManualPINVOKE.ImfManager_NotifyCursorPosition(swigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
///
/// Sets the cursor position stored in VirtualKeyboard, this is required by the IMF context.
///
/// The position of the cursor.
/// 3
public void SetCursorPosition(uint cursorPosition)
{
NDalicManualPINVOKE.ImfManager_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.
///
/// The current position of the cursor.
/// 3
public uint GetCursorPosition()
{
uint ret = NDalicManualPINVOKE.ImfManager_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.
///
/// The text string surrounding the current cursor point.
/// 3
public void SetSurroundingText(string text)
{
NDalicManualPINVOKE.ImfManager_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.
///
/// The surrounding text.
/// 3
public string GetSurroundingText()
{
string ret = NDalicManualPINVOKE.ImfManager_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.
///
/// True if multiline text input is used.
/// 3
public void NotifyTextInputMultiLine(bool multiLine)
{
NDalicManualPINVOKE.ImfManager_NotifyTextInputMultiLine(swigCPtr, multiLine);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
///
/// Returns the text direction of the keyboard's current input language.
///
/// The direction of the text.
/// 3
public ImfManager.TextDirection GetTextDirection()
{
ImfManager.TextDirection ret = (ImfManager.TextDirection)NDalicManualPINVOKE.ImfManager_GetTextDirection(swigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
///
/// Provides the size and the position of the keyboard.
/// The position is relative to whether the keyboard is visible or not.
/// If the keyboard is not visible, then the position will be off the screen.
/// If the keyboard is not being shown when this method is called, the keyboard is partially setup (IMFContext) to get/>
/// the values then taken down. So ideally, GetInputMethodArea() should be called after Show().
///
/// Rectangle which is keyboard panel x, y, width, height.
/// 3
public Rectangle GetInputMethodArea()
{
Rectangle ret = new Rectangle(NDalicManualPINVOKE.ImfManager_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();
}
///
/// Sets up the input-panel specific data.
///
/// The specific data to be set to the input panel.
/// 3
public void SetInputPanelUserData(string text)
{
NDalicManualPINVOKE.ImfManager_SetInputPanelUserData(swigCPtr, text);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
///
/// Gets the specific data of the current active input panel.
///
/// The specific data to be received from the input panel.
/// 3
public void GetInputPanelUserData(out string text)
{
NDalicManualPINVOKE.ImfManager_GetInputPanelUserData(swigCPtr, out text);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
///
/// Gets the state of the current active input panel.
///
/// The state of the input panel.
/// 3
public ImfManager.State GetInputPanelState()
{
ImfManager.State ret = (ImfManager.State)NDalicManualPINVOKE.ImfManager_GetInputPanelState(swigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
///
/// Sets the return key on the input panel to be visible or invisible.
/// The default is true.
///
/// True if the return key is visible (enabled), false otherwise.
/// 3
public void SetReturnKeyState(bool visible)
{
NDalicManualPINVOKE.ImfManager_SetReturnKeyState(swigCPtr, visible);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
///
/// Enables to show the input panel automatically when focused.
///
/// If true, the input panel will be shown when focused.
/// 3
public void AutoEnableInputPanel(bool enabled)
{
NDalicManualPINVOKE.ImfManager_AutoEnableInputPanel(swigCPtr, enabled);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
///
/// Shows the input panel.
///
/// 3
public void ShowInputPanel()
{
NDalicManualPINVOKE.ImfManager_ShowInputPanel(swigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
///
/// Hides the input panel.
///
/// 3
public void HideInputPanel()
{
NDalicManualPINVOKE.ImfManager_HideInputPanel(swigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
///
/// Gets the keyboard type.
/// The default keyboard type is SoftwareKeyboard.
///
/// The keyboard type.
/// 4
public ImfManager.KeyboardType GetKeyboardType()
{
ImfManager.KeyboardType ret = (ImfManager.KeyboardType)NDalicManualPINVOKE.ImfManager_GetKeyboardType(swigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
///
/// Gets the current language locale of the input panel.
/// For example, en_US, en_GB, en_PH, fr_FR, ...
///
/// The current language locale of the input panel.
/// 4
public string GetInputPanelLocale()
{
string ret = NDalicManualPINVOKE.ImfManager_GetInputPanelLocale(swigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
///
/// The constructor.
///
/// 3
public ImfManager() : this(NDalicManualPINVOKE.new_ImfManager(), true)
{
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
///
/// ImfManager activated event arguments.
///
//Please do not use! this will be deprecated
[EditorBrowsable(EditorBrowsableState.Never)]
public class ImfManagerActivatedEventArgs : EventArgs
{
///
/// ImfManager
///
/// 3
public ImfManager ImfManager
{
get;
set;
}
}
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
private delegate void ImfManagerActivatedEventCallbackType(global::System.IntPtr data);
private ImfManagerActivatedEventCallbackType _imfManagerActivatedEventCallback;
private event EventHandler _imfManagerActivatedEventHandler;
///
/// ImfManager activated event.
///
//Please do not use! this will be deprecated
[EditorBrowsable(EditorBrowsableState.Never)]
public event EventHandler ImfManagerActivated
{
add
{
if (_imfManagerActivatedEventHandler == null)
{
_imfManagerActivatedEventCallback = OnImfManagerActivated;
ActivatedSignal().Connect(_imfManagerActivatedEventCallback);
}
_imfManagerActivatedEventHandler += value;
}
remove
{
_imfManagerActivatedEventHandler -= value;
if (_imfManagerActivatedEventHandler == null && _imfManagerActivatedEventCallback != null)
{
ActivatedSignal().Disconnect(_imfManagerActivatedEventCallback);
}
}
}
private void OnImfManagerActivated(global::System.IntPtr data)
{
ImfManagerActivatedEventArgs e = new ImfManagerActivatedEventArgs();
if (data != null)
{
e.ImfManager = Registry.GetManagedBaseHandleFromNativePtr(data) as ImfManager;
}
if (_imfManagerActivatedEventHandler != null)
{
_imfManagerActivatedEventHandler(this, e);
}
}
///
/// ImfManager activated event arguments.
///
public class ActivatedEventArgs : EventArgs
{
///
/// ImfManager
///
/// 3
public ImfManager ImfManager
{
get;
set;
}
}
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
private delegate void ActivatedEventCallbackType(IntPtr data);
private ActivatedEventCallbackType _activatedEventCallback;
private event EventHandler _activatedEventHandler;
///
/// ImfManager activated.
///
/// 4
public event EventHandler Activated
{
add
{
if (_activatedEventHandler == null)
{
_activatedEventCallback = OnActivated;
ActivatedSignal().Connect(_activatedEventCallback);
}
_activatedEventHandler += value;
}
remove
{
_activatedEventHandler -= value;
if (_activatedEventHandler == null && _activatedEventCallback != null)
{
ActivatedSignal().Disconnect(_activatedEventCallback);
}
}
}
private void OnActivated(IntPtr data)
{
ActivatedEventArgs e = new ActivatedEventArgs();
if (data != null)
{
e.ImfManager = Registry.GetManagedBaseHandleFromNativePtr(data) as ImfManager;
}
if (_activatedEventHandler != null)
{
_activatedEventHandler(this, e);
}
}
///
/// ImfManager activated signal.
///
//Please do not use! this will be internal
[EditorBrowsable(EditorBrowsableState.Never)]
public ActivatedSignalType ActivatedSignal()
{
ActivatedSignalType ret = new ActivatedSignalType(NDalicManualPINVOKE.ImfManager_ActivatedSignal(swigCPtr), false);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
///
/// ImfManager event received event arguments.
///
//Please do not use! this will be deprecated
[EditorBrowsable(EditorBrowsableState.Never)]
public class ImfManagerEventReceivedEventArgs : EventArgs
{
///
/// ImfManager
///
/// 3
public ImfManager ImfManager
{
get;
set;
}
}
private delegate void ImfManagerEventReceivedEventCallbackType(global::System.IntPtr data);
private ImfManagerEventReceivedEventCallbackType _imfManagerEventReceivedEventCallback;
private event EventHandler _imfManagerEventReceivedEventHandler;
///
/// ImfManager event received.
///
//Please do not use! this will be deprecated
[EditorBrowsable(EditorBrowsableState.Never)]
public event EventHandler ImfManagerEventReceived
{
add
{
if (_imfManagerEventReceivedEventHandler == null)
{
_imfManagerEventReceivedEventCallback = OnImfManagerEventReceived;
EventReceivedSignal().Connect(_imfManagerEventReceivedEventCallback);
}
_imfManagerEventReceivedEventHandler += value;
}
remove
{
_imfManagerEventReceivedEventHandler -= value;
if (_imfManagerEventReceivedEventHandler == null && _imfManagerEventReceivedEventCallback != null)
{
EventReceivedSignal().Disconnect(_imfManagerEventReceivedEventCallback);
}
}
}
private void OnImfManagerEventReceived(global::System.IntPtr data)
{
ImfManagerEventReceivedEventArgs e = new ImfManagerEventReceivedEventArgs();
if (data != null)
{
e.ImfManager = Registry.GetManagedBaseHandleFromNativePtr(data) as ImfManager;
}
if (_imfManagerEventReceivedEventHandler != null)
{
_imfManagerEventReceivedEventHandler(this, e);
}
}
///
/// ImfManager event received event arguments.
///
public class EventReceivedEventArgs : EventArgs
{
///
/// ImfManager
///
/// 3
public ImfManager ImfManager
{
get;
set;
}
///
/// ImfEventData
///
/// 3
public ImfEventData ImfEventData
{
get;
set;
}
}
private delegate IntPtr EventReceivedEventCallbackType(IntPtr imfManager, IntPtr imfEventData);
private EventReceivedEventCallbackType _eventReceivedEventCallback;
private event EventHandlerWithReturnType