2022-10-18 11:39:48 +00:00
|
|
|
/*
|
2023-05-06 07:20:31 +00:00
|
|
|
* Copyright (c) 2022-2023 Huawei Device Co., Ltd.
|
2022-10-18 11:39:48 +00:00
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
|
|
|
|
2023-12-11 09:08:03 +00:00
|
|
|
/**
|
|
|
|
* @file
|
2024-01-08 07:25:39 +00:00
|
|
|
* @kit FormKit
|
2023-12-11 09:08:03 +00:00
|
|
|
*/
|
|
|
|
|
2022-10-18 12:14:04 +00:00
|
|
|
import Want from './@ohos.app.ability.Want';
|
2022-10-18 11:39:48 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* interface of formInfo.
|
2023-05-06 06:59:50 +00:00
|
|
|
*
|
2022-10-18 11:39:48 +00:00
|
|
|
* @namespace formInfo
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @since 9
|
|
|
|
*/
|
2023-11-11 10:44:20 +00:00
|
|
|
/**
|
|
|
|
* interface of formInfo.
|
|
|
|
*
|
|
|
|
* @namespace formInfo
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
*/
|
2022-10-18 11:39:48 +00:00
|
|
|
declare namespace formInfo {
|
2023-04-21 09:47:24 +00:00
|
|
|
/**
|
|
|
|
* Provides information about a form.
|
2023-05-06 06:59:50 +00:00
|
|
|
*
|
2023-04-21 09:47:24 +00:00
|
|
|
* @typedef FormInfo
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @since 9
|
|
|
|
*/
|
2023-11-11 10:44:20 +00:00
|
|
|
/**
|
|
|
|
* Provides information about a form.
|
|
|
|
*
|
|
|
|
* @typedef FormInfo
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-04-21 09:47:24 +00:00
|
|
|
interface FormInfo {
|
2022-10-18 11:39:48 +00:00
|
|
|
/**
|
2023-04-21 09:47:24 +00:00
|
|
|
* Obtains the bundle name of the application to which this form belongs.
|
2023-05-06 06:59:50 +00:00
|
|
|
*
|
2023-05-26 02:24:08 +00:00
|
|
|
* @type { string }
|
2023-04-21 09:47:24 +00:00
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @since 9
|
|
|
|
*/
|
2023-11-11 10:44:20 +00:00
|
|
|
/**
|
|
|
|
* Obtains the bundle name of the application to which this form belongs.
|
|
|
|
*
|
|
|
|
* @type { string }
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-04-21 09:47:24 +00:00
|
|
|
bundleName: string;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Obtains the name of the application module to which this form belongs.
|
2023-05-06 06:59:50 +00:00
|
|
|
*
|
2023-05-26 02:24:08 +00:00
|
|
|
* @type { string }
|
2023-04-21 09:47:24 +00:00
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @since 9
|
|
|
|
*/
|
2023-11-11 10:44:20 +00:00
|
|
|
/**
|
|
|
|
* Obtains the name of the application module to which this form belongs.
|
|
|
|
*
|
|
|
|
* @type { string }
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-04-21 09:47:24 +00:00
|
|
|
moduleName: string;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Obtains the class name of the ability to which this form belongs.
|
2023-05-06 06:59:50 +00:00
|
|
|
*
|
2023-05-26 02:24:08 +00:00
|
|
|
* @type { string }
|
2023-04-21 09:47:24 +00:00
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @since 9
|
|
|
|
*/
|
2023-11-11 10:44:20 +00:00
|
|
|
/**
|
|
|
|
* Obtains the class name of the ability to which this form belongs.
|
|
|
|
*
|
|
|
|
* @type { string }
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-04-21 09:47:24 +00:00
|
|
|
abilityName: string;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Obtains the name of this form.
|
2023-05-06 06:59:50 +00:00
|
|
|
*
|
2023-05-26 02:24:08 +00:00
|
|
|
* @type { string }
|
2023-04-21 09:47:24 +00:00
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @since 9
|
|
|
|
*/
|
2023-11-11 10:44:20 +00:00
|
|
|
/**
|
|
|
|
* Obtains the name of this form.
|
|
|
|
*
|
|
|
|
* @type { string }
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-04-21 09:47:24 +00:00
|
|
|
name: string;
|
|
|
|
|
2023-12-11 02:50:07 +00:00
|
|
|
/**
|
|
|
|
* Obtains the display name of this form.
|
|
|
|
*
|
|
|
|
* @type { string }
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
*/
|
|
|
|
displayName: string;
|
|
|
|
|
2023-12-21 06:28:55 +00:00
|
|
|
/**
|
2024-01-03 07:04:47 +00:00
|
|
|
* Obtains the displayName resource id of this form.
|
2023-12-21 06:28:55 +00:00
|
|
|
*
|
|
|
|
* @type { number }
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
*/
|
|
|
|
displayNameId: number;
|
|
|
|
|
2023-04-21 09:47:24 +00:00
|
|
|
/**
|
2023-05-08 14:23:29 +00:00
|
|
|
* Obtains the description of this form.
|
2023-05-26 02:24:08 +00:00
|
|
|
*
|
|
|
|
* @type { string }
|
2023-04-21 09:47:24 +00:00
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @since 9
|
|
|
|
*/
|
2023-11-11 10:44:20 +00:00
|
|
|
/**
|
|
|
|
* Obtains the description of this form.
|
|
|
|
*
|
|
|
|
* @type { string }
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-04-21 09:47:24 +00:00
|
|
|
description: string;
|
|
|
|
|
2023-05-08 14:23:29 +00:00
|
|
|
/**
|
|
|
|
* Obtains the description id of this form.
|
2023-05-18 01:46:40 +00:00
|
|
|
*
|
2023-05-26 02:24:08 +00:00
|
|
|
* @type { number }
|
2023-05-08 14:23:29 +00:00
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-11-11 10:44:20 +00:00
|
|
|
/**
|
|
|
|
* Obtains the description id of this form.
|
|
|
|
*
|
|
|
|
* @type { number }
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-05-08 14:23:29 +00:00
|
|
|
descriptionId: number;
|
|
|
|
|
2023-04-21 09:47:24 +00:00
|
|
|
/**
|
|
|
|
* Obtains the type of this form. Currently, JS forms are supported.
|
2023-05-06 06:59:50 +00:00
|
|
|
*
|
2023-05-26 02:24:08 +00:00
|
|
|
* @type { FormType }
|
2023-04-21 09:47:24 +00:00
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @since 9
|
|
|
|
*/
|
2023-11-11 10:44:20 +00:00
|
|
|
/**
|
|
|
|
* Obtains the type of this form. Currently, JS forms are supported.
|
|
|
|
*
|
|
|
|
* @type { FormType }
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-04-21 09:47:24 +00:00
|
|
|
type: FormType;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Obtains the JS component name of this JS form.
|
2023-05-06 06:59:50 +00:00
|
|
|
*
|
2023-05-26 02:24:08 +00:00
|
|
|
* @type { string }
|
2023-04-21 09:47:24 +00:00
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @since 9
|
|
|
|
*/
|
2023-11-11 10:44:20 +00:00
|
|
|
/**
|
|
|
|
* Obtains the JS component name of this JS form.
|
|
|
|
*
|
|
|
|
* @type { string }
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-04-21 09:47:24 +00:00
|
|
|
jsComponentName: string;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Obtains the color mode of this form.
|
2023-05-06 06:59:50 +00:00
|
|
|
*
|
2023-05-26 02:24:08 +00:00
|
|
|
* @type { ColorMode }
|
2023-04-21 09:47:24 +00:00
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @since 9
|
|
|
|
*/
|
2023-11-11 10:44:20 +00:00
|
|
|
/**
|
|
|
|
* Obtains the color mode of this form.
|
|
|
|
*
|
|
|
|
* @type { ColorMode }
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-04-21 09:47:24 +00:00
|
|
|
colorMode: ColorMode;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Checks whether this form is a default form.
|
2023-05-06 06:59:50 +00:00
|
|
|
*
|
2023-05-26 02:24:08 +00:00
|
|
|
* @type { boolean }
|
2023-04-21 09:47:24 +00:00
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @since 9
|
|
|
|
*/
|
2023-11-11 10:44:20 +00:00
|
|
|
/**
|
|
|
|
* Checks whether this form is a default form.
|
|
|
|
*
|
|
|
|
* @type { boolean }
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-04-21 09:47:24 +00:00
|
|
|
isDefault: boolean;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Obtains the updateEnabled.
|
2023-05-06 06:59:50 +00:00
|
|
|
*
|
2023-05-26 02:24:08 +00:00
|
|
|
* @type { boolean }
|
2023-04-21 09:47:24 +00:00
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @since 9
|
|
|
|
*/
|
2023-11-11 10:44:20 +00:00
|
|
|
/**
|
|
|
|
* Obtains the updateEnabled.
|
|
|
|
*
|
|
|
|
* @type { boolean }
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-04-21 09:47:24 +00:00
|
|
|
updateEnabled: boolean;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Obtains whether notify visible of this form.
|
2023-05-06 06:59:50 +00:00
|
|
|
*
|
2023-05-26 02:24:08 +00:00
|
|
|
* @type { boolean }
|
2023-04-21 09:47:24 +00:00
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @since 9
|
|
|
|
*/
|
2023-11-11 10:44:20 +00:00
|
|
|
/**
|
|
|
|
* Obtains whether notify visible of this form.
|
|
|
|
*
|
|
|
|
* @type { boolean }
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-04-21 09:47:24 +00:00
|
|
|
formVisibleNotify: boolean;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Obtains the scheduledUpdateTime.
|
2023-05-06 06:59:50 +00:00
|
|
|
*
|
2023-05-26 02:24:08 +00:00
|
|
|
* @type { string }
|
2023-04-21 09:47:24 +00:00
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @since 9
|
|
|
|
*/
|
2023-11-11 10:44:20 +00:00
|
|
|
/**
|
|
|
|
* Obtains the scheduledUpdateTime.
|
|
|
|
*
|
|
|
|
* @type { string }
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-04-21 09:47:24 +00:00
|
|
|
scheduledUpdateTime: string;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Obtains the form config ability about this form.
|
2023-05-06 06:59:50 +00:00
|
|
|
*
|
2023-05-26 02:24:08 +00:00
|
|
|
* @type { string }
|
2023-04-21 09:47:24 +00:00
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @since 9
|
|
|
|
*/
|
2023-11-11 10:44:20 +00:00
|
|
|
/**
|
|
|
|
* Obtains the form config ability about this form.
|
|
|
|
*
|
|
|
|
* @type { string }
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-04-21 09:47:24 +00:00
|
|
|
formConfigAbility: string;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Obtains the updateDuration.
|
2023-05-06 06:59:50 +00:00
|
|
|
*
|
2023-05-26 02:24:08 +00:00
|
|
|
* @type { number }
|
2023-04-21 09:47:24 +00:00
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @since 9
|
|
|
|
*/
|
2023-11-11 10:44:20 +00:00
|
|
|
/**
|
|
|
|
* Obtains the updateDuration.
|
|
|
|
*
|
|
|
|
* @type { number }
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-04-21 09:47:24 +00:00
|
|
|
updateDuration: number;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Obtains the default grid style of this form.
|
2023-05-06 06:59:50 +00:00
|
|
|
*
|
2023-05-26 02:24:08 +00:00
|
|
|
* @type { number }
|
2023-04-21 09:47:24 +00:00
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @since 9
|
|
|
|
*/
|
2023-11-11 10:44:20 +00:00
|
|
|
/**
|
|
|
|
* Obtains the default grid style of this form.
|
|
|
|
*
|
|
|
|
* @type { number }
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-04-21 09:47:24 +00:00
|
|
|
defaultDimension: number;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Obtains the grid styles supported by this form.
|
2023-05-06 06:59:50 +00:00
|
|
|
*
|
2023-05-26 02:24:08 +00:00
|
|
|
* @type { Array<number> }
|
2023-04-21 09:47:24 +00:00
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @since 9
|
|
|
|
*/
|
2023-11-11 10:44:20 +00:00
|
|
|
/**
|
|
|
|
* Obtains the grid styles supported by this form.
|
|
|
|
*
|
|
|
|
* @type { Array<number> }
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-04-21 09:47:24 +00:00
|
|
|
supportDimensions: Array<number>;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Obtains the custom data defined in this form.
|
2023-05-06 06:59:50 +00:00
|
|
|
*
|
2023-05-26 02:24:08 +00:00
|
|
|
* @type { object }
|
2023-04-21 09:47:24 +00:00
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @since 9
|
|
|
|
*/
|
2023-11-11 10:44:20 +00:00
|
|
|
/**
|
|
|
|
* Obtains the custom data defined in this form.
|
|
|
|
*
|
2023-12-19 09:27:58 +00:00
|
|
|
* @type { Record<string, string> }
|
2023-11-11 10:44:20 +00:00
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-12-19 09:27:58 +00:00
|
|
|
customizeData: Record<string, string>;
|
2023-06-13 03:00:04 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Obtains whether this form is a dynamic form.
|
|
|
|
*
|
|
|
|
* @type { boolean }
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-11-11 10:44:20 +00:00
|
|
|
/**
|
|
|
|
* Obtains whether this form is a dynamic form.
|
|
|
|
*
|
|
|
|
* @type { boolean }
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-06-13 03:00:04 +00:00
|
|
|
isDynamic: boolean;
|
2023-09-23 06:33:32 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Indicates whether the form can be set as a transparent background
|
|
|
|
*
|
|
|
|
* @type { boolean }
|
|
|
|
* @default false
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
2023-11-11 11:17:37 +00:00
|
|
|
* @atomicservice
|
2023-09-23 06:33:32 +00:00
|
|
|
* @since 11
|
|
|
|
*/
|
|
|
|
transparencyEnabled: boolean;
|
2024-04-30 05:54:12 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Obtains the shape supported by this form.
|
|
|
|
*
|
|
|
|
* @type { Array<number> }
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @atomicservice
|
|
|
|
* @since 12
|
|
|
|
*/
|
2024-05-11 02:26:18 +00:00
|
|
|
supportedShapes: Array<number>;
|
2023-04-21 09:47:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Type of form.
|
2023-05-06 06:59:50 +00:00
|
|
|
*
|
2023-04-21 09:47:24 +00:00
|
|
|
* @enum { number }
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @since 9
|
2023-05-06 06:59:50 +00:00
|
|
|
*/
|
2023-11-11 10:44:20 +00:00
|
|
|
/**
|
|
|
|
* Type of form.
|
|
|
|
*
|
|
|
|
* @enum { number }
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-04-21 09:47:24 +00:00
|
|
|
enum FormType {
|
|
|
|
/**
|
|
|
|
* JS form.
|
2023-05-06 06:59:50 +00:00
|
|
|
*
|
2023-04-21 09:47:24 +00:00
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @since 9
|
|
|
|
*/
|
2023-11-11 10:44:20 +00:00
|
|
|
/**
|
|
|
|
* JS form.
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-04-21 09:47:24 +00:00
|
|
|
JS = 1,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* eTS form.
|
2023-05-06 06:59:50 +00:00
|
|
|
*
|
2023-04-21 09:47:24 +00:00
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @since 9
|
|
|
|
*/
|
2023-11-11 10:44:20 +00:00
|
|
|
/**
|
|
|
|
* eTS form.
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-04-21 09:47:24 +00:00
|
|
|
eTS = 2
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Color mode.
|
2023-05-06 06:59:50 +00:00
|
|
|
*
|
2023-04-21 09:47:24 +00:00
|
|
|
* @enum { number }
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @since 9
|
2023-05-06 06:59:50 +00:00
|
|
|
*/
|
2023-11-11 10:44:20 +00:00
|
|
|
/**
|
|
|
|
* Color mode.
|
|
|
|
*
|
|
|
|
* @enum { number }
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-04-21 09:47:24 +00:00
|
|
|
enum ColorMode {
|
|
|
|
/**
|
|
|
|
* Automatic mode.
|
2023-05-06 06:59:50 +00:00
|
|
|
*
|
2023-04-21 09:47:24 +00:00
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @since 9
|
|
|
|
*/
|
2023-11-11 10:44:20 +00:00
|
|
|
/**
|
|
|
|
* Automatic mode.
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-04-21 09:47:24 +00:00
|
|
|
MODE_AUTO = -1,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Dark mode.
|
2023-05-06 06:59:50 +00:00
|
|
|
*
|
2023-04-21 09:47:24 +00:00
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @since 9
|
|
|
|
*/
|
2023-11-11 10:44:20 +00:00
|
|
|
/**
|
|
|
|
* Dark mode.
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-04-21 09:47:24 +00:00
|
|
|
MODE_DARK = 0,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Light mode.
|
2023-05-06 06:59:50 +00:00
|
|
|
*
|
2023-04-21 09:47:24 +00:00
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @since 9
|
|
|
|
*/
|
2023-11-11 10:44:20 +00:00
|
|
|
/**
|
|
|
|
* Light mode.
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-04-21 09:47:24 +00:00
|
|
|
MODE_LIGHT = 1
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Provides state information about a form.
|
2023-05-06 06:59:50 +00:00
|
|
|
*
|
2023-04-21 09:47:24 +00:00
|
|
|
* @typedef FormStateInfo
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @since 9
|
|
|
|
*/
|
2023-11-11 10:44:20 +00:00
|
|
|
/**
|
|
|
|
* Provides state information about a form.
|
|
|
|
*
|
|
|
|
* @typedef FormStateInfo
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-04-21 09:47:24 +00:00
|
|
|
interface FormStateInfo {
|
|
|
|
/**
|
|
|
|
* Obtains the form state.
|
2023-05-06 06:59:50 +00:00
|
|
|
*
|
2023-05-26 02:24:08 +00:00
|
|
|
* @type { FormState }
|
2023-04-21 09:47:24 +00:00
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @since 9
|
|
|
|
*/
|
2023-11-11 10:44:20 +00:00
|
|
|
/**
|
|
|
|
* Obtains the form state.
|
|
|
|
*
|
|
|
|
* @type { FormState }
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-04-21 09:47:24 +00:00
|
|
|
formState: FormState;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Obtains the want form .
|
2023-05-06 06:59:50 +00:00
|
|
|
*
|
2023-05-26 02:24:08 +00:00
|
|
|
* @type { Want }
|
2023-04-21 09:47:24 +00:00
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @since 9
|
|
|
|
*/
|
2023-11-11 10:44:20 +00:00
|
|
|
/**
|
|
|
|
* Obtains the want form .
|
|
|
|
*
|
|
|
|
* @type { Want }
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-04-21 09:47:24 +00:00
|
|
|
want: Want;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Provides state about a form.
|
2023-05-06 06:59:50 +00:00
|
|
|
*
|
2023-04-21 09:47:24 +00:00
|
|
|
* @enum { number }
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @since 9
|
|
|
|
*/
|
2023-11-11 10:44:20 +00:00
|
|
|
/**
|
|
|
|
* Provides state about a form.
|
|
|
|
*
|
|
|
|
* @enum { number }
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-04-21 09:47:24 +00:00
|
|
|
enum FormState {
|
|
|
|
/**
|
|
|
|
* Indicates that the form status is unknown due to an internal error.
|
2023-05-06 06:59:50 +00:00
|
|
|
*
|
2023-04-21 09:47:24 +00:00
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @since 9
|
|
|
|
*/
|
2023-11-11 10:44:20 +00:00
|
|
|
/**
|
|
|
|
* Indicates that the form status is unknown due to an internal error.
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-04-21 09:47:24 +00:00
|
|
|
UNKNOWN = -1,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Indicates that the form is in the default state.
|
2023-05-06 06:59:50 +00:00
|
|
|
*
|
2023-04-21 09:47:24 +00:00
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @since 9
|
|
|
|
*/
|
2023-11-11 10:44:20 +00:00
|
|
|
/**
|
|
|
|
* Indicates that the form is in the default state.
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-04-21 09:47:24 +00:00
|
|
|
DEFAULT = 0,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Indicates that the form is ready.
|
2023-05-06 06:59:50 +00:00
|
|
|
*
|
2023-04-21 09:47:24 +00:00
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @since 9
|
|
|
|
*/
|
2023-11-11 10:44:20 +00:00
|
|
|
/**
|
|
|
|
* Indicates that the form is ready.
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-05-06 06:59:50 +00:00
|
|
|
READY = 1
|
2023-04-21 09:47:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Parameter of form.
|
2023-05-06 06:59:50 +00:00
|
|
|
*
|
2023-04-21 09:47:24 +00:00
|
|
|
* @enum { string }
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @since 9
|
|
|
|
*/
|
2023-11-11 10:44:20 +00:00
|
|
|
/**
|
|
|
|
* Parameter of form.
|
|
|
|
*
|
|
|
|
* @enum { string }
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-04-21 09:47:24 +00:00
|
|
|
enum FormParam {
|
|
|
|
/**
|
|
|
|
* Indicates the key specifying the ID of the form to be obtained, which is represented as
|
|
|
|
* want: {
|
|
|
|
* "parameters": {
|
|
|
|
* IDENTITY_KEY: "119476135"
|
|
|
|
* }
|
|
|
|
* }.
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @since 9
|
|
|
|
*/
|
2023-11-11 10:44:20 +00:00
|
|
|
/**
|
|
|
|
* Indicates the key specifying the ID of the form to be obtained, which is represented as
|
|
|
|
* want: {
|
|
|
|
* "parameters": {
|
|
|
|
* IDENTITY_KEY: "119476135"
|
|
|
|
* }
|
|
|
|
* }.
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-05-06 06:59:50 +00:00
|
|
|
IDENTITY_KEY = 'ohos.extra.param.key.form_identity',
|
2023-04-21 09:47:24 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Indicates the key specifying the grid style of the form to be obtained, which is represented as
|
|
|
|
* want: {
|
|
|
|
* "parameters": {
|
|
|
|
* DIMENSION_KEY: FormDimension.Dimension_1_2
|
|
|
|
* }
|
|
|
|
* }.
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @since 9
|
|
|
|
*/
|
2023-11-11 10:44:20 +00:00
|
|
|
/**
|
|
|
|
* Indicates the key specifying the grid style of the form to be obtained, which is represented as
|
|
|
|
* want: {
|
|
|
|
* "parameters": {
|
|
|
|
* DIMENSION_KEY: FormDimension.Dimension_1_2
|
|
|
|
* }
|
|
|
|
* }.
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-05-06 06:59:50 +00:00
|
|
|
DIMENSION_KEY = 'ohos.extra.param.key.form_dimension',
|
2023-04-21 09:47:24 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Indicates the key specifying the name of the form to be obtained, which is represented as
|
|
|
|
* want: {
|
|
|
|
* "parameters": {
|
|
|
|
* NAME_KEY: "formName"
|
|
|
|
* }
|
|
|
|
* }.
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @since 9
|
|
|
|
*/
|
2023-11-11 10:44:20 +00:00
|
|
|
/**
|
|
|
|
* Indicates the key specifying the name of the form to be obtained, which is represented as
|
|
|
|
* want: {
|
|
|
|
* "parameters": {
|
|
|
|
* NAME_KEY: "formName"
|
|
|
|
* }
|
|
|
|
* }.
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-05-06 06:59:50 +00:00
|
|
|
NAME_KEY = 'ohos.extra.param.key.form_name',
|
2023-04-21 09:47:24 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Indicates the key specifying the name of the module to which the form to be obtained belongs, which is
|
|
|
|
* represented as
|
|
|
|
* want: {
|
|
|
|
* "parameters": {
|
|
|
|
* MODULE_NAME_KEY: "formEntry"
|
|
|
|
* }
|
|
|
|
* }
|
|
|
|
* This constant is mandatory.
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @since 9
|
|
|
|
*/
|
2023-11-11 10:44:20 +00:00
|
|
|
/**
|
|
|
|
* Indicates the key specifying the name of the module to which the form to be obtained belongs, which is
|
|
|
|
* represented as
|
|
|
|
* want: {
|
|
|
|
* "parameters": {
|
|
|
|
* MODULE_NAME_KEY: "formEntry"
|
|
|
|
* }
|
|
|
|
* }
|
|
|
|
* This constant is mandatory.
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-05-06 06:59:50 +00:00
|
|
|
MODULE_NAME_KEY = 'ohos.extra.param.key.module_name',
|
2023-04-21 09:47:24 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Indicates the key specifying the width of the form to be obtained, which is represented as
|
|
|
|
* want: {
|
|
|
|
* "parameters": {
|
|
|
|
* WIDTH_KEY: 800
|
|
|
|
* }
|
|
|
|
* }
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @since 9
|
|
|
|
*/
|
2023-11-11 10:44:20 +00:00
|
|
|
/**
|
|
|
|
* Indicates the key specifying the width of the form to be obtained, which is represented as
|
|
|
|
* want: {
|
|
|
|
* "parameters": {
|
|
|
|
* WIDTH_KEY: 800
|
|
|
|
* }
|
|
|
|
* }
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-05-06 06:59:50 +00:00
|
|
|
WIDTH_KEY = 'ohos.extra.param.key.form_width',
|
2023-04-21 09:47:24 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Indicates the key specifying the height of the form to be obtained, which is represented as
|
|
|
|
* want: {
|
|
|
|
* "parameters": {
|
|
|
|
* HEIGHT_KEY: 400
|
|
|
|
* }
|
|
|
|
* }
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @since 9
|
|
|
|
*/
|
2023-11-11 10:44:20 +00:00
|
|
|
/**
|
|
|
|
* Indicates the key specifying the height of the form to be obtained, which is represented as
|
|
|
|
* want: {
|
|
|
|
* "parameters": {
|
|
|
|
* HEIGHT_KEY: 400
|
|
|
|
* }
|
|
|
|
* }
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-05-06 06:59:50 +00:00
|
|
|
HEIGHT_KEY = 'ohos.extra.param.key.form_height',
|
2023-04-21 09:47:24 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Indicates the key specifying whether a form is temporary, which is represented as
|
|
|
|
* want: {
|
|
|
|
* "parameters": {
|
|
|
|
* TEMPORARY_KEY: true
|
|
|
|
* }
|
|
|
|
* }
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @since 9
|
|
|
|
*/
|
2023-11-11 10:44:20 +00:00
|
|
|
/**
|
|
|
|
* Indicates the key specifying whether a form is temporary, which is represented as
|
|
|
|
* want: {
|
|
|
|
* "parameters": {
|
|
|
|
* TEMPORARY_KEY: true
|
|
|
|
* }
|
|
|
|
* }
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-05-06 06:59:50 +00:00
|
|
|
TEMPORARY_KEY = 'ohos.extra.param.key.form_temporary',
|
2023-04-21 09:47:24 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Indicates the key specifying the name of the bundle to be obtained, which is represented as
|
|
|
|
* want: {
|
|
|
|
* "parameters": {
|
|
|
|
* BUNDLE_NAME_KEY: "bundleName"
|
|
|
|
* }
|
|
|
|
* }
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @since 9
|
|
|
|
*/
|
2023-11-11 10:44:20 +00:00
|
|
|
/**
|
|
|
|
* Indicates the key specifying the name of the bundle to be obtained, which is represented as
|
|
|
|
* want: {
|
|
|
|
* "parameters": {
|
|
|
|
* BUNDLE_NAME_KEY: "bundleName"
|
|
|
|
* }
|
|
|
|
* }
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-05-06 06:59:50 +00:00
|
|
|
BUNDLE_NAME_KEY = 'ohos.extra.param.key.bundle_name',
|
2023-04-21 09:47:24 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Indicates the key specifying the name of the ability to be obtained, which is represented as
|
|
|
|
* want: {
|
|
|
|
* "parameters": {
|
|
|
|
* ABILITY_NAME_KEY: "abilityName"
|
|
|
|
* }
|
|
|
|
* }
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @since 9
|
|
|
|
*/
|
2023-11-11 10:44:20 +00:00
|
|
|
/**
|
|
|
|
* Indicates the key specifying the name of the ability to be obtained, which is represented as
|
|
|
|
* want: {
|
|
|
|
* "parameters": {
|
|
|
|
* ABILITY_NAME_KEY: "abilityName"
|
|
|
|
* }
|
|
|
|
* }
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-05-06 06:59:50 +00:00
|
|
|
ABILITY_NAME_KEY = 'ohos.extra.param.key.ability_name',
|
2023-04-21 09:47:24 +00:00
|
|
|
|
2024-02-18 03:52:35 +00:00
|
|
|
/**
|
|
|
|
* Indicates the key specifying whether a form type is theme, which is represented as
|
|
|
|
* want: {
|
|
|
|
* "parameters": {
|
|
|
|
* THEME_KEY: true
|
|
|
|
* }
|
|
|
|
* }
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @systemapi
|
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
THEME_KEY = 'ohos.extra.param.key.form_is_theme',
|
|
|
|
|
2023-04-21 09:47:24 +00:00
|
|
|
/**
|
|
|
|
* Indicates the key specifying the the device ID, which is represented as
|
|
|
|
* want: {
|
|
|
|
* "parameters": {
|
|
|
|
* DEVICE_ID_KEY : "EFC11C0C53628D8CC2F8CB5052477E130D075917034613B9884C55CD22B3DEF2"
|
|
|
|
* }
|
|
|
|
* }
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @systemapi
|
|
|
|
* @since 9
|
|
|
|
*/
|
2023-05-06 06:59:50 +00:00
|
|
|
DEVICE_ID_KEY = 'ohos.extra.param.key.device_id',
|
2023-04-21 09:47:24 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Indicates the key specifying the launch reason of the form to be obtained, which is represented as
|
|
|
|
* want: {
|
|
|
|
* "parameters": {
|
|
|
|
* LAUNCH_REASON_KEY: LaunchReason.FORM_DEFAULT
|
|
|
|
* }
|
|
|
|
* }
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-11-11 10:44:20 +00:00
|
|
|
/**
|
|
|
|
* Indicates the key specifying the launch reason of the form to be obtained, which is represented as
|
|
|
|
* want: {
|
|
|
|
* "parameters": {
|
|
|
|
* LAUNCH_REASON_KEY: LaunchReason.FORM_DEFAULT
|
|
|
|
* }
|
|
|
|
* }
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-05-06 06:59:50 +00:00
|
|
|
LAUNCH_REASON_KEY = 'ohos.extra.param.key.form_launch_reason',
|
2023-04-21 09:47:24 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Indicates the key specifying the custom data of the form to be obtained, which is represented as
|
|
|
|
* want: {
|
|
|
|
* "parameters": {
|
|
|
|
* PARAM_FORM_CUSTOMIZE_KEY: {
|
|
|
|
* "key": "userData"
|
|
|
|
* }
|
|
|
|
* }
|
|
|
|
* }
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-11-11 10:44:20 +00:00
|
|
|
/**
|
|
|
|
* Indicates the key specifying the custom data of the form to be obtained, which is represented as
|
|
|
|
* want: {
|
|
|
|
* "parameters": {
|
|
|
|
* PARAM_FORM_CUSTOMIZE_KEY: {
|
|
|
|
* "key": "userData"
|
|
|
|
* }
|
|
|
|
* }
|
|
|
|
* }
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-11-14 10:52:16 +00:00
|
|
|
PARAM_FORM_CUSTOMIZE_KEY = 'ohos.extra.param.key.form_customize',
|
|
|
|
|
2024-02-19 03:53:48 +00:00
|
|
|
/**
|
|
|
|
* Indicates the key specifying the form location, which is represented as
|
|
|
|
* want: {
|
|
|
|
* "parameters": {
|
|
|
|
* FORM_LOCATION_KEY: FormLocation.DESKTOP
|
|
|
|
* }
|
|
|
|
* }.
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
FORM_LOCATION_KEY = 'ohos.extra.param.key.form_location',
|
|
|
|
|
2023-11-14 10:52:16 +00:00
|
|
|
/**
|
|
|
|
* Indicates the key specifying the form rendering mode, which is represented as
|
|
|
|
* want: {
|
|
|
|
* "parameters": {
|
|
|
|
* FORM_RENDERING_MODE_KEY: FormRenderingMode.SINGLE_COLOR
|
|
|
|
* }
|
|
|
|
* }.
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @since 11
|
|
|
|
*/
|
2024-02-18 04:01:14 +00:00
|
|
|
/**
|
|
|
|
* Indicates the key specifying the form rendering mode, which is represented as
|
|
|
|
* want: {
|
|
|
|
* "parameters": {
|
|
|
|
* FORM_RENDERING_MODE_KEY: FormRenderingMode.SINGLE_COLOR
|
|
|
|
* }
|
|
|
|
* }.
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @atomicservice
|
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
FORM_RENDERING_MODE_KEY = 'ohos.extra.param.key.form_rendering_mode',
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Indicates the key specifying the inverse of the host background color, which is represented as
|
|
|
|
* want: {
|
|
|
|
* "parameters": {
|
|
|
|
* HOST_BG_INVERSE_COLOR_KEY: "#FF000000"
|
|
|
|
* }
|
|
|
|
* }.
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @atomicservice
|
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
HOST_BG_INVERSE_COLOR_KEY = 'ohos.extra.param.key.host_bg_inverse_color',
|
2024-04-08 02:24:08 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Indicates the key specifying the user granted permission name, which is represented as
|
|
|
|
* want: {
|
|
|
|
* "parameters": {
|
|
|
|
* FORM_PERMISSION_NAME_KEY: "permissionName"
|
|
|
|
* }
|
|
|
|
* }.
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @atomicservice
|
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
FORM_PERMISSION_NAME_KEY = 'ohos.extra.param.key.permission_name',
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Indicates the key specifying whether the user granted, which is represented as
|
|
|
|
* want: {
|
|
|
|
* "parameters": {
|
|
|
|
* FORM_PERMISSION_GRANTED_KEY: true
|
|
|
|
* }
|
|
|
|
* }.
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @atomicservice
|
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
FORM_PERMISSION_GRANTED_KEY = 'ohos.extra.param.key.permission_granted',
|
2023-04-21 09:47:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The optional options used as filters to ask
|
|
|
|
* getFormsInfo to return formInfos from only forms that match the options.
|
2023-05-06 06:59:50 +00:00
|
|
|
*
|
2023-04-21 09:47:24 +00:00
|
|
|
* @typedef FormInfoFilter
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @since 9
|
|
|
|
*/
|
2023-11-11 10:44:20 +00:00
|
|
|
/**
|
|
|
|
* The optional options used as filters to ask
|
|
|
|
* getFormsInfo to return formInfos from only forms that match the options.
|
|
|
|
*
|
|
|
|
* @typedef FormInfoFilter
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-04-21 09:47:24 +00:00
|
|
|
interface FormInfoFilter {
|
2024-02-18 03:03:18 +00:00
|
|
|
/**
|
|
|
|
* optional bundleName that used to ask getFormsInfo to return
|
|
|
|
* form infos with the same bundleName.
|
|
|
|
*
|
|
|
|
* @type { ?string }
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @systemapi
|
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
bundleName?: string;
|
|
|
|
|
2023-04-21 09:47:24 +00:00
|
|
|
/**
|
|
|
|
* optional moduleName that used to ask getFormsInfo to return
|
|
|
|
* form infos with the same moduleName.
|
2023-05-06 06:59:50 +00:00
|
|
|
*
|
2023-05-26 02:24:08 +00:00
|
|
|
* @type { ?string }
|
2023-04-21 09:47:24 +00:00
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @since 9
|
|
|
|
*/
|
2023-11-11 10:44:20 +00:00
|
|
|
/**
|
|
|
|
* optional moduleName that used to ask getFormsInfo to return
|
|
|
|
* form infos with the same moduleName.
|
|
|
|
*
|
|
|
|
* @type { ?string }
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-04-21 09:47:24 +00:00
|
|
|
moduleName?: string;
|
2024-02-18 03:03:18 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* optional supportedDimensions that used to ask getFormsInfo to return
|
|
|
|
* form infos with the same supportedDimensions.
|
|
|
|
*
|
|
|
|
* @type { ?Array<number> }
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @systemapi
|
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
supportedDimensions?: Array<number>;
|
2024-04-30 05:54:12 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* optional supportedShapes that used to ask getFormsInfo to return
|
|
|
|
* form infos with the same supportedShapes.
|
|
|
|
*
|
|
|
|
* @type { ?Array<number> }
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @systemapi
|
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
supportedShapes?: Array<number>;
|
2023-04-21 09:47:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Defines the FormDimension enum.
|
2023-05-06 06:59:50 +00:00
|
|
|
*
|
2023-04-21 09:47:24 +00:00
|
|
|
* @enum { number }
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @since 9
|
|
|
|
*/
|
2023-11-11 10:44:20 +00:00
|
|
|
/**
|
|
|
|
* Defines the FormDimension enum.
|
|
|
|
*
|
|
|
|
* @enum { number }
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-04-21 09:47:24 +00:00
|
|
|
enum FormDimension {
|
|
|
|
/**
|
|
|
|
* 1 x 2 form
|
2023-05-06 06:59:50 +00:00
|
|
|
*
|
2023-04-21 09:47:24 +00:00
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @since 9
|
|
|
|
*/
|
2023-11-11 10:44:20 +00:00
|
|
|
/**
|
|
|
|
* 1 x 2 form
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-04-21 09:47:24 +00:00
|
|
|
Dimension_1_2 = 1,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 2 x 2 form
|
2023-05-06 06:59:50 +00:00
|
|
|
*
|
2023-04-21 09:47:24 +00:00
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @since 9
|
|
|
|
*/
|
2023-11-11 10:44:20 +00:00
|
|
|
/**
|
|
|
|
* 2 x 2 form
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-04-21 09:47:24 +00:00
|
|
|
Dimension_2_2,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 2 x 4 form
|
2023-05-06 06:59:50 +00:00
|
|
|
*
|
2023-04-21 09:47:24 +00:00
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @since 9
|
|
|
|
*/
|
2023-11-11 10:44:20 +00:00
|
|
|
/**
|
|
|
|
* 2 x 4 form
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-04-21 09:47:24 +00:00
|
|
|
Dimension_2_4,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 4 x 4 form
|
2023-05-06 06:59:50 +00:00
|
|
|
*
|
2023-04-21 09:47:24 +00:00
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @since 9
|
|
|
|
*/
|
2023-11-11 10:44:20 +00:00
|
|
|
/**
|
|
|
|
* 4 x 4 form
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-04-21 09:47:24 +00:00
|
|
|
Dimension_4_4,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 2 x 1 form
|
2023-05-06 06:59:50 +00:00
|
|
|
*
|
2023-04-21 09:47:24 +00:00
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @since 9
|
|
|
|
*/
|
2023-11-11 10:44:20 +00:00
|
|
|
/**
|
|
|
|
* 2 x 1 form
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-11-17 06:09:57 +00:00
|
|
|
Dimension_2_1,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 1 x 1 form
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
*/
|
|
|
|
DIMENSION_1_1,
|
2024-02-18 04:07:01 +00:00
|
|
|
|
|
|
|
/**
|
2024-03-13 09:11:58 +00:00
|
|
|
* 6 x 4 form
|
2024-02-18 04:07:01 +00:00
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @atomicservice
|
|
|
|
* @since 12
|
|
|
|
*/
|
2024-03-13 09:11:58 +00:00
|
|
|
DIMENSION_6_4,
|
2024-10-30 01:26:47 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* 2 x 3 form used for wearable devices
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @atomicservice
|
|
|
|
* @since 14
|
|
|
|
*/
|
|
|
|
DIMENSION_2_3 = 8,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 3 x 3 form used for wearable devices
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @atomicservice
|
|
|
|
* @since 14
|
|
|
|
*/
|
|
|
|
DIMENSION_3_3 = 9,
|
2023-04-21 09:47:24 +00:00
|
|
|
}
|
2024-04-30 05:54:12 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Defines the FormShape enum.
|
|
|
|
*
|
|
|
|
* @enum { number }
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @atomicservice
|
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
enum FormShape {
|
|
|
|
/**
|
|
|
|
* The rect shape.
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @atomicservice
|
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
RECT = 1,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The circle shape.
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @atomicservice
|
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
CIRCLE,
|
|
|
|
}
|
|
|
|
|
2023-04-21 09:47:24 +00:00
|
|
|
/**
|
|
|
|
* The visibility of a form.
|
2023-05-06 06:59:50 +00:00
|
|
|
*
|
2023-04-21 09:47:24 +00:00
|
|
|
* @enum { number }
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @since 9
|
|
|
|
*/
|
2023-11-11 10:44:20 +00:00
|
|
|
/**
|
|
|
|
* The visibility of a form.
|
|
|
|
*
|
|
|
|
* @enum { number }
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-04-21 09:47:24 +00:00
|
|
|
enum VisibilityType {
|
2023-04-27 14:36:34 +00:00
|
|
|
/**
|
|
|
|
* Indicates the type of the form type is unknown.
|
|
|
|
* Often used as a condition variable in function OnVisibilityChange to specify actions only on forms that are
|
|
|
|
* changing to unknown.
|
2023-05-26 02:24:08 +00:00
|
|
|
*
|
2023-04-27 14:36:34 +00:00
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-11-11 10:44:20 +00:00
|
|
|
/**
|
|
|
|
* Indicates the type of the form type is unknown.
|
|
|
|
* Often used as a condition variable in function OnVisibilityChange to specify actions only on forms that are
|
|
|
|
* changing to unknown.
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-04-27 14:36:34 +00:00
|
|
|
UNKNOWN = 0,
|
2023-04-21 09:47:24 +00:00
|
|
|
/**
|
|
|
|
* Indicates the type of the form is visible.
|
|
|
|
* Often used as a condition variable in function OnVisibilityChange to specify actions only on forms that are
|
|
|
|
* changing to visible.
|
2023-05-06 06:59:50 +00:00
|
|
|
*
|
2023-04-21 09:47:24 +00:00
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @since 9
|
|
|
|
*/
|
2023-11-11 10:44:20 +00:00
|
|
|
/**
|
|
|
|
* Indicates the type of the form is visible.
|
|
|
|
* Often used as a condition variable in function OnVisibilityChange to specify actions only on forms that are
|
|
|
|
* changing to visible.
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-04-21 09:47:24 +00:00
|
|
|
FORM_VISIBLE = 1,
|
|
|
|
/**
|
|
|
|
* Indicates the type of the form is invisible.
|
|
|
|
* Often used as a condition variable in function OnVisibilityChange to specify actions only on forms that are
|
|
|
|
* changing to invisible.
|
2023-05-06 06:59:50 +00:00
|
|
|
*
|
2023-04-21 09:47:24 +00:00
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @since 9
|
|
|
|
*/
|
2023-11-11 10:44:20 +00:00
|
|
|
/**
|
|
|
|
* Indicates the type of the form is invisible.
|
|
|
|
* Often used as a condition variable in function OnVisibilityChange to specify actions only on forms that are
|
|
|
|
* changing to invisible.
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-05-06 06:59:50 +00:00
|
|
|
FORM_INVISIBLE
|
2023-04-21 09:47:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Indicates the launch reason of a form.
|
2023-05-06 06:59:50 +00:00
|
|
|
*
|
2023-04-21 09:47:24 +00:00
|
|
|
* @enum { number }
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-11-11 10:44:20 +00:00
|
|
|
/**
|
|
|
|
* Indicates the launch reason of a form.
|
|
|
|
*
|
|
|
|
* @enum { number }
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-04-21 09:47:24 +00:00
|
|
|
enum LaunchReason {
|
|
|
|
/**
|
|
|
|
* Indicates the launch reason of a form is default.
|
2023-05-06 06:59:50 +00:00
|
|
|
*
|
2023-04-21 09:47:24 +00:00
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-11-11 10:44:20 +00:00
|
|
|
/**
|
|
|
|
* Indicates the launch reason of a form is default.
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-04-21 09:47:24 +00:00
|
|
|
FORM_DEFAULT = 1,
|
|
|
|
/**
|
|
|
|
* Indicates the launch reason of a form is share.
|
2023-05-06 06:59:50 +00:00
|
|
|
*
|
2023-03-17 13:06:58 +00:00
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-11-11 10:44:20 +00:00
|
|
|
/**
|
|
|
|
* Indicates the launch reason of a form is share.
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @atomicservice
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-05-06 06:59:50 +00:00
|
|
|
FORM_SHARE
|
2023-04-21 09:47:24 +00:00
|
|
|
}
|
2023-05-08 07:47:53 +00:00
|
|
|
|
2024-02-18 03:17:50 +00:00
|
|
|
/**
|
|
|
|
* The result of publish form.
|
|
|
|
*
|
|
|
|
* @typedef PublishFormResult
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @systemapi
|
|
|
|
* @stagemodelonly
|
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
interface PublishFormResult {
|
|
|
|
/**
|
|
|
|
* The error code.
|
|
|
|
*
|
|
|
|
* @type { PublishFormErrorCode }
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @systemapi
|
|
|
|
* @stagemodelonly
|
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
code: PublishFormErrorCode;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The message.
|
|
|
|
*
|
|
|
|
* @type { string }
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @systemapi
|
|
|
|
* @stagemodelonly
|
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
message: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The error code of publish form.
|
|
|
|
*
|
|
|
|
* @enum { number }
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @systemapi
|
|
|
|
* @stagemodelonly
|
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
enum PublishFormErrorCode {
|
|
|
|
/**
|
|
|
|
* Publish form success.
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @systemapi
|
|
|
|
* @stagemodelonly
|
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
SUCCESS,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Host has no space to publish form.
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @systemapi
|
|
|
|
* @stagemodelonly
|
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
NO_SPACE,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Check param failed.
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @systemapi
|
|
|
|
* @stagemodelonly
|
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
PARAM_ERROR,
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Internal error occurs during form processing.
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @systemapi
|
|
|
|
* @stagemodelonly
|
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
INTERNAL_ERROR,
|
|
|
|
}
|
|
|
|
|
2023-05-08 07:47:53 +00:00
|
|
|
/**
|
|
|
|
* Information about a running form.
|
2023-05-26 02:24:08 +00:00
|
|
|
*
|
2023-05-08 07:47:53 +00:00
|
|
|
* @typedef FormProviderFilter
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @systemapi
|
|
|
|
* @stagemodelonly
|
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
interface FormProviderFilter {
|
|
|
|
/**
|
|
|
|
* Obtains the bundle name of the provider application.
|
2023-05-26 02:24:08 +00:00
|
|
|
*
|
|
|
|
* @type { string }
|
2023-05-08 07:47:53 +00:00
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @systemapi
|
|
|
|
* @stagemodelonly
|
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
bundleName: string;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Obtains the form name of the provider application form.
|
2023-05-26 02:24:08 +00:00
|
|
|
*
|
|
|
|
* @type { ?string }
|
2023-05-08 07:47:53 +00:00
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @systemapi
|
|
|
|
* @stagemodelonly
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-05-26 02:24:08 +00:00
|
|
|
formName?: string;
|
2023-05-08 07:47:53 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Obtains the module name of the provider application module.
|
2023-05-26 02:24:08 +00:00
|
|
|
*
|
|
|
|
* @type { ?string }
|
2023-05-08 07:47:53 +00:00
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @systemapi
|
|
|
|
* @stagemodelonly
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-05-26 02:24:08 +00:00
|
|
|
moduleName?: string;
|
2023-05-08 07:47:53 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Obtains the ability name of the provider application module.
|
2023-05-26 02:24:08 +00:00
|
|
|
*
|
|
|
|
* @type { ?string }
|
2023-05-08 07:47:53 +00:00
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @systemapi
|
|
|
|
* @stagemodelonly
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-05-26 02:24:08 +00:00
|
|
|
abilityName?: string;
|
2023-10-12 07:09:05 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Indicates whether to include unused form.
|
|
|
|
*
|
|
|
|
* @type { ?boolean }
|
|
|
|
* @default false
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @systemapi
|
|
|
|
* @stagemodelonly
|
|
|
|
* @since 11
|
|
|
|
*/
|
2023-10-13 01:32:20 +00:00
|
|
|
isUnusedIncluded?: boolean;
|
2023-05-08 07:47:53 +00:00
|
|
|
}
|
2023-05-09 07:30:42 +00:00
|
|
|
|
2023-04-27 14:36:34 +00:00
|
|
|
/**
|
2023-05-09 07:30:42 +00:00
|
|
|
* The class of a running form information.
|
|
|
|
*
|
2023-05-18 03:46:34 +00:00
|
|
|
* @typedef RunningFormInfo
|
2023-05-09 07:30:42 +00:00
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @systemapi hide this for inner system use
|
|
|
|
* @since 10
|
|
|
|
*/
|
2023-05-08 14:23:29 +00:00
|
|
|
interface RunningFormInfo {
|
2023-04-27 14:36:34 +00:00
|
|
|
/**
|
|
|
|
* Obtains the id of the this form.
|
2023-05-26 02:24:08 +00:00
|
|
|
*
|
2023-04-27 14:36:34 +00:00
|
|
|
* @type { string }
|
2024-11-15 02:24:11 +00:00
|
|
|
* @readonly
|
2023-04-27 14:36:34 +00:00
|
|
|
* @default -
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @systemapi
|
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
readonly formId: string;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Obtains the bundle name of the application to which this form belongs.
|
2023-05-26 02:24:08 +00:00
|
|
|
*
|
2023-04-27 14:36:34 +00:00
|
|
|
* @type { string }
|
2024-11-15 02:24:11 +00:00
|
|
|
* @readonly
|
2023-04-27 14:36:34 +00:00
|
|
|
* @default -
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @systemapi
|
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
readonly bundleName: string;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Obtains the bundle name of the form host application.
|
2023-05-26 02:24:08 +00:00
|
|
|
*
|
2023-04-27 14:36:34 +00:00
|
|
|
* @type { string }
|
2024-11-15 02:24:11 +00:00
|
|
|
* @readonly
|
2023-04-27 14:36:34 +00:00
|
|
|
* @default -
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @systemapi
|
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
readonly hostBundleName: string;
|
|
|
|
|
2024-02-19 03:53:48 +00:00
|
|
|
/**
|
|
|
|
* The location of this form.
|
|
|
|
*
|
|
|
|
* @type { FormLocation }
|
2024-11-15 02:24:11 +00:00
|
|
|
* @readonly
|
2024-02-19 03:53:48 +00:00
|
|
|
* @default -
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @systemapi
|
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
readonly formLocation: FormLocation;
|
|
|
|
|
2023-04-27 14:36:34 +00:00
|
|
|
/**
|
|
|
|
* Obtains the visibility of this form.
|
2023-05-26 02:24:08 +00:00
|
|
|
*
|
2023-04-27 14:36:34 +00:00
|
|
|
* @type { VisibilityType }
|
2024-11-15 02:24:11 +00:00
|
|
|
* @readonly
|
2023-04-27 14:36:34 +00:00
|
|
|
* @default -
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @systemapi
|
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
readonly visibilityType: VisibilityType;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Obtains the name of the application module to which this form belongs.
|
2023-05-26 02:24:08 +00:00
|
|
|
*
|
2023-04-27 14:36:34 +00:00
|
|
|
* @type { string }
|
2024-11-15 02:24:11 +00:00
|
|
|
* @readonly
|
2023-04-27 14:36:34 +00:00
|
|
|
* @default -
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @systemapi
|
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
readonly moduleName: string;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Obtains the class name of the ability to which this form belongs.
|
2023-05-26 02:24:08 +00:00
|
|
|
*
|
2023-04-27 14:36:34 +00:00
|
|
|
* @type { string }
|
2024-11-15 02:24:11 +00:00
|
|
|
* @readonly
|
2023-04-27 14:36:34 +00:00
|
|
|
* @default -
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @systemapi
|
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
readonly abilityName: string;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Obtains the name of this form.
|
2023-05-26 02:24:08 +00:00
|
|
|
*
|
2023-04-27 14:36:34 +00:00
|
|
|
* @type { string }
|
2024-11-15 02:24:11 +00:00
|
|
|
* @readonly
|
2023-04-27 14:36:34 +00:00
|
|
|
* @default -
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @systemapi
|
|
|
|
* @since 10
|
|
|
|
*/
|
|
|
|
readonly formName: string;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Obtains the grid style of this form.
|
2023-05-26 02:24:08 +00:00
|
|
|
*
|
2023-04-27 14:36:34 +00:00
|
|
|
* @type { number }
|
2024-11-15 02:24:11 +00:00
|
|
|
* @readonly
|
2023-04-27 14:36:34 +00:00
|
|
|
* @default -
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @systemapi
|
2023-03-17 13:06:58 +00:00
|
|
|
* @since 10
|
|
|
|
*/
|
2023-04-27 14:36:34 +00:00
|
|
|
readonly dimension: number;
|
2023-10-12 07:09:05 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Obtains the stage of form use.
|
|
|
|
*
|
|
|
|
* @type { FormUsageState }
|
|
|
|
* @default FormUsageState.USED
|
|
|
|
* @readonly
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @systemapi
|
|
|
|
* @since 11
|
|
|
|
*/
|
|
|
|
readonly formUsageState: FormUsageState;
|
2023-10-24 12:39:00 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Obtains the description of this form.
|
|
|
|
*
|
|
|
|
* @type { string }
|
2023-11-08 02:21:49 +00:00
|
|
|
* @readonly
|
2023-10-24 12:39:00 +00:00
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @systemapi
|
|
|
|
* @since 11
|
|
|
|
*/
|
|
|
|
readonly formDescription: string;
|
2024-02-18 03:52:35 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Obtains the extra data of the this form.
|
|
|
|
*
|
|
|
|
* @type { ?Record<string, Object> }
|
|
|
|
* @default -
|
|
|
|
* @readonly
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @systemapi
|
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
readonly extraData?: Record<string, Object>;
|
2023-10-12 07:09:05 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The stage of form use.
|
|
|
|
*
|
|
|
|
* @enum { number }
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @systemapi
|
|
|
|
* @since 11
|
|
|
|
*/
|
|
|
|
enum FormUsageState {
|
|
|
|
/**
|
|
|
|
* Indicates the stage of the form is used.
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @systemapi
|
|
|
|
* @since 11
|
|
|
|
*/
|
|
|
|
USED = 0,
|
|
|
|
/**
|
|
|
|
* Indicates the stage of the form is unused.
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @systemapi
|
|
|
|
* @since 11
|
|
|
|
*/
|
|
|
|
UNUSED = 1,
|
2023-04-27 14:36:34 +00:00
|
|
|
}
|
2024-02-19 03:53:48 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Defines the FormLocation enum.
|
|
|
|
*
|
|
|
|
* @enum { number }
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @systemapi
|
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
enum FormLocation {
|
|
|
|
/**
|
|
|
|
* Form is on the other location.
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @systemapi
|
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
OTHER = -1,
|
2024-06-13 03:10:23 +00:00
|
|
|
|
2024-02-19 03:53:48 +00:00
|
|
|
/**
|
|
|
|
* Form is on the desktop
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @systemapi
|
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
DESKTOP = 0,
|
2024-06-13 03:10:23 +00:00
|
|
|
|
2024-02-19 03:53:48 +00:00
|
|
|
/**
|
|
|
|
* Form is on the form center.
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @systemapi
|
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
FORM_CENTER = 1,
|
2024-06-13 03:10:23 +00:00
|
|
|
|
2024-02-19 03:53:48 +00:00
|
|
|
/**
|
|
|
|
* Form is on the form manager.
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @systemapi
|
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
FORM_MANAGER = 2,
|
2024-06-13 03:10:23 +00:00
|
|
|
|
2024-02-19 03:53:48 +00:00
|
|
|
/**
|
|
|
|
* Form is on the negative screen.
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @systemapi
|
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
NEGATIVE_SCREEN = 3,
|
2024-06-13 03:10:23 +00:00
|
|
|
|
2024-02-19 03:53:48 +00:00
|
|
|
/**
|
|
|
|
* Form is on the form center of negative screen.
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @systemapi
|
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
FORM_CENTER_NEGATIVE_SCREEN = 4,
|
2024-06-13 03:10:23 +00:00
|
|
|
|
2024-02-19 03:53:48 +00:00
|
|
|
/**
|
|
|
|
* Form is on the form manager of negative screen.
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @systemapi
|
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
FORM_MANAGER_NEGATIVE_SCREEN = 5,
|
2024-06-13 03:10:23 +00:00
|
|
|
|
2024-02-19 03:53:48 +00:00
|
|
|
/**
|
|
|
|
* Form is on the screen lock.
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @systemapi
|
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
SCREEN_LOCK = 6,
|
2024-06-13 03:10:23 +00:00
|
|
|
|
2024-02-19 03:53:48 +00:00
|
|
|
/**
|
|
|
|
* Form is on the ai suggestion.
|
|
|
|
*
|
|
|
|
* @syscap SystemCapability.Ability.Form
|
|
|
|
* @systemapi
|
|
|
|
* @since 12
|
|
|
|
*/
|
|
|
|
AI_SUGGESTION = 7,
|
|
|
|
}
|
2022-10-18 11:39:48 +00:00
|
|
|
}
|
2023-05-06 06:59:50 +00:00
|
|
|
export default formInfo;
|