• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# @ohos.application.formInfo (formInfo)
2<!--Kit: Form Kit-->
3<!--Subsystem: Ability-->
4<!--Owner: @cx983299475-->
5<!--Designer: @xueyulong-->
6<!--Tester: @chenmingze-->
7<!--Adviser: @Brilliantry_Rui-->
8The **formInfo** module provides types and enums related to the widget information and state.
9
10> **NOTE**
11>
12> The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version.
13> This module is deprecated since API version 9. You are advised to use [formInfo](js-apis-app-form-formInfo.md) instead.
14
15## Modules to Import
16
17```ts
18import formInfo from '@ohos.application.formInfo';
19```
20
21## FormInfo
22
23Widget information.
24
25**System capability**: SystemCapability.Ability.Form
26
27| Name       | Type                | Readable   | Writable    | Description                                                        |
28| ----------- | -------- |-------- | -------------------- | ------------------------------------------------------------ |
29| bundleName  | string               | Yes   | No     | Name of the bundle to which the widget belongs.                  |
30| moduleName  | string               | Yes   | No     | Name of the module to which the widget belongs.                      |
31| abilityName | string               | Yes   | No     | Name of the ability to which the widget belongs.                    |
32| name        | string               | Yes   | No     | Widget name.                                |
33| description | string               | Yes   | No     | Description of the widget.  |
34| type        | [FormType](#formtype)             | Yes   | No     | Type of the widget. Currently, only JS widgets are supported.|
35| jsComponentName      | string               | Yes   | No     | Component name of the JS widget.              |
36| colorMode  | [ColorMode](#colormode) | Yes   | No     | Color mode of the widget.                                      |
37| isDefault    | boolean      | Yes   | No     | Whether the widget is the default one.                             |
38| updateEnabled  | boolean               | Yes   | No     | Whether the widget is updatable.                   |
39| formVisibleNotify  | boolean               | Yes   | No     | Whether to send a notification when the widget is visible.           |
40| relatedBundleName | string               | Yes   | No     | Name of the associated bundle to which the widget belongs.          |
41| scheduledUpdateTime        | string               | Yes   | No     | Time when the widget was updated.    |
42| formConfigAbility | string               | Yes   | No     | Configuration ability of the widget.  |
43| updateDuration        | number             | Yes   | No     | Update period of the widget.|
44| defaultDimension  | number | Yes   | No     | Default dimension of the widget.                                      |
45| supportDimensions    | Array&lt;number&gt;      | Yes   | No     | Dimensions supported by the widget.                |
46| customizeData    | {[key: string]: [value: string]}      | Yes   | No     | Custom data of the widget.        |
47
48## FormType
49
50Enumerates the widget types.
51
52**System capability**: SystemCapability.Ability.Form
53
54| Name       | Value  | Description        |
55| ----------- | ---- | ------------ |
56| JS      | 1    | JS widget.  |
57
58## ColorMode
59
60Enumerates the color modes supported by the widget.
61
62**System capability**: SystemCapability.Ability.Form
63
64| Name       | Value  | Description        |
65| ----------- | ---- | ------------ |
66| MODE_AUTO   | -1    | Auto mode.  |
67| MODE_DARK    | 0   | Dark mode.  |
68| MODE_LIGHT     | 1   | Light mode.  |
69
70## FormStateInfo
71
72Describes the widget state information.
73
74**System capability**: SystemCapability.Ability.Form
75
76| Name       | Type                | Readable   | Writable    | Description                                                        |
77| ----------- | -------- |-------- | -------------------- | ------------------------------------------------------------ |
78| formState  | [FormState](#formstate)               | Yes   | No     | Widget state.                         |
79| want  | [Want](../apis-ability-kit/js-apis-app-ability-want.md)               | Yes   | No     | Want text.   |
80
81##  FormState
82
83Enumerates the widget states.
84
85**System capability**: SystemCapability.Ability.Form
86
87| Name       | Value  | Description        |
88| ----------- | ---- | ------------ |
89| UNKNOWN    | -1    | Unknown state.  |
90| DEFAULT     | 0   | Default state.  |
91| READY      | 1   | Ready state.  |
92
93##  FormParam
94
95Enumerates the widget parameters.
96
97**System capability**: SystemCapability.Ability.Form
98
99| Name       | Value  | Description        |
100| ----------- | ---- | ------------ |
101| DIMENSION_KEY      | 'ohos.extra.param.key.form_dimension'  | Widget dimension.  |
102| NAME_KEY       | 'ohos.extra.param.key.form_name'   | Widget name.  |
103| MODULE_NAME_KEY        | 'ohos.extra.param.key.module_name'   | Name of the module to which the widget belongs.  |
104| WIDTH_KEY        | 'ohos.extra.param.key.form_width'   | Widget width.  |
105| HEIGHT_KEY         | 'ohos.extra.param.key.form_height'   | Widget height.  |
106| TEMPORARY_KEY          | 'ohos.extra.param.key.form_temporary'   | Temporary widget.  |
107