diff --git a/en/application-dev/reference/apis/js-apis-window.md b/en/application-dev/reference/apis/js-apis-window.md index 4f2cb43b9197f866bd9f3a9f8c03bc9125098964..be2cc3942bde9631c694934f03f933303ef93ca9 100644 --- a/en/application-dev/reference/apis/js-apis-window.md +++ b/en/application-dev/reference/apis/js-apis-window.md @@ -148,6 +148,7 @@ Describes the window properties. | focusable7+ | boolean | Yes | No | Whether the window can gain focus. The default value is **true**. | | touchable7+ | boolean | Yes | No | Whether the window is touchable. The default value is **true**. | | brightness | number | Yes | Yes | Screen brightness. The value ranges from 0 to 1. The value **1** indicates the maximum brightness. | +| dimBehindValue(deprecated) | number | Yes | Yes | Dimness of the window that is not on top. The value ranges from 0 to 1. The value **1** indicates the maximum dimness.
This attribute is supported since API version 7 and deprecated since API version 9.
| | isKeepScreenOn | boolean | Yes | Yes | Whether the screen is always on. The default value is **false**. | | isPrivacyMode7+ | boolean | Yes | Yes | Whether the window is in privacy mode. The default value is **false**. | | isRoundCorner7+ | boolean | Yes | Yes | Whether the window has rounded corners. The default value is **false**. | @@ -170,7 +171,7 @@ create(id: string, type: WindowType, callback: AsyncCallback<Window>): voi Creates a subwindow. This API uses an asynchronous callback to return the result. -This API is discarded since API version 8. You are advised to use [window.create8+](#windowcreate8) instead. +This API is deprecated since API version 8. You are advised to use [window.create8+](#windowcreate8) instead. **System capability**: SystemCapability.WindowManager.WindowManager.Core @@ -203,7 +204,7 @@ create(id: string, type: WindowType): Promise<Window> Creates a subwindow. This API uses a promise to return the result. -This API is discarded since API version 8. You are advised to use [window.create8+](#windowcreate8) instead. +This API is deprecated since API version 8. You are advised to use [window.create8+](#windowcreate8) instead. **System capability**: SystemCapability.WindowManager.WindowManager.Core @@ -372,7 +373,7 @@ getTopWindow(callback: AsyncCallback<Window>): void Obtains the top window of the current application. This API uses an asynchronous callback to return the result. -This API is discarded since API version 8. You are advised to use [window.getTopWindow8+](#windowgettopwindow8) instead. +This API is deprecated since API version 8. You are advised to use [window.getTopWindow8+](#windowgettopwindow8) instead. **System capability**: SystemCapability.WindowManager.WindowManager.Core @@ -402,7 +403,7 @@ getTopWindow(): Promise<Window> Obtains the top window of the current application. This API uses a promise to return the result. -This API is discarded since API version 8. You are advised to use [window.getTopWindow8+](#windowgettopwindow8) instead. +This API is deprecated since API version 8. You are advised to use [window.getTopWindow8+](#windowgettopwindow8) instead. **System capability**: SystemCapability.WindowManager.WindowManager.Core @@ -1778,6 +1779,70 @@ Sets the screen brightness for this window. This API uses a promise to return th }); ``` +### setDimBehind(deprecated) + +setDimBehind(dimBehindValue: number, callback: AsyncCallback<void>): void + +Sets the dimness of the window that is not on top. This API uses an asynchronous callback to return the result. + +> This API is supported since API version 7 and deprecated since API version 9. +> + +**System capability**: SystemCapability.WindowManager.WindowManager.Core + +**Parameters** + +| Name | Type | Mandatory| Description | +| -------------- | ------------------------- | ---- | -------------------------------------------------- | +| dimBehindValue | number | Yes | Dimness of the window to set. The value ranges from 0 to 1. The value **1** indicates the dimmest.| +| callback | AsyncCallback<void> | Yes | Callback used to return the execution result. | + +**Example** + + ```js + windowClass.setDimBehind(0.5, (err, data) => { + if (err.code) { + console.error('Failed to set the dimness. Cause: ' + JSON.stringify(err)); + return; + } + console.info('Succeeded in setting the dimness. Data:' + JSON.stringify(data)); + }); + ``` + +### setDimBehind(deprecated) + +setDimBehind(dimBehindValue: number): Promise<void> + +Sets the dimness of the window that is not on top. This API uses a promise to return the result. + +> This API is supported since API version 7 and deprecated since API version 9. +> + +**System capability**: SystemCapability.WindowManager.WindowManager.Core + +**Parameters** + +| Name | Type | Mandatory| Description | +| -------------- | ------ | ---- | -------------------------------------------------- | +| dimBehindValue | number | Yes | Dimness of the window to set. The value ranges from 0 to 1. The value **1** indicates the dimmest.| + +**Return value** + +| Type | Description | +| ------------------- | ----------------------------------------------- | +| Promise<void> | Promise used to return the execution result.| + +**Example** + + ```js + let promise = windowClass.setDimBehind(0.5); + promise.then((data)=> { + console.info('Succeeded in setting the dimness. Data: ' + JSON.stringify(data)) + }).catch((err)=>{ + console.error('Failed to set the dimness. Cause: ' + JSON.stringify(err)); + }); + ``` + ### setFocusable7+ setFocusable(isFocusable: boolean, callback: AsyncCallback<void>): void @@ -1866,6 +1931,70 @@ Sets whether to keep the screen always on. This API uses an asynchronous callbac }); ``` +### setOutsideTouchable(deprecated) + +setOutsideTouchable(touchable: boolean, callback: AsyncCallback<void>): void + +Sets whether the area outside the subwindow is touchable. This API uses an asynchronous callback to return the result. + +> This API is supported since API version 7 and deprecated since API version 9. +> + +**System capability**: SystemCapability.WindowManager.WindowManager.Core + +**Parameters** + +| Name | Type | Mandatory| Description | +| --------- | ------------------------- | ---- | ---------------- | +| touchable | boolean | Yes | Whether the area outside the subwindow is touchable. The value **true** means that such an area is touchable, and **false** means the opposite.| +| callback | AsyncCallback<void> | Yes | Callback used to return the execution result. | + +**Example** + + ```js + windowClass.setOutsideTouchable(true, (err, data) => { + if (err.code) { + console.error('Failed to set the area to be touchable. Cause: ' + JSON.stringify(err)); + return; + } + console.info('Succeeded in setting the area to be touchable. Data: ' + JSON.stringify(data)) + }) + ``` + +### setOutsideTouchable(deprecated) + +setOutsideTouchable(touchable: boolean): Promise<void> + +Sets whether the area outside the subwindow is touchable. This API uses a promise to return the result. + +> This API is supported since API version 7 and deprecated since API version 9. +> + +**System capability**: SystemCapability.WindowManager.WindowManager.Core + +**Parameters** + +| Name | Type | Mandatory| Description | +| --------- | ------- | ---- | ---------------- | +| touchable | boolean | Yes | Whether the area outside the subwindow is touchable. The value **true** means that such an area is touchable, and **false** means the opposite.| + +**Return value** + +| Type | Description | +| ------------------- | ----------------------------------------------- | +| Promise<void> | Promise used to return the execution result.| + +**Example** + + ```js + let promise = windowClass.setOutsideTouchable(true); + promise.then((data)=> { + console.info('Succeeded in setting the area to be touchable. Data: ' + JSON.stringify(data)) + }).catch((err)=>{ + console.error('Failed to set the area to be touchable. Cause: ' + JSON.stringify(err)); + }); + ``` + ### setKeepScreenOn setKeepScreenOn(isKeepScreenOn: boolean): Promise<void>