目录

InputMethod_TextConfig

typedef struct InputMethod_TextConfig InputMethod_TextConfig

Overview

Represents a configuration struct for text input behavior in text input boxes. The input box uses it to pass core input rules to the input method framework, which then performs the corresponding input behavior based on the configuration. By configuring input attributes (such as input type and text format), it can meet input requirements in various scenarios and improve user input experience. It is suitable for text input scenarios that require fine-grained control over input behavior. This struct is an opaque type, and you cannot directly access its internal members. You can only operate on it through the function interfaces provided by this module.

Since: 12

Related module: InputMethod

Header file: inputmethod_text_config_capi.h

Struct Purpose

Carries the configuration information of the edit box, including the input type, enter key type, preview text support, selection range, cursor information, avoidance information, window ID, placeholder text, and abilityName. This configuration information is used in the OH_TextEditorProxy_GetTextConfigFunc callback. In the callback, you need to set each configuration item in the config parameter, and the input method framework adjusts the keyboard layout and input behavior based on the settings.

Composition

InputMethod_TextConfig internally contains the following substructure information:

Related functions:

Function Description
OH_TextConfig_Create Creates a new InputMethod_TextConfig instance.
OH_TextConfig_Destroy Destroys an InputMethod_TextConfig instance.
Function Description
OH_TextConfig_SetInputType Sets the input box type in the text configuration information.
OH_TextConfig_SetEnterKeyType Sets the enter key function type in the text configuration information.
OH_TextConfig_SetPreviewTextSupport Sets whether preview text is supported.
OH_TextConfig_SetSelection Sets the selected text range.
OH_TextConfig_SetWindowId Sets the ID of the window to which the input box belongs.
OH_TextConfig_SetPlaceholder Sets the placeholder text information.
OH_TextConfig_SetAbilityName Sets the abilityName information.
OH_TextConfig_SetConsumeKeyEvents

Sets whether the edit box can fully process keys such as letters, characters, and function keys in the text configuration information.

Since: 26.0.0

Function Description
OH_TextConfig_GetInputType Obtains the input box type.
OH_TextConfig_GetEnterKeyType Obtains the enter key function type.
OH_TextConfig_IsPreviewTextSupported Obtains whether preview text is supported.
OH_TextConfig_GetCursorInfo Obtains the cursor information (double pointer, memory allocated inside the function).
OH_TextConfig_GetTextAvoidInfo Obtains the avoidance information (double pointer, memory allocated inside the function).
OH_TextConfig_GetSelection Obtains the selection range information.
OH_TextConfig_GetWindowId Obtains the window ID of the owning window.
OH_TextConfig_GetPlaceholder Obtains the placeholder text information.
OH_TextConfig_GetAbilityName Obtains the abilityName information.
OH_TextConfig_GetConsumeKeyEvents

Obtains whether the edit box can fully process keys such as letters, characters, and function keys in the text configuration information.

Since: 26.0.0