1e41f4b71Sopenharmony_ci# @ohos.app.form.formInfo (formInfo) 2e41f4b71Sopenharmony_ci 3e41f4b71Sopenharmony_ciThe **formInfo** module provides types and enums related to the widget information and state. 4e41f4b71Sopenharmony_ci 5e41f4b71Sopenharmony_ci> **NOTE** 6e41f4b71Sopenharmony_ci> 7e41f4b71Sopenharmony_ci> The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version. 8e41f4b71Sopenharmony_ci 9e41f4b71Sopenharmony_ci## Modules to Import 10e41f4b71Sopenharmony_ci 11e41f4b71Sopenharmony_ci```ts 12e41f4b71Sopenharmony_ciimport { formInfo } from '@kit.FormKit'; 13e41f4b71Sopenharmony_ci``` 14e41f4b71Sopenharmony_ci 15e41f4b71Sopenharmony_ci## FormInfo 16e41f4b71Sopenharmony_ci 17e41f4b71Sopenharmony_ciDefines the widget information. 18e41f4b71Sopenharmony_ci 19e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Ability.Form 20e41f4b71Sopenharmony_ci 21e41f4b71Sopenharmony_ci| Name | Type | Readable | Writable | Description | 22e41f4b71Sopenharmony_ci| ----------- | -------- | -------- | -------------------- | ------------------------------------------------------------ | 23e41f4b71Sopenharmony_ci| bundleName | string | Yes | No | Name of the bundle to which the widget belongs.<br>**Atomic service API**: This API can be used in atomic services since API version 11. | 24e41f4b71Sopenharmony_ci| moduleName | string | Yes | No | Name of the module to which the widget belongs.<br>**Atomic service API**: This API can be used in atomic services since API version 11. | 25e41f4b71Sopenharmony_ci| abilityName | string | Yes | No | Name of the ability to which the widget belongs.<br>**Atomic service API**: This API can be used in atomic services since API version 11. | 26e41f4b71Sopenharmony_ci| name | string | Yes | No | Name of an application or atomic service.<br>**Atomic service API**: This API can be used in atomic services since API version 11. | 27e41f4b71Sopenharmony_ci| displayName<sup>11+</sup> | string | Yes | No | Widget name.<br>**Atomic service API**: This API can be used in atomic services since API version 11. | 28e41f4b71Sopenharmony_ci| displayNameId<sup>11+</sup> | number | Yes | No | ID of the widget name displayed during widget preview.<br>**Atomic service API**: This API can be used in atomic services since API version 11. | 29e41f4b71Sopenharmony_ci| description | string | Yes | No | Description of the widget.<br>**Atomic service API**: This API can be used in atomic services since API version 11. | 30e41f4b71Sopenharmony_ci| descriptionId<sup>10+</sup> | number | Yes | No | ID of the widget description.<br>**Atomic service API**: This API can be used in atomic services since API version 11. | 31e41f4b71Sopenharmony_ci| type | [FormType](#formtype) | Yes | No | Type of the widget. Currently, JS and ArkTS widgets are supported.<br>**Atomic service API**: This API can be used in atomic services since API version 11. | 32e41f4b71Sopenharmony_ci| jsComponentName | string | Yes | No | Name of the component used in the JS widget.<br>**Atomic service API**: This API can be used in atomic services since API version 11. | 33e41f4b71Sopenharmony_ci| colorMode | [ColorMode](#colormode) | Yes | No | Color mode of the widget.<br>**Atomic service API**: This API can be used in atomic services since API version 11. | 34e41f4b71Sopenharmony_ci| isDefault | boolean | Yes | No | Whether the widget is the default one.<br>**Atomic service API**: This API can be used in atomic services since API version 11. | 35e41f4b71Sopenharmony_ci| updateEnabled | boolean | Yes | No | Whether the widget is updatable.<br>**Atomic service API**: This API can be used in atomic services since API version 11. | 36e41f4b71Sopenharmony_ci| formVisibleNotify | boolean | Yes | No | Whether to send a notification when the widget is visible.<br>**Atomic service API**: This API can be used in atomic services since API version 11. | 37e41f4b71Sopenharmony_ci| scheduledUpdateTime | string | Yes | No | Time when the widget was updated.<br>**Atomic service API**: This API can be used in atomic services since API version 11. | 38e41f4b71Sopenharmony_ci| formConfigAbility | string | Yes | No | Configuration ability of the widget, that is, the ability corresponding to the option in the selection box displayed when the widget is long pressed.<br>**Atomic service API**: This API can be used in atomic services since API version 11. | 39e41f4b71Sopenharmony_ci| updateDuration | number | Yes | No | Update period of the widget.<br>**Atomic service API**: This API can be used in atomic services since API version 11. | 40e41f4b71Sopenharmony_ci| defaultDimension | number | Yes | No | Widget specifications.<br>**Atomic service API**: This API can be used in atomic services since API version 11. | 41e41f4b71Sopenharmony_ci| supportDimensions | Array<number> | Yes | No | Dimensions supported by the widget. For details, see [FormDimension](#formdimension).<br>**Atomic service API**: This API can be used in atomic services since API version 11. | 42e41f4b71Sopenharmony_ci| customizeData | Record\<string, string> | Yes | No | Custom data of the widget.<br>**Atomic service API**: This API can be used in atomic services since API version 11. | 43e41f4b71Sopenharmony_ci| isDynamic<sup>10+</sup> | boolean | Yes | No | Whether the widget is a dynamic widget.<br>ArkTS widgets are classified into dynamic and static widgets. JS widgets are all dynamic widgets.<br>**Atomic service API**: This API can be used in atomic services since API version 11. | 44e41f4b71Sopenharmony_ci| transparencyEnabled<sup>11+</sup> | boolean | Yes | No | Whether the widget supports the setting of the background transparency.<br>For ArkTS widgets, the support for the background transparency setting depends on user configurations. For JS widgets, the background transparency setting is not supported.<br>**Atomic service API**: This API can be used in atomic services since API version 11. | 45e41f4b71Sopenharmony_ci| supportedShapes<sup>12+</sup> | Array<number> | Yes | No | Shapes supported by the widget. For details about the available shapes, see [FormShape<sup>12+</sup>](#formshape12).<br>**Atomic service API**: This API can be used in atomic services since API version 12. | 46e41f4b71Sopenharmony_ci 47e41f4b71Sopenharmony_ci## FormType 48e41f4b71Sopenharmony_ci 49e41f4b71Sopenharmony_ciEnumerates the widget types. 50e41f4b71Sopenharmony_ci 51e41f4b71Sopenharmony_ci**Atomic service API**: This API can be used in atomic services since API version 11. 52e41f4b71Sopenharmony_ci 53e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Ability.Form 54e41f4b71Sopenharmony_ci 55e41f4b71Sopenharmony_ci| Name | Value | Description | 56e41f4b71Sopenharmony_ci| ----------- | ---- | ------------ | 57e41f4b71Sopenharmony_ci| JS | 1 | JS widget. | 58e41f4b71Sopenharmony_ci| eTS | 2 | ArkTS widget. | 59e41f4b71Sopenharmony_ci 60e41f4b71Sopenharmony_ci## ColorMode 61e41f4b71Sopenharmony_ci 62e41f4b71Sopenharmony_ciEnumerates the color modes supported by the widget. 63e41f4b71Sopenharmony_ci 64e41f4b71Sopenharmony_ci**Atomic service API**: This API can be used in atomic services since API version 11. 65e41f4b71Sopenharmony_ci 66e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Ability.Form 67e41f4b71Sopenharmony_ci 68e41f4b71Sopenharmony_ci| Name | Value | Description | 69e41f4b71Sopenharmony_ci| ----------- | ---- | ------------ | 70e41f4b71Sopenharmony_ci| MODE_AUTO | -1 | Auto mode. | 71e41f4b71Sopenharmony_ci| MODE_DARK | 0 | Dark mode. | 72e41f4b71Sopenharmony_ci| MODE_LIGHT | 1 | Light mode. | 73e41f4b71Sopenharmony_ci 74e41f4b71Sopenharmony_ci## FormStateInfo 75e41f4b71Sopenharmony_ci 76e41f4b71Sopenharmony_ciDescribes the widget state information. 77e41f4b71Sopenharmony_ci 78e41f4b71Sopenharmony_ci**Atomic service API**: This API can be used in atomic services since API version 11. 79e41f4b71Sopenharmony_ci 80e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Ability.Form 81e41f4b71Sopenharmony_ci 82e41f4b71Sopenharmony_ci| Name | Type | Readable | Writable | Description | 83e41f4b71Sopenharmony_ci| ----------- | -------- | -------- | -------------------- | ------------------------------------------------------------ | 84e41f4b71Sopenharmony_ci| formState | [FormState](#formstate) | Yes | No | Widget state. | 85e41f4b71Sopenharmony_ci| want | [Want](../apis-ability-kit/js-apis-app-ability-want.md) | Yes | No | Want text. | 86e41f4b71Sopenharmony_ci 87e41f4b71Sopenharmony_ci## FormState 88e41f4b71Sopenharmony_ci 89e41f4b71Sopenharmony_ciEnumerates the widget states. 90e41f4b71Sopenharmony_ci 91e41f4b71Sopenharmony_ci**Atomic service API**: This API can be used in atomic services since API version 11. 92e41f4b71Sopenharmony_ci 93e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Ability.Form 94e41f4b71Sopenharmony_ci 95e41f4b71Sopenharmony_ci| Name | Value | Description | 96e41f4b71Sopenharmony_ci| ----------- | ---- | ------------ | 97e41f4b71Sopenharmony_ci| UNKNOWN | -1 | Unknown state. | 98e41f4b71Sopenharmony_ci| DEFAULT | 0 | Default state. | 99e41f4b71Sopenharmony_ci| READY | 1 | Ready state. | 100e41f4b71Sopenharmony_ci 101e41f4b71Sopenharmony_ci## FormParam 102e41f4b71Sopenharmony_ci 103e41f4b71Sopenharmony_ciEnumerates the widget parameters. 104e41f4b71Sopenharmony_ci 105e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Ability.Form 106e41f4b71Sopenharmony_ci 107e41f4b71Sopenharmony_ci| Name | Value | Description | 108e41f4b71Sopenharmony_ci| ----------- | ---- | ------------ | 109e41f4b71Sopenharmony_ci| IDENTITY_KEY | 'ohos.extra.param.key.form_identity' | Widget ID.<br>**Atomic service API**: This API can be used in atomic services since API version 11.| 110e41f4b71Sopenharmony_ci| DIMENSION_KEY | 'ohos.extra.param.key.form_dimension' | Widget dimension.<br>**Atomic service API**: This API can be used in atomic services since API version 11.| 111e41f4b71Sopenharmony_ci| NAME_KEY | 'ohos.extra.param.key.form_name' | Widget name.<br>**Atomic service API**: This API can be used in atomic services since API version 11.| 112e41f4b71Sopenharmony_ci| MODULE_NAME_KEY | 'ohos.extra.param.key.module_name' | Name of the module to which the widget belongs.<br>**Atomic service API**: This API can be used in atomic services since API version 11.| 113e41f4b71Sopenharmony_ci| WIDTH_KEY | 'ohos.extra.param.key.form_width' | Widget width.<br>**Atomic service API**: This API can be used in atomic services since API version 11.| 114e41f4b71Sopenharmony_ci| HEIGHT_KEY | 'ohos.extra.param.key.form_height' | Widget height.<br>**Atomic service API**: This API can be used in atomic services since API version 11.| 115e41f4b71Sopenharmony_ci| TEMPORARY_KEY | 'ohos.extra.param.key.form_temporary' | Temporary widget.<br>**Atomic service API**: This API can be used in atomic services since API version 11.| 116e41f4b71Sopenharmony_ci| ABILITY_NAME_KEY | 'ohos.extra.param.key.ability_name' | Ability name.<br>**Atomic service API**: This API can be used in atomic services since API version 11.| 117e41f4b71Sopenharmony_ci| BUNDLE_NAME_KEY | 'ohos.extra.param.key.bundle_name' | Bundle name.<br>**Atomic service API**: This API can be used in atomic services since API version 11.| 118e41f4b71Sopenharmony_ci| LAUNCH_REASON_KEY<sup>10+</sup> | 'ohos.extra.param.key.form_launch_reason' | Reason for creating the widget.<br>**Atomic service API**: This API can be used in atomic services since API version 11.| 119e41f4b71Sopenharmony_ci| PARAM_FORM_CUSTOMIZE_KEY<sup>10+</sup> | 'ohos.extra.param.key.form_customize' | Custom data.<br>**Atomic service API**: This API can be used in atomic services since API version 11.| 120e41f4b71Sopenharmony_ci| FORM_RENDERING_MODE_KEY<sup>11+</sup> | 'ohos.extra.param.key.form_rendering_mode' | Widget rendering mode.<br>**Atomic service API**: This API can be used in atomic services since API version 12. | 121e41f4b71Sopenharmony_ci| HOST_BG_INVERSE_COLOR_KEY<sup>12+</sup> | 'ohos.extra.param.key.host_bg_inverse_color' | Inverse background color of the widget client.<br>**Atomic service API**: This API can be used in atomic services since API version 12.| 122e41f4b71Sopenharmony_ci| FORM_LOCATION_KEY<sup>12+</sup> | 'ohos.extra.param.key.form_location' | Widget location.| 123e41f4b71Sopenharmony_ci| FORM_PERMISSION_NAME_KEY<sup>12+</sup> | 'ohos.extra.param.key.permission_name' | Name of the permission.<br>**Atomic service API**: This API can be used in atomic services since API version 12. | 124e41f4b71Sopenharmony_ci| FORM_PERMISSION_GRANTED_KEY<sup>12+</sup> | 'ohos.extra.param.key.permission_granted' | Whether the permission is granted.<br>**Atomic service API**: This API can be used in atomic services since API version 12. | 125e41f4b71Sopenharmony_ci 126e41f4b71Sopenharmony_ci## FormDimension 127e41f4b71Sopenharmony_ci 128e41f4b71Sopenharmony_ciEnumerates the widget dimensions. 129e41f4b71Sopenharmony_ci 130e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Ability.Form 131e41f4b71Sopenharmony_ci 132e41f4b71Sopenharmony_ci| Name | Value | Description | 133e41f4b71Sopenharmony_ci| ----------- | ---- | ------------ | 134e41f4b71Sopenharmony_ci| Dimension_1_2 | 1 | 1 x 2.<br>**Atomic service API**: This API can be used in atomic services since API version 11.| 135e41f4b71Sopenharmony_ci| Dimension_2_2 | 2 | 2 x 2.<br>**Atomic service API**: This API can be used in atomic services since API version 11.| 136e41f4b71Sopenharmony_ci| Dimension_2_4 | 3 | 2 x 4.<br>**Atomic service API**: This API can be used in atomic services since API version 11.| 137e41f4b71Sopenharmony_ci| Dimension_4_4 | 4 | 4 x 4.<br>**Atomic service API**: This API can be used in atomic services since API version 11.| 138e41f4b71Sopenharmony_ci| Dimension_2_1 | 5 | 2 x 1.<br>**Atomic service API**: This API can be used in atomic services since API version 11.| 139e41f4b71Sopenharmony_ci| DIMENSION_1_1<sup>11+<sup> | 6 | 1 x 1.<br>**Atomic service API**: This API can be used in atomic services since API version 11.| 140e41f4b71Sopenharmony_ci| DIMENSION_6_4<sup>12+<sup> | 7 | 6 x 4.<br>**Atomic service API**: This API can be used in atomic services since API version 12.| 141e41f4b71Sopenharmony_ci 142e41f4b71Sopenharmony_ci## FormShape<sup>12+</sup> 143e41f4b71Sopenharmony_ci 144e41f4b71Sopenharmony_ciEnumerates the widget shapes. 145e41f4b71Sopenharmony_ci 146e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Ability.Form 147e41f4b71Sopenharmony_ci 148e41f4b71Sopenharmony_ci| Name | Value | Description | 149e41f4b71Sopenharmony_ci| ----------- | ---- | ------------ | 150e41f4b71Sopenharmony_ci| RECT | 1 | Rectangle.<br>**Atomic service API**: This API can be used in atomic services since API version 12.| 151e41f4b71Sopenharmony_ci| CIRCLE | 2 | Circle.<br>**Atomic service API**: This API can be used in atomic services since API version 12.| 152e41f4b71Sopenharmony_ci 153e41f4b71Sopenharmony_ci## FormInfoFilter 154e41f4b71Sopenharmony_ci 155e41f4b71Sopenharmony_ciDefines the widget information filter. Only the widget information that meets the filter is returned. 156e41f4b71Sopenharmony_ci 157e41f4b71Sopenharmony_ci**Atomic service API**: This API can be used in atomic services since API version 11. 158e41f4b71Sopenharmony_ci 159e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Ability.Form 160e41f4b71Sopenharmony_ci 161e41f4b71Sopenharmony_ci| Name | Type | Mandatory |Description | 162e41f4b71Sopenharmony_ci| ----------- | ---- | ------------ |------------ | 163e41f4b71Sopenharmony_ci| moduleName | string |No | Only the information about the widget whose **moduleName** is the same as the provided value is returned.<br>If this parameter is not set, **moduleName** is not used for filtering. | 164e41f4b71Sopenharmony_ci 165e41f4b71Sopenharmony_ci 166e41f4b71Sopenharmony_ci 167e41f4b71Sopenharmony_ci## VisibilityType 168e41f4b71Sopenharmony_ci 169e41f4b71Sopenharmony_ciEnumerates the visibility types of the widget. 170e41f4b71Sopenharmony_ci 171e41f4b71Sopenharmony_ci**Atomic service API**: This API can be used in atomic services since API version 11. 172e41f4b71Sopenharmony_ci 173e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Ability.Form 174e41f4b71Sopenharmony_ci 175e41f4b71Sopenharmony_ci| Name | Value | Description | 176e41f4b71Sopenharmony_ci| ----------- | ---- | ------------ | 177e41f4b71Sopenharmony_ci| UNKNOWN<sup>10+</sup> | 0 | The visibility type of the widget is unknown. | 178e41f4b71Sopenharmony_ci| FORM_VISIBLE | 1 | The widget is visible. | 179e41f4b71Sopenharmony_ci| FORM_INVISIBLE | 2 | The widget is invisible. | 180e41f4b71Sopenharmony_ci 181e41f4b71Sopenharmony_ci 182e41f4b71Sopenharmony_ci## LaunchReason<sup>10+</sup> 183e41f4b71Sopenharmony_ci 184e41f4b71Sopenharmony_ciEnumerates the reasons for creating a widget. 185e41f4b71Sopenharmony_ci 186e41f4b71Sopenharmony_ci**Atomic service API**: This API can be used in atomic services since API version 11. 187e41f4b71Sopenharmony_ci 188e41f4b71Sopenharmony_ci**System capability**: SystemCapability.Ability.Form 189e41f4b71Sopenharmony_ci 190e41f4b71Sopenharmony_ci| Name | Value | Description | 191e41f4b71Sopenharmony_ci| ----------- | ---- | ------------ | 192e41f4b71Sopenharmony_ci| FORM_DEFAULT | 1 | The widget is created by default. | 193e41f4b71Sopenharmony_ci| FORM_SHARE | 2 | The widget is created for sharing. | 194