Class InputMethodContext

Definition

Namespace:
Tizen.NUI
Assembly:
Tizen.NUI.dll
API Level:
5

Specifically manages the input method framework (IMF) that enables the virtual or hardware keyboards.

C#
Copy
public class InputMethodContext : BaseHandle, INotifyPropertyChanged, IDynamicResourceHandler, IElement, INameScope, IElementController, IDisposable
Inheritance
System.Object
Tizen.NUI.Binding.Element
InputMethodContext
Implements
System.ComponentModel.INotifyPropertyChanged
System.IDisposable

Constructors

View Source

InputMethodContext()

Constructor.

Declaration
C#
Copy
[Obsolete("Deprecated in API8; Will be removed in API10")] public InputMethodContext()
API Level: 5

Properties

View Source

TextPrediction

Gets or sets whether the IM context allows to use the text prediction.

Declaration
C#
Copy
public bool TextPrediction { get; set; }
Property Value
Type Description
Boolean
API Level: 8

Methods

View Source

Activate()

Activates the IMF.
It means that the text editing has started.
If the hardware keyboard is not connected, then it shows the virtual keyboard.

Declaration
C#
Copy
public void Activate()
API Level: 5
View Source

AutoEnableInputPanel(Boolean)

Enables to show the input panel automatically when focused.

Declaration
C#
Copy
public void AutoEnableInputPanel(bool enabled)
Parameters
Type Name Description
Boolean enabled

If true, the input panel will be shown when focused.

API Level: 5
View Source

Deactivate()

Deactivates the IMF.
It means that the text editing is complete.

Declaration
C#
Copy
public void Deactivate()
API Level: 5
View Source

DestroyContext()

Destroys the context of the IMF.

Declaration
C#
Copy
public void DestroyContext()
API Level: 5
View Source

GetCursorPosition()

Gets the cursor position stored in VirtualKeyboard, this is required by the IMF context.

Declaration
C#
Copy
public uint GetCursorPosition()
Returns
Type Description
System.UInt32

The current position of the cursor.

API Level: 5
View Source

GetInputMethodArea()

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() must be called after Show().

Declaration
C#
Copy
public Rectangle GetInputMethodArea()
Returns
Type Description
Rectangle

Rectangle which is keyboard panel x, y, width, and height.

API Level: 5
View Source

GetInputPanelLanguage()

Gets the language of the input panel.

Declaration
C#
Copy
public InputMethodContext.InputPanelLanguage GetInputPanelLanguage()
Returns
Type Description
InputMethodContext.InputPanelLanguage

The language of the input panel

API Level: 8
View Source

GetInputPanelLocale()

Gets the current language locale of the input panel.
For example, en_US, en_GB, en_PH, fr_FR, and so on.

Declaration
C#
Copy
public string GetInputPanelLocale()
Returns
Type Description
System.String

The current language locale of the input panel.

API Level: 5
View Source

GetInputPanelState()

Gets the state of the current active input panel.

Declaration
C#
Copy
public InputMethodContext.State GetInputPanelState()
Returns
Type Description
InputMethodContext.State

The state of the input panel.

API Level: 5
View Source

GetInputPanelUserData(out String)

Gets the specific data of the current active input panel.

Declaration
C#
Copy
public void GetInputPanelUserData(out string text)
Parameters
Type Name Description
System.String text

The specific data to be received from the input panel.

API Level: 5
View Source

GetKeyboardType()

Gets the keyboard type.
The default keyboard type is SoftwareKeyboard.

Declaration
C#
Copy
public InputMethodContext.KeyboardType GetKeyboardType()
Returns
Type Description
InputMethodContext.KeyboardType

The keyboard type.

API Level: 5
View Source

GetSurroundingText()

Gets the current text string set within the IMF manager, this is used to offer predictive suggestions.

Declaration
C#
Copy
public string GetSurroundingText()
Returns
Type Description
System.String

The surrounding text.

API Level: 5
View Source

GetTextDirection()

Returns the text direction of the current input language of the keyboard.

Declaration
C#
Copy
public InputMethodContext.TextDirection GetTextDirection()
Returns
Type Description
InputMethodContext.TextDirection

The direction of the text.

API Level: 5
View Source

HideInputPanel()

Hides the input panel.

Declaration
C#
Copy
public void HideInputPanel()
API Level: 5
View Source

NotifyCursorPosition()

Notifies the IMF context that the cursor position has changed, required for features such as auto-capitalization.

Declaration
C#
Copy
public void NotifyCursorPosition()
API Level: 5
View Source

NotifyTextInputMultiLine(Boolean)

Notifies the IMF context that text input is set to multiline or not.

Declaration
C#
Copy
public void NotifyTextInputMultiLine(bool multiLine)
Parameters
Type Name Description
Boolean multiLine

True if multiline text input is used.

API Level: 5
View Source

Reset()

Sends a message reset to the pre-edit state or the IMF module.

Declaration
C#
Copy
public void Reset()
API Level: 5
View Source

