diff --git a/en/application-dev/reference/apis/js-apis-screenshot.md b/en/application-dev/reference/apis/js-apis-screenshot.md index 309a1bc64491497bf61aaf6f2695a9d5c4fbd9d4..8b760e7cb48b3031e728ec80cc2c178501abb677 100644 --- a/en/application-dev/reference/apis/js-apis-screenshot.md +++ b/en/application-dev/reference/apis/js-apis-screenshot.md @@ -37,10 +37,10 @@ Describes the region of the screen to capture. | Name| Type | Mandatory| Description | | ------ | ------ | ---- | ------------------------------------------------------------ | -| left | number | Yes | Left boundary of the screen region to capture.| -| top | number | Yes | Top boundary of the screen region to capture.| -| width | number | Yes | Width of the screen region to capture.| -| height | number | Yes | Height of the screen region to capture.| +| left | number | Yes | Left boundary of the screen region to capture, in pixels.| +| top | number | Yes | Top boundary of the screen region to capture, in pixels.| +| width | number | Yes | Width of the screen region to capture, in pixels.| +| height | number | Yes | Height of the screen region to capture, in pixels.| ## Size @@ -51,8 +51,8 @@ Describes the size of the screen region to capture. | Name| Type | Mandatory| Description | | ------ | ------ | ---- | ------------------------------------------------------------ | -| width | number | Yes | Width of the screen region to capture.| -| height | number | Yes | Height of the screen region to capture.| +| width | number | Yes | Width of the screen region to capture, in pixels.| +| height | number | Yes | Height of the screen region to capture, in pixels.| ## screenshot.save diff --git a/en/application-dev/reference/apis/js-apis-window.md b/en/application-dev/reference/apis/js-apis-window.md index f8a8d90d0e6eea8ad7a95cb49fe873c7a82d41a5..26fd78b642da4a588bec3a06e12a1b591681da62 100644 --- a/en/application-dev/reference/apis/js-apis-window.md +++ b/en/application-dev/reference/apis/js-apis-window.md @@ -40,7 +40,7 @@ Enumerates the window types. | TYPE_LAUNCHER_DOCK9+ | 12 | Dock bar on the home screen.
**Model restriction**: This API can be used only in the stage model.
**System API**: This is a system API.| | TYPE_VOICE_INTERACTION9+ | 13 | Voice assistant.
**Model restriction**: This API can be used only in the stage model.
**System API**: This is a system API.| | TYPE_POINTER9+ | 14 | Mouse.
**Model restriction**: This API can be used only in the stage model.
**System API**: This is a system API.| -| TYPE_FLOAT_CAMERA9+ | 15 | Floating camera window.
**Model restriction**: This API can be used only in the stage model.
**Required permissions**: ohos.permission.SYSTEM_FLOAT_WINDOW| +| TYPE_FLOAT_CAMERA9+ | 15 | Floating camera window.
**Model restriction**: This API can be used only in the stage model.
**System API**: This is a system API.| | TYPE_DIALOG9+ | 16 | Modal window.
**Model restriction**: This API can be used only in the stage model.
**System API**: This is a system API.| | TYPE_SCREENSHOT9+ | 17 | Screenshot window.
**Model restriction**: This API can be used only in the stage model.
**System API**: This is a system API.| @@ -4671,6 +4671,100 @@ try { ``` +### setWaterMarkFlag10+ + +setWaterMarkFlag(enable: boolean): Promise<void> + +Adds or deletes the watermark flag for this window. This API uses a promise to return the result. + +**System API**: This is a system API. + +**System capability**: SystemCapability.WindowManager.WindowManager.Core + +**Parameters** + +| Name | Type | Mandatory | Description | +| ------ | ------- | --------- | ------------------------------------------------------------ | +| enable | boolean | Yes | Whether to add or delete the watermark flag to the window. The value **true** means to add the watermark flag and **false** means to delete the watermark flag. | + +**Return value** + +| Type | Description | +| ------------------- | ------------------------------ | +| Promise<void> | Promise that returns no value. | + +**Error codes** + +For details about the error codes, see [Window Error Codes](../errorcodes/errorcode-window.md). + +| ID | Error Message | +| ------- | --------------------------------------------- | +| 1300002 | This window state is abnormal. | +| 1300003 | This window manager service works abnormally. | +| 1300008 | The operation is on invalid display. | + +**Example** + +```js +try { + let enable = true; + let promise = windowClass.setWaterMarkFlag(enable); + promise.then(()=> { + console.info('Succeeded in setting water mark flag of window.'); + }).catch((err)=>{ + console.error('Failed to set water mark flag of window. Cause:' + JSON.stringify(err)); + }); +} catch (exception) { + console.error('Failed to set water mark flag of window. Cause: ' + JSON.stringify(exception)); +} + +``` + +### setWaterMarkFlag10+ + +setWaterMarkFlag(enable: boolean, callback: AsyncCallback<void>): void + +Adds or deletes the watermark flag for this window. This API uses an asynchronous callback to return the result. + +**System API**: This is a system API. + +**System capability**: SystemCapability.WindowManager.WindowManager.Core + +**Parameters** + +| Name | Type | Mandatory | Description | +| -------- | ------------------------- | --------- | ------------------------------------------------------------ | +| enable | boolean | Yes | Whether to add or delete the watermark flag to the window. The value **true** means to add the watermark flag and **false** means to delete the watermark flag. | +| callback | AsyncCallback<void> | Yes | Callback used to return the result. | + +**Error codes** + +For details about the error codes, see [Window Error Codes](../errorcodes/errorcode-window.md). + +| ID | Error Message | +| ------- | --------------------------------------------- | +| 1300002 | This window state is abnormal. | +| 1300003 | This window manager service works abnormally. | +| 1300008 | The operation is on invalid display. | + +**Example** + +```js +try { + let enable = true; + windowClass.setWaterMarkFlag(enable, (err) => { + if (err.code) { + console.error('Failed to set water mark flag of window. Cause:' + JSON.stringify(err)); + return; + } + console.info('Succeeded in setting water mark flag of window.'); + }); +} catch (exception) { + console.error('Failed to set water mark flag of window. Cause: ' + JSON.stringify(exception)); +} + +``` + ### show(deprecated) show(callback: AsyncCallback<void>): void @@ -7212,6 +7306,7 @@ controller.animationForShown = (context : window.TransitionContext) => { ); console.info('complete transition end'); }; + ``` ### animationForHidden9+ diff --git a/en/application-dev/windowmanager/window-overview.md b/en/application-dev/windowmanager/window-overview.md index 5a2e75770469377d96c58bf93650c7a47a171e3f..a585f4c7cbde39f74123cacb4d76c2a001290539 100644 --- a/en/application-dev/windowmanager/window-overview.md +++ b/en/application-dev/windowmanager/window-overview.md @@ -36,7 +36,9 @@ In OpenHarmony, the **Window** module provides system windows and application wi - A **system window** implements specific functionalities of the system, such as the volume bar, wallpaper, notification panel, status bar, and navigation bar. - An **application window** is related to the application display. Based on the displayed content, application windows are further classified into main windows and subwindows. - A main window shows the application UI and appears on the **Recent tasks** page. - - A subwindow shows auxiliary windows such as dialog boxes and floating windows of an application. It is not displayed on the **Task Management** page. + - A subwindow shows auxiliary windows such as dialog boxes and floating windows of an application. It is not displayed on the **Task Management** page. Its lifecycle follows that of the main window. + + ### Application Window Mode