From 978569aac292f39b087d26db37eda1ab96b311b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E8=82=96=E8=91=9B?= Date: Sun, 6 Jul 2025 09:45:11 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=94=AF=E6=8C=81=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E5=8D=A1=E7=89=87=E8=B0=83=E6=95=B4=E5=B0=BA=E5=AF=B8=E7=9A=84?= =?UTF-8?q?=E8=83=BD=E5=8A=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 李肖葛 --- api/@ohos.app.form.FormExtensionAbility.d.ts | 15 ++++++++++++ api/@ohos.app.form.formHost.d.ts | 19 ++++++++++++++++ api/@ohos.app.form.formInfo.d.ts | 24 ++++++++++++++++++++ 3 files changed, 58 insertions(+) diff --git a/api/@ohos.app.form.FormExtensionAbility.d.ts b/api/@ohos.app.form.FormExtensionAbility.d.ts index f106f0c109..e866007b1f 100644 --- a/api/@ohos.app.form.FormExtensionAbility.d.ts +++ b/api/@ohos.app.form.FormExtensionAbility.d.ts @@ -338,5 +338,20 @@ declare class FormExtensionAbility { * @since 20 */ onFormLocationChanged(formId: string, newFormLocation: formInfo.FormLocation): void; + + /** + * Called to notify the form provider that the size of the form has been changed. Override this method if + * you want to know the form size be changed, used for data continuity and layout refresh. + * + * @param { string } formId - Indicates the ID of the form. + * @param { string } newDimension - Indicates the new dimension of the form. + * @param { formInfo.Rect } newRect - Indicates the new rect(vp) of the form. + * + * @syscap SystemCapability.Ability.Form + * @stagemodelonly + * @since 20 + * @arkts 1.1&1.2 + */ + onSizeChanged(formId: string, newDimension: string, newRect: formInfo.Rect): void; } export default FormExtensionAbility; diff --git a/api/@ohos.app.form.formHost.d.ts b/api/@ohos.app.form.formHost.d.ts index 421eb36c6e..1094d452dc 100644 --- a/api/@ohos.app.form.formHost.d.ts +++ b/api/@ohos.app.form.formHost.d.ts @@ -1318,5 +1318,24 @@ declare namespace formHost { */ function off(type: 'getLiveFormStatus', callback?: formInfo.GetLiveFormStatusCallback): void; + + /** + * Update size of the form. + * + * @permission ohos.permission.REQUIRE_FORM + * @param { string } formId - Indicates the form id. + * @param { formInfo.FormDimension } newDimension - The new dimension of the form. + * @param { formInfo.Rect } newRect - The new size of the form. + * @throws { BusinessError } 201 - Permissions denied. + * @throws { BusinessError } 202 - caller is not system app. + * @throws { BusinessError } 16501000 - An internal functional error occurred. + * @throws { BusinessError } 16501001 - The ID of the form to be operated does not exist. + * @throws { BusinessError } 16501012 - The dimension parameter is incorrect + * @syscap SystemCapability.Ability.Form + * @systemapi + * @since 20 + * @arkts 1.1&1.2 + */ + function updateFormSize(formId: string, newDimension: string, newRect: formInfo.Rect): void; } export default formHost; diff --git a/api/@ohos.app.form.formInfo.d.ts b/api/@ohos.app.form.formInfo.d.ts index f6f9d43c38..185b93d378 100644 --- a/api/@ohos.app.form.formInfo.d.ts +++ b/api/@ohos.app.form.formInfo.d.ts @@ -472,6 +472,30 @@ declare namespace formInfo { * @since 20 */ readonly sceneAnimationParams?: SceneAnimationParams; + + /** + * Obtains the resizable of the form. + * + * @type { ?boolean } + * @readonly + * @syscap SystemCapability.Ability.Form + * @systemapi + * @since 20 + * @arkts 1.2 + */ + readonly resizable?: boolean; + + /** + * Obtains the group id of the form. + * + * @type { ?string } + * @readonly + * @syscap SystemCapability.Ability.Form + * @systemapi + * @since 20 + * @arkts 1.2 + */ + readonly groupId?: string; } /** -- Gitee From 055fd63013547597275992bb4e0cf7a3b792c448 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E8=82=96=E8=91=9B?= Date: Sun, 6 Jul 2025 10:10:20 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=94=AF=E6=8C=81=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E5=8D=A1=E7=89=87=E8=B0=83=E6=95=B4=E5=B0=BA=E5=AF=B8=E7=9A=84?= =?UTF-8?q?=E8=83=BD=E5=8A=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 李肖葛 --- api/@ohos.app.form.FormExtensionAbility.d.ts | 6 ++---- api/@ohos.app.form.formHost.d.ts | 3 +-- api/@ohos.app.form.formInfo.d.ts | 2 -- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/api/@ohos.app.form.FormExtensionAbility.d.ts b/api/@ohos.app.form.FormExtensionAbility.d.ts index e866007b1f..64bcd8ca3f 100644 --- a/api/@ohos.app.form.FormExtensionAbility.d.ts +++ b/api/@ohos.app.form.FormExtensionAbility.d.ts @@ -344,14 +344,12 @@ declare class FormExtensionAbility { * you want to know the form size be changed, used for data continuity and layout refresh. * * @param { string } formId - Indicates the ID of the form. - * @param { string } newDimension - Indicates the new dimension of the form. + * @param { formInfo.FormDimension } newDimension - Indicates the new dimension of the form. * @param { formInfo.Rect } newRect - Indicates the new rect(vp) of the form. - * * @syscap SystemCapability.Ability.Form * @stagemodelonly * @since 20 - * @arkts 1.1&1.2 */ - onSizeChanged(formId: string, newDimension: string, newRect: formInfo.Rect): void; + onSizeChanged(formId: string, newDimension: formInfo.FormDimension, newRect: formInfo.Rect): void } export default FormExtensionAbility; diff --git a/api/@ohos.app.form.formHost.d.ts b/api/@ohos.app.form.formHost.d.ts index 1094d452dc..5db0f7bb26 100644 --- a/api/@ohos.app.form.formHost.d.ts +++ b/api/@ohos.app.form.formHost.d.ts @@ -1334,8 +1334,7 @@ declare namespace formHost { * @syscap SystemCapability.Ability.Form * @systemapi * @since 20 - * @arkts 1.1&1.2 */ - function updateFormSize(formId: string, newDimension: string, newRect: formInfo.Rect): void; + function updateFormSize(formId: string, newDimension: formInfo.FormDimension, newRect: formInfo.Rect): void } export default formHost; diff --git a/api/@ohos.app.form.formInfo.d.ts b/api/@ohos.app.form.formInfo.d.ts index 185b93d378..5c59c1182c 100644 --- a/api/@ohos.app.form.formInfo.d.ts +++ b/api/@ohos.app.form.formInfo.d.ts @@ -481,7 +481,6 @@ declare namespace formInfo { * @syscap SystemCapability.Ability.Form * @systemapi * @since 20 - * @arkts 1.2 */ readonly resizable?: boolean; @@ -493,7 +492,6 @@ declare namespace formInfo { * @syscap SystemCapability.Ability.Form * @systemapi * @since 20 - * @arkts 1.2 */ readonly groupId?: string; } -- Gitee