RestoreAfterFocusLost()

Gets the restoration status, which controls if the keyboard is restored after the focus is lost and then regained.
If true, then the keyboard will be restored (activated) after the focus is regained.

Declaration
C#
Copy
public bool RestoreAfterFocusLost()
Returns
Type Description
Boolean

The restoration status.

API Level: 5
View Source

SetCursorPosition(UInt32)

Sets the cursor position stored in VirtualKeyboard, this is required by the IMF context.

Declaration
C#
Copy
public void SetCursorPosition(uint cursorPosition)
Parameters
Type Name Description
System.UInt32 cursorPosition

The position of the cursor.

API Level: 5
View Source

SetInputPanelLanguage(InputMethodContext.InputPanelLanguage)

Sets the language of the input panel.

Declaration
C#
Copy
public void SetInputPanelLanguage(InputMethodContext.InputPanelLanguage language)
Parameters
Type Name Description
InputMethodContext.InputPanelLanguage language

The language to be set to the input panel

API Level: 8
View Source

SetInputPanelPosition(UInt32, UInt32)

Sets the x,y coordinates of the input panel.

Declaration
C#
Copy
public void SetInputPanelPosition(uint x, uint y)
Parameters
Type Name Description
System.UInt32 x

The top-left x coordinate of the input panel.

System.UInt32 y

The top-left y coordinate of the input panel.

API Level: 8
View Source

SetInputPanelUserData(String)

Sets up the input panel specific data.

Declaration
C#
Copy
public void SetInputPanelUserData(string text)
Parameters
Type Name Description
System.String text

The specific data to be set to the input panel.

API Level: 5
View Source

SetMIMEType(String)

Sets the allowed MIME Type to deliver to the input panel.
For example, string mimeType = "text/plain,image/png,image/gif,application/pdf";

Declaration
C#
Copy
public void SetMIMEType(string mimeType)
Parameters
Type Name Description
System.String mimeType

The allowed MIME type.

API Level: 8
View Source

SetRestoreAfterFocusLost(Boolean)

Sets the status whether the IMF has to restore the keyboard after losing focus.

Declaration
C#
Copy
public void SetRestoreAfterFocusLost(bool toggle)
Parameters
Type Name Description
Boolean toggle

True means that keyboard must be restored after the focus is lost and regained.

API Level: 5
View Source

SetReturnKeyState(Boolean)

Sets the return key on the input panel to be visible or invisible.
The default value is true.

Declaration
C#
Copy
public void SetReturnKeyState(bool visible)
Parameters
Type Name Description
Boolean visible

True if the return key is visible (enabled), false otherwise.

API Level: 5
View Source

SetSurroundingText(String)

A method to store the string required by the IMF, this is used to provide predictive word suggestions.

Declaration
C#
Copy
public void SetSurroundingText(string text)
Parameters
Type Name Description
System.String text

The text string surrounding the current cursor point.

API Level: 5
View Source

ShowInputPanel()

Shows the input panel.

Declaration
C#
Copy
public void ShowInputPanel()
API Level: 5

Events

View Source

Activated

InputMethodContext activated.

Declaration
C#
Copy
public event EventHandler<InputMethodContext.ActivatedEventArgs> Activated
Event Type
Type Description
System.EventHandler<InputMethodContext.ActivatedEventArgs>
API Level: 5
View Source

EventReceived

InputMethodContext event received.

Declaration
C#
Copy
public event EventHandlerWithReturnType<object, InputMethodContext.EventReceivedEventArgs, InputMethodContext.CallbackData> EventReceived
Event Type
Type Description
EventHandlerWithReturnType<System.Object, InputMethodContext.EventReceivedEventArgs, InputMethodContext.CallbackData>
API Level: 5
View Source

KeyboardTypeChanged

InputMethodContext keyboard type changed.

Declaration
C#
Copy
public event EventHandler<InputMethodContext.KeyboardTypeChangedEventArgs> KeyboardTypeChanged
Event Type
Type Description
System.EventHandler<InputMethodContext.KeyboardTypeChangedEventArgs>
API Level: 5
View Source

LanguageChanged

InputMethodContext language changed.

Declaration
C#
Copy
public event EventHandler<InputMethodContext.LanguageChangedEventArgs> LanguageChanged
Event Type
Type Description
System.EventHandler<InputMethodContext.LanguageChangedEventArgs>
API Level: 5
View Source

Resized

InputMethodContext resized.

Declaration
C#
Copy
public event EventHandler<InputMethodContext.ResizedEventArgs> Resized
Event Type
Type Description
System.EventHandler<InputMethodContext.ResizedEventArgs>
API Level: 5
View Source

StatusChanged

InputMethodContext status changed.

Declaration
C#
Copy
public event EventHandler<InputMethodContext.StatusChangedEventArgs> StatusChanged
Event Type
Type Description
System.EventHandler<InputMethodContext.StatusChangedEventArgs>
API Level: 5

Implements

System.ComponentModel.INotifyPropertyChanged
System.IDisposable