openharmony 鸿蒙 js-apis-application-formInfo

2025-06-12 浏览 (1)

@ohos.application.formInfo (formInfo)

The formInfo module provides types and enums related to the widget information and state.

NOTE

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. This module is deprecated since API version 9. You are advised to use formInfo instead.

Modules to Import

import formInfo from '@ohos.application.formInfo';

FormInfo

Describes widget information.

System capability: SystemCapability.Ability.Form

NameTypeReadableWritableDescription
bundleNamestringYesNoName of the bundle to which the widget belongs.
moduleNamestringYesNoName of the module to which the widget belongs.
abilityNamestringYesNoName of the ability to which the widget belongs.
namestringYesNoWidget name.
descriptionstringYesNoDescription of the widget.
typeFormTypeYesNoType of the widget. Currently, only JS widgets are supported.
jsComponentNamestringYesNoName of the component used in the JS widget.
colorModeColorModeYesNoColor mode of the widget.
isDefaultbooleanYesNoWhether the widget is the default one.
updateEnabledbooleanYesNoWhether the widget is updatable.
formVisibleNotifybooleanYesNoWhether to send a notification when the widget is visible.
relatedBundleNamestringYesNoName of the associated bundle to which the widget belongs.
scheduledUpdateTimestringYesNoTime when the widget was updated.
formConfigAbilitystringYesNoConfiguration ability of the widget.
updateDurationnumberYesNoUpdate period of the widget.
defaultDimensionnumberYesNoDefault dimension of the widget.
supportDimensionsArray<number>YesNoDimensions supported by the widget.
customizeData{[key: string]: [value: string]}YesNoCustom data of the widget.

FormType

Enumerates the widget types.

System capability: SystemCapability.Ability.Form

NameValueDescription
JS1JS widget.

ColorMode

Enumerates the color modes supported by the widget.

System capability: SystemCapability.Ability.Form

NameValueDescription
MODE_AUTO-1Auto mode.
MODE_DARK0Dark mode.
MODE_LIGHT1Light mode.

FormStateInfo

Describes the widget state information.

System capability: SystemCapability.Ability.Form

NameTypeReadableWritableDescription
formStateFormStateYesNoWidget state.
wantWantYesNoWant text.

FormState

Enumerates the widget states.

System capability: SystemCapability.Ability.Form

NameValueDescription
UNKNOWN-1Unknown state.
DEFAULT0Default state.
READY1Ready state.

FormParam

Enumerates the widget parameters.

System capability: SystemCapability.Ability.Form

NameValueDescription
DIMENSION_KEY'ohos.extra.param.key.form_dimension'Widget dimension.
NAME_KEY'ohos.extra.param.key.form_name'Widget name.
MODULE_NAME_KEY'ohos.extra.param.key.module_name'Name of the module to which the widget belongs.
WIDTH_KEY'ohos.extra.param.key.form_width'Widget width.
HEIGHT_KEY'ohos.extra.param.key.form_height'Widget height.
TEMPORARY_KEY'ohos.extra.param.key.form_temporary'Temporary widget.

你可能感兴趣的鸿蒙文章

harmony 鸿蒙Form Kit

harmony 鸿蒙Form Error Codes

harmony 鸿蒙@ohos.app.form.formAgent (FormAgent) (System API)

harmony 鸿蒙@ohos.app.form.formBindingData (formBindingData)

harmony 鸿蒙@ohos.app.form.FormEditExtensionAbility (FormEditExtensionAbility)

harmony 鸿蒙@ohos.app.form.FormExtensionAbility (FormExtensionAbility) (System API)

harmony 鸿蒙@ohos.app.form.FormExtensionAbility (FormExtensionAbility)

harmony 鸿蒙@ohos.app.form.formHost (formHost) (System API)

harmony 鸿蒙@ohos.app.form.formInfo (formInfo) (System API)

harmony 鸿蒙@ohos.app.form.formInfo (formInfo)

  • 所属分类: 后端技术
  • 本文标签: 软件 鸿蒙
  • 版权声明: 本文链接 https://seaxiang.com/blog/6XmRzX