1# inputmethod_text_config_capi.h 2<!--Kit: IME Kit--> 3<!--Subsystem: MiscServices--> 4<!--Owner: @illybyy--> 5<!--Designer: @andeszhang--> 6<!--Tester: @murphy1984--> 7<!--Adviser: @zhang_yixin13--> 8 9## Overview 10 11Provides methods for creating, destroying, reading, and writing the text box configuration information objects. 12 13**File to include**: <inputmethod/inputmethod_text_config_capi.h> 14 15**Library**: libohinputmethod.so 16 17**System capability**: SystemCapability.MiscServices.InputMethodFramework 18 19**Since**: 12 20 21**Related module**: [InputMethod](capi-inputmethod.md) 22 23## Summary 24 25### Structs 26 27| Name| typedef Keyword| Description| 28| -- | -- | -- | 29| [InputMethod_TextConfig](capi-inputmethod-inputmethod-textconfig.md) | InputMethod_TextConfig | Represents the text box configuration information. | 30 31### Function 32 33| Name| Description| 34| -- | -- | 35| [InputMethod_TextConfig *OH_TextConfig_Create(void)](#oh_textconfig_create) | Creates an [InputMethod_TextConfig](capi-inputmethod-inputmethod-textconfig.md) instance.| 36| [void OH_TextConfig_Destroy(InputMethod_TextConfig *config)](#oh_textconfig_destroy) | Destroys an [InputMethod_TextConfig](capi-inputmethod-inputmethod-textconfig.md) instance.| 37| [InputMethod_ErrorCode OH_TextConfig_SetInputType(InputMethod_TextConfig *config, InputMethod_TextInputType inputType)](#oh_textconfig_setinputtype) | Sets the text box type.| 38| [InputMethod_ErrorCode OH_TextConfig_SetEnterKeyType(InputMethod_TextConfig *config, InputMethod_EnterKeyType enterKeyType)](#oh_textconfig_setenterkeytype) | Sets the Enter key type.| 39| [InputMethod_ErrorCode OH_TextConfig_SetPreviewTextSupport(InputMethod_TextConfig *config, bool supported)](#oh_textconfig_setpreviewtextsupport) | Sets the text preview feature.| 40| [InputMethod_ErrorCode OH_TextConfig_SetSelection(InputMethod_TextConfig *config, int32_t start, int32_t end)](#oh_textconfig_setselection) | Sets the selected text area.| 41| [InputMethod_ErrorCode OH_TextConfig_SetWindowId(InputMethod_TextConfig *config, int32_t windowId)](#oh_textconfig_setwindowid) | Sets the window ID.| 42| [InputMethod_ErrorCode OH_TextConfig_SetPlaceholder(InputMethod_TextConfig *config, const char16_t *placeholder,size_t length)](#oh_textconfig_setplaceholder) | Sets the placeholder text.| 43| [InputMethod_ErrorCode OH_TextConfig_SetAbilityName(InputMethod_TextConfig *config, const char16_t *abilityName,size_t length)](#oh_textconfig_setabilityname) | Sets the ability name.| 44| [InputMethod_ErrorCode OH_TextConfig_GetInputType(InputMethod_TextConfig *config, InputMethod_TextInputType *inputType)](#oh_textconfig_getinputtype) | Obtains the text box type.| 45| [InputMethod_ErrorCode OH_TextConfig_GetEnterKeyType(InputMethod_TextConfig *config, InputMethod_EnterKeyType *enterKeyType)](#oh_textconfig_getenterkeytype) | Obtains the Enter key type.| 46| [InputMethod_ErrorCode OH_TextConfig_IsPreviewTextSupported(InputMethod_TextConfig *config, bool *supported)](#oh_textconfig_ispreviewtextsupported) | Obtains whether the text preview feature is supported.| 47| [InputMethod_ErrorCode OH_TextConfig_GetCursorInfo(InputMethod_TextConfig *config, InputMethod_CursorInfo **cursorInfo)](#oh_textconfig_getcursorinfo) | Obtains the cursor information.| 48| [InputMethod_ErrorCode OH_TextConfig_GetTextAvoidInfo(InputMethod_TextConfig *config, InputMethod_TextAvoidInfo **avoidInfo)](#oh_textconfig_gettextavoidinfo) | Obtains the avoidance information.| 49| [InputMethod_ErrorCode OH_TextConfig_GetSelection(InputMethod_TextConfig *config, int32_t *start, int32_t *end)](#oh_textconfig_getselection) | Obtains the selected text area.| 50| [InputMethod_ErrorCode OH_TextConfig_GetWindowId(InputMethod_TextConfig *config, int32_t *windowId)](#oh_textconfig_getwindowid) | Obtains the window ID.| 51| [InputMethod_ErrorCode OH_TextConfig_GetPlaceholder(InputMethod_TextConfig *config, char16_t *placeholder,size_t *length)](#oh_textconfig_getplaceholder) | Obtains the placeholder text.| 52| [InputMethod_ErrorCode OH_TextConfig_GetAbilityName(InputMethod_TextConfig *config, char16_t *abilityName,size_t *length)](#oh_textconfig_getabilityname) | Obtains the ability name.| 53 54## Function Description 55 56### OH_TextConfig_Create() 57 58``` 59InputMethod_TextConfig *OH_TextConfig_Create(void) 60``` 61 62**Description** 63 64Creates an [InputMethod_TextConfig](capi-inputmethod-inputmethod-textconfig.md) instance. 65 66**Since**: 12 67 68**Returns** 69 70| Type| Description| 71| -- | -- | 72| [InputMethod_TextConfig](capi-inputmethod-inputmethod-textconfig.md) * | If the operation is successful, a pointer to the created [InputMethod_TextConfig](capi-inputmethod-inputmethod-textconfig.md) instance is returned.<br> If the operation failed, **NULL** is returned, which may be caused by insufficient application address space.| 73 74### OH_TextConfig_Destroy() 75 76``` 77void OH_TextConfig_Destroy(InputMethod_TextConfig *config) 78``` 79 80**Description** 81 82Destroys an [InputMethod_TextConfig](capi-inputmethod-inputmethod-textconfig.md) instance. 83 84**Since**: 12 85 86 87**Parameters** 88 89| Name| Description| 90| -- | -- | 91| [InputMethod_TextConfig](capi-inputmethod-inputmethod-textconfig.md) *config | Pointer to the [InputMethod_TextConfig](capi-inputmethod-inputmethod-textconfig.md) instance to be destroyed.| 92 93### OH_TextConfig_SetInputType() 94 95``` 96InputMethod_ErrorCode OH_TextConfig_SetInputType(InputMethod_TextConfig *config, InputMethod_TextInputType inputType) 97``` 98 99**Description** 100 101Sets the text box type. 102 103**Since**: 12 104 105 106**Parameters** 107 108| Name| Description| 109| -- | -- | 110| [InputMethod_TextConfig](capi-inputmethod-inputmethod-textconfig.md) *config | Pointer to the [InputMethod_TextConfig](capi-inputmethod-inputmethod-textconfig.md) instance whose value is to be set.| 111| [InputMethod_TextInputType](capi-inputmethod-types-capi-h.md#inputmethod_textinputtype) inputType | Input type of the text box.| 112 113**Returns** 114 115| Type| Description| 116| -- | -- | 117| [InputMethod_ErrorCode](capi-inputmethod-types-capi-h.md#inputmethod_errorcode) | An error code.<br> [IME_ERR_OK](capi-inputmethod-types-capi-h.md#inputmethod_errorcode) - Success.<br> [IME_ERR_NULL_POINTER](capi-inputmethod-types-capi-h.md#inputmethod_errorcode) - An unexpected null pointer.<br> For details about the error codes, see [InputMethod_ErrorCode](capi-inputmethod-types-capi-h.md#inputmethod_errorcode).| 118 119### OH_TextConfig_SetEnterKeyType() 120 121``` 122InputMethod_ErrorCode OH_TextConfig_SetEnterKeyType(InputMethod_TextConfig *config, InputMethod_EnterKeyType enterKeyType) 123``` 124 125**Description** 126 127Sets the Enter key type. 128 129**Since**: 12 130 131 132**Parameters** 133 134| Name| Description| 135| -- | -- | 136| [InputMethod_TextConfig](capi-inputmethod-inputmethod-textconfig.md) *config | Pointer to the [InputMethod_TextConfig](capi-inputmethod-inputmethod-textconfig.md) instance whose value is to be set.| 137| [InputMethod_EnterKeyType](capi-inputmethod-types-capi-h.md#inputmethod_enterkeytype) enterKeyType | Enter key type.| 138 139**Returns** 140 141| Type| Description| 142| -- | -- | 143| [InputMethod_ErrorCode](capi-inputmethod-types-capi-h.md#inputmethod_errorcode) | An error code.<br> [IME_ERR_OK](capi-inputmethod-types-capi-h.md#inputmethod_errorcode) - Success.<br> [IME_ERR_NULL_POINTER](capi-inputmethod-types-capi-h.md#inputmethod_errorcode) - An unexpected null pointer.<br> For details about the error codes, see [InputMethod_ErrorCode](capi-inputmethod-types-capi-h.md#inputmethod_errorcode).| 144 145### OH_TextConfig_SetPreviewTextSupport() 146 147``` 148InputMethod_ErrorCode OH_TextConfig_SetPreviewTextSupport(InputMethod_TextConfig *config, bool supported) 149``` 150 151**Description** 152 153Sets the text preview feature. 154 155**Since**: 12 156 157 158**Parameters** 159 160| Name| Description| 161| -- | -- | 162| [InputMethod_TextConfig](capi-inputmethod-inputmethod-textconfig.md) *config | Pointer to the [InputMethod_TextConfig](capi-inputmethod-inputmethod-textconfig.md) instance whose value is to be set.| 163| bool supported | Whether text preview is supported.| 164 165**Returns** 166 167| Type| Description| 168| -- | -- | 169| [InputMethod_ErrorCode](capi-inputmethod-types-capi-h.md#inputmethod_errorcode) | An error code.<br> [IME_ERR_OK](capi-inputmethod-types-capi-h.md#inputmethod_errorcode) - Success.<br> [IME_ERR_NULL_POINTER](capi-inputmethod-types-capi-h.md#inputmethod_errorcode) - An unexpected null pointer.<br> For details about the error codes, see [InputMethod_ErrorCode](capi-inputmethod-types-capi-h.md#inputmethod_errorcode).| 170 171### OH_TextConfig_SetSelection() 172 173``` 174InputMethod_ErrorCode OH_TextConfig_SetSelection(InputMethod_TextConfig *config, int32_t start, int32_t end) 175``` 176 177**Description** 178 179Sets the selected text area. 180 181**Since**: 12 182 183 184**Parameters** 185 186| Name| Description| 187| -- | -- | 188| [InputMethod_TextConfig](capi-inputmethod-inputmethod-textconfig.md) *config | Pointer to the [InputMethod_TextConfig](capi-inputmethod-inputmethod-textconfig.md) instance whose value is to be set.| 189| int32_t start | Start position of the selected text.| 190| int32_t end | End position of the selected text.| 191 192**Returns** 193 194| Type| Description| 195| -- | -- | 196| [InputMethod_ErrorCode](capi-inputmethod-types-capi-h.md#inputmethod_errorcode) | An error code.<br> [IME_ERR_OK](capi-inputmethod-types-capi-h.md#inputmethod_errorcode) - Success.<br> [IME_ERR_NULL_POINTER](capi-inputmethod-types-capi-h.md#inputmethod_errorcode) - An unexpected null pointer.<br> For details about the error codes, see [InputMethod_ErrorCode](capi-inputmethod-types-capi-h.md#inputmethod_errorcode).| 197 198### OH_TextConfig_SetWindowId() 199 200``` 201InputMethod_ErrorCode OH_TextConfig_SetWindowId(InputMethod_TextConfig *config, int32_t windowId) 202``` 203 204**Description** 205 206Sets the window ID. 207 208**Since**: 12 209 210 211**Parameters** 212 213| Name| Description| 214| -- | -- | 215| [InputMethod_TextConfig](capi-inputmethod-inputmethod-textconfig.md) *config | Pointer to the [InputMethod_TextConfig](capi-inputmethod-inputmethod-textconfig.md) instance whose value is to be set.| 216| int32_t windowId | Window ID of the application bound to the input method.| 217 218**Returns** 219 220| Type| Description| 221| -- | -- | 222| [InputMethod_ErrorCode](capi-inputmethod-types-capi-h.md#inputmethod_errorcode) | An error code.<br> [IME_ERR_OK](capi-inputmethod-types-capi-h.md#inputmethod_errorcode) - Success.<br> [IME_ERR_NULL_POINTER](capi-inputmethod-types-capi-h.md#inputmethod_errorcode) - An unexpected null pointer.<br> For details about the error codes, see [InputMethod_ErrorCode](capi-inputmethod-types-capi-h.md#inputmethod_errorcode).| 223 224### OH_TextConfig_SetPlaceholder() 225 226``` 227InputMethod_ErrorCode OH_TextConfig_SetPlaceholder(InputMethod_TextConfig *config, const char16_t *placeholder,size_t length) 228``` 229 230**Description** 231 232Sets the placeholder text. 233 234**Since**: 20 235 236 237**Parameters** 238 239| Name| Description| 240| -- | -- | 241| [InputMethod_TextConfig](capi-inputmethod-inputmethod-textconfig.md) *config | Pointer to the [InputMethod_TextConfig](capi-inputmethod-inputmethod-textconfig.md) instance whose value is to be set.| 242| const char16_t *placeholder | Pointer to a UTF-16 encoded double-byte string. If a null pointer is passed, the placeholder text is an empty string.| 243| size_t length | Number of elements in the memory to which **placeholder** points, including the null character of the double-byte string.1. If **length** is **0**, the placeholder text is an empty string.2. The maximum length of UTF-16 encoding is 255 characters (the null character of the string is not included in the count). If the length exceeds 255 characters, the extra characters will be truncated.| 244 245**Returns** 246 247| Type| Description| 248| -- | -- | 249| [InputMethod_ErrorCode](capi-inputmethod-types-capi-h.md#inputmethod_errorcode) | [InputMethod_ErrorCode](capi-inputmethod-types-capi-h.md#inputmethod_errorcode):<br> **IME_ERR_OK** = **0**: indicates success.<br> **IME_ERR_NULL_POINTER** = **12802000**: indicates an unexpected null pointer.| 250 251### OH_TextConfig_SetAbilityName() 252 253``` 254InputMethod_ErrorCode OH_TextConfig_SetAbilityName(InputMethod_TextConfig *config, const char16_t *abilityName,size_t length) 255``` 256 257**Description** 258 259Sets the ability name. 260 261**Since**: 20 262 263 264**Parameters** 265 266| Name| Description| 267| -- | -- | 268| [InputMethod_TextConfig](capi-inputmethod-inputmethod-textconfig.md) *config | Pointer to the [InputMethod_TextConfig](capi-inputmethod-inputmethod-textconfig.md) instance whose value is to be set.| 269| const char16_t *abilityName | Pointer to a UTF-16 encoded double-byte string. If a null pointer is passed, the ability name is an empty string.| 270| size_t length | Number of elements in the memory to which **abilityName** points, including the null character of the double-byte string.1. If **length** is **0**, the ability name is set to an empty string.2. The maximum length of UTF-16 encoding is 127 characters (the null character of the string is not included in the count). If the length exceeds 127 characters, the extra characters will be truncated.| 271 272**Returns** 273 274| Type| Description| 275| -- | -- | 276| [InputMethod_ErrorCode](capi-inputmethod-types-capi-h.md#inputmethod_errorcode) | [InputMethod_ErrorCode](capi-inputmethod-types-capi-h.md#inputmethod_errorcode):<br> **IME_ERR_OK** = **0**: indicates success.<br> **IME_ERR_NULL_POINTER** = **12802000**: indicates an unexpected null pointer.| 277 278### OH_TextConfig_GetInputType() 279 280``` 281InputMethod_ErrorCode OH_TextConfig_GetInputType(InputMethod_TextConfig *config, InputMethod_TextInputType *inputType) 282``` 283 284**Description** 285 286Obtains the text box type. 287 288**Since**: 12 289 290 291**Parameters** 292 293| Name| Description| 294| -- | -- | 295| [InputMethod_TextConfig](capi-inputmethod-inputmethod-textconfig.md) *config | Pointer to the [InputMethod_TextConfig](capi-inputmethod-inputmethod-textconfig.md) instance whose value is to be obtained.| 296| [InputMethod_TextInputType](capi-inputmethod-types-capi-h.md#inputmethod_textinputtype) *inputType | Pointer to the [InputMethod_TextInputType](capi-inputmethod-types-capi-h.md#inputmethod_textinputtype) instance. Input type of the text box.| 297 298**Returns** 299 300| Type| Description| 301| -- | -- | 302| [InputMethod_ErrorCode](capi-inputmethod-types-capi-h.md#inputmethod_errorcode) | An error code.<br> [IME_ERR_OK](capi-inputmethod-types-capi-h.md#inputmethod_errorcode) - Success.<br> [IME_ERR_NULL_POINTER](capi-inputmethod-types-capi-h.md#inputmethod_errorcode) - An unexpected null pointer.<br> For details about the error codes, see [InputMethod_ErrorCode](capi-inputmethod-types-capi-h.md#inputmethod_errorcode).| 303 304### OH_TextConfig_GetEnterKeyType() 305 306``` 307InputMethod_ErrorCode OH_TextConfig_GetEnterKeyType(InputMethod_TextConfig *config, InputMethod_EnterKeyType *enterKeyType) 308``` 309 310**Description** 311 312Obtains the Enter key type. 313 314**Since**: 12 315 316 317**Parameters** 318 319| Name| Description| 320| -- | -- | 321| [InputMethod_TextConfig](capi-inputmethod-inputmethod-textconfig.md) *config | Pointer to the [InputMethod_TextConfig](capi-inputmethod-inputmethod-textconfig.md) instance whose value is to be obtained.| 322| [InputMethod_EnterKeyType](capi-inputmethod-types-capi-h.md#inputmethod_enterkeytype) *enterKeyType | Pointer to the [InputMethod_EnterKeyType](capi-inputmethod-types-capi-h.md#inputmethod_enterkeytype) instance. Enter key type of the text box.| 323 324**Returns** 325 326| Type| Description| 327| -- | -- | 328| [InputMethod_ErrorCode](capi-inputmethod-types-capi-h.md#inputmethod_errorcode) | An error code.<br> [IME_ERR_OK](capi-inputmethod-types-capi-h.md#inputmethod_errorcode) - Success.<br> [IME_ERR_NULL_POINTER](capi-inputmethod-types-capi-h.md#inputmethod_errorcode) - An unexpected null pointer.<br> For details about the error codes, see [InputMethod_ErrorCode](capi-inputmethod-types-capi-h.md#inputmethod_errorcode).| 329 330### OH_TextConfig_IsPreviewTextSupported() 331 332``` 333InputMethod_ErrorCode OH_TextConfig_IsPreviewTextSupported(InputMethod_TextConfig *config, bool *supported) 334``` 335 336**Description** 337 338Obtains whether the text preview feature is supported. 339 340**Since**: 12 341 342 343**Parameters** 344 345| Name| Description| 346| -- | -- | 347| [InputMethod_TextConfig](capi-inputmethod-inputmethod-textconfig.md) *config | Pointer to the [InputMethod_TextConfig](capi-inputmethod-inputmethod-textconfig.md) instance whose value is to be obtained.| 348| bool *supported | Whether text preview is supported.| 349 350**Returns** 351 352| Type| Description| 353| -- | -- | 354| [InputMethod_ErrorCode](capi-inputmethod-types-capi-h.md#inputmethod_errorcode) | An error code.<br> [IME_ERR_OK](capi-inputmethod-types-capi-h.md#inputmethod_errorcode) - Success.<br> [IME_ERR_NULL_POINTER](capi-inputmethod-types-capi-h.md#inputmethod_errorcode) - An unexpected null pointer.<br> For details about the error codes, see [InputMethod_ErrorCode](capi-inputmethod-types-capi-h.md#inputmethod_errorcode).| 355 356### OH_TextConfig_GetCursorInfo() 357 358``` 359InputMethod_ErrorCode OH_TextConfig_GetCursorInfo(InputMethod_TextConfig *config, InputMethod_CursorInfo **cursorInfo) 360``` 361 362**Description** 363 364Obtains the cursor information. 365 366**Since**: 12 367 368 369**Parameters** 370 371| Name | Description| 372|------------------------------------------------------------------------------| -- | 373| [InputMethod_TextConfig](capi-inputmethod-inputmethod-textconfig.md) *config | Pointer to the [InputMethod_TextConfig](capi-inputmethod-inputmethod-textconfig.md) instance whose value is to be obtained.| 374| [InputMethod_CursorInfo](capi-inputmethod-inputmethod-cursorinfo.md) **cursorInfo | Cursor information.| 375 376**Returns** 377 378| Type| Description| 379| -- | -- | 380| [InputMethod_ErrorCode](capi-inputmethod-types-capi-h.md#inputmethod_errorcode) | An error code.<br> [IME_ERR_OK](capi-inputmethod-types-capi-h.md#inputmethod_errorcode) - Success.<br> [IME_ERR_NULL_POINTER](capi-inputmethod-types-capi-h.md#inputmethod_errorcode) - An unexpected null pointer.<br> For details about the error codes, see [InputMethod_ErrorCode](capi-inputmethod-types-capi-h.md#inputmethod_errorcode).| 381 382### OH_TextConfig_GetTextAvoidInfo() 383 384``` 385InputMethod_ErrorCode OH_TextConfig_GetTextAvoidInfo(InputMethod_TextConfig *config, InputMethod_TextAvoidInfo **avoidInfo) 386``` 387 388**Description** 389 390Obtains the avoidance information. 391 392**Since**: 12 393 394 395**Parameters** 396 397| Name | Description| 398|------------------------------------------------------------------------------| -- | 399| [InputMethod_TextConfig](capi-inputmethod-inputmethod-textconfig.md) *config | Text configuration information.| 400| [InputMethod_TextAvoidInfo](capi-inputmethod-inputmethod-textavoidinfo.md) **avoidInfo | Text box avoidance information.| 401 402**Returns** 403 404| Type| Description| 405| -- | -- | 406| [InputMethod_ErrorCode](capi-inputmethod-types-capi-h.md#inputmethod_errorcode) | An error code.<br> [IME_ERR_OK](capi-inputmethod-types-capi-h.md#inputmethod_errorcode) - Success.<br> [IME_ERR_NULL_POINTER](capi-inputmethod-types-capi-h.md#inputmethod_errorcode) - An unexpected null pointer.<br> For details about the error codes, see [InputMethod_ErrorCode](capi-inputmethod-types-capi-h.md#inputmethod_errorcode).<br>| 407 408### OH_TextConfig_GetSelection() 409 410``` 411InputMethod_ErrorCode OH_TextConfig_GetSelection(InputMethod_TextConfig *config, int32_t *start, int32_t *end) 412``` 413 414**Description** 415 416Obtains the selected text area. 417 418**Since**: 12 419 420 421**Parameters** 422 423| Name| Description| 424| -- | -- | 425| [InputMethod_TextConfig](capi-inputmethod-inputmethod-textconfig.md) *config | Pointer to the [InputMethod_TextConfig](capi-inputmethod-inputmethod-textconfig.md) instance whose value is to be obtained.| 426| int32_t *start | Start position of the selected text.| 427| int32_t *end | End position of the selected text.| 428 429**Returns** 430 431| Type| Description| 432| -- | -- | 433| [InputMethod_ErrorCode](capi-inputmethod-types-capi-h.md#inputmethod_errorcode) | An error code.<br> [IME_ERR_OK](capi-inputmethod-types-capi-h.md#inputmethod_errorcode) - Success.<br> [IME_ERR_NULL_POINTER](capi-inputmethod-types-capi-h.md#inputmethod_errorcode) - An unexpected null pointer.<br> For details about the error codes, see [InputMethod_ErrorCode](capi-inputmethod-types-capi-h.md#inputmethod_errorcode).| 434 435### OH_TextConfig_GetWindowId() 436 437``` 438InputMethod_ErrorCode OH_TextConfig_GetWindowId(InputMethod_TextConfig *config, int32_t *windowId) 439``` 440 441**Description** 442 443Obtains the window ID. 444 445**Since**: 12 446 447 448**Parameters** 449 450| Name| Description| 451| -- | -- | 452| [InputMethod_TextConfig](capi-inputmethod-inputmethod-textconfig.md) *config | Pointer to the [InputMethod_TextConfig](capi-inputmethod-inputmethod-textconfig.md) instance whose value is to be obtained.| 453| int32_t *windowId | Window ID of the application bound to the input method.| 454 455**Returns** 456 457| Type| Description| 458| -- | -- | 459| [InputMethod_ErrorCode](capi-inputmethod-types-capi-h.md#inputmethod_errorcode) | An error code.<br> [IME_ERR_OK](capi-inputmethod-types-capi-h.md#inputmethod_errorcode) - Success.<br> [IME_ERR_NULL_POINTER](capi-inputmethod-types-capi-h.md#inputmethod_errorcode) - An unexpected null pointer.<br> For details about the error codes, see [InputMethod_ErrorCode](capi-inputmethod-types-capi-h.md#inputmethod_errorcode).| 460 461### OH_TextConfig_GetPlaceholder() 462 463``` 464InputMethod_ErrorCode OH_TextConfig_GetPlaceholder(InputMethod_TextConfig *config, char16_t *placeholder,size_t *length) 465``` 466 467**Description** 468 469Obtains the placeholder text. 470 471**Since**: 20 472 473 474**Parameters** 475 476| Name| Description| 477| -- | -- | 478| [InputMethod_TextConfig](capi-inputmethod-inputmethod-textconfig.md) *config | Pointer to the [InputMethod_TextConfig](capi-inputmethod-inputmethod-textconfig.md) instance whose value is to be obtained.| 479| char16_t *placeholder | Pointer to the placeholder text. The memory of this pointer is maintained by the caller.| 480| size_t *length | Pointer to the length of the placeholder text, in double bytes. The length includes the null character of the string.1. As an input parameter, **length** indicates the available length of the memory to which **placeholder** points. As an output parameter, it indicates the actual length of the placeholder text.2. If **placeholder** is a null pointer and **length** points to valid memory, **length** will be set to the actual length of the placeholder text, and an error will be thrown.3. If both **placeholder** and **length** point to valid memory, but the value of **length** is less than the actual length of the placeholder text, **length** will be set to the actual length of the placeholder text, and an error will be thrown.| 481 482**Returns** 483 484| Type| Description| 485| -- | -- | 486| [InputMethod_ErrorCode](capi-inputmethod-types-capi-h.md#inputmethod_errorcode) | [InputMethod_ErrorCode](capi-inputmethod-types-capi-h.md#inputmethod_errorcode):<br> **IME_ERR_OK** = **0**: indicates success.<br> **IME_ERR_PARAMCHECK** = **401**: indicates that parameter check failed.<br> **IME_ERR_NULL_POINTER** = **12802000**: indicates an unexpected null pointer.| 487 488### OH_TextConfig_GetAbilityName() 489 490``` 491InputMethod_ErrorCode OH_TextConfig_GetAbilityName(InputMethod_TextConfig *config, char16_t *abilityName,size_t *length) 492``` 493 494**Description** 495 496Obtains the ability name. 497 498**Since**: 20 499 500 501**Parameters** 502 503| Name| Description| 504| -- | -- | 505| [InputMethod_TextConfig](capi-inputmethod-inputmethod-textconfig.md) *config | Pointer to the [InputMethod_TextConfig](capi-inputmethod-inputmethod-textconfig.md) instance whose value is to be obtained.| 506| char16_t *abilityName | Pointer to the ability name. The memory of this pointer is maintained by the caller.| 507| size_t *length | Pointer to the length of the ability name, in double bytes. The length includes the null character of the string.1. As an input parameter, **length** indicates the available length of the memory to which **abilityName** points. As an output parameter, it indicates the actual length of the ability name.2. If **abilityName** is a null pointer and **length** points to valid memory, **length** will be set to the actual length of the ability name, and an error will be thrown.3. If both **abilityName** and **length** point to valid memory, but the value of **length** is less than the actual length of the ability name, **length** will be set to the actual length of the ability name, and an error will be thrown.| 508 509**Returns** 510 511| Type| Description| 512| -- | -- | 513| [InputMethod_ErrorCode](capi-inputmethod-types-capi-h.md#inputmethod_errorcode) | [InputMethod_ErrorCode](capi-inputmethod-types-capi-h.md#inputmethod_errorcode):<br> **IME_ERR_OK** = **0**: indicates success.<br> **IME_ERR_PARAMCHECK** = **401**: indicates that parameter check failed.<br> **IME_ERR_NULL_POINTER** = **12802000**: indicates an unexpected null pointer.| 514