From 6aef7c42e90a298f521f0a054f0ba7c386921e74 Mon Sep 17 00:00:00 2001 From: zhangdezhou Date: Mon, 16 Jun 2025 17:55:43 +0800 Subject: [PATCH 1/9] add getFormRect interface Signed-off-by: zhangdezhou --- api/@ohos.app.form.formHost.d.ts | 30 ++++++++++++++++++++++++++++++ api/@ohos.app.form.formInfo.d.ts | 7 +++++++ 2 files changed, 37 insertions(+) diff --git a/api/@ohos.app.form.formHost.d.ts b/api/@ohos.app.form.formHost.d.ts index cb7a9402a3..5745bdcd0c 100644 --- a/api/@ohos.app.form.formHost.d.ts +++ b/api/@ohos.app.form.formHost.d.ts @@ -788,6 +788,36 @@ declare namespace formHost { function off(type: 'changeSceneAnimationState', callback?: Callback): void; + /** + * Listens to the event of get form rect. + *

You can use this method to listen to the event of get form rect.

+ * + * @param { 'getFormRect' } type - Indicates event type. + * @param { formInfo.GetFormRectInfoCallback } callback - The callback of get form rect. + * @throws { BusinessError } 202 - The application is not a system application. + * @throws { BusinessError } 801 - Capability not supported.function getFormRect can not work correctly + * due to limited device capabilities. + * @syscap SystemCapability.Ability.Form + * @systemapi + * @since 20 + */ + function on(type: 'getFormRect', callback: formInfo.GetFormRectInfoCallback): void; + + /** + * Cancels listening to the event of get form rect. + *

You can use this method to cancel listening to the event of get form rect.

+ * + * @param { 'getFormRect' } type - Indicates event type. + * @param { formInfo.GetFormRectInfoCallback } callback - The callback of get form rect. + * @throws { BusinessError } 202 - The application is not a system application. + * @throws { BusinessError } 801 - Capability not supported.function getFormRect can not work correctly + * due to limited device capabilities. + * @syscap SystemCapability.Ability.Form + * @systemapi + * @since 20 + */ + function off(type: 'getFormRect', callback?: formInfo.GetFormRectInfoCallback): void; + /** * Notify form is Visible *

You can use this method to notify form visible state.

diff --git a/api/@ohos.app.form.formInfo.d.ts b/api/@ohos.app.form.formInfo.d.ts index c6c6e9245b..985199a4a5 100644 --- a/api/@ohos.app.form.formInfo.d.ts +++ b/api/@ohos.app.form.formInfo.d.ts @@ -2132,5 +2132,12 @@ declare namespace formInfo { */ disabledDesktopBehaviors?: string; } + + /** + * Get form rect info callback + */ + interface GetFormRectInfoCallback { + (data: T): Promise; + } } export default formInfo; -- Gitee From 8b38af75a21d11e8f29149188bb7d1e4936da256 Mon Sep 17 00:00:00 2001 From: zhangdezhou Date: Mon, 16 Jun 2025 19:20:23 +0800 Subject: [PATCH 2/9] add getFormRect interface Signed-off-by: zhangdezhou --- api/@ohos.app.form.formInfo.d.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/api/@ohos.app.form.formInfo.d.ts b/api/@ohos.app.form.formInfo.d.ts index 985199a4a5..80792a3a49 100644 --- a/api/@ohos.app.form.formInfo.d.ts +++ b/api/@ohos.app.form.formInfo.d.ts @@ -2135,8 +2135,24 @@ declare namespace formInfo { /** * Get form rect info callback + * + * @typedef GetFormRectInfoCallback + * @syscap SystemCapability.Ability.Form + * @systemapi + * @since 20 */ interface GetFormRectInfoCallback { + /** + * Get form rect info + * + * @param { T } data + * @returns { Promise } + * + * @throws { BusinessError } 202 - The application is not a system application. + * @syscap SystemCapability.Ability.Form + * @systemapi + * @since 20 + */ (data: T): Promise; } } -- Gitee From af495ef09d99f911080342a7d6f384099f42c4c1 Mon Sep 17 00:00:00 2001 From: zhangdezhou Date: Thu, 19 Jun 2025 21:31:03 +0800 Subject: [PATCH 3/9] add getFormRect interface Signed-off-by: zhangdezhou --- api/@ohos.app.form.formInfo.d.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/api/@ohos.app.form.formInfo.d.ts b/api/@ohos.app.form.formInfo.d.ts index 80792a3a49..994823be51 100644 --- a/api/@ohos.app.form.formInfo.d.ts +++ b/api/@ohos.app.form.formInfo.d.ts @@ -1936,6 +1936,15 @@ declare namespace formInfo { * @since 20 */ duration: number; + + /** + * Whether use default animate + * + * @type { boolean } + * @syscap SystemCapability.Ability.Form + * @since 20 + */ + useDefaultAnimate?: boolean; } /** -- Gitee From 8ae524fca997607696005a0206be2f0d97da66e3 Mon Sep 17 00:00:00 2001 From: zhangdezhou Date: Mon, 23 Jun 2025 12:03:43 +0800 Subject: [PATCH 4/9] add useDefaultAnimate variable of OverflowInfo Signed-off-by: zhangdezhou --- api/@ohos.app.form.formInfo.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/@ohos.app.form.formInfo.d.ts b/api/@ohos.app.form.formInfo.d.ts index 994823be51..6d3441b635 100644 --- a/api/@ohos.app.form.formInfo.d.ts +++ b/api/@ohos.app.form.formInfo.d.ts @@ -1938,7 +1938,7 @@ declare namespace formInfo { duration: number; /** - * Whether use default animate + * Whether use default animate, default is true * * @type { boolean } * @syscap SystemCapability.Ability.Form -- Gitee From 5d5b16968585168a591411c4eb81b98582534856 Mon Sep 17 00:00:00 2001 From: zhangdezhou Date: Mon, 23 Jun 2025 17:49:14 +0800 Subject: [PATCH 5/9] add useDefaultAnimate variable of OverflowInfo Signed-off-by: zhangdezhou --- api/@ohos.app.form.formHost.d.ts | 4 ++-- api/@ohos.app.form.formInfo.d.ts | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/api/@ohos.app.form.formHost.d.ts b/api/@ohos.app.form.formHost.d.ts index 5745bdcd0c..5527cbb670 100644 --- a/api/@ohos.app.form.formHost.d.ts +++ b/api/@ohos.app.form.formHost.d.ts @@ -801,7 +801,7 @@ declare namespace formHost { * @systemapi * @since 20 */ - function on(type: 'getFormRect', callback: formInfo.GetFormRectInfoCallback): void; + function on(type: 'getFormRect', callback: formInfo.GetFormRectInfoCallback): void; /** * Cancels listening to the event of get form rect. @@ -816,7 +816,7 @@ declare namespace formHost { * @systemapi * @since 20 */ - function off(type: 'getFormRect', callback?: formInfo.GetFormRectInfoCallback): void; + function off(type: 'getFormRect', callback?: formInfo.GetFormRectInfoCallback): void; /** * Notify form is Visible diff --git a/api/@ohos.app.form.formInfo.d.ts b/api/@ohos.app.form.formInfo.d.ts index 6d3441b635..8f83595617 100644 --- a/api/@ohos.app.form.formInfo.d.ts +++ b/api/@ohos.app.form.formInfo.d.ts @@ -2145,16 +2145,16 @@ declare namespace formInfo { /** * Get form rect info callback * - * @typedef GetFormRectInfoCallback + * @typedef GetFormRectInfoCallback * @syscap SystemCapability.Ability.Form * @systemapi * @since 20 */ - interface GetFormRectInfoCallback { + interface GetFormRectInfoCallback { /** * Get form rect info * - * @param { T } data + * @param { string } formId * @returns { Promise } * * @throws { BusinessError } 202 - The application is not a system application. @@ -2162,7 +2162,7 @@ declare namespace formInfo { * @systemapi * @since 20 */ - (data: T): Promise; + (formId: string): Promise; } } export default formInfo; -- Gitee From b15971c63c20ff9f4584e76846d0952ac1de0ef0 Mon Sep 17 00:00:00 2001 From: zhangdezhou Date: Tue, 24 Jun 2025 20:57:04 +0800 Subject: [PATCH 6/9] add getFormRect listener and useDefaultAnimate variable of OverflowInfo Signed-off-by: zhangdezhou --- api/@ohos.app.form.formHost.d.ts | 12 ------------ api/@ohos.app.form.formInfo.d.ts | 2 +- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/api/@ohos.app.form.formHost.d.ts b/api/@ohos.app.form.formHost.d.ts index 5527cbb670..51872ed8e1 100644 --- a/api/@ohos.app.form.formHost.d.ts +++ b/api/@ohos.app.form.formHost.d.ts @@ -731,8 +731,6 @@ declare namespace formHost { * @param { 'formOverflow' } type - Indicates event type. * @param { Callback } callback - The callback of formOverflow. * @throws { BusinessError } 202 - The application is not a system application. - * @throws { BusinessError } 801 - Capability not supported.function formOverflow can not work correctly - * due to limited device capabilities. * @syscap SystemCapability.Ability.Form * @systemapi * @since 20 @@ -746,8 +744,6 @@ declare namespace formHost { * @param { 'formOverflow' } type - Indicates event type. * @param { Callback } callback - The callback of formOverflow. * @throws { BusinessError } 202 - The application is not a system application. - * @throws { BusinessError } 801 - Capability not supported.function formOverflow can not work correctly - * due to limited device capabilities. * @syscap SystemCapability.Ability.Form * @systemapi * @since 20 @@ -762,8 +758,6 @@ declare namespace formHost { * @param { Callback } callback - The callback of * change scene animation state. * @throws { BusinessError } 202 - The application is not a system application. - * @throws { BusinessError } 801 - Capability not supported.function changeSceneAnimationState can not work correctly - * due to limited device capabilities. * @syscap SystemCapability.Ability.Form * @systemapi * @since 20 @@ -779,8 +773,6 @@ declare namespace formHost { * @param { Callback } callback - The callback of * change scene animation state. * @throws { BusinessError } 202 - The application is not a system application. - * @throws { BusinessError } 801 - Capability not supported.function changeSceneAnimationState can not work correctly - * due to limited device capabilities. * @syscap SystemCapability.Ability.Form * @systemapi * @since 20 @@ -795,8 +787,6 @@ declare namespace formHost { * @param { 'getFormRect' } type - Indicates event type. * @param { formInfo.GetFormRectInfoCallback } callback - The callback of get form rect. * @throws { BusinessError } 202 - The application is not a system application. - * @throws { BusinessError } 801 - Capability not supported.function getFormRect can not work correctly - * due to limited device capabilities. * @syscap SystemCapability.Ability.Form * @systemapi * @since 20 @@ -810,8 +800,6 @@ declare namespace formHost { * @param { 'getFormRect' } type - Indicates event type. * @param { formInfo.GetFormRectInfoCallback } callback - The callback of get form rect. * @throws { BusinessError } 202 - The application is not a system application. - * @throws { BusinessError } 801 - Capability not supported.function getFormRect can not work correctly - * due to limited device capabilities. * @syscap SystemCapability.Ability.Form * @systemapi * @since 20 diff --git a/api/@ohos.app.form.formInfo.d.ts b/api/@ohos.app.form.formInfo.d.ts index 8f83595617..358885b8a5 100644 --- a/api/@ohos.app.form.formInfo.d.ts +++ b/api/@ohos.app.form.formInfo.d.ts @@ -1940,7 +1940,7 @@ declare namespace formInfo { /** * Whether use default animate, default is true * - * @type { boolean } + * @type { ?boolean } * @syscap SystemCapability.Ability.Form * @since 20 */ -- Gitee From f8d92217fa35fe416cb03c4974946913b4ee9f05 Mon Sep 17 00:00:00 2001 From: zhangdezhou Date: Wed, 25 Jun 2025 10:50:37 +0800 Subject: [PATCH 7/9] add useDefaultAnimate variable of OverflowInfo Signed-off-by: zhangdezhou --- api/@ohos.app.form.formInfo.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/@ohos.app.form.formInfo.d.ts b/api/@ohos.app.form.formInfo.d.ts index 358885b8a5..b9d435dd3a 100644 --- a/api/@ohos.app.form.formInfo.d.ts +++ b/api/@ohos.app.form.formInfo.d.ts @@ -1938,13 +1938,13 @@ declare namespace formInfo { duration: number; /** - * Whether use default animate, default is true + * Whether use default animation, default is true * * @type { ?boolean } * @syscap SystemCapability.Ability.Form * @since 20 */ - useDefaultAnimate?: boolean; + useDefaultAnimation?: boolean; } /** -- Gitee From 1caafcdb8342a5ee69103ff5b025713496291402 Mon Sep 17 00:00:00 2001 From: zhangdezhou Date: Wed, 25 Jun 2025 15:04:18 +0800 Subject: [PATCH 8/9] add useDefaultAnimate variable of OverflowInfo Signed-off-by: zhangdezhou --- api/@ohos.app.form.formHost.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/api/@ohos.app.form.formHost.d.ts b/api/@ohos.app.form.formHost.d.ts index 51872ed8e1..ab3638953e 100644 --- a/api/@ohos.app.form.formHost.d.ts +++ b/api/@ohos.app.form.formHost.d.ts @@ -785,7 +785,7 @@ declare namespace formHost { *

You can use this method to listen to the event of get form rect.

* * @param { 'getFormRect' } type - Indicates event type. - * @param { formInfo.GetFormRectInfoCallback } callback - The callback of get form rect. + * @param { formInfo.GetFormRectInfoCallback } callback - The callback of get form rect. * @throws { BusinessError } 202 - The application is not a system application. * @syscap SystemCapability.Ability.Form * @systemapi @@ -798,7 +798,7 @@ declare namespace formHost { *

You can use this method to cancel listening to the event of get form rect.

* * @param { 'getFormRect' } type - Indicates event type. - * @param { formInfo.GetFormRectInfoCallback } callback - The callback of get form rect. + * @param { formInfo.GetFormRectInfoCallback } [callback] - The callback of get form rect. * @throws { BusinessError } 202 - The application is not a system application. * @syscap SystemCapability.Ability.Form * @systemapi -- Gitee From c1ea2d458da9fe6882df2598010176c29b673585 Mon Sep 17 00:00:00 2001 From: zhangdezhou Date: Thu, 26 Jun 2025 11:47:12 +0800 Subject: [PATCH 9/9] add useDefaultAnimate variable of OverflowInfo Signed-off-by: zhangdezhou --- api/@ohos.app.form.formInfo.d.ts | 9 +++++++++ api/@ohos.app.form.formProvider.d.ts | 15 +++++++-------- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/api/@ohos.app.form.formInfo.d.ts b/api/@ohos.app.form.formInfo.d.ts index b9d435dd3a..6b40e61310 100644 --- a/api/@ohos.app.form.formInfo.d.ts +++ b/api/@ohos.app.form.formInfo.d.ts @@ -1916,6 +1916,7 @@ declare namespace formInfo { * * @typedef { OverflowInfo } * @syscap SystemCapability.Ability.Form + * @atomicservice * @since 20 */ interface OverflowInfo { @@ -1924,6 +1925,7 @@ declare namespace formInfo { * * @type { Rect } * @syscap SystemCapability.Ability.Form + * @atomicservice * @since 20 */ area: Rect; @@ -1933,6 +1935,7 @@ declare namespace formInfo { * * @type { number } * @syscap SystemCapability.Ability.Form + * @atomicservice * @since 20 */ duration: number; @@ -1942,6 +1945,7 @@ declare namespace formInfo { * * @type { ?boolean } * @syscap SystemCapability.Ability.Form + * @atomicservice * @since 20 */ useDefaultAnimation?: boolean; @@ -2022,6 +2026,7 @@ declare namespace formInfo { * * @typedef { Rect } * @syscap SystemCapability.Ability.Form + * @atomicservice * @since 20 */ interface Rect { @@ -2030,6 +2035,7 @@ declare namespace formInfo { * * @type { number } * @syscap SystemCapability.Ability.Form + * @atomicservice * @since 20 */ left: number; @@ -2039,6 +2045,7 @@ declare namespace formInfo { * * @type { number } * @syscap SystemCapability.Ability.Form + * @atomicservice * @since 20 */ top: number; @@ -2048,6 +2055,7 @@ declare namespace formInfo { * * @type { number } * @syscap SystemCapability.Ability.Form + * @atomicservice * @since 20 */ width: number; @@ -2057,6 +2065,7 @@ declare namespace formInfo { * * @type { number } * @syscap SystemCapability.Ability.Form + * @atomicservice * @since 20 */ height: number; diff --git a/api/@ohos.app.form.formProvider.d.ts b/api/@ohos.app.form.formProvider.d.ts index a16552f68f..7bd2de5b9b 100644 --- a/api/@ohos.app.form.formProvider.d.ts +++ b/api/@ohos.app.form.formProvider.d.ts @@ -466,8 +466,7 @@ declare namespace formProvider { * @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. - * @throws { BusinessError } 16501011 - The form can not support this operation, please check your fom_config's - * sceneAnimationParams configuration infomation is correct or not. + * @throws { BusinessError } 16501011 - The form can not support this operation. * @syscap SystemCapability.Ability.Form * @systemapi * @since 20 @@ -488,8 +487,7 @@ declare namespace formProvider { * @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. - * @throws { BusinessError } 16501011 - The form can not support this operation, please check your fom_config's - * sceneAnimationParams configuration infomation is correct or not. + * @throws { BusinessError } 16501011 - The form can not support this operation. * @syscap SystemCapability.Ability.Form * @systemapi * @since 20 @@ -510,9 +508,9 @@ declare namespace formProvider { * @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. - * @throws { BusinessError } 16501011 - The form can not support this operation, please check your fom_config's - * sceneAnimationParams configuration infomation is correct or not. + * @throws { BusinessError } 16501011 - The form can not support this operation. * @syscap SystemCapability.Ability.Form + * @atomicservice * @since 20 */ function requestOverflow(formId: string, overflowInfo: formInfo.OverflowInfo): Promise; @@ -530,9 +528,9 @@ declare namespace formProvider { * @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. - * @throws { BusinessError } 16501011 - The form can not support this operation, please check your fom_config's - * sceneAnimationParams configuration infomation is correct or not. + * @throws { BusinessError } 16501011 - The form can not support this operation. * @syscap SystemCapability.Ability.Form + * @atomicservice * @since 20 */ function cancelOverflow(formId: string): Promise; @@ -552,6 +550,7 @@ declare namespace formProvider { * @throws { BusinessError } 16501001 - The ID of the form to be operated does not exist. * @throws { BusinessError } 16501003 - The form cannot be operated by the current application. * @syscap SystemCapability.Ability.Form + * @atomicservice * @since 20 */ function getFormRect(formId: string): Promise; -- Gitee