未验证 提交 353e43d5 编写于 作者: O openharmony_ci 提交者: Gitee

!20915 翻译完成:19644+20292+20181 针对Issue的doc文档修改

Merge pull request !20915 from wusongqing/TR19644
......@@ -49,10 +49,10 @@ Describes a rectangle on the display.
| Name | Type| Readable| Writable| Description |
| ------ | -------- | ---- | ---- | ------------------ |
| left | number | Yes | Yes | Left boundary of the rectangle, in pixels.|
| top | number | Yes | Yes | Top boundary of the rectangle, in pixels.|
| width | number | Yes | Yes | Width of the rectangle, in pixels. |
| height | number | Yes | Yes | Height of the rectangle, in pixels. |
| left | number | Yes | Yes | Left boundary of the rectangle, in pixels. The value must be an integer.|
| top | number | Yes | Yes | Top boundary of the rectangle, in pixels. The value must be an integer.|
| width | number | Yes | Yes | Width of the rectangle, in pixels. The value must be an integer. |
| height | number | Yes | Yes | Height of the rectangle, in pixels. The value must be an integer. |
## WaterfallDisplayAreaRects<sup>9+</sup>
......@@ -196,7 +196,7 @@ Checks whether there is a visible privacy window on a display. The privacy windo
| Name| Type | Mandatory| Description |
| ------ | ------------------------- | ---- |----------|
| id | number | Yes | ID of the display.|
| id | number | Yes | ID of the display. The value must be an integer.|
**Return value**
......@@ -248,10 +248,10 @@ Subscribes to display changes.
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| Name| Type| Mandatory| Description |
| -------- | -------- | -------- |---------------------------------------------------------------------------------------------------------------------------------|
| type | string | Yes| Event type.<br>- **add**, indicating the display addition event. Example: event that a display is connected.<br>- **remove**, indicating the display removal event. Example: event that a display is disconnected.<br>- **change**, indicating the display change event. Example: event that the display orientation is changed.|
| callback | Callback&lt;number&gt; | Yes| Callback used to return the ID of the display.|
| callback | Callback&lt;number&gt; | Yes| Callback used to return the ID of the display, which is an integer. |
**Example**
......@@ -279,7 +279,7 @@ Unsubscribes from display changes.
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| type | string | Yes| Event type.<br>- **add**, indicating the display addition event. Example: event that a display is connected.<br>- **remove**, indicating the display removal event. Example: event that a display is disconnected.<br>- **change**, indicating the display change event. Example: event that the display orientation is changed.|
| callback | Callback&lt;number&gt; | No| Callback used to return the ID of the display.|
| callback | Callback&lt;number&gt; | No| Callback used to return the ID of the display, which is an integer.|
**Example**
......@@ -335,7 +335,7 @@ Unsubscribes from privacy mode changes of this display. When there is a privacy
| Name | Type | Mandatory| Description |
| -------- |------------------------------------------| ---- | ------------------------------------------------------- |
| type | string | Yes | Event type. The value is fixed at **'privateModeChange'**, indicating the event of display private mode changes.|
| type | string | Yes | Event type. The value is fixed at **'privateModeChange'**, indicating the event of display privacy mode changes.|
| callback | Callback&lt;boolean&gt; | No | Callback used to return whether the privacy mode of the display is changed. The value **true** means that the display changes to the privacy mode, and **false** means the opposite.|
**Example**
......@@ -479,22 +479,22 @@ Before calling any API in **Display**, you must use [getAllDisplays()](#displayg
**System capability**: SystemCapability.WindowManager.WindowManager.Core
| Name| Type| Readable| Writable| Description|
| -------- | -------- | -------- | -------- | -------- |
| id | number | Yes| No| ID of the display.|
| name | string | Yes| No| Name of the display.|
| alive | boolean | Yes| No| Whether the display is alive.|
| state | [DisplayState](#displaystate) | Yes| No| State of the display.|
| refreshRate | number | Yes| No| Refresh rate of the display.|
| Name| Type| Readable| Writable| Description |
| -------- | -------- | -------- | -------- |---------------------------------------------------------------------------------------------------------------|
| id | number | Yes| No| ID of the display. The value must be an integer. |
| name | string | Yes| No| Name of the display. |
| alive | boolean | Yes| No| Whether the display is alive. |
| state | [DisplayState](#displaystate) | Yes| No| State of the display. |
| refreshRate | number | Yes| No| Refresh rate of the display. The value must be an integer. |
| rotation | number | Yes| No| Screen rotation angle of the display.<br>The value **0** indicates that the screen of the display rotates by 0°.<br>The value **1** indicates that the screen of the display rotates by 90°.<br>The value **2** indicates that the screen of the display rotates by 180°.<br>The value **3** indicates that the screen of the display rotates by 270°.|
| width | number | Yes| No| Width of the display, in pixels.|
| height | number | Yes| No| Height of the display, in pixels.|
| densityDPI | number | Yes| No| Screen density of the display, that is, the number of dots per inch. Generally, the value is **160** or **480**.|
| orientation<sup>10+</sup> | [Orientation](#orientation10) | Yes| No| Orientation of the display.|
| densityPixels | number | Yes| No| Logical density of the display, which is a scaling coefficient independent of the pixel unit. Generally, the value is **1** or **3**.|
| scaledDensity | number | Yes| No| Scaling factor for fonts displayed on the display. Generally, the value is the same as that of **densityPixels**.|
| xDPI | number | Yes| No| Exact physical dots per inch of the screen in the horizontal direction.|
| yDPI | number | Yes| No| Exact physical dots per inch of the screen in the vertical direction.|
| width | number | Yes| No| Width of the display, in pixels. The value must be an integer. |
| height | number | Yes| No| Height of the display, in pixels. The value must be an integer. |
| densityDPI | number | Yes| No| Screen density of the display, that is, the number of dots per inch. The value must be a floating point number. Generally, the value is **160.0** or **480.0**. |
| orientation<sup>10+</sup> | [Orientation](#orientation10) | Yes| No| Orientation of the display. |
| densityPixels | number | Yes| No| Logical density of the display, which is a scaling coefficient independent of the pixel unit. The value must be a floating point number. Generally, the value is **1.0** or **3.0**. |
| scaledDensity | number | Yes| No| Scaling factor for fonts displayed on the display. The value must be a floating point number. Generally, the value is the same as that of **densityPixels**. |
| xDPI | number | Yes| No| Exact physical dots per inch of the screen in the horizontal direction. The value must be a floating point number. |
| yDPI | number | Yes| No| Exact physical dots per inch of the screen in the vertical direction. The value must be a floating point number. |
### getCutoutInfo<sup>9+</sup>
getCutoutInfo(callback: AsyncCallback&lt;CutoutInfo&gt;): void
......
......@@ -95,10 +95,10 @@ Subscribes to events related to the screen state.
**Parameters**
| Name | Type | Mandatory| Description |
| --------- | ---------------------- | ---- | ------------------------------------------------------------ |
| Name | Type | Mandatory| Description |
| --------- | ---------------------- | ---- | ----------------------------------------------------------- |
| eventType | string | Yes | Event type.<br>- **connect**: an event indicating that the screen is connected.<br>- **disconnect**: an event indicating that the screen is disconnected.<br>- **change**: an event indicating that the screen state changes.|
| callback | Callback&lt;number&gt; | Yes | Callback used to return the screen ID. |
| callback | Callback&lt;number&gt; | Yes | Callback used to return the screen ID, which is an integer. |
**Example**
......@@ -126,7 +126,7 @@ Unsubscribes from events related to the screen state.
| Name | Type | Mandatory| Description |
| --------- | ---------------------- | ---- | ------------------------------------------------------------ |
| eventType | string | Yes | Event type.<br>- **connect**: an event indicating that the screen is connected.<br>- **disconnect**: an event indicating that the screen is disconnected.<br>- **change**: an event indicating that the screen state changes.|
| callback | Callback&lt;number&gt; | No | Callback used to return the screen ID. |
| callback | Callback&lt;number&gt; | No | Callback used to return the screen ID, which is an integer. |
**Example**
......@@ -151,10 +151,10 @@ Sets the screen to the expanded mode. This API uses an asynchronous callback to
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ------------------------------------------ | ---- | -------------------------------- |
| options | Array&lt;[ExpandOption](#expandoption)&gt; | Yes | Parameters for expanding the screen. |
| callback | AsyncCallback&lt;number&gt; | Yes | Callback used to return the group ID of the expanded screens.|
| Name | Type | Mandatory| Description |
| -------- | ------------------------------------------ | ---- |----------------------------|
| options | Array&lt;[ExpandOption](#expandoption)&gt; | Yes | Parameters for expanding the screen. |
| callback | AsyncCallback&lt;number&gt; | Yes | Callback used to return the group ID of the expanded screens, which is an integer.|
**Error codes**
......@@ -198,9 +198,9 @@ Sets the screen to the expanded mode. This API uses a promise to return the resu
**Return value**
| Type | Description |
| --------------------- | ----------------------------------- |
| Promise&lt;number&gt; | Promise used to return the group ID of the expanded screens.|
| Type | Description |
| --------------------- |---------------------------------|
| Promise&lt;number&gt; | Promise used to return the group ID of the expanded screens, which is an integer.|
**Error codes**
......@@ -234,9 +234,9 @@ Stops the expanded mode. This API uses an asynchronous callback to return the re
**Parameters**
| Name| Type| Mandatory| Description|
| ------------ | --------------------------- | --- | -------------------------------------------------------------- |
| expandScreen | Array&lt;number&gt; | Yes | IDs of the expanded screens. |
| Name| Type| Mandatory| Description |
| ------------ | --------------------------- | --- |-----------------------------------------|
| expandScreen | Array&lt;number&gt; | Yes | IDs of the expanded screens. Each ID must be an integer. |
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result. If the expanded mode is stopped, **err** is **undefined**; otherwise, **err** is an error object.|
**Error codes**
......@@ -274,9 +274,9 @@ Stops the expanded mode. This API uses a promise to return the result.
**Parameters**
| Name| Type| Mandatory| Description|
| ------------ | ------------------- | --- | --------------- |
| expandScreen | Array&lt;number&gt; | Yes | IDs of the expanded screens.|
| Name| Type| Mandatory| Description |
| ------------ | ------------------- | --- |--------------------|
| expandScreen | Array&lt;number&gt; | Yes | IDs of the expanded screens. Each ID must be an integer.|
**Return value**
......@@ -317,11 +317,11 @@ Sets screen mirroring. This API uses an asynchronous callback to return the resu
**Parameters**
| Name | Type | Mandatory| Description |
| ------------ | --------------------------- | ---- |-----------------|
| mainScreen | number | Yes | ID of the primary screen. |
| mirrorScreen | Array&lt;number&gt; | Yes | IDs of secondary screens. |
| callback | AsyncCallback&lt;number&gt; | Yes | Callback used to return the group ID of the secondary screens.|
| Name | Type | Mandatory| Description |
| ------------ | --------------------------- | ---- |--------------------|
| mainScreen | number | Yes | ID of the primary screen. The value must be an integer. |
| mirrorScreen | Array&lt;number&gt; | Yes | IDs of secondary screens. Each ID must be an integer.|
| callback | AsyncCallback&lt;number&gt; | Yes | Callback used to return the group ID of the secondary screens, which is an integer. |
**Error codes**
......@@ -359,16 +359,16 @@ Sets screen mirroring. This API uses a promise to return the result.
**Parameters**
| Name | Type | Mandatory| Description |
| ------------ | ------------------- | ---- |-----------|
| mainScreen | number | Yes | ID of the primary screen. |
| mirrorScreen | Array&lt;number&gt; | Yes | IDs of secondary screens.|
| Name | Type | Mandatory| Description |
| ------------ | ------------------- | ---- |--------------------|
| mainScreen | number | Yes | ID of the primary screen. The value must be an integer. |
| mirrorScreen | Array&lt;number&gt; | Yes | IDs of secondary screens. Each ID must be an integer.|
**Return value**
| Type | Description |
| --------------------- | ----------------------------------- |
| Promise&lt;number&gt; | Promise used to return the group ID of the secondary screens.|
| Type | Description |
| --------------------- |---------------------------------|
| Promise&lt;number&gt; | Promise used to return the group ID of the secondary screens, which is an integer.|
**Error codes**
......@@ -404,10 +404,10 @@ Stops screen mirroring. This API uses an asynchronous callback to return the res
**Parameters**
| Name| Type| Mandatory| Description|
| ------------ | --------------------------- | --- | -------------------------------------------------------------- |
| mirrorScreen | Array&lt;number&gt; | Yes | IDs of secondary screens. |
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result. If screen mirroring is stopped, **err** is **undefined**; otherwise, **err** is an error object. |
| Name| Type| Mandatory| Description |
| ------------ | --------------------------- | --- |-----------------------------------------|
| mirrorScreen | Array&lt;number&gt; | Yes | IDs of secondary screens. Each ID must be an integer. |
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result. If screen mirroring is stopped, **err** is **undefined**; otherwise, **err** is an error object.|
**Error codes**
......@@ -444,9 +444,9 @@ Stops screen mirroring. This API uses a promise to return the result.
**Parameters**
| Name| Type| Mandatory| Description|
| ------------ | ------------------- | --- | --------------- |
| mirrorScreen | Array&lt;number&gt; | Yes | IDs of secondary screens.|
| Name| Type| Mandatory| Description |
| ------------ | ------------------- | --- |--------------------|
| mirrorScreen | Array&lt;number&gt; | Yes | IDs of secondary screens. Each ID must be an integer.|
**Return value**
......@@ -590,7 +590,7 @@ Destroys a virtual screen. This API uses an asynchronous callback to return the
| Name | Type | Mandatory| Description |
| -------- | ------------------------- | ---- | ------------------------------------------------------------ |
| screenId | number | Yes | Screen ID. |
| screenId | number | Yes | Screen ID. The value must be an integer. |
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result. If the virtual screen is destroyed, **err** is **undefined**; otherwise, **err** is an error object.|
**Error codes**
......@@ -630,7 +630,7 @@ Destroys a virtual screen. This API uses a promise to return the result.
| Name | Type | Mandatory| Description |
| -------- | ------ | ---- | ---------- |
| screenId | number | Yes | Screen ID.|
| screenId | number | Yes | Screen ID. The value must be an integer.|
**Return value**
......@@ -675,7 +675,7 @@ Sets the surface for a virtual screen. This API uses an asynchronous callback to
| Name | Type | Mandatory| Description |
| --------- | ------------------------- | ---- | ------------------------------------------------------------ |
| screenId | number | Yes | Screen ID. |
| screenId | number | Yes | Screen ID. The value must be an integer. |
| surfaceId | string | Yes | Surface ID. |
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result. If the virtual screen surface is successfully set, **err** is **undefined**; otherwise, **err** is an error object.|
......@@ -719,7 +719,7 @@ Sets the surface for a virtual screen. This API uses a promise to return the res
| Name | Type | Mandatory| Description |
| --------- | ------ | ---- | ------------- |
| screenId | number | Yes | Screen ID. |
| screenId | number | Yes | Screen ID. The value must be an integer. |
| surfaceId | string | Yes | Surface ID.|
**Return value**
......@@ -877,9 +877,9 @@ Defines the parameters for expanding a screen.
| Name | Type| Readable| Writable| Description |
| -------- | -------- | ---- | ---- | ------------------- |
| screenId | number | Yes | Yes | Screen ID. |
| startX | number | Yes | Yes | Start X coordinate of the screen.|
| startY | number | Yes | Yes | Start Y coordinate of the screen.|
| screenId | number | Yes | Yes | Screen ID. The value must be an integer. |
| startX | number | Yes | Yes | Start X coordinate of the screen. The value must be an integer.|
| startY | number | Yes | Yes | Start Y coordinate of the screen. The value must be an integer.|
## VirtualScreenOption
......@@ -887,13 +887,13 @@ Defines virtual screen parameters.
**System capability**: SystemCapability.WindowManager.WindowManager.Core
| Name | Type| Readable| Writable| Description |
| --------- | -------- | ---- | ---- | ------------------------- |
| name | string | Yes | Yes | Name of a virtual screen. |
| width | number | Yes | Yes | Width of the virtual screen, in pixels.|
| height | number | Yes | Yes | Height of the virtual screen, in pixels.|
| density | number | Yes | Yes | Density of the virtual screen. |
| surfaceId | string | Yes | Yes | Surface ID of the virtual screen.|
| Name | Type| Readable| Writable| Description |
| --------- | -------- | ---- | ---- |--------------------------|
| name | string | Yes | Yes | Name of a virtual screen. |
| width | number | Yes | Yes | Width of the virtual screen, in pixels. The value must be an integer.|
| height | number | Yes | Yes | Height of the virtual screen, in pixels. The value must be an integer.|
| density | number | Yes | Yes | Density of the virtual screen. The value must be a floating point number. |
| surfaceId | string | Yes | Yes | Surface ID of the virtual screen. |
## Screen
......@@ -905,14 +905,14 @@ Before calling any API in **Screen**, you must use **[getAllScreens()](#screenge
**System capability**: SystemCapability.WindowManager.WindowManager.Core
| Name | Type | Readable| Writable| Description |
| ----------------- | ---------------------------------------------- | ---- | ---- | ---------------------- |
| id | number | Yes | No | Screen ID. |
| parent | number | Yes | No | ID of the group to which a screen belongs. |
| supportedModeInfo | Array&lt;[ScreenModeInfo](#screenmodeinfo)&gt; | Yes | No | Mode set supported by the screen. |
| activeModeIndex | number | Yes | No | Index of the active screen mode. The current value and value range of this parameter vary according to the screen resolution, refresh rate, and device hardware.|
| orientation | [Orientation](#orientation) | Yes | No | Screen orientation. |
| sourceMode<sup>10+</sup> | [ScreenSourceMode](#screensourcemode10) | Yes | No | Source mode of the screen. |
| Name | Type | Readable| Writable| Description |
| ----------------- | ---------------------------------------------- | ---- | ---- |-------------------------------------------------------------|
| id | number | Yes | No | Screen ID. The value must be an integer. |
| parent | number | Yes | No | ID of the group to which a screen belongs. The value must be an integer. |
| supportedModeInfo | Array&lt;[ScreenModeInfo](#screenmodeinfo)&gt; | Yes | No | Mode set supported by the screen. |
| activeModeIndex | number | Yes | No | Index of the active screen mode. The current value and value range of this parameter vary according to the screen resolution, refresh rate, and device hardware. The value must be an integer.|
| orientation | [Orientation](#orientation) | Yes | No | Screen orientation. |
| sourceMode<sup>10+</sup> | [ScreenSourceMode](#screensourcemode10) | Yes | No | Source mode of the screen. |
### setOrientation
......@@ -1002,7 +1002,7 @@ Sets the active mode of the screen. This API uses an asynchronous callback to re
| Name | Type | Mandatory| Description |
| --------- | ------------------------- | ---- | ------------------------------------------------------------ |
| modeIndex | number | Yes | Index of the mode to set. The current value and value range of this parameter vary according to the screen resolution, refresh rate, and device hardware.|
| modeIndex | number | Yes | Index of the mode to set. The current value and value range of this parameter vary according to the screen resolution, refresh rate, and device hardware. The value must be an integer.|
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result. If the active mode is successfully set, **err** is **undefined**; otherwise, **err** is an error object.|
**Error codes**
......@@ -1040,7 +1040,7 @@ Sets the active mode of the screen. This API uses a promise to return the result
| Name | Type | Mandatory| Description |
| --------- | ------ | ---- | ---------- |
| modeIndex | number | Yes | Index of the mode to set. The current value and value range of this parameter vary according to the screen resolution, refresh rate, and device hardware.|
| modeIndex | number | Yes | Index of the mode to set. The current value and value range of this parameter vary according to the screen resolution, refresh rate, and device hardware. The value must be an integer.|
**Return value**
......@@ -1080,9 +1080,9 @@ Sets the pixel density of the screen. This API uses an asynchronous callback to
**System capability**: SystemCapability.WindowManager.WindowManager.Core
| Name | Type | Mandatory| Description |
| ---------- | ------------------------- | ---- | ------------------------------------------------------------ |
| densityDpi | number | Yes | Pixel density. The value ranges from 80 to 640. |
| Name | Type | Mandatory| Description |
| ---------- | ------------------------- | ---- |------------------------------------------|
| densityDpi | number | Yes | Pixel density. The value must be an integer in the range [80, 640]. |
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result. If the pixel density is successfully set, **err** is **undefined**; otherwise, **err** is an error object.|
**Error codes**
......@@ -1118,9 +1118,9 @@ Sets the pixel density of the screen. This API uses a promise to return the resu
**System capability**: SystemCapability.WindowManager.WindowManager.Core
| Name | Type | Mandatory| Description |
| ---------- | ------ | ---- | ---------------------------------- |
| densityDpi | number | Yes | Pixel density. The value ranges from 80 to 640.|
| Name | Type | Mandatory| Description |
| ---------- | ------ | ---- |------------------------------------|
| densityDpi | number | Yes | Pixel density. The value must be an integer in the range [80, 640].|
**Return value**
......@@ -1187,7 +1187,7 @@ Defines the screen mode information.
| Name | Type| Readable| Writable| Description |
| ----------- | -------- | ---- | ---- | -------------------------------------------------- |
| id | number | Yes | Yes | Mode ID. The supported mode is determined by the device resolution and refresh rate.|
| width | number | Yes | Yes | Width of the screen, in pixels. |
| height | number | Yes | Yes | Height of the screen, in pixels. |
| refreshRate | number | Yes | Yes | Screen refresh rate. |
| id | number | Yes | Yes | Mode ID. The supported mode is determined by the device resolution and refresh rate. The value must be an integer.|
| width | number | Yes | Yes | Width of the screen, in pixels. The value must be an integer. |
| height | number | Yes | Yes | Height of the screen, in pixels. The value must be an integer. |
| refreshRate | number | Yes | Yes | Refresh rate of the screen. The value must be an integer. |
......@@ -25,8 +25,8 @@ Describes screenshot options.
| ---------------------- | ------------- | ---- | ------------------------------------------------------------ |
| screenRect | [Rect](#rect) | No | Region of the screen to capture. If this parameter is null, the full screen will be captured. |
| imageSize | [Size](#size) | No | Size of the screen region to capture. If this parameter is null, the full screen will be captured. |
| rotation | number | No | Rotation angle of the screenshot. Currently, the value can be **0** only. The default value is **0**. |
| displayId<sup>8+</sup> | number | No | ID of the [display](js-apis-display.md#display) device on which the screen region is to be captured.|
| rotation | number | No | Rotation angle of the screenshot. Currently, the value can be **0** only. The default value is **0**. The value must be an integer. |
| displayId<sup>8+</sup> | number | No | ID of the [display](js-apis-display.md#display) device on which the screen region is to be captured. The value must be an integer.|
## Rect
......@@ -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, 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.|
| left | number | Yes | Left boundary of the screen region to capture, in pixels. The value must be an integer.|
| top | number | Yes | Top boundary of the screen region to capture, in pixels. The value must be an integer.|
| width | number | Yes | Width of the screen region to capture, in pixels. The value must be an integer.|
| height | number | Yes | Height of the screen region to capture, in pixels. The value must be an integer.|
## 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, in pixels.|
| height | number | Yes | Height of the screen region to capture, in pixels.|
| width | number | Yes | Width of the screen region to capture, in pixels. The value must be an integer.|
| height | number | Yes | Height of the screen region to capture, in pixels. The value must be an integer.|
## screenshot.save
......
......@@ -54,7 +54,7 @@ Defines the parameters for creating a subwindow or system window.
| ---------- | -------------------------- | -- |-----------------------------------------------------------------------------|
| name | string | Yes| Name of the window. |
| windowType | [WindowType](#windowtype7) | Yes| Type of the window. |
| ctx | [BaseContext](js-apis-inner-application-baseContext.md) | No| Current application context. If no value is passed, no context is used.<br>You do not need to set this parameter to create a subwindow in the FA model or a system window in the stage model. |
| ctx | [BaseContext](js-apis-inner-application-baseContext.md) | No| Current application context. If no value is passed, no context is used.<br>You do not need to set this parameter to create a subwindow in the FA model or a system window in the stage model.|
| displayId | number | No| ID of the current physical screen. If no value is passed, the default value **-1** is used. The value must be an integer. |
| parentId | number | No| ID of the parent window. If no value is passed, the default value **-1** is used. The value must be an integer. |
......@@ -228,7 +228,7 @@ Describes the window properties.
| ------------------------------------- | ------------------------- | ---- | ---- |--------------------------------------------------------------------------------------------------------|
| windowRect<sup>7+</sup> | [Rect](#rect7) | Yes | Yes | Window size. |
| type<sup>7+</sup> | [WindowType](#windowtype7) | Yes | Yes | Window type. |
| isFullScreen | boolean | Yes | Yes | Whether the window is displayed in full-screen mode. The default value is **false**. The value **true** means that the window is displayed in full-screen mode, and **false** means the opposite. |
| isFullScreen | boolean | Yes | Yes | Whether the window is displayed in full-screen mode. The default value is **false**. The value **true** means that the window is displayed in full-screen mode, and **false** means the opposite. |
| isLayoutFullScreen<sup>7+</sup> | boolean | Yes | Yes | Whether the window layout is in full-screen mode (whether the window is immersive). The default value is **false**. The value **true** means that the window is immersive, and **false** means the opposite. |
| focusable<sup>7+</sup> | boolean | Yes | No | Whether the window can gain focus. The default value is **true**. The value **true** means that the window can gain focus, and **false** means the opposite. |
| touchable<sup>7+</sup> | boolean | Yes | No | Whether the window is touchable. The default value is **true**. The value **true** means that the window is touchable, and **false** means the opposite. |
......@@ -261,7 +261,7 @@ Describes the scale parameters.
| Name | Type| Readable| Writable| Description |
| ------ | -------- | ---- | ---- |--------------------------------------------|
| x | number | No | Yes | Scale factor along the x-axis. The value is a floating point number, and the default value is **1.0**. |
| x | number | No | Yes | Scale factor along the x-axis. The value is a floating point number, and the default value is **1.0**. |
| y | number | No | Yes | Scale factor along the y-axis. The value is a floating point number, and the default value is **1.0**. |
| pivotX | number | No | Yes | X coordinate of the scale center. The value is a floating point number in the range [0.0, 1.0], and the default value is **0.5**.|
| pivotY | number | No | Yes | Y coordinate of the scale center. The value is a floating point number in the range [0.0, 1.0], and the default value is **0.5**.|
......@@ -276,7 +276,7 @@ Describes the rotation parameters.
| Name | Type| Readable| Writable| Description |
| ------ | -------- | ---- | ---- |---------------------------------------------|
| x | number | No | Yes | Rotation angle around the x-axis. The value is a floating point number, and the default value is **0.0**. |
| x | number | No | Yes | Rotation angle around the x-axis. The value is a floating point number, and the default value is **0.0**. |
| y | number | No | Yes | Rotation angle around the y-axis. The value is a floating point number, and the default value is **0.0**. |
| z | number | No | Yes | Rotation angle around the z-axis. The value is a floating point number, and the default value is **0.0**. |
| pivotX | number | No | Yes | X coordinate of the rotation center. The value is a floating point number in the range [0.0, 1.0], and the default value is **0.5**.|
......@@ -790,7 +790,7 @@ try {
on(type: 'systemBarTintChange', callback: Callback&lt;SystemBarTintState&gt;): void
Enables listening for properties changes of the status bar and navigation bar.
Subscribes to the property change event of the status bar and navigation bar.
**System API**: This is a system API.
......@@ -819,7 +819,7 @@ try {
off(type: 'systemBarTintChange', callback?: Callback&lt;SystemBarTintState &gt;): void
Disables listening for properties changes of the status bar and navigation bar.
Unsubscribes from the property change event of the status bar and navigation bar.
**System API**: This is a system API.
......@@ -830,7 +830,7 @@ Disables listening for properties changes of the status bar and navigation bar.
| Name | Type | Mandatory| Description |
| -------- | ---------------------------------------------------------- | ---- | ------------------------------------------------------------ |
| type | string | Yes | Event type. The value is fixed at **'systemBarTintChange'**, indicating the property change event of the status bar and navigation bar.|
| callback | Callback&lt;[SystemBarTintState](#systembartintstate8)&gt; | No | Callback used to return the properties of the status bar and navigation bar. |
| callback | Callback&lt;[SystemBarTintState](#systembartintstate8)&gt; | No | Callback used to return the properties of the status bar and navigation bar. If a value is passed in, the corresponding subscription is canceled. If no value is passed in, all subscriptions to the specified event are canceled. |
**Example**
......@@ -846,7 +846,7 @@ try {
on(type: 'gestureNavigationEnabledChange', callback: Callback&lt;boolean&gt;): void
Enables listening for gesture navigation status changes.
Subscribes to the gesture navigation status change event.
**System API**: This is a system API.
......@@ -875,7 +875,7 @@ try {
off(type: 'gestureNavigationEnabledChange', callback?: Callback&lt;boolean&gt;): void
Disables the listening for gesture navigation status changes.
Unsubscribes from the gesture navigation status change event.
**System API**: This is a system API.
......@@ -886,7 +886,7 @@ Disables the listening for gesture navigation status changes.
| Name | Type | Mandatory| Description |
| -------- | ----------------------- | -- | ------------------------------------------------------------ |
| type | string | Yes| Event type. The value is fixed at **'gestureNavigationEnabledChange'**, indicating the gesture navigation status change event.|
| callback | Callback&lt;boolean&gt; | No| Callback function that has been used for registering the listener. If this parameter is passed in, only the listener registered using this callback function is removed; otherwise, all gesture navigation status change listeners are removed.|
| callback | Callback&lt;boolean&gt; | No| Callback function that has been used for registering the listener. If a value is passed in, the corresponding subscription is canceled. If no value is passed in, all subscriptions to the specified event are canceled.|
**Example**
......@@ -2694,7 +2694,7 @@ try {
on(type: 'windowSizeChange', callback: Callback&lt;Size&gt;): void
Enables listening for window size changes.
Subscribes to the window size change event.
**System capability**: SystemCapability.WindowManager.WindowManager.Core
......@@ -2721,7 +2721,7 @@ try {
off(type: 'windowSizeChange', callback?: Callback&lt;Size&gt;): void
Disables listening for window size changes.
Unsubscribes from the window size change event.
**System capability**: SystemCapability.WindowManager.WindowManager.Core
......@@ -2730,7 +2730,7 @@ Disables listening for window size changes.
| Name | Type | Mandatory| Description |
| -------- | ----------------------------- | ---- | -------------------------------------------------------- |
| type | string | Yes | Event type. The value is fixed at **'windowSizeChange'**, indicating the window size change event.|
| callback | Callback&lt;[Size](#size7)&gt; | No | Callback used to return the window size. |
| callback | Callback&lt;[Size](#size7)&gt; | No | Callback used to return the window size. If a value is passed in, the corresponding subscription is canceled. If no value is passed in, all subscriptions to the specified event are canceled. |
**Example**
......@@ -2746,7 +2746,7 @@ try {
on(type: 'avoidAreaChange', callback: Callback&lt;{AvoidAreaType, AvoidArea}&gt;): void
Enables listening for changes to the area where the window cannot be displayed.
Subscribes to the event indicating changes to the area where the window cannot be displayed.
**System capability**: SystemCapability.WindowManager.WindowManager.Core
......@@ -2774,7 +2774,7 @@ try {
off(type: 'avoidAreaChange', callback?: Callback&lt;{AvoidAreaType, AvoidArea}&gt;): void
Disables listening for changes to the area where the window cannot be displayed.
Unsubscribes from the event indicating changes to the area where the window cannot be displayed.
**System capability**: SystemCapability.WindowManager.WindowManager.Core
......@@ -2783,7 +2783,7 @@ Disables listening for changes to the area where the window cannot be displayed.
| Name | Type | Mandatory | Description |
| -------- |-----------------------------------------------------------------------------|-----|------------------------------------|
| type | string | Yes | Event type. The value is fixed at **'avoidAreaChange'**, indicating the event of changes to the area where the window cannot be displayed.|
| callback | Callback&lt;{[AvoidAreaType](#avoidareatype7), [AvoidArea](#avoidarea7)}&gt; | No | Callback used to return the area and area type.|
| callback | Callback&lt;{[AvoidAreaType](#avoidareatype7), [AvoidArea](#avoidarea7)}&gt; | No | Callback used to return the area and area type. If a value is passed in, the corresponding subscription is canceled. If no value is passed in, all subscriptions to the specified event are canceled.|
**Example**
......@@ -2799,7 +2799,7 @@ try {
on(type: 'keyboardHeightChange', callback: Callback&lt;number&gt;): void
Enables listening for soft keyboard height changes in the input method panel in fixed state. Since API version 10, the input method panel can be set to the fixed or floating state. For details, see [Input Method Service](js-apis-inputmethodengine.md#changeflag10).
Subscribes to the event indicating soft keyboard height changes in the input method panel in fixed state. Since API version 10, the input method panel can be set to the fixed or floating state. For details, see [Input Method Service](js-apis-inputmethodengine.md#changeflag10).
**System capability**: SystemCapability.WindowManager.WindowManager.Core
......@@ -2826,7 +2826,7 @@ try {
off(type: 'keyboardHeightChange', callback?: Callback&lt;number&gt;): void
Disables listening for soft keyboard height changes in the input method panel in fixed state. Since API version 10, the input method panel can be set to the fixed or floating state. For details, see [Input Method Service](js-apis-inputmethodengine.md#changeflag10).
Unsubscribes from the event indicating soft keyboard height changes in the input method panel in fixed state. Since API version 10, the input method panel can be set to the fixed or floating state. For details, see [Input Method Service](js-apis-inputmethodengine.md#changeflag10).
**System capability**: SystemCapability.WindowManager.WindowManager.Core
......@@ -2835,7 +2835,7 @@ Disables listening for soft keyboard height changes in the input method panel in
| Name | Type | Mandatory| Description |
| -------- | ---------------------- | ---- | ------------------------------------------------------------ |
| type | string | Yes | Event type. The value is fixed at **'keyboardHeightChange'**, indicating the keyboard height change event.|
| callback | Callback&lt;number&gt; | No | Callback used to return the current keyboard height, which is an integer. |
| callback | Callback&lt;number&gt; | No | Callback used to return the current keyboard height, which is an integer. If a value is passed in, the corresponding subscription is canceled. If no value is passed in, all subscriptions to the specified event are canceled. |
**Example**
......@@ -2851,7 +2851,7 @@ try {
on(type: 'touchOutside', callback: Callback&lt;void&gt;): void
Enables listening for click events outside this window.
Subscribes to the click event outside this window.
**System API**: This is a system API.
......@@ -2880,7 +2880,7 @@ try {
off(type: 'touchOutside', callback?: Callback&lt;void&gt;): void
Disables listening for click events outside this window.
Unsubscribes from the click event outside this window.
**System API**: This is a system API.
......@@ -2891,7 +2891,7 @@ Disables listening for click events outside this window.
| Name | Type | Mandatory| Description |
| -------- |----------------------| ---- |--------------------------------------|
| type | string | Yes | Event type. The value is fixed at **'touchOutside'**, indicating the click event outside this window.|
| callback | Callback&lt;void&gt; | No | Callback used to return the click event outside this window. |
| callback | Callback&lt;void&gt; | No | Callback used to return the click event outside this window. If a value is passed in, the corresponding subscription is canceled. If no value is passed in, all subscriptions to the specified event are canceled. |
**Example**
......@@ -2907,7 +2907,7 @@ try {
on(type: 'screenshot', callback: Callback&lt;void&gt;): void
Subscribes to screenshot events.
Subscribes to the screenshot event.
**System capability**: SystemCapability.WindowManager.WindowManager.Core
......@@ -2934,7 +2934,7 @@ try {
off(type: 'screenshot', callback?: Callback&lt;void&gt;): void
Unsubscribes from screenshot events.
Unsubscribes from the screenshot event.
**System capability**: SystemCapability.WindowManager.WindowManager.Core
......@@ -2943,7 +2943,7 @@ Unsubscribes from screenshot events.
| Name | Type | Mandatory| Description |
| -------- | ---------------------- | ---- | ------------------------------------------------------------ |
| type | string | Yes | Event type. The value is fixed at **'screenshot'**, indicating the screenshot event.|
| callback | Callback&lt;void&gt; | No | Callback invoked when a screenshot event occurs.|
| callback | Callback&lt;void&gt; | No | Callback invoked when a screenshot event occurs. If a value is passed in, the corresponding subscription is canceled. If no value is passed in, all subscriptions to the specified event are canceled.|
**Example**
......@@ -2969,7 +2969,7 @@ try {
on(type: 'dialogTargetTouch', callback: Callback&lt;void&gt;): void
Subscribes to click events of the target window in the modal window mode.
Subscribes to the click event of the target window in the modal window mode.
**System capability**: SystemCapability.WindowManager.WindowManager.Core
......@@ -2996,7 +2996,7 @@ try {
off(type: 'dialogTargetTouch', callback?: Callback&lt;void&gt;): void
Unsubscribes from click events of the target window in the modal window mode.
Unsubscribes from the click event of the target window in the modal window mode.
**System capability**: SystemCapability.WindowManager.WindowManager.Core
......@@ -3005,7 +3005,7 @@ Unsubscribes from click events of the target window in the modal window mode.
| Name | Type | Mandatory| Description |
| -------- | ---------------------- | ---- | ------------------------------------------------------------ |
| type | string | Yes | Event type. The value is fixed at **'dialogTargetTouch'**, indicating the click event of the target window in the modal window mode.|
| callback | Callback&lt;void&gt; | No | Callback invoked when the click event occurs in the target window of the modal window mode.|
| callback | Callback&lt;void&gt; | No | Callback invoked when the click event occurs in the target window of the modal window mode. If a value is passed in, the corresponding subscription is canceled. If no value is passed in, all subscriptions to the specified event are canceled.|
**Example**
......@@ -3021,7 +3021,7 @@ try {
on(type: 'windowEvent', callback: Callback&lt;WindowEventType&gt;): void
Enables listening for window lifecycle changes.
Subscribes to the window lifecycle change event.
**System capability**: SystemCapability.WindowManager.WindowManager.Core
......@@ -3048,7 +3048,7 @@ try {
off(type: 'windowEvent', callback?: Callback&lt;WindowEventType &gt;): void
Disables listening for window lifecycle changes.
Unsubscribes from the window lifecycle change event.
**System capability**: SystemCapability.WindowManager.WindowManager.Core
......@@ -3057,7 +3057,7 @@ Disables listening for window lifecycle changes.
| Name | Type | Mandatory| Description |
| -------- | ---------------------------------------------------------- | ---- | ------------------------------------------------------------ |
| type | string | Yes | Event type. The value is fixed at **'windowEvent'**, indicating the window lifecycle change event.|
| callback | Callback&lt;[WindowEventType](#windoweventtype10)&gt; | No | Callback used to return the window lifecycle state. |
| callback | Callback&lt;[WindowEventType](#windoweventtype10)&gt; | No | Callback used to return the window lifecycle state. If a value is passed in, the corresponding subscription is canceled. If no value is passed in, all subscriptions to the specified event are canceled. |
**Example**
......@@ -4430,7 +4430,7 @@ Blurs this window.
| Name| Type | Mandatory| Description |
| ------ | ------ | ---- |--------------------------------------------------|
| radius | number | Yes | Radius of the blur. The value is a floating point number greater than or equal to 0.0, and the value **0.0** means that the blur is disabled for the window. |
| radius | number | Yes | Radius of the blur. The value is a floating point number greater than or equal to 0.0, and the value **0.0** means that the blur is disabled for the window.|
**Error codes**
......@@ -4465,7 +4465,7 @@ Blurs the background of this window.
| Name| Type | Mandatory| Description |
| ------ | ------ | ---- |-------------------------------------------------------|
| radius | number | Yes | Radius of the blur. The value is a floating point number greater than or equal to 0.0, and the value **0.0** means that the blur is disabled for the background of the window. |
| radius | number | Yes | Radius of the blur. The value is a floating point number greater than or equal to 0.0, and the value **0.0** means that the blur is disabled for the background of the window.|
**Error codes**
......@@ -4535,7 +4535,7 @@ Sets the shadow for the window borders.
| Name | Type | Mandatory| Description |
| ------- | ------ | ---- |-------------------------------------------------------------|
| radius | number | Yes | Radius of the shadow. The value is a floating point number greater than or equal to 0.0, and the value **0.0** means that the shadow is disabled for the window borders. |
| radius | number | Yes | Radius of the shadow. The value is a floating point number greater than or equal to 0.0, and the value **0.0** means that the shadow is disabled for the window borders. |
| color | string | No | Color of the shadow. The value is a hexadecimal RGB or ARGB color code and is case insensitive, for example, **#00FF00** or **#FF00FF00**.|
| offsetX | number | No | Offset of the shadow along the x-axis, in pixels. The value is a floating point number. |
| offsetY | number | No | Offset of the shadow along the y-axis, in pixels. The value is a floating point number. |
......@@ -4573,7 +4573,7 @@ Sets the radius of the rounded corners for this window.
| Name | Type | Mandatory| Description |
| ----------- | ------- | ---- |----------------------------------------------------|
| radius | number | Yes | Radius of the rounded corners. The value is a floating point number greater than or equal to 0.0. The value **0.0** means that the window does not use rounded corners. |
| radius | number | Yes | Radius of the rounded corners. The value is a floating point number greater than or equal to 0.0. The value **0.0** means that the window does not use rounded corners.|
**Error codes**
......@@ -4684,7 +4684,7 @@ This API is available only for the main window of the application. The aspect ra
| Name | Type | Mandatory| Description |
| ------------------ | ------- | ---- |-------------------------------------------|
| ratio | number | Yes | Aspect ratio of the window content layout except border decoration. The value is a floating point number greater than or equal to 0.0. |
| ratio | number | Yes | Aspect ratio of the window content layout except border decoration. The value is a floating point number greater than or equal to 0.0.|
**Return value**
......@@ -4731,7 +4731,7 @@ This API is available only for the main window of the application. The aspect ra
| Name | Type | Mandatory| Description |
| ------------------ | ------- | ---- |--------------------------------------------|
| ratio | number | Yes | Aspect ratio of the window content layout except border decoration. The value is a floating point number greater than or equal to 0.0. |
| ratio | number | Yes | Aspect ratio of the window content layout except border decoration. The value is a floating point number greater than or equal to 0.0.|
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result. |
**Error codes**
......@@ -5426,7 +5426,7 @@ In non-full-screen mode, the status bar and navigation bar are displayed, and th
| Name | Type | Mandatory| Description |
| ------------ | ------------------------- | ---- | ---------------------------------------------- |
| isFullScreen | boolean | Yes | Whether to set full-screen mode. This setting affects the display of the status bar and navigation bar. The value **true** means to set full-screen mode, and **false** means the opposite. |
| isFullScreen | boolean | Yes | Whether to set full-screen mode. This setting affects the display of the status bar and navigation bar. The value **true** means to set full-screen mode, and **false** means the opposite.|
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result. |
**Example**
......@@ -5449,7 +5449,6 @@ setFullScreen(isFullScreen: boolean): Promise&lt;void&gt;
Sets whether the window is in full-screen mode. This API uses a promise to return the result.
In full-screen mode, the window is displayed in full screen, and the status bar and navigation bar are not displayed.
In non-full-screen mode, the status bar and navigation bar are displayed, and the window size does not overlap the positions of the status bar and navigation bar.
> **NOTE**
......@@ -5462,7 +5461,7 @@ In non-full-screen mode, the status bar and navigation bar are displayed, and th
| Name | Type | Mandatory| Description |
| ------------ | ------- | ---- | ---------------------------------------------- |
| isFullScreen | boolean | Yes | Whether to set full-screen mode. This setting affects the display of the status bar and navigation bar. The value **true** means to set full-screen mode, and **false** means the opposite. |
| isFullScreen | boolean | Yes | Whether to set full-screen mode. This setting affects the display of the status bar and navigation bar. The value **true** means to set full-screen mode, and **false** means the opposite.|
**Return value**
......@@ -5837,7 +5836,7 @@ promise.then((data)=> {
on(type: 'systemAvoidAreaChange', callback: Callback&lt;AvoidArea&gt;): void
Enables listening for changes to the area where the window cannot be displayed.
Subscribes to the event indicating changes to the area where the window cannot be displayed.
> **NOTE**
>
......@@ -5864,7 +5863,7 @@ windowClass.on('systemAvoidAreaChange', (data) => {
off(type: 'systemAvoidAreaChange', callback?: Callback&lt;AvoidArea&gt;): void
Disables listening for changes to the area where the window cannot be displayed.
Unsubscribes from the event indicating changes to the area where the window cannot be displayed.
> **NOTE**
>
......@@ -5877,7 +5876,7 @@ Disables listening for changes to the area where the window cannot be displayed.
| Name | Type | Mandatory| Description |
| -------- |------------------------------------------| ---- | ------------------------------------------------------- |
| type | string | Yes | Event type. The value is fixed at **'systemAvoidAreaChange'**, indicating the event of changes to the area where the window cannot be displayed.|
| callback | Callback&lt;[AvoidArea](#avoidarea7)&gt; | No | Callback used to return the area. |
| callback | Callback&lt;[AvoidArea](#avoidarea7)&gt; | No | Callback used to return the area. If a value is passed in, the corresponding subscription is canceled. If no value is passed in, all subscriptions to the specified event are canceled. |
**Example**
......@@ -7143,7 +7142,7 @@ export default class EntryAbility extends UIAbility {
on(eventType: 'windowStageEvent', callback: Callback&lt;WindowStageEventType&gt;): void
Enables listening for window stage lifecycle changes.
Subscribes to the window stage lifecycle change event.
**Model restriction**: This API can be used only in the stage model.
......@@ -7192,7 +7191,7 @@ export default class EntryAbility extends UIAbility {
off(eventType: 'windowStageEvent', callback?: Callback&lt;WindowStageEventType&gt;): void
Disables listening for window stage lifecycle changes.
Unsubscribes from the window stage lifecycle change event.
**Model restriction**: This API can be used only in the stage model.
......@@ -7203,7 +7202,7 @@ Disables listening for window stage lifecycle changes.
| Name | Type | Mandatory| Description |
| -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| type | string | Yes | Event type. The value is fixed at **'windowStageEvent'**, indicating the window stage lifecycle change event.|
| callback | Callback&lt;[WindowStageEventType](#windowstageeventtype9)&gt; | No | Callback used to return the window stage lifecycle state. |
| callback | Callback&lt;[WindowStageEventType](#windowstageeventtype9)&gt; | No | Callback used to return the window stage lifecycle state. If a value is passed in, the corresponding subscription is canceled. If no value is passed in, all subscriptions to the specified event are canceled. |
**Error codes**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册