harmony(鸿蒙)FormInfo

2022-08-09 浏览 (817)

FormInfo

The FormInfo module provides 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.

Modules to Import

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

Required Permissions

None

FormInfo

Describes widget information.

System capability: SystemCapability.Ability.Form

NameReadable/WritableTypeDescription
bundleNameRead onlystringName of the bundle to which the widget belongs.
moduleNameRead onlystringName of the module to which the widget belongs.
abilityNameRead onlystringName of the ability to which the widget belongs.
nameRead onlystringWidget name.
descriptionRead onlystringDescription of the widget.
typeRead onlyFormTypeWidget type. Currently, only JS widgets are supported.
jsComponentNameRead onlystringComponent name of the JS widget.
colorModeRead onlyColorModeColor mode of the widget.
isDefaultRead onlybooleanWhether the widget is the default one.
updateEnabledRead onlybooleanWhether the widget is updatable.
formVisibleNotifyRead onlystringWhether to send a notification when the widget is visible.
relatedBundleNameRead onlystringName of the associated bundle to which the widget belongs.
scheduledUpdateTimeRead onlystringTime when the widget was updated.
formConfigAbilityRead onlystringConfiguration ability of the widget.
updateDurationRead onlystringWidget update period.
defaultDimensionRead onlynumberDefault dimension of the widget.
supportDimensionsRead onlyArray<number>Dimensions supported by the widget.
customizeDataRead only{[key: string]: [value: string]}Custom 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

NameReadable/WritableTypeDescription
formStateRead onlyFormStateWidget state.
wantRead onlyWantWant 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
IDENTITY_KEY9+"ohos.extra.param.key.form_identity"ID of a widget.
System API: This is a system API and cannot be called by third-party applications.
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.
ABILITY_NAME_KEY9+"ohos.extra.param.key.ability_name"Ability name.
DEVICE_ID_KEY9+"ohos.extra.param.key.device_id"Device ID.
This is a system API.
BUNDLE_NAME_KEY9+"ohos.extra.param.key.bundle_name"Key that specifies the target bundle name.

FormDimension

Enumerates the widget dimensions.

System capability: SystemCapability.Ability.Form

NameValueDescription
Dimension_1_29+11 x 2.
Dimension_2_29+22 x 2.
Dimension_2_49+32 x 4.
Dimension_4_49+44 x 4.
Dimension_2_19+52 x 1.

FormInfoFilter

Defines the widget information filter. Only the widget information that meets the filter is returned.

System capability: SystemCapability.Ability.Form

NameYesDescription
moduleName9+NoModule name.

你可能感兴趣的鸿蒙文章

harmony(鸿蒙)APIs

harmony(鸿蒙)API Reference Document Description

harmony(鸿蒙)BundleStatusCallback

harmony(鸿蒙)innerBundleManager(deprecated)

harmony(鸿蒙)distributedBundle

harmony(鸿蒙)Bundle

harmony(鸿蒙)Context

harmony(鸿蒙)DataUriUtils

harmony(鸿蒙)EnterpriseAdminExtensionAbility

harmony(鸿蒙)Work Scheduler Callbacks

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