1# inputmethod_text_avoid_info_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 avoidance information objects. 12 13**File to include**: <inputmethod/inputmethod_text_avoid_info_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_TextAvoidInfo](capi-inputmethod-inputmethod-textavoidinfo.md) | InputMethod_TextAvoidInfo | Represents the information used by the input box to avoid the keyboard.| 30 31### Function 32 33| Name| Description | 34| -- |-----------------------------------------------| 35| [InputMethod_TextAvoidInfo *OH_TextAvoidInfo_Create(double positionY, double height)](#oh_textavoidinfo_create) | Creates an [InputMethod_TextAvoidInfo](capi-inputmethod-inputmethod-textavoidinfo.md) instance.| 36| [void OH_TextAvoidInfo_Destroy(InputMethod_TextAvoidInfo *info)](#oh_textavoidinfo_destroy) | Destroys an [InputMethod_TextAvoidInfo](capi-inputmethod-inputmethod-textavoidinfo.md) instance. | 37| [InputMethod_ErrorCode OH_TextAvoidInfo_SetPositionY(InputMethod_TextAvoidInfo *info, double positionY)](#oh_textavoidinfo_setpositiony) | Sets the Y coordinate in [InputMethod_TextAvoidInfo](capi-inputmethod-inputmethod-textavoidinfo.md). | 38| [InputMethod_ErrorCode OH_TextAvoidInfo_SetHeight(InputMethod_TextAvoidInfo *info, double height)](#oh_textavoidinfo_setheight) | Sets the height in [InputMethod_TextAvoidInfo](capi-inputmethod-inputmethod-textavoidinfo.md). | 39| [InputMethod_ErrorCode OH_TextAvoidInfo_GetPositionY(InputMethod_TextAvoidInfo *info, double *positionY)](#oh_textavoidinfo_getpositiony) | Obtains the Y coordinate from [InputMethod_TextAvoidInfo](capi-inputmethod-inputmethod-textavoidinfo.md). | 40| [InputMethod_ErrorCode OH_TextAvoidInfo_GetHeight(InputMethod_TextAvoidInfo *info, double *height)](#oh_textavoidinfo_getheight) | Obtains the height from [InputMethod_TextAvoidInfo](capi-inputmethod-inputmethod-textavoidinfo.md). | 41 42## Function Description 43 44### OH_TextAvoidInfo_Create() 45 46``` 47InputMethod_TextAvoidInfo *OH_TextAvoidInfo_Create(double positionY, double height) 48``` 49 50**Description** 51 52Creates an [InputMethod_TextAvoidInfo](capi-inputmethod-inputmethod-textavoidinfo.md) instance. 53 54**Since**: 12 55 56 57**Parameters** 58 59| Name| Description| 60| -- | -- | 61| double positionY | Y coordinate of the text box.| 62| double height | Height of the text box.| 63 64**Returns** 65 66| Type| Description| 67| -- | -- | 68| [InputMethod_TextAvoidInfo](capi-inputmethod-inputmethod-textavoidinfo.md) * | If the operation is successful, a pointer to the created [InputMethod_TextAvoidInfo](capi-inputmethod-inputmethod-textavoidinfo.md) instance is returned.<br> If the operation failed, **NULL** is returned, which may be caused by insufficient application address space.| 69 70### OH_TextAvoidInfo_Destroy() 71 72``` 73void OH_TextAvoidInfo_Destroy(InputMethod_TextAvoidInfo *info) 74``` 75 76**Description** 77 78Destroys an [InputMethod_TextAvoidInfo](capi-inputmethod-inputmethod-textavoidinfo.md) instance. 79 80**Since**: 12 81 82 83**Parameters** 84 85| Name| Description| 86| -- | -- | 87| [InputMethod_TextAvoidInfo](capi-inputmethod-inputmethod-textavoidinfo.md) *info | Pointer to the [InputMethod_TextAvoidInfo](capi-inputmethod-inputmethod-textavoidinfo.md) instance to be destroyed.| 88 89### OH_TextAvoidInfo_SetPositionY() 90 91``` 92InputMethod_ErrorCode OH_TextAvoidInfo_SetPositionY(InputMethod_TextAvoidInfo *info, double positionY) 93``` 94 95**Description** 96 97Sets the Y coordinate in [InputMethod_TextAvoidInfo](capi-inputmethod-inputmethod-textavoidinfo.md). 98 99**Since**: 12 100 101 102**Parameters** 103 104| Name| Description| 105| -- | -- | 106| [InputMethod_TextAvoidInfo](capi-inputmethod-inputmethod-textavoidinfo.md) *info | Pointer to the [InputMethod_TextAvoidInfo](capi-inputmethod-inputmethod-textavoidinfo.md) instance whose value is to be set.| 107| double positionY | Absolute value of the distance between the text box's top vertex and the top edge of the physical screen.| 108 109**Returns** 110 111| Type| Description| 112| -- | -- | 113| [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).| 114 115### OH_TextAvoidInfo_SetHeight() 116 117``` 118InputMethod_ErrorCode OH_TextAvoidInfo_SetHeight(InputMethod_TextAvoidInfo *info, double height) 119``` 120 121**Description** 122 123Sets the height in [InputMethod_TextAvoidInfo](capi-inputmethod-inputmethod-textavoidinfo.md). 124 125**Since**: 12 126 127 128**Parameters** 129 130| Name| Description| 131| -- | -- | 132| [InputMethod_TextAvoidInfo](capi-inputmethod-inputmethod-textavoidinfo.md) *info | Pointer to the [InputMethod_TextAvoidInfo](capi-inputmethod-inputmethod-textavoidinfo.md) instance whose value is to be set.| 133| double height | Height.| 134 135**Returns** 136 137| Type| Description| 138| -- | -- | 139| [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).| 140 141### OH_TextAvoidInfo_GetPositionY() 142 143``` 144InputMethod_ErrorCode OH_TextAvoidInfo_GetPositionY(InputMethod_TextAvoidInfo *info, double *positionY) 145``` 146 147**Description** 148 149Obtains the Y coordinate from [InputMethod_TextAvoidInfo](capi-inputmethod-inputmethod-textavoidinfo.md). 150 151**Since**: 12 152 153 154**Parameters** 155 156| Name| Description| 157| -- | -- | 158| [InputMethod_TextAvoidInfo](capi-inputmethod-inputmethod-textavoidinfo.md) *info | Pointer to the [InputMethod_TextAvoidInfo](capi-inputmethod-inputmethod-textavoidinfo.md) instance whose value is to be obtained.| 159| double *positionY | Absolute value of the distance between the text box's top vertex and the top edge of the physical screen.| 160 161**Returns** 162 163| Type| Description| 164| -- | -- | 165| [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).| 166 167### OH_TextAvoidInfo_GetHeight() 168 169``` 170InputMethod_ErrorCode OH_TextAvoidInfo_GetHeight(InputMethod_TextAvoidInfo *info, double *height) 171``` 172 173**Description** 174 175Obtains the height from [InputMethod_TextAvoidInfo](capi-inputmethod-inputmethod-textavoidinfo.md). 176 177**Since**: 12 178 179 180**Parameters** 181 182| Name| Description| 183| -- | -- | 184| [InputMethod_TextAvoidInfo](capi-inputmethod-inputmethod-textavoidinfo.md) *info | Pointer to the [InputMethod_TextAvoidInfo](capi-inputmethod-inputmethod-textavoidinfo.md) instance whose value is to be obtained.| 185| double *height | Height of the text box.| 186 187**Returns** 188 189| Type| Description| 190| -- | -- | 191| [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).| 192