增加卡片在宿主中的位置类型

Change-Id: I494a4924c10c7ed229b41c86fd71560b2467c71c
Signed-off-by: sunhaiyang <sunhy.sun@huawei.com>
This commit is contained in:
sunhaiyang 2024-02-19 11:53:48 +08:00
parent d36852ebee
commit 34d98d4c5e
2 changed files with 136 additions and 0 deletions

View File

@ -1076,5 +1076,26 @@ declare namespace formHost {
* @since 11
*/
function recoverForms(formIds: Array<string>, callback: AsyncCallback<void>): void;
/**
* Update location of the form.
*
* @permission ohos.permission.REQUIRE_FORM
* @param { string } formId - Indicates the form id.
* @param { formInfo.FormLocation } location - The location of the form.
* @throws { BusinessError } 201 - Permissions denied.
* @throws { BusinessError } 202 - caller is not system app.
* @throws { BusinessError } 401 - If the input parameter is not valid parameter.
* @throws { BusinessError } 16500050 - An IPC connection error happened.
* @throws { BusinessError } 16500060 - A service connection error happened, please try again later.
* @throws { BusinessError } 16501000 - An internal functional error occurred.
* @throws { BusinessError } 16501001 - The ID of the form to be operated does not exist.
* @throws { BusinessError } 16501003 - The form can not be operated by the current application.
* @syscap SystemCapability.Ability.Form
* @systemapi
* @stagemodelonly
* @since 12
*/
function updateFormLocation(formId: string, location: formInfo.FormLocation): void;
}
export default formHost;

View File

@ -942,6 +942,19 @@ declare namespace formInfo {
*/
PARAM_FORM_CUSTOMIZE_KEY = 'ohos.extra.param.key.form_customize',
/**
* 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',
/**
* Indicates the key specifying the form rendering mode, which is represented as
* want: {
@ -1347,6 +1360,17 @@ declare namespace formInfo {
*/
readonly hostBundleName: string;
/**
* The location of this form.
*
* @type { FormLocation }
* @default -
* @syscap SystemCapability.Ability.Form
* @systemapi
* @since 12
*/
readonly formLocation: FormLocation;
/**
* Obtains the visibility of this form.
*
@ -1452,5 +1476,96 @@ declare namespace formInfo {
*/
UNUSED = 1,
}
/**
* 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,
/**
* Form is on the desktop
*
* @syscap SystemCapability.Ability.Form
* @systemapi
* @since 12
*/
DESKTOP = 0,
/**
* Form is on the form center.
*
* @syscap SystemCapability.Ability.Form
* @systemapi
* @since 12
*/
FORM_CENTER = 1,
/**
* Form is on the form manager.
*
* @syscap SystemCapability.Ability.Form
* @systemapi
* @since 12
*/
FORM_MANAGER = 2,
/**
* Form is on the negative screen.
*
* @syscap SystemCapability.Ability.Form
* @systemapi
* @since 12
*/
NEGATIVE_SCREEN = 3,
/**
* Form is on the form center of negative screen.
*
* @syscap SystemCapability.Ability.Form
* @systemapi
* @since 12
*/
FORM_CENTER_NEGATIVE_SCREEN = 4,
/**
* Form is on the form manager of negative screen.
*
* @syscap SystemCapability.Ability.Form
* @systemapi
* @since 12
*/
FORM_MANAGER_NEGATIVE_SCREEN = 5,
/**
* Form is on the screen lock.
*
* @syscap SystemCapability.Ability.Form
* @systemapi
* @since 12
*/
SCREEN_LOCK = 6,
/**
* Form is on the ai suggestion.
*
* @syscap SystemCapability.Ability.Form
* @systemapi
* @since 12
*/
AI_SUGGESTION = 7,
}
}
export default formInfo;