提交 790e7881 编写于 作者: W wusongqing

updated docs

Signed-off-by: Nwusongqing <wusongqing@huawei.com>
上级 98b36aa2
# Window # Window
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE** > ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**<br/>
> The initial APIs of this module are supported since API version 6. Newly added APIs will be marked with a superscript to indicate their earliest API version. > The initial APIs of this module are supported since API version 6. Newly added APIs will be marked with a superscript to indicate their earliest API version.
>
## Modules to Import ## Modules to Import
...@@ -15,10 +16,10 @@ Enumerates the window types. ...@@ -15,10 +16,10 @@ Enumerates the window types.
**System capability**: SystemCapability.WindowManager.WindowManager.Core **System capability**: SystemCapability.WindowManager.WindowManager.Core
| Name | Default Value | Description | | Name | Default Value| Description |
| ----------------- | ------------- | ---------------------- | | ----------------- | ------ | ------------------ |
| TYPE_APP | 0 | Application subwindow. | | TYPE_APP | 0 | Application subwindow. |
| TYPE_SYSTEM_ALERT | 1 | System alert window. | | TYPE_SYSTEM_ALERT | 1 | System alert window.|
## AvoidAreaType<sup>7+</sup><a name="avoidareatype"></a> ## AvoidAreaType<sup>7+</sup><a name="avoidareatype"></a>
...@@ -26,10 +27,10 @@ Enumerates the types of the area where the window cannot be displayed. ...@@ -26,10 +27,10 @@ Enumerates the types of the area where the window cannot be displayed.
**System capability**: SystemCapability.WindowManager.WindowManager.Core **System capability**: SystemCapability.WindowManager.WindowManager.Core
| Name | Default Value | Description | | Name | Default Value| Description |
| ----------- | ------------- | --------------------------- | | ----------- | ------ | ------------------ |
| TYPE_SYSTEM | 0 | Default area of the system. | | TYPE_SYSTEM | 0 | Default area of the system.|
| TYPE_CUTOUT | 1 | Notch. | | TYPE_CUTOUT | 1 | Notch. |
## WindowMode<sup>7+</sup><a name="windowmode"></a> ## WindowMode<sup>7+</sup><a name="windowmode"></a>
...@@ -39,13 +40,13 @@ This is a system API and cannot be called by third-party applications. ...@@ -39,13 +40,13 @@ This is a system API and cannot be called by third-party applications.
**System capability**: SystemCapability.WindowManager.WindowManager.Core **System capability**: SystemCapability.WindowManager.WindowManager.Core
| Name | Default Value | Description | | Name | Default Value| Description |
| ---------- | ------------- | ------------------------------------------------------------ | | ---------- | ------ | ----------------------------- |
| UNDEFINED | 1 | The window mode is not defined by the application. | | UNDEFINED | 1 | The window mode is not defined by the application. |
| FULLSCREEN | 2 | The application is displayed in full screen. | | FULLSCREEN | 2 | The application is displayed in full screen. |
| PRIMARY | 3 | The application is displayed in the primary window in split-screen mode. | | PRIMARY | 3 | The application is displayed in the primary window in split-screen mode. |
| SECONDARY | 4 | The application is displayed in the secondary window in split-screen mode. | | SECONDARY | 4 | The application is displayed in the secondary window in split-screen mode. |
| FLOATING | 5 | The application is displayed in a floating window. | | FLOATING | 5 | The application is displayed in a floating window.|
## SystemBarProperties<a name="systembarproperties"></a> ## SystemBarProperties<a name="systembarproperties"></a>
...@@ -53,14 +54,14 @@ Describes the properties of the status bar and navigation bar. ...@@ -53,14 +54,14 @@ Describes the properties of the status bar and navigation bar.
**System capability**: SystemCapability.WindowManager.WindowManager.Core **System capability**: SystemCapability.WindowManager.WindowManager.Core
| Name | Type | Readable | Writable | Description | | Name | Type| Readable| Writable| Description |
| -------------------------------------- | ------- | -------- | -------- | ------------------------------------------------------------ | | -------------------------------------- | -------- | ---- | ---- | ------------------------------------------------------------ |
| statusBarColor | string | Yes | Yes | Background color of the status bar. The value is a hexadecimal RGB or aRGB color value, for example, **\#00FF00** or **\#FF00FF00**. | | statusBarColor | string | Yes | Yes | Background color of the status bar. The value is a hexadecimal RGB or aRGB color value, for example, **\#00FF00** or **\#FF00FF00**.|
| isStatusBarLightIcon<sup>7+</sup> | boolean | No | Yes | Whether any icon on the status bar is highlighted. | | isStatusBarLightIcon<sup>7+</sup> | boolean | No | Yes | Whether any icon on the status bar is highlighted. |
| statusBarContentColor<sup>8+</sup> | string | No | Yes | Color of the text on the status bar. | | statusBarContentColor<sup>8+</sup> | string | No | Yes | Color of the text on the status bar. |
| navigationBarColor | string | Yes | Yes | Background color of the navigation bar. The value is a hexadecimal RGB or aRGB color value, for example, **\#00FF00** or **\#FF00FF00**. | | navigationBarColor | string | Yes | Yes | Background color of the navigation bar. The value is a hexadecimal RGB or aRGB color value, for example, **\#00FF00** or **\#FF00FF00**.|
| isNavigationBarLightIcon<sup>7+</sup> | boolean | No | No | Whether any icon on the navigation bar is highlighted. | | isNavigationBarLightIcon<sup>7+</sup> | boolean | No | No | Whether any icon on the navigation bar is highlighted. |
| navigationBarContentColor<sup>8+</sup> | string | No | Yes | Color of the text on the navigation bar. | | navigationBarContentColor<sup>8+</sup> | string | No | Yes | Color of the text on the navigation bar. |
## SystemBarRegionTint<sup>8+</sup><a name="systembartegiontint"></a> ## SystemBarRegionTint<sup>8+</sup><a name="systembartegiontint"></a>
...@@ -70,13 +71,13 @@ This is a system API and cannot be called by third-party applications. ...@@ -70,13 +71,13 @@ This is a system API and cannot be called by third-party applications.
**System capability**: SystemCapability.WindowManager.WindowManager.Core **System capability**: SystemCapability.WindowManager.WindowManager.Core
| Name | Type | Readable | Writable | Description | | Name | Type | Readable| Writable| Description |
| --------------- | ------------------------- | -------- | -------- | ------------------------------------------------------------ | | --------------- | ------------------------- | ---- | ---- | ------------------------------------------------------------ |
| type | [WindowType](#windowtype) | Yes | Yes | Type of the system bar whose properties are changed. Only the navigation bar and status bar are supported. | | type | [WindowType](#windowtype) | Yes | Yes | Type of the system bar whose properties are changed. Only the navigation bar and status bar are supported.|
| isEnable | boolean | Yes | Yes | Whether the system bar is displayed. | | isEnable | boolean | Yes | Yes | Whether the system bar is displayed. |
| region | [Rect](#rect) | Yes | Yes | Current position and size of the system bar. | | region | [Rect](#rect) | Yes | Yes | Current position and size of the system bar. |
| backgroundColor | string | Yes | Yes | Background color of the system bar. The value is a hexadecimal RGB or aRGB color value, for example, **\#00FF00** or **\#FF00FF00**. | | backgroundColor | string | Yes | Yes | Background color of the system bar. The value is a hexadecimal RGB or aRGB color value, for example, **\#00FF00** or **\#FF00FF00**.|
| contentColor | string | Yes | Yes | Color of the text on the system bar. | | contentColor | string | Yes | Yes | Color of the text on the system bar. |
## SystemBarTintState<sup>8+</sup><a name="systembartintstate"></a> ## SystemBarTintState<sup>8+</sup><a name="systembartintstate"></a>
...@@ -86,10 +87,10 @@ This is a system API and cannot be called by third-party applications. ...@@ -86,10 +87,10 @@ This is a system API and cannot be called by third-party applications.
**System capability**: SystemCapability.WindowManager.WindowManager.Core **System capability**: SystemCapability.WindowManager.WindowManager.Core
| Name | Type | Readable | Writable | Description | | Name | Type | Readable| Writable| Description |
| ---------- | -------------------------------------------------- | -------- | -------- | ----------------------------------- | | ---------- | -------------------------------------------------- | ---- | ---- | -------------------------- |
| displayId | number | Yes | No | ID of the current physical screen. | | displayId | number | Yes | No | ID of the current physical screen. |
| regionTint | Array<[SystemBarRegionTint](#systembartegiontint)> | Yes | Yes | All system bar information changed. | | regionTint | Array<[SystemBarRegionTint](#systembartegiontint)> | Yes | Yes | All system bar information changed.|
## Rect<sup>7+</sup><a name="rect"></a> ## Rect<sup>7+</sup><a name="rect"></a>
...@@ -97,12 +98,12 @@ Describes a rectangle. ...@@ -97,12 +98,12 @@ Describes a rectangle.
**System capability**: SystemCapability.WindowManager.WindowManager.Core **System capability**: SystemCapability.WindowManager.WindowManager.Core
| Name | Type | Readable | Writable | Description | | Name | Type| Readable| Writable| Description |
| ------ | ------ | -------- | -------- | ------------------------------- | | ------ | -------- | ---- | ---- | ------------------ |
| left | number | Yes | Yes | Left boundary of the rectangle. | | left | number | Yes | Yes | Left boundary of the rectangle.|
| top | number | Yes | Yes | Top boundary of the rectangle. | | top | number | Yes | Yes | Top boundary of the rectangle.|
| width | number | Yes | Yes | Width of the rectangle. | | width | number | Yes | Yes | Width of the rectangle. |
| height | number | Yes | Yes | Height of the rectangle. | | height | number | Yes | Yes | Height of the rectangle. |
## AvoidArea<sup>7+</sup><a name="avoidarea"></a> ## AvoidArea<sup>7+</sup><a name="avoidarea"></a>
...@@ -110,12 +111,12 @@ Describes the area where the window cannot be displayed. ...@@ -110,12 +111,12 @@ Describes the area where the window cannot be displayed.
**System capability**: SystemCapability.WindowManager.WindowManager.Core **System capability**: SystemCapability.WindowManager.WindowManager.Core
| Name | Type | Readable | Writable | Description | | Name | Type | Readable| Writable| Description |
| ---------- | ------------- | -------- | -------- | -------------------------------------- | | ---------- | ------------- | ---- | ---- | ------------------ |
| leftRect | [Rect](#rect) | Yes | Yes | Rectangle on the left of the screen. | | leftRect | [Rect](#rect) | Yes | Yes | Rectangle on the left of the screen.|
| topRect | [Rect](#rect) | Yes | Yes | Rectangle at the top of the screen. | | topRect | [Rect](#rect) | Yes | Yes | Rectangle at the top of the screen.|
| rightRect | [Rect](#rect) | Yes | Yes | Rectangle on the right of the screen. | | rightRect | [Rect](#rect) | Yes | Yes | Rectangle on the right of the screen.|
| bottomRect | [Rect](#rect) | Yes | Yes | Rectangle at the bottom of the screen. | | bottomRect | [Rect](#rect) | Yes | Yes | Rectangle at the bottom of the screen.|
## Size<sup>7+</sup><a name="size"></a> ## Size<sup>7+</sup><a name="size"></a>
...@@ -123,10 +124,10 @@ Describes the window size. ...@@ -123,10 +124,10 @@ Describes the window size.
**System capability**: SystemCapability.WindowManager.WindowManager.Core **System capability**: SystemCapability.WindowManager.WindowManager.Core
| Name | Type | Readable | Writable | Description | | Name | Type| Readable| Writable| Description |
| ------ | ------ | -------- | -------- | -------------- | | ------ | -------- | ---- | ---- | ---------- |
| width | number | Yes | Yes | Window width. | | width | number | Yes | Yes | Window width.|
| height | number | Yes | Yes | Window height. | | height | number | Yes | Yes | Window height.|
## WindowProperties<a name="windowproperties"></a> ## WindowProperties<a name="windowproperties"></a>
...@@ -134,20 +135,20 @@ Describes the window properties. ...@@ -134,20 +135,20 @@ Describes the window properties.
**System capability**: SystemCapability.WindowManager.WindowManager.Core **System capability**: SystemCapability.WindowManager.WindowManager.Core
| Name | Type | Readable | Writable | Description | | Name | Type | Readable| Writable| Description |
| ------------------------------- | ------------------------- | -------- | -------- | ------------------------------------------------------------ | | ------------------------------- | ------------------------- | ---- | ---- | ------------------------------------------------------------ |
| windowRect<sup>7+</sup> | [Rect](#rect) | Yes | Yes | Window size. | | windowRect<sup>7+</sup> | [Rect](#rect) | Yes | Yes | Window size. |
| type<sup>7+</sup> | [WindowType](#windowtype) | Yes | Yes | Window type. | | type<sup>7+</sup> | [WindowType](#windowtype) | Yes | Yes | Window type. |
| isFullScreen | boolean | Yes | Yes | Whether the window is displayed in full screen mode. The default value is **false**. | | isFullScreen | boolean | Yes | Yes | Whether the window is displayed in full screen mode. The default value is **false**. |
| 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**. | | 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**. |
| focusable<sup>7+</sup> | boolean | Yes | No | Whether the window can gain focus. The default value is **true**. | | focusable<sup>7+</sup> | boolean | Yes | No | Whether the window can gain focus. The default value is **true**. |
| touchable<sup>7+</sup> | boolean | Yes | No | Whether the window is touchable. The default value is **true**. | | touchable<sup>7+</sup> | 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.<br>This API is defined but not implemented in OpenHarmony 3.1 Release. It will be available for use in OpenHarmony 3.1 MR. | | brightness | number | Yes | Yes | Screen brightness. The value ranges from 0 to 1. The value **1** indicates the maximum brightness.<br>This API is defined but not implemented in OpenHarmony 3.1 Release. It will be available for use in OpenHarmony 3.1 MR.|
| dimBehindValue<sup>7+</sup> | 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.<br>This API is defined but not implemented in OpenHarmony 3.1 Release. It will be available for use in OpenHarmony 3.1 MR. | | dimBehindValue<sup>7+</sup> | 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.<br>This API is defined but not implemented in OpenHarmony 3.1 Release. It will be available for use in OpenHarmony 3.1 MR.|
| isKeepScreenOn | boolean | Yes | Yes | Whether the screen is always on. The default value is **false**.<br>This API is defined but not implemented in OpenHarmony 3.1 Release. It will be available for use in OpenHarmony 3.1 MR. | | isKeepScreenOn | boolean | Yes | Yes | Whether the screen is always on. The default value is **false**.<br>This API is defined but not implemented in OpenHarmony 3.1 Release. It will be available for use in OpenHarmony 3.1 MR.|
| isPrivacyMode<sup>7+</sup> | boolean | Yes | Yes | Whether the window is in privacy mode. The default value is **false**.<br>This API is defined but not implemented in OpenHarmony 3.1 Release. It will be available for use in OpenHarmony 3.1 MR. | | isPrivacyMode<sup>7+</sup> | boolean | Yes | Yes | Whether the window is in privacy mode. The default value is **false**.<br>This API is defined but not implemented in OpenHarmony 3.1 Release. It will be available for use in OpenHarmony 3.1 MR.|
| isRoundCorner<sup>7+</sup> | boolean | Yes | Yes | Whether the window has rounded corners.<br>This API is defined but not implemented in OpenHarmony 3.1 Release. It will be available for use in OpenHarmony 3.1 MR. | | isRoundCorner<sup>7+</sup> | boolean | Yes | Yes | Whether the window has rounded corners.<br>This API is defined but not implemented in OpenHarmony 3.1 Release. It will be available for use in OpenHarmony 3.1 MR.|
| isTransparent<sup>7+</sup> | boolean | Yes | Yes | Whether the window is transparent. The default value is **false**.<br>This API is defined but not implemented in OpenHarmony 3.1 Release. It will be available for use in OpenHarmony 3.1 MR. | | isTransparent<sup>7+</sup> | boolean | Yes | Yes | Whether the window is transparent. The default value is **false**.<br>This API is defined but not implemented in OpenHarmony 3.1 Release. It will be available for use in OpenHarmony 3.1 MR.|
## ColorSpace<sup>8+</sup><a name="colorspace"></a> ## ColorSpace<sup>8+</sup><a name="colorspace"></a>
...@@ -155,10 +156,10 @@ Describes the color gamut mode. ...@@ -155,10 +156,10 @@ Describes the color gamut mode.
**System capability**: SystemCapability.WindowManager.WindowManager.Core **System capability**: SystemCapability.WindowManager.WindowManager.Core
| Name | Default Value | Description | | Name | Default Value| Description |
| ---------- | ------------- | ------------------------- | | ---------- | ------ | -------------- |
| DEFAULT | 0 | Default color gamut mode. | | DEFAULT | 0 | Default color gamut mode.|
| WIDE_GAMUT | 1 | Wide color gamut mode. | | WIDE_GAMUT | 1 | Wide color gamut mode. |
## window.create<sup>7+</sup> ## window.create<sup>7+</sup>
...@@ -172,11 +173,11 @@ This API is discarded since API version 8. You are advised to use [window.create ...@@ -172,11 +173,11 @@ This API is discarded since API version 8. You are advised to use [window.create
- Parameters - Parameters
| Name | Type | Mandatory | Description | | Name | Type | Mandatory| Description |
| -------- | -------------------------------------- | --------- | ---------------------------------------------- | | -------- | -------------------------------------- | ---- | -------------------------- |
| id | string | Yes | Window ID. | | id | string | Yes | Window ID. |
| type | [WindowType](#windowtype) | Yes | Window type. | | type | [WindowType](#windowtype) | Yes | Window type. |
| callback | AsyncCallback&lt;[Window](#window)&gt; | Yes | Callback used to return the subwindow created. | | callback | AsyncCallback&lt;[Window](#window)&gt; | Yes | Callback used to return the subwindow created.|
- Example - Example
...@@ -205,16 +206,16 @@ This API is discarded since API version 8. You are advised to use [window.create ...@@ -205,16 +206,16 @@ This API is discarded since API version 8. You are advised to use [window.create
- Parameters - Parameters
| Name | Type | Mandatory | Description | | Name| Type | Mandatory| Description |
| ---- | ------------------------- | --------- | ------------ | | ------ | ------------------------- | ---- | ---------- |
| id | string | Yes | Window ID. | | id | string | Yes | Window ID. |
| type | [WindowType](#windowtype) | Yes | Window type. | | type | [WindowType](#windowtype) | Yes | Window type.|
- Return value - Return value
| Type | Description | | Type | Description |
| -------------------------------- | --------------------------------------------- | | -------------------------------- | ------------------------------------------------- |
| Promise&lt;[Window](#window)&gt; | Promise used to return the subwindow created. | | Promise&lt;[Window](#window)&gt; | Promise used to return the subwindow created.|
- Example - Example
...@@ -233,18 +234,20 @@ This API is discarded since API version 8. You are advised to use [window.create ...@@ -233,18 +234,20 @@ This API is discarded since API version 8. You are advised to use [window.create
create(ctx: Context, id: string, type: WindowType, callback: AsyncCallback&lt;Window&gt;): void create(ctx: Context, id: string, type: WindowType, callback: AsyncCallback&lt;Window&gt;): void
Creates a system window when the context is [ServiceExtensionContext](js-apis-service-extension-context.md). This API uses an asynchronous callback to return the result. Creates a subwindow when the context is [Context](js-apis-Context.md). This API uses an asynchronous callback to return the result.
Creates a system window when the context is [ServiceExtensionContext](js-apis-service-extension-context.md), starting from API version 9. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.WindowManager.WindowManager.Core **System capability**: SystemCapability.WindowManager.WindowManager.Core
- Parameters - Parameters
| Name | Type | Mandatory | Description | | Name | Type | Mandatory| Description |
| -------- | ----------------------------------------------- | --------- | -------------------------------------------------- | | -------- | -------------------------------------- | ---- | ------------------------------------------------------------ |
| ctx | [Context](js-apis-service-extension-context.md) | Yes | Current application context. | | ctx | Context | Yes | Current application context.<br>For the definition of **Context** of API version 8, see [Context](js-apis-Context.md).<br>For the definition of **Context** of API version 9, see [Context](js-apis-service-extension-context.md).|
| id | string | Yes | Window ID. | | id | string | Yes | Window ID. |
| type | [WindowType](#windowtype) | Yes | Window type. | | type | [WindowType](#windowtype) | Yes | Window type. |
| callback | AsyncCallback&lt;[Window](#window)&gt; | Yes | Callback used to return the system window created. | | callback | AsyncCallback&lt;[Window](#window)&gt; | Yes | Callback used to return the window created. |
- Example - Example
...@@ -265,23 +268,25 @@ Creates a system window when the context is [ServiceExtensionContext](js-apis-se ...@@ -265,23 +268,25 @@ Creates a system window when the context is [ServiceExtensionContext](js-apis-se
create(ctx: Context, id: string, type: WindowType): Promise&lt;Window&gt; create(ctx: Context, id: string, type: WindowType): Promise&lt;Window&gt;
Creates a system window when the context is [ServiceExtensionContext](js-apis-service-extension-context.md). This API uses a promise to return the result. Creates a subwindow when the context is [Context](js-apis-Context.md). This API uses a promise to return the result.
Creates a system window when the context is [ServiceExtensionContext](js-apis-service-extension-context.md), starting from API version 9. This API uses a promise to return the result.
**System capability**: SystemCapability.WindowManager.WindowManager.Core **System capability**: SystemCapability.WindowManager.WindowManager.Core
- Parameters - Parameters
| Name | Type | Mandatory | Description | | Name| Type | Mandatory| Description |
| ---- | ----------------------------------------------- | --------- | ---------------------------- | | ------ | ------------------------- | ---- | ------------------------------------------------------------ |
| ctx | [Context](js-apis-service-extension-context.md) | Yes | Current application context. | | ctx | Context | Yes | Current application context.<br>For the definition of **Context** of API version 8, see [Context](js-apis-Context.md).<br>For the definition of **Context** of API version 9, see [Context](js-apis-service-extension-context.md).|
| id | string | Yes | Window ID. | | id | string | Yes | Window ID. |
| type | [WindowType](#windowtype) | Yes | Window type. | | type | [WindowType](#windowtype) | Yes | Window type. |
- Return value - Return value
| Type | Description | | Type | Description |
| -------------------------------- | ------------------------------------------------- | | -------------------------------- | ----------------------------------------------- |
| Promise&lt;[Window](#window)&gt; | Promise used to return the system window created. | | Promise&lt;[Window](#window)&gt; | Promise used to return the window created.|
- Example - Example
...@@ -296,7 +301,7 @@ Creates a system window when the context is [ServiceExtensionContext](js-apis-se ...@@ -296,7 +301,7 @@ Creates a system window when the context is [ServiceExtensionContext](js-apis-se
}); });
``` ```
## window.find<sup>7+</sup><a name="window-find"></a> ## window.find<sup>7+</sup>
find(id: string, callback: AsyncCallback&lt;Window&gt;): void find(id: string, callback: AsyncCallback&lt;Window&gt;): void
...@@ -306,10 +311,10 @@ Finds a window based on the ID. This API uses an asynchronous callback to return ...@@ -306,10 +311,10 @@ Finds a window based on the ID. This API uses an asynchronous callback to return
- Parameters - Parameters
| Name | Type | Mandatory | Description | | Name | Type | Mandatory| Description |
| -------- | -------------------------------------- | --------- | ----------------------------------------- | | -------- | -------------------------------------- | ---- | ---------------------------- |
| id | string | Yes | Window ID. | | id | string | Yes | Window ID. |
| callback | AsyncCallback&lt;[Window](#window)&gt; | Yes | Callback used to return the window found. | | callback | AsyncCallback&lt;[Window](#window)&gt; | Yes | Callback used to return the window found.|
- Example - Example
...@@ -335,15 +340,15 @@ Finds a window based on the ID. This API uses a promise to return the result. ...@@ -335,15 +340,15 @@ Finds a window based on the ID. This API uses a promise to return the result.
- Parameters - Parameters
| Name | Type | Mandatory | Description | | Name| Type | Mandatory| Description |
| ---- | ------ | --------- | ----------- | | ------ | ------ | ---- | -------- |
| id | string | Yes | Window ID. | | id | string | Yes | Window ID.|
- Return value - Return value
| Type | Description | | Type | Description |
| -------------------------------- | ---------------------------------------- | | -------------------------------- | ----------------------------------------------- |
| Promise&lt;[Window](#window)&gt; | Promise used to return the window found. | | Promise&lt;[Window](#window)&gt; | Promise used to return the window found.|
- Example - Example
...@@ -358,7 +363,7 @@ Finds a window based on the ID. This API uses a promise to return the result. ...@@ -358,7 +363,7 @@ Finds a window based on the ID. This API uses a promise to return the result.
}); });
``` ```
## window.getTopWindow<a name="window-gettopwindow"></a> ## window.getTopWindow
getTopWindow(callback: AsyncCallback&lt;Window&gt;): void getTopWindow(callback: AsyncCallback&lt;Window&gt;): void
...@@ -368,9 +373,9 @@ Obtains the top window of the current application. This API uses an asynchronous ...@@ -368,9 +373,9 @@ Obtains the top window of the current application. This API uses an asynchronous
- Parameters - Parameters
| Name | Type | Mandatory | Description | | Name | Type | Mandatory| Description |
| -------- | -------------------------------------- | --------- | ------------------------------------------------ | | -------- | -------------------------------------- | ---- | -------------------------------------- |
| callback | AsyncCallback&lt;[Window](#window)&gt; | Yes | Callback used to return the top window obtained. | | callback | AsyncCallback&lt;[Window](#window)&gt; | Yes | Callback used to return the top window obtained.|
- Example - Example
...@@ -396,9 +401,9 @@ Obtains the top window of the current application. This API uses a promise to re ...@@ -396,9 +401,9 @@ Obtains the top window of the current application. This API uses a promise to re
- Return value - Return value
| Type | Description | | Type | Description |
| -------------------------------- | ----------------------------------------------- | | -------------------------------- | --------------------------------------------------------- |
| Promise&lt;[Window](#window)&gt; | Promise used to return the top window obtained. | | Promise&lt;[Window](#window)&gt; | Promise used to return the top window obtained.|
- Example - Example
...@@ -423,10 +428,10 @@ Obtains the top window of the current application. This API uses an asynchronous ...@@ -423,10 +428,10 @@ Obtains the top window of the current application. This API uses an asynchronous
- Parameters - Parameters
| Name | Type | Mandatory | Description | | Name | Type | Mandatory| Description |
| -------- | -------------------------------------- | --------- | ------------------------------------------------------------ | | -------- | -------------------------------------- | ---- | ------------------------------------------------------------ |
| ctx | Context | Yes | Current application context.For the definition of **Context** of API version 8, see [Context](js-apis-Context.md). For the definition of **Context** of API version 9, see [Context](js-apis-ability-context.md). | | ctx | Context | Yes | Current application context.<br>For the definition of **Context** of API version 8, see [Context](js-apis-Context.md).<br>For the definition of **Context** of API version 9, see [Context](js-apis-ability-context.md).|
| callback | AsyncCallback&lt;[Window](#window)&gt; | Yes | Callback used to return the top window obtained. | | callback | AsyncCallback&lt;[Window](#window)&gt; | Yes | Callback used to return the top window obtained. |
- Example - Example
...@@ -452,15 +457,15 @@ Obtains the top window of the current application. This API uses a promise to re ...@@ -452,15 +457,15 @@ Obtains the top window of the current application. This API uses a promise to re
- Parameters - Parameters
| Name | Type | Mandatory | Description | | Name| Type | Mandatory| Description |
| ---- | ------- | --------- | ------------------------------------------------------------ | | ------ | ------- | ---- | ------------------------------------------------------------ |
| ctx | Context | Yes | Current application context.For the definition of **Context** of API version 8, see [Context](js-apis-Context.md). For the definition of **Context** of API version 9, see [Context](js-apis-ability-context.md). | | ctx | Context | Yes | Current application context.<br>For the definition of **Context** of API version 8, see [Context](js-apis-Context.md).<br>For the definition of **Context** of API version 9, see [Context](js-apis-ability-context.md).|
- Return value - Return value
| Type | Description | | Type | Description |
| -------------------------------- | ----------------------------------------------- | | -------------------------------- | --------------------------------------------------------- |
| Promise&lt;[Window](#window)&gt; | Promise used to return the top window obtained. | | Promise&lt;[Window](#window)&gt; | Promise used to return the top window obtained.|
- Example - Example
...@@ -479,7 +484,7 @@ Obtains the top window of the current application. This API uses a promise to re ...@@ -479,7 +484,7 @@ Obtains the top window of the current application. This API uses a promise to re
on(type: 'systemBarTintChange', callback: Callback&lt;SystemBarTintState&gt;): void on(type: 'systemBarTintChange', callback: Callback&lt;SystemBarTintState&gt;): void
Enables listening for the properties changes of the status bar and navigation bar. Enables listening for properties changes of the status bar and navigation bar.
This is a system API and cannot be called by third-party applications. This is a system API and cannot be called by third-party applications.
...@@ -487,10 +492,10 @@ This is a system API and cannot be called by third-party applications. ...@@ -487,10 +492,10 @@ This is a system API and cannot be called by third-party applications.
- Parameters - Parameters
| Name | Type | Mandatory | Description | | Name | Type | Mandatory| Description |
| -------- | --------------------------------------------------------- | --------- | ------------------------------------------------------------ | | -------- | --------------------------------------------------------- | ---- | ------------------------------------------------------------ |
| type | string | Yes | Listening type.<br>Set it to **systemBarTintChange**, which indicates listening for properties changes of the status bar and navigation bar. | | type | string | Yes | Listening type.<br>Set it to **systemBarTintChange**, which indicates listening for properties changes of the status bar and navigation bar.|
| callback | Callback&lt;[SystemBarTintState](#systembartintstate)&gt; | Yes | Callback used to return the information. | | callback | Callback&lt;[SystemBarTintState](#systembartintstate)&gt; | Yes | Callback used to return the information. |
- Example - Example
...@@ -513,10 +518,10 @@ This is a system API and cannot be called by third-party applications. ...@@ -513,10 +518,10 @@ This is a system API and cannot be called by third-party applications.
- Parameters - Parameters
| Name | Type | Mandatory | Description | | Name | Type | Mandatory| Description |
| -------- | --------------------------------------------------------- | --------- | ------------------------------------------------------------ | | -------- | --------------------------------------------------------- | ---- | ------------------------------------------------------------ |
| type | string | Yes | Listening type.<br>Set it to **systemBarTintChange**, which indicates listening for properties changes of the status bar and navigation bar. | | type | string | Yes | Listening type.<br>Set it to **systemBarTintChange**, which indicates listening for properties changes of the status bar and navigation bar.|
| callback | Callback&lt;[SystemBarTintState](#systembartintstate)&gt; | No | Callback used to return the information. | | callback | Callback&lt;[SystemBarTintState](#systembartintstate)&gt; | No | Callback used to return the information. |
- Example - Example
...@@ -527,7 +532,7 @@ This is a system API and cannot be called by third-party applications. ...@@ -527,7 +532,7 @@ This is a system API and cannot be called by third-party applications.
## Window ## Window
In the following API examples, you must use [getTopWindow()](#window-gettopwindow), [create()](#windowcreate7), or [find()](#window-find) to obtain a **Window** instance and then call a method in this instance. In the following API examples, you must use [getTopWindow()](#windowgettopwindow), [create()](#windowcreate7), or [find()](#windowfind7) to obtain a **Window** instance and then call a method in this instance.
### hide<sup>7+</sup> ### hide<sup>7+</sup>
...@@ -541,9 +546,9 @@ This is a system API and cannot be called by third-party applications. ...@@ -541,9 +546,9 @@ This is a system API and cannot be called by third-party applications.
- Parameters - Parameters
| Name | Type | Mandatory | Description | | Name | Type | Mandatory| Description |
| -------- | ------------------------- | --------- | --------------------------------------------- | | -------- | ------------------------- | ---- | ---------- |
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the execution result. | | callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the execution result.|
- Example - Example
...@@ -569,9 +574,9 @@ This is a system API and cannot be called by third-party applications. ...@@ -569,9 +574,9 @@ This is a system API and cannot be called by third-party applications.
- Return value - Return value
| Type | Description | | Type | Description |
| ------------------- | -------------------------------------------- | | ------------------- | ----------------------------------------------- |
| Promise&lt;void&gt; | Promise used to return the execution result. | | Promise&lt;void&gt; | Promise used to return the execution result.|
- Example - Example
...@@ -594,9 +599,9 @@ Shows this window. This API uses an asynchronous callback to return the result. ...@@ -594,9 +599,9 @@ Shows this window. This API uses an asynchronous callback to return the result.
- Parameters - Parameters
| Name | Type | Mandatory | Description | | Name | Type | Mandatory| Description |
| -------- | ------------------------- | --------- | --------------------------------------------- | | -------- | ------------------------- | ---- | ---------- |
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the execution result. | | callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the execution result.|
- Example - Example
...@@ -620,9 +625,9 @@ Shows this window. This API uses a promise to return the result. ...@@ -620,9 +625,9 @@ Shows this window. This API uses a promise to return the result.
- Return value - Return value
| Type | Description | | Type | Description |
| ------------------- | -------------------------------------------- | | ------------------- | ----------------------------------------------- |
| Promise&lt;void&gt; | Promise used to return the execution result. | | Promise&lt;void&gt; | Promise used to return the execution result.|
- Example - Example
...@@ -645,9 +650,9 @@ Destroys this window. This API uses an asynchronous callback to return the resul ...@@ -645,9 +650,9 @@ Destroys this window. This API uses an asynchronous callback to return the resul
- Parameters - Parameters
| Name | Type | Mandatory | Description | | Name | Type | Mandatory| Description |
| -------- | ------------------------- | --------- | --------------------------------------------- | | -------- | ------------------------- | ---- | ---------- |
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the execution result. | | callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the execution result.|
- Example - Example
...@@ -671,9 +676,9 @@ Destroys this window. This API uses a promise to return the result. ...@@ -671,9 +676,9 @@ Destroys this window. This API uses a promise to return the result.
- Return value - Return value
| Type | Description | | Type | Description |
| ------------------- | -------------------------------------------- | | ------------------- | ----------------------------------------------- |
| Promise&lt;void&gt; | Promise used to return the execution result. | | Promise&lt;void&gt; | Promise used to return the execution result.|
- Example - Example
...@@ -696,11 +701,11 @@ Moves the position of this window. This API uses an asynchronous callback to ret ...@@ -696,11 +701,11 @@ Moves the position of this window. This API uses an asynchronous callback to ret
- Parameters - Parameters
| Name | Type | Mandatory | Description | | Name | Type | Mandatory| Description |
| -------- | ------------------------- | --------- | ------------------------------------------------------------ | | -------- | ------------------------- | ---- | --------------------------------------- |
| x | number | Yes | Distance that the window moves along the x-axis. A positive value indicates that the window moves to the right. | | x | number | Yes | Distance that the window moves along the x-axis. A positive value indicates that the window moves to the right.|
| y | number | Yes | Distance that the window moves along the y-axis. A positive value indicates that the window moves downwards. | | y | number | Yes | Distance that the window moves along the y-axis. A positive value indicates that the window moves downwards.|
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the execution result. | | callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the execution result. |
- Example - Example
...@@ -725,16 +730,16 @@ Moves the position of this window. This API uses a promise to return the result. ...@@ -725,16 +730,16 @@ Moves the position of this window. This API uses a promise to return the result.
- Parameters - Parameters
| Name | Type | Mandatory | Description | | Name| Type | Mandatory| Description |
| ---- | ------ | --------- | ------------------------------------------------------------ | | ------ | ------ | ---- | --------------------------------------- |
| x | number | Yes | Distance that the window moves along the x-axis. A positive value indicates that the window moves to the right. | | x | number | Yes | Distance that the window moves along the x-axis. A positive value indicates that the window moves to the right.|
| y | number | Yes | Distance that the window moves along the y-axis. A positive value indicates that the window moves downwards. | | y | number | Yes | Distance that the window moves along the y-axis. A positive value indicates that the window moves downwards.|
- Return value - Return value
| Type | Description | | Type | Description |
| ------------------- | -------------------------------------------- | | ------------------- | ----------------------------------------------- |
| Promise&lt;void&gt; | Promise used to return the execution result. | | Promise&lt;void&gt; | Promise used to return the execution result.|
- Example - Example
...@@ -757,11 +762,11 @@ Changes the size of this window. This API uses an asynchronous callback to retur ...@@ -757,11 +762,11 @@ Changes the size of this window. This API uses an asynchronous callback to retur
- Parameters - Parameters
| Name | Type | Mandatory | Description | | Name | Type | Mandatory| Description |
| -------- | ------------------------- | --------- | --------------------------------------------- | | -------- | ------------------------- | ---- | ---------------- |
| width | number | Yes | New width of the window. | | width | number | Yes | New width of the window.|
| height | number | Yes | New height of the window. | | height | number | Yes | New height of the window.|
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the execution result. | | callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the execution result. |
- Example - Example
...@@ -785,16 +790,16 @@ Changes the size of this window. This API uses a promise to return the result. ...@@ -785,16 +790,16 @@ Changes the size of this window. This API uses a promise to return the result.
- Parameters - Parameters
| Name | Type | Mandatory | Description | | Name| Type | Mandatory| Description |
| ------ | ------ | --------- | ------------------------- | | ------ | ------ | ---- | ---------------- |
| width | number | Yes | New width of the window. | | width | number | Yes | New width of the window.|
| height | number | Yes | New height of the window. | | height | number | Yes | New height of the window.|
- Return value - Return value
| Type | Description | | Type | Description |
| ------------------- | -------------------------------------------- | | ------------------- | ----------------------------------------------- |
| Promise&lt;void&gt; | Promise used to return the execution result. | | Promise&lt;void&gt; | Promise used to return the execution result.|
- Example - Example
...@@ -819,10 +824,10 @@ This is a system API and cannot be called by third-party applications. ...@@ -819,10 +824,10 @@ This is a system API and cannot be called by third-party applications.
- Parameters - Parameters
| Name | Type | Mandatory | Description | | Name | Type | Mandatory| Description |
| -------- | ------------------------- | --------- | --------------------------------------------- | | -------- | ------------------------- | ---- | ---------- |
| type | [WindowType](#windowtype) | Yes | Window type. | | type | [WindowType](#windowtype) | Yes | Window type.|
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the execution result. | | callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the execution result.|
- Example - Example
...@@ -849,15 +854,15 @@ This is a system API and cannot be called by third-party applications. ...@@ -849,15 +854,15 @@ This is a system API and cannot be called by third-party applications.
- Parameters - Parameters
| Name | Type | Mandatory | Description | | Name| Type | Mandatory| Description |
| ---- | ------------------------- | --------- | ------------ | | ------ | ------------------------- | ---- | ---------- |
| type | [WindowType](#windowtype) | Yes | Window type. | | type | [WindowType](#windowtype) | Yes | Window type.|
- Return value - Return value
| Type | Description | | Type | Description |
| ------------------- | -------------------------------------------- | | ------------------- | ----------------------------------------------- |
| Promise&lt;void&gt; | Promise used to return the execution result. | | Promise&lt;void&gt; | Promise used to return the execution result.|
- Example - Example
...@@ -881,9 +886,9 @@ Obtains the properties of this window. This API uses an asynchronous callback to ...@@ -881,9 +886,9 @@ Obtains the properties of this window. This API uses an asynchronous callback to
- Parameters - Parameters
| Name | Type | Mandatory | Description | | Name | Type | Mandatory| Description |
| -------- | ---------------------------------------------------------- | --------- | ---------------------------------------------- | | -------- | ---------------------------------------------------------- | ---- | ------------------ |
| callback | AsyncCallback&lt;[WindowProperties](#windowproperties)&gt; | Yes | Callback used to return the window properties. | | callback | AsyncCallback&lt;[WindowProperties](#windowproperties)&gt; | Yes | Callback used to return the window properties.|
- Example - Example
...@@ -907,13 +912,13 @@ Obtains the properties of this window. This API uses a promise to return the res ...@@ -907,13 +912,13 @@ Obtains the properties of this window. This API uses a promise to return the res
- Return value - Return value
| Type | Description | | Type | Description |
| ---------------------------------------------------- | --------------------------------------------- | | ---------------------------------------------------- | ------------------------------------- |
| Promise&lt;[WindowProperties](#windowproperties)&gt; | Promise used to return the window properties. | | Promise&lt;[WindowProperties](#windowproperties)&gt; | Promise used to return the window properties.|
- Example - Example
``` ```js
let promise = windowClass.getProperties(); let promise = windowClass.getProperties();
promise.then((data)=> { promise.then((data)=> {
console.info('Succeeded in obtaining the window properties. Data: ' + JSON.stringify(data)) console.info('Succeeded in obtaining the window properties. Data: ' + JSON.stringify(data))
...@@ -932,10 +937,10 @@ Obtains the area where this window cannot be displayed, for example, the system ...@@ -932,10 +937,10 @@ Obtains the area where this window cannot be displayed, for example, the system
- Parameters - Parameters
| Name | Type | Mandatory | Description | | Name | Type | Mandatory| Description |
| -------- | -------------------------------------------- | --------- | ------------------------------------------------------------ | | -------- | -------------------------------------------- | ---- | ------------------------------------------------------------ |
| type | [AvoidAreaType](#avoidareatype) | Yes | Type of the area. **TYPE_SYSTEM** indicates the default area of the system. **TYPE_CUTOUT** indicates the notch. | | type | [AvoidAreaType](#avoidareatype) | Yes | Type of the area. **TYPE_SYSTEM** indicates the default area of the system. **TYPE_CUTOUT** indicates the notch.|
| callback | AsyncCallback&lt;[AvoidArea](#avoidarea)&gt; | Yes | Callback used to return the area. | | callback | AsyncCallback&lt;[AvoidArea](#avoidarea)&gt; | Yes | Callback used to return the area. |
- Example - Example
...@@ -960,15 +965,15 @@ Obtains the area where this window cannot be displayed, for example, the system ...@@ -960,15 +965,15 @@ Obtains the area where this window cannot be displayed, for example, the system
- Parameters - Parameters
| Name | Type | Mandatory | Description | | Name| Type | Mandatory| Description |
| ---- | ------------------------------- | --------- | ------------------------------------------------------------ | | ------ | ------------------------------- | ---- | ------------------------------------------------------------ |
| type | [AvoidAreaType](#avoidareatype) | Yes | Type of the area. **TYPE_SYSTEM** indicates the default area of the system. **TYPE_CUTOUT** indicates the notch. | | type | [AvoidAreaType](#avoidareatype) | Yes | Type of the area. **TYPE_SYSTEM** indicates the default area of the system. **TYPE_CUTOUT** indicates the notch.|
- Return value - Return value
| Type | Description | | Type | Description |
| -------------------------------------- | -------------------------------- | | -------------------------------------- | --------------------------------------------- |
| Promise&lt;[AvoidArea](#avoidarea)&gt; | Promise used to return the area. | | Promise&lt;[AvoidArea](#avoidarea)&gt; | Promise used to return the area.|
- Example - Example
...@@ -991,10 +996,10 @@ Sets whether to enable the full-screen mode for this window. This API uses an as ...@@ -991,10 +996,10 @@ Sets whether to enable the full-screen mode for this window. This API uses an as
- Parameters - Parameters
| Name | Type | Mandatory | Description | | Name | Type | Mandatory| Description |
| ------------ | ------------------------- | --------- | ------------------------------------------------------------ | | ------------ | ------------------------- | ---- | ---------------------------------------------- |
| isFullScreen | boolean | Yes | Whether to enable the full-screen mode, in which the status bar and navigation bar are hidden. | | isFullScreen | boolean | Yes | Whether to enable the full-screen mode, in which the status bar and navigation bar are hidden.|
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the execution result. | | callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the execution result. |
- Example - Example
...@@ -1019,15 +1024,15 @@ Sets whether to enable the full-screen mode for this window. This API uses a pro ...@@ -1019,15 +1024,15 @@ Sets whether to enable the full-screen mode for this window. This API uses a pro
- Parameters - Parameters
| Name | Type | Mandatory | Description | | Name | Type | Mandatory| Description |
| ------------ | ------- | --------- | ------------------------------------------------------------ | | ------------ | ------- | ---- | ---------------------------------------------- |
| isFullScreen | boolean | Yes | Whether to enable the full-screen mode, in which the status bar and navigation bar are hidden. | | isFullScreen | boolean | Yes | Whether to enable the full-screen mode, in which the status bar and navigation bar are hidden.|
- Return value - Return value
| Type | Description | | Type | Description |
| ------------------- | -------------------------------------------- | | ------------------- | ----------------------------------------------- |
| Promise&lt;void&gt; | Promise used to return the execution result. | | Promise&lt;void&gt; | Promise used to return the execution result.|
- Example - Example
...@@ -1051,10 +1056,10 @@ Sets whether the window layout is in full-screen mode. This API uses an asynchro ...@@ -1051,10 +1056,10 @@ Sets whether the window layout is in full-screen mode. This API uses an asynchro
- Parameters - Parameters
| Name | Type | Mandatory | Description | | Name | Type | Mandatory| Description |
| ------------------ | ------------------------- | --------- | ------------------------------------------------------------ | | ------------------ | ------------------------- | ---- | ------------------------------------------------------------ |
| isLayoutFullScreen | boolean | Yes | Whether the window layout is in full-screen mode, in which the status bar and navigation bar are displayed. | | isLayoutFullScreen | boolean | Yes | Whether the window layout is in full-screen mode, in which the status bar and navigation bar are displayed.|
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the execution result. | | callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the execution result. |
- Example - Example
...@@ -1079,15 +1084,15 @@ Sets whether the window layout is in full-screen mode. This API uses a promise t ...@@ -1079,15 +1084,15 @@ Sets whether the window layout is in full-screen mode. This API uses a promise t
- Parameters - Parameters
| Name | Type | Mandatory | Description | | Name | Type | Mandatory| Description |
| ------------------ | ------- | --------- | ------------------------------------------------------------ | | ------------------ | ------- | ---- | ------------------------------------------------------------ |
| isLayoutFullScreen | boolean | Yes | Whether the window layout is in full-screen mode, in which the status bar and navigation bar are displayed. | | isLayoutFullScreen | boolean | Yes | Whether the window layout is in full-screen mode, in which the status bar and navigation bar are displayed.|
- Return value - Return value
| Type | Description | | Type | Description |
| ------------------- | -------------------------------------------- | | ------------------- | ----------------------------------------------- |
| Promise&lt;void&gt; | Promise used to return the execution result. | | Promise&lt;void&gt; | Promise used to return the execution result.|
- Example - Example
...@@ -1111,10 +1116,10 @@ Sets whether to display the status bar and navigation bar in this window. This A ...@@ -1111,10 +1116,10 @@ Sets whether to display the status bar and navigation bar in this window. This A
- Parameters - Parameters
| Name | Type | Mandatory | Description | | Name | Type | Mandatory| Description |
| -------- | ------------------------- | --------- | ------------------------------------------------------------ | | -------- | ------------------------- | ---- | ------------------------------------------------------------ |
| names | Array | Yes | Whether to display the status bar and navigation bar. For example, to display the status bar and navigation bar, set this parameter to **["status", "navigation"]**. By default, they are not displayed. | | names | Array | Yes | Whether to display the status bar and navigation bar. For example, to display the status bar and navigation bar, set this parameter to **["status", "navigation"]**. By default, they are not displayed.|
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the execution result. | | callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the execution result. |
- Example - Example
...@@ -1139,15 +1144,15 @@ Sets whether to display the status bar and navigation bar in this window. This A ...@@ -1139,15 +1144,15 @@ Sets whether to display the status bar and navigation bar in this window. This A
- Parameters - Parameters
| Name | Type | Mandatory | Description | | Name| Type | Mandatory| Description |
| ----- | ----- | --------- | ------------------------------------------------------------ | | ------ | ----- | ---- | ------------------------------------------------------------ |
| names | Array | Yes | Whether to display the status bar and navigation bar. For example, to display the status bar and navigation bar, set this parameter to **["status", "navigation"]**. By default, they are not displayed. | | names | Array | Yes | Whether to display the status bar and navigation bar. For example, to display the status bar and navigation bar, set this parameter to **["status", "navigation"]**. By default, they are not displayed.|
- Return value - Return value
| Type | Description | | Type | Description |
| ------------------- | -------------------------------------------- | | ------------------- | ----------------------------------------------- |
| Promise&lt;void&gt; | Promise used to return the execution result. | | Promise&lt;void&gt; | Promise used to return the execution result.|
- Example - Example
...@@ -1171,10 +1176,10 @@ Sets the properties of the status bar and navigation bar in this window. This AP ...@@ -1171,10 +1176,10 @@ Sets the properties of the status bar and navigation bar in this window. This AP
- Parameters - Parameters
| Name | Type | Mandatory | Description | | Name | Type | Mandatory| Description |
| ------------------- | ------------------------------------------- | --------- | ------------------------------------------------ | | ------------------- | ------------------------------------------- | ---- | -------------------- |
| SystemBarProperties | [SystemBarProperties](#systembarproperties) | Yes | Properties of the status bar and navigation bar. | | SystemBarProperties | [SystemBarProperties](#systembarproperties) | Yes | Properties of the status bar and navigation bar.|
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the execution result. | | callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the execution result. |
- Example - Example
...@@ -1208,15 +1213,15 @@ Sets the properties of the status bar and navigation bar in this window. This AP ...@@ -1208,15 +1213,15 @@ Sets the properties of the status bar and navigation bar in this window. This AP
- Parameters - Parameters
| Name | Type | Mandatory | Description | | Name | Type | Mandatory| Description |
| ------------------- | ------------------------------------------- | --------- | ------------------------------------------------ | | ------------------- | ------------------------------------------- | ---- | -------------------- |
| SystemBarProperties | [SystemBarProperties](#systembarproperties) | Yes | Properties of the status bar and navigation bar. | | SystemBarProperties | [SystemBarProperties](#systembarproperties) | Yes | Properties of the status bar and navigation bar.|
- Return value - Return value
| Type | Description | | Type | Description |
| ------------------- | -------------------------------------------- | | ------------------- | ----------------------------------------------- |
| Promise&lt;void&gt; | Promise used to return the execution result. | | Promise&lt;void&gt; | Promise used to return the execution result.|
- Example - Example
...@@ -1249,10 +1254,10 @@ Loads content to this window. This API uses an asynchronous callback to return t ...@@ -1249,10 +1254,10 @@ Loads content to this window. This API uses an asynchronous callback to return t
- Parameters - Parameters
| Name | Type | Mandatory | Description | | Name | Type | Mandatory| Description |
| -------- | ------------------------- | --------- | ------------------------------------------------------- | | -------- | ------------------------- | ---- | -------------------- |
| path | string | Yes | Path of the page from which the content will be loaded. | | path | string | Yes | Path of the page from which the content will be loaded.|
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the execution result. | | callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the execution result. |
- Example - Example
...@@ -1276,15 +1281,15 @@ Loads content to this window. This API uses a promise to return the result. ...@@ -1276,15 +1281,15 @@ Loads content to this window. This API uses a promise to return the result.
- Parameters - Parameters
| Name | Type | Mandatory | Description | | Name| Type | Mandatory| Description |
| ---- | ------ | --------- | ------------------------------------------------------- | | ------ | ------ | ---- | -------------------- |
| path | string | Yes | Path of the page from which the content will be loaded. | | path | string | Yes | Path of the page from which the content will be loaded.|
- Return value - Return value
| Type | Description | | Type | Description |
| ------------------- | -------------------------------------------- | | ------------------- | ----------------------------------------------- |
| Promise&lt;void&gt; | Promise used to return the execution result. | | Promise&lt;void&gt; | Promise used to return the execution result.|
- Example - Example
...@@ -1307,9 +1312,9 @@ Checks whether this window is displayed. This API uses an asynchronous callback ...@@ -1307,9 +1312,9 @@ Checks whether this window is displayed. This API uses an asynchronous callback
- Parameters - Parameters
| Name | Type | Mandatory | Description | | Name | Type | Mandatory| Description |
| -------- | ---------------------------- | --------- | -------------------------------------------------------- | | -------- | ---------------------------- | ---- | -------------------------------- |
| callback | AsyncCallback&lt;boolean&gt; | Yes | Callback used to return whether the window is displayed. | | callback | AsyncCallback&lt;boolean&gt; | Yes | Callback used to return whether the window is displayed.|
- Example - Example
...@@ -1333,9 +1338,9 @@ Checks whether this window is displayed. This API uses a promise to return the r ...@@ -1333,9 +1338,9 @@ Checks whether this window is displayed. This API uses a promise to return the r
- Return value - Return value
| Type | Description | | Type | Description |
| ---------------------- | ------------------------------------------------------- | | ---------------------- | ----------------------------------------------------- |
| Promise&lt;boolean&gt; | Promise used to return whether the window is displayed. | | Promise&lt;boolean&gt; | Promise used to return whether the window is displayed.|
- Example - Example
...@@ -1358,10 +1363,10 @@ Enables listening for window size changes. ...@@ -1358,10 +1363,10 @@ Enables listening for window size changes.
- Parameters - Parameters
| Name | Type | Mandatory | Description | | Name | Type | Mandatory| Description |
| -------- | ----------------------------- | --------- | ------------------------------------------------------------ | | -------- | ----------------------------- | ---- | ------------------------------------------------------------ |
| type | string | Yes | Listening type.<br>Set it to **windowSizeChange**, which indicates listening for window size changes. | | type | string | Yes | Listening type.<br>Set it to **windowSizeChange**, which indicates listening for window size changes.|
| callback | Callback&lt;[Size](#size)&gt; | Yes | Callback used to return the information. | | callback | Callback&lt;[Size](#size)&gt; | Yes | Callback used to return the information. |
- Example - Example
...@@ -1382,10 +1387,10 @@ Disables listening for window size changes. ...@@ -1382,10 +1387,10 @@ Disables listening for window size changes.
- Parameters - Parameters
| Name | Type | Mandatory | Description | | Name | Type | Mandatory| Description |
| -------- | ----------------------------- | --------- | ------------------------------------------------------------ | | -------- | ----------------------------- | ---- | ------------------------------------------------------------ |
| type | string | Yes | Listening type.<br>Set it to **windowSizeChange<sup>7+</sup>**, which indicates listening for window size changes. | | type | string | Yes | Listening type.<br>Set it to **windowSizeChange<sup>7+</sup>**, which indicates listening for window size changes.|
| callback | Callback&lt;[Size](#size)&gt; | No | Callback used to return the information. | | callback | Callback&lt;[Size](#size)&gt; | No | Callback used to return the information. |
- Example - Example
...@@ -1404,10 +1409,10 @@ Enables listening for changes to the area where the window cannot be displayed. ...@@ -1404,10 +1409,10 @@ Enables listening for changes to the area where the window cannot be displayed.
- Parameters - Parameters
| Name | Type | Mandatory | Description | | Name | Type | Mandatory| Description |
| -------- | --------------------------------------- | --------- | ------------------------------------------------------------ | | -------- | --------------------------------------- | ---- | ------------------------------------------------------------ |
| type | string | Yes | Listening type.<br>Set it to **systemAvoidAreaChange**, which indicates listening for changes to the area where the window cannot be displayed. | | type | string | Yes | Listening type.<br>Set it to **systemAvoidAreaChange**, which indicates listening for changes to the area where the window cannot be displayed.|
| callback | Callback&lt;[AvoidArea](#avoidarea)&gt; | Yes | Callback used to return the information. | | callback | Callback&lt;[AvoidArea](#avoidarea)&gt; | Yes | Callback used to return the information. |
- Example - Example
...@@ -1428,10 +1433,10 @@ Disables listening for changes to the area where the window cannot be displayed. ...@@ -1428,10 +1433,10 @@ Disables listening for changes to the area where the window cannot be displayed.
- Parameters - Parameters
| Name | Type | Mandatory | Description | | Name | Type | Mandatory| Description |
| -------- | --------------------------------------- | --------- | ------------------------------------------------------------ | | -------- | --------------------------------------- | ---- | ------------------------------------------------------------ |
| type | string | Yes | Listening type.<br>Set it to **systemAvoidAreaChange**, which indicates listening for changes to the area where the window cannot be displayed. | | type | string | Yes | Listening type.<br>Set it to **systemAvoidAreaChange**, which indicates listening for changes to the area where the window cannot be displayed.|
| callback | Callback&lt;[AvoidArea](#avoidarea)&gt; | No | Callback used to return the information. | | callback | Callback&lt;[AvoidArea](#avoidarea)&gt; | No | Callback used to return the information. |
- Example - Example
...@@ -1452,10 +1457,10 @@ This API is defined but not implemented in OpenHarmony 3.1 Release. It will be a ...@@ -1452,10 +1457,10 @@ This API is defined but not implemented in OpenHarmony 3.1 Release. It will be a
- Parameters - Parameters
| Name | Type | Mandatory | Description | | Name | Type | Mandatory| Description |
| -------- | ---------------------- | --------- | ------------------------------------------------------------ | | -------- | ------------------ | ---- | ------------------------------------------------------------ |
| type | string | Yes | Listening type.<br>Set it to **keyboardHeightChange**, which indicates listening for keyboard height changes. | | type | string | Yes | Listening type.<br>Set it to **keyboardHeightChange**, which indicates listening for keyboard height changes.|
| callback | Callback&lt;number&gt; | Yes | Callback used to return the information. | | callback | Callbacknumber&gt; | Yes | Callback used to return the information. |
- Example - Example
...@@ -1478,10 +1483,10 @@ This API is defined but not implemented in OpenHarmony 3.1 Release. It will be a ...@@ -1478,10 +1483,10 @@ This API is defined but not implemented in OpenHarmony 3.1 Release. It will be a
- Parameters - Parameters
| Name | Type | Mandatory | Description | | Name | Type | Mandatory| Description |
| -------- | ---------------------- | --------- | ------------------------------------------------------------ | | -------- | ---------------------- | ---- | ------------------------------------------------------------ |
| type | string | Yes | Listening type.<br>Set it to **keyboardHeightChange**, which indicates listening for keyboard height changes. | | type | string | Yes | Listening type.<br>Set it to **keyboardHeightChange**, which indicates listening for keyboard height changes.|
| callback | Callback&lt;number&gt; | No | Callback used to return the information. | | callback | Callback&lt;number&gt; | No | Callback used to return the information. |
- Example - Example
...@@ -1500,9 +1505,9 @@ Checks whether this window supports the wide color gamut mode. This API uses an ...@@ -1500,9 +1505,9 @@ Checks whether this window supports the wide color gamut mode. This API uses an
- Parameters - Parameters
| Name | Type | Mandatory | Description | | Name | Type | Mandatory| Description |
| -------- | ---------------------------- | --------- | ------------------------------------------------------------ | | -------- | ---------------------------- | ---- | -------------------------------- |
| callback | AsyncCallback&lt;boolean&gt; | Yes | Callback used to return whether the wide color gamut mode is supported. | | callback | AsyncCallback&lt;boolean&gt; | Yes | Callback used to return whether the wide color gamut mode is supported.|
- Example - Example
...@@ -1526,13 +1531,13 @@ Checks whether this window supports the wide color gamut mode. This API uses a p ...@@ -1526,13 +1531,13 @@ Checks whether this window supports the wide color gamut mode. This API uses a p
- Return value - Return value
| Type | Description | | Type | Description |
| ---------------------- | ------------------------------------------------------------ | | ---------------------- | ------------------------------------------------------------ |
| Promise&lt;boolean&gt; | Promise used to return whether the wide color gamut mode is supported. | | Promise&lt;boolean&gt; | Promise used to return whether the wide color gamut mode is supported.|
- Example - Example
```js ```
let promise = windowClass.isSupportWideGamut(); let promise = windowClass.isSupportWideGamut();
promise.then((data)=> { promise.then((data)=> {
console.info('Succeeded in checking whether the window support WideGamut. Data: ' + JSON.stringify(data)) console.info('Succeeded in checking whether the window support WideGamut. Data: ' + JSON.stringify(data))
...@@ -1551,10 +1556,10 @@ Sets this window to the wide or default color gamut mode. This API uses an async ...@@ -1551,10 +1556,10 @@ Sets this window to the wide or default color gamut mode. This API uses an async
- Parameters - Parameters
| Name | Type | Mandatory | Description | | Name | Type | Mandatory| Description |
| ---------- | ------------------------- | --------- | --------------------------------------------- | | ---------- | ------------------------- | ---- | ------------ |
| colorSpace | [ColorSpace](#colorspace) | Yes | Color gamut mode. | | colorSpace | [ColorSpace](#colorspace) | Yes | Color gamut mode.|
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the execution result. | | callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the execution result. |
- Example - Example
...@@ -1578,15 +1583,15 @@ Sets this window to the wide or default color gamut mode. This API uses a promis ...@@ -1578,15 +1583,15 @@ Sets this window to the wide or default color gamut mode. This API uses a promis
- Parameters - Parameters
| Name | Type | Mandatory | Description | | Name | Type | Mandatory| Description |
| ---------- | ------------------------- | --------- | ----------------- | | ---------- | ------------------------- | ---- | ------------ |
| colorSpace | [ColorSpace](#colorspace) | Yes | Color gamut mode. | | colorSpace | [ColorSpace](#colorspace) | Yes | Color gamut mode.|
- Return value - Return value
| Type | Description | | Type | Description |
| ------------------- | -------------------------------------------- | | ------------------- | ----------------------------------------------- |
| Promise&lt;void&gt; | Promise used to return the execution result. | | Promise&lt;void&gt; | Promise used to return the execution result.|
- Example - Example
...@@ -1609,9 +1614,9 @@ Obtains the color gamut mode of this window. This API uses an asynchronous callb ...@@ -1609,9 +1614,9 @@ Obtains the color gamut mode of this window. This API uses an asynchronous callb
- Parameters - Parameters
| Name | Type | Mandatory | Description | | Name | Type | Mandatory| Description |
| -------- | ---------------------------------------------- | --------- | ------------------------------------------------------ | | -------- | ---------------------------------------------- | ---- | -------------------------- |
| callback | AsyncCallback&lt;[ColorSpace](#colorspace)&gt; | Yes | Callback used to return the color gamut mode obtained. | | callback | AsyncCallback&lt;[ColorSpace](#colorspace)&gt; | Yes | Callback used to return the color gamut mode obtained.|
- Example - Example
...@@ -1635,9 +1640,9 @@ Obtains the color gamut mode of this window. This API uses a promise to return t ...@@ -1635,9 +1640,9 @@ Obtains the color gamut mode of this window. This API uses a promise to return t
- Return value - Return value
| Type | Description | | Type | Description |
| ---------------------------------------- | ----------------------------------------------------- | | ---------------------------------------- | ----------------------------------------- |
| Promise&lt;[ColorSpace](#colorspace)&gt; | Promise used to return the color gamut mode obtained. | | Promise&lt;[ColorSpace](#colorspace)&gt; | Promise used to return the color gamut mode obtained.|
- Example - Example
...@@ -1662,10 +1667,10 @@ This API is defined but not implemented in OpenHarmony 3.1 Release. It will be a ...@@ -1662,10 +1667,10 @@ This API is defined but not implemented in OpenHarmony 3.1 Release. It will be a
- Parameters - Parameters
| Name | Type | Mandatory | Description | | Name | Type | Mandatory| Description |
| -------- | ------------------------- | --------- | ------------------------------------------------------------ | | -------- | ------------------------- | ---- | ------------------------------------------------------------ |
| color | string | Yes | Background color to set. The color is a hexadecimal value, for example, #00FF00 or #FF00FF00. | | color | string | Yes | Background color to set. The color is a hexadecimal value, for example, #00FF00 or #FF00FF00.|
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the execution result. | | callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the execution result. |
- Example - Example
...@@ -1692,15 +1697,15 @@ This API is defined but not implemented in OpenHarmony 3.1 Release. It will be a ...@@ -1692,15 +1697,15 @@ This API is defined but not implemented in OpenHarmony 3.1 Release. It will be a
- Parameters - Parameters
| Name | Type | Mandatory | Description | | Name| Type | Mandatory| Description |
| ----- | ------ | --------- | ------------------------------------------------------------ | | ------ | ------ | ---- | ------------------------------------------------------------ |
| color | string | Yes | Background color to set. The color is a hexadecimal value, for example, #00FF00 or #FF00FF00. | | color | string | Yes | Background color to set. The color is a hexadecimal value, for example, #00FF00 or #FF00FF00.|
- Return value - Return value
| Type | Description | | Type | Description |
| ------------------- | -------------------------------------------- | | ------------------- | ----------------------------------------------- |
| Promise&lt;void&gt; | Promise used to return the execution result. | | Promise&lt;void&gt; | Promise used to return the execution result.|
- Example - Example
...@@ -1726,10 +1731,10 @@ This API is defined but not implemented in OpenHarmony 3.1 Release. It will be a ...@@ -1726,10 +1731,10 @@ This API is defined but not implemented in OpenHarmony 3.1 Release. It will be a
- Parameters - Parameters
| Name | Type | Mandatory | Description | | Name | Type | Mandatory| Description |
| ---------- | ------------------------- | --------- | ------------------------------------------------------------ | | ---------- | ------------------------- | ---- | ------------------------------------ |
| brightness | number | Yes | Brightness to set, which ranges from 0 to 1. The value **1** indicates the brightest. | | brightness | number | Yes | Brightness to set, which ranges from 0 to 1. The value **1** indicates the brightest.|
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the execution result. | | callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the execution result. |
- Example - Example
...@@ -1756,15 +1761,15 @@ This API is defined but not implemented in OpenHarmony 3.1 Release. It will be a ...@@ -1756,15 +1761,15 @@ This API is defined but not implemented in OpenHarmony 3.1 Release. It will be a
- Parameters - Parameters
| Name | Type | Mandatory | Description | | Name | Type | Mandatory| Description |
| ---------- | ------ | --------- | ------------------------------------------------------------ | | ---------- | ------ | ---- | ------------------------------------ |
| brightness | number | Yes | Brightness to set, which ranges from 0 to 1. The value **1** indicates the brightest. | | brightness | number | Yes | Brightness to set, which ranges from 0 to 1. The value **1** indicates the brightest.|
- Return value - Return value
| Type | Description | | Type | Description |
| ------------------- | -------------------------------------------- | | ------------------- | ----------------------------------------------- |
| Promise&lt;void&gt; | Promise used to return the execution result. | | Promise&lt;void&gt; | Promise used to return the execution result.|
- Example - Example
...@@ -1790,10 +1795,10 @@ This API is defined but not implemented in OpenHarmony 3.1 Release. It will be a ...@@ -1790,10 +1795,10 @@ This API is defined but not implemented in OpenHarmony 3.1 Release. It will be a
- Parameters - Parameters
| Name | Type | Mandatory | Description | | 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. | | dimBehindValue | number | Yes | Dimness of the window to set. The value ranges from 0 to 1. The value **1** indicates the dimmest.|
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the execution result. | | callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the execution result. |
- Example - Example
...@@ -1819,15 +1824,15 @@ This API is defined but not implemented in OpenHarmony 3.1 Release. It will be a ...@@ -1819,15 +1824,15 @@ This API is defined but not implemented in OpenHarmony 3.1 Release. It will be a
- Parameters - Parameters
| Name | Type | Mandatory | Description | | 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. | | dimBehindValue | number | Yes | Dimness of the window to set. The value ranges from 0 to 1. The value **1** indicates the dimmest.|
- Return value - Return value
| Type | Description | | Type | Description |
| ------------------- | -------------------------------------------- | | ------------------- | ----------------------------------------------- |
| Promise&lt;void&gt; | Promise used to return the execution result. | | Promise&lt;void&gt; | Promise used to return the execution result.|
- Example - Example
...@@ -1852,10 +1857,10 @@ This API is defined but not implemented in OpenHarmony 3.1 Release. It will be a ...@@ -1852,10 +1857,10 @@ This API is defined but not implemented in OpenHarmony 3.1 Release. It will be a
- Parameters - Parameters
| Name | Type | Mandatory | Description | | Name | Type | Mandatory| Description |
| ----------- | ------------------------- | --------- | --------------------------------------------- | | ----------- | ------------------------- | ---- | ---------------------------- |
| isFocusable | boolean | Yes | Whether the window can gain focus. | | isFocusable | boolean | Yes | Whether the window can gain focus.|
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the execution result. | | callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the execution result. |
- Example - Example
...@@ -1882,15 +1887,15 @@ This API is defined but not implemented in OpenHarmony 3.1 Release. It will be a ...@@ -1882,15 +1887,15 @@ This API is defined but not implemented in OpenHarmony 3.1 Release. It will be a
- Parameters - Parameters
| Name | Type | Mandatory | Description | | Name | Type | Mandatory| Description |
| ----------- | ------- | --------- | ---------------------------------- | | ----------- | ------- | ---- | ---------------------------- |
| isFocusable | boolean | Yes | Whether the window can gain focus. | | isFocusable | boolean | Yes | Whether the window can gain focus.|
- Return value - Return value
| Type | Description | | Type | Description |
| ------------------- | -------------------------------------------- | | ------------------- | ----------------------------------------------- |
| Promise&lt;void&gt; | Promise used to return the execution result. | | Promise&lt;void&gt; | Promise used to return the execution result.|
- Example - Example
...@@ -1916,10 +1921,10 @@ This API is defined but not implemented in OpenHarmony 3.1 Release. It will be a ...@@ -1916,10 +1921,10 @@ This API is defined but not implemented in OpenHarmony 3.1 Release. It will be a
- Parameters - Parameters
| Name | Type | Mandatory | Description | | Name | Type | Mandatory| Description |
| -------------- | ------------------------- | --------- | --------------------------------------------- | | -------------- | ------------------------- | ---- | ------------------------ |
| isKeepScreenOn | boolean | Yes | Whether to keep the screen always on. | | isKeepScreenOn | boolean | Yes | Whether to keep the screen always on.|
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the execution result. | | callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the execution result. |
- Example - Example
...@@ -1946,15 +1951,15 @@ This API is defined but not implemented in OpenHarmony 3.1 Release. It will be a ...@@ -1946,15 +1951,15 @@ This API is defined but not implemented in OpenHarmony 3.1 Release. It will be a
- Parameters - Parameters
| Name | Type | Mandatory | Description | | Name | Type | Mandatory| Description |
| -------------- | ------- | --------- | ------------------------------------- | | -------------- | ------- | ---- | ------------------------ |
| isKeepScreenOn | boolean | Yes | Whether to keep the screen always on. | | isKeepScreenOn | boolean | Yes | Whether to keep the screen always on.|
- Return value - Return value
| Type | Description | | Type | Description |
| ------------------- | -------------------------------------------- | | ------------------- | ----------------------------------------------- |
| Promise&lt;void&gt; | Promise used to return the execution result. | | Promise&lt;void&gt; | Promise used to return the execution result.|
- Example - Example
...@@ -1980,10 +1985,10 @@ This API is defined but not implemented in OpenHarmony 3.1 Release. It will be a ...@@ -1980,10 +1985,10 @@ This API is defined but not implemented in OpenHarmony 3.1 Release. It will be a
- Parameters - Parameters
| Name | Type | Mandatory | Description | | 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. | | 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&lt;void&gt; | Yes | Callback used to return the execution result. | | callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the execution result. |
- Example - Example
...@@ -2009,15 +2014,15 @@ This API is defined but not implemented in OpenHarmony 3.1 Release. It will be a ...@@ -2009,15 +2014,15 @@ This API is defined but not implemented in OpenHarmony 3.1 Release. It will be a
- Parameters - Parameters
| Name | Type | Mandatory | Description | | 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. | | 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 - Return value
| Type | Description | | Type | Description |
| ------------------- | -------------------------------------------- | | ------------------- | ----------------------------------------------- |
| Promise&lt;void&gt; | Promise used to return the execution result. | | Promise&lt;void&gt; | Promise used to return the execution result.|
- Example - Example
...@@ -2042,10 +2047,10 @@ This API is defined but not implemented in OpenHarmony 3.1 Release. It will be a ...@@ -2042,10 +2047,10 @@ This API is defined but not implemented in OpenHarmony 3.1 Release. It will be a
- Parameters - Parameters
| Name | Type | Mandatory | Description | | Name | Type | Mandatory| Description |
| ------------- | ------------------------- | --------- | --------------------------------------------- | | ------------- | ------------------------- | ---- | -------------------- |
| isPrivacyMode | boolean | Yes | Whether the window is in privacy mode. | | isPrivacyMode | boolean | Yes | Whether the window is in privacy mode.|
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the execution result. | | callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the execution result. |
- Example - Example
...@@ -2073,15 +2078,15 @@ This API is defined but not implemented in OpenHarmony 3.1 Release. It will be a ...@@ -2073,15 +2078,15 @@ This API is defined but not implemented in OpenHarmony 3.1 Release. It will be a
- Parameters - Parameters
| Name | Type | Mandatory | Description | | Name | Type | Mandatory| Description |
| ------------- | ------- | --------- | -------------------------------------- | | ------------- | ------- | ---- | -------------------- |
| isPrivacyMode | boolean | Yes | Whether the window is in privacy mode. | | isPrivacyMode | boolean | Yes | Whether the window is in privacy mode.|
- Return value - Return value
| Type | Description | | Type | Description |
| ------------------- | -------------------------------------------- | | ------------------- | ----------------------------------------------- |
| Promise&lt;void&gt; | Promise used to return the execution result. | | Promise&lt;void&gt; | Promise used to return the execution result.|
- Example - Example
...@@ -2107,10 +2112,10 @@ This API is defined but not implemented in OpenHarmony 3.1 Release. It will be a ...@@ -2107,10 +2112,10 @@ This API is defined but not implemented in OpenHarmony 3.1 Release. It will be a
- Parameters - Parameters
| Name | Type | Mandatory | Description | | Name | Type | Mandatory| Description |
| ----------- | ------------------------- | --------- | --------------------------------------------- | | ----------- | ------------------------- | ---- | -------------------- |
| isTouchable | boolean | Yes | Whether the window is touchable. | | isTouchable | boolean | Yes | Whether the window is touchable.|
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the execution result. | | callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the execution result. |
- Example - Example
...@@ -2138,15 +2143,15 @@ This API is defined but not implemented in OpenHarmony 3.1 Release. It will be a ...@@ -2138,15 +2143,15 @@ This API is defined but not implemented in OpenHarmony 3.1 Release. It will be a
- Parameters - Parameters
| Name | Type | Mandatory | Description | | Name | Type | Mandatory| Description |
| ----------- | ------- | --------- | -------------------------------- | | ----------- | ------- | ---- | -------------------- |
| isTouchable | boolean | Yes | Whether the window is touchable. | | isTouchable | boolean | Yes | Whether the window is touchable.|
- Return value - Return value
| Type | Description | | Type | Description |
| ------------------- | -------------------------------------------- | | ------------------- | ----------------------------------------------- |
| Promise&lt;void&gt; | Promise used to return the execution result. | | Promise&lt;void&gt; | Promise used to return the execution result.|
- Example - Example
...@@ -2166,12 +2171,12 @@ Describes the lifecycle of a window stage. ...@@ -2166,12 +2171,12 @@ Describes the lifecycle of a window stage.
**System capability**: SystemCapability.WindowManager.WindowManager.Core **System capability**: SystemCapability.WindowManager.WindowManager.Core
| Name | Default Value | Description | | Name | Default Value| Description |
| ---------- | ------------- | ---------------------------------------------- | | ---------- | ------ | -------- |
| FOREGROUND | 1 | The window stage is running in the foreground. | | FOREGROUND | 1 | The window stage is running in the foreground.|
| ACTIVE | 2 | The window stage gains focus. | | ACTIVE | 2 | The window stage gains focus.|
| INACTIVE | 3 | The window stage loses focus. | | INACTIVE | 3 | The window stage loses focus.|
| BACKGROUND | 4 | The window stage is running in the background. | | BACKGROUND | 4 | The window stage is running in the background.|
## WindowStage<sup>9+</sup> ## WindowStage<sup>9+</sup>
...@@ -2187,9 +2192,9 @@ Obtains the main window of this window stage. This API uses a promise to return ...@@ -2187,9 +2192,9 @@ Obtains the main window of this window stage. This API uses a promise to return
- Return value - Return value
| Type | Description | | Type | Description |
| -------------------------------- | --------------------------------------- | | -------------------------------- | ---------------------------------------------------------- |
| Promise&lt;[Window](#window)&gt; | Promise used to return the main window. | | Promise&lt;[Window](#window)&gt; | Promise used to return the main window.|
- Example - Example
...@@ -2219,9 +2224,9 @@ Obtains the main window of this window stage. This API uses an asynchronous call ...@@ -2219,9 +2224,9 @@ Obtains the main window of this window stage. This API uses an asynchronous call
- Parameters - Parameters
| Name | Type | Mandatory | Description | | Name | Type | Mandatory| Description |
| -------- | -------------------------------------- | --------- | ---------------------------------------- | | -------- | -------------------------------------- | ---- | --------------------------------------- |
| callback | AsyncCallback&lt;[Window](#window)&gt; | Yes | Callback used to return the main window. | | callback | AsyncCallback&lt;[Window](#window)&gt; | Yes | Callback used to return the main window.|
- Example - Example
...@@ -2252,15 +2257,15 @@ Creates a subwindow for this window stage. This API uses a promise to return the ...@@ -2252,15 +2257,15 @@ Creates a subwindow for this window stage. This API uses a promise to return the
- Parameters - Parameters
| Name | Type | Mandatory | Description | | Name| Type | Mandatory| Description |
| ---- | ------ | --------- | ---------------------- | | ------ | ------ | ---- | -------------- |
| name | String | Yes | Name of the subwindow. | | name | String | Yes | Name of the subwindow.|
- Return value - Return value
| Type | Description | | Type | Description |
| -------------------------------- | --------------------------------------------- | | -------------------------------- | ------------------------------------------------- |
| Promise&lt;[Window](#window)&gt; | Promise used to return the subwindow created. | | Promise&lt;[Window](#window)&gt; | Promise used to return the subwindow created.|
- Example - Example
...@@ -2290,10 +2295,10 @@ Creates a subwindow for this window stage. This API uses an asynchronous callbac ...@@ -2290,10 +2295,10 @@ Creates a subwindow for this window stage. This API uses an asynchronous callbac
- Parameters - Parameters
| Name | Type | Mandatory | Description | | Name | Type | Mandatory| Description |
| -------- | -------------------------------------- | --------- | ---------------------------------------------- | | -------- | -------------------------------------- | ---- | ------------------------------ |
| name | String | Yes | Name of the subwindow. | | name | String | Yes | Name of the subwindow. |
| callback | AsyncCallback&lt;[Window](#window)&gt; | Yes | Callback used to return the subwindow created. | | callback | AsyncCallback&lt;[Window](#window)&gt; | Yes | Callback used to return the subwindow created.|
- Example - Example
...@@ -2325,9 +2330,9 @@ Obtains all the subwindows of this window stage. This API uses a promise to retu ...@@ -2325,9 +2330,9 @@ Obtains all the subwindows of this window stage. This API uses a promise to retu
- Return value - Return value
| Type | Description | | Type | Description |
| --------------------------------------------- | ------------------------------------------ | | --------------------------------------------- | ------------------------------------------------------------ |
| Promise&lt;Array&lt;[Window](#window)&gt;&gt; | Promise used to return all the subwindows. | | Promise&lt;Array&lt;[Window](#window)&gt;&gt; | Promise used to return all the subwindows.|
- Example - Example
...@@ -2357,9 +2362,9 @@ Obtains all the subwindows of this window stage. This API uses an asynchronous c ...@@ -2357,9 +2362,9 @@ Obtains all the subwindows of this window stage. This API uses an asynchronous c
- Parameters - Parameters
| Name | Type | Mandatory | Description | | Name | Type | Mandatory| Description |
| -------- | --------------------------------------------------- | --------- | ------------------------------------------- | | -------- | --------------------------------------------------- | ---- | ------------------------------------------- |
| callback | AsyncCallback&lt;Array&lt;[Window](#window)&gt;&gt; | Yes | Callback used to return all the subwindows. | | callback | AsyncCallback&lt;Array&lt;[Window](#window)&gt;&gt; | Yes | Callback used to return all the subwindows.|
- Example - Example
...@@ -2390,10 +2395,10 @@ Loads content to this window stage. This API uses an asynchronous callback to re ...@@ -2390,10 +2395,10 @@ Loads content to this window stage. This API uses an asynchronous callback to re
- Parameters - Parameters
| Name | Type | Mandatory | Description | | Name | Type | Mandatory| Description |
| -------- | ------------------------- | --------- | ------------------------------------------------------- | | -------- | ------------------------- | ---- | -------------------- |
| path | string | Yes | Path of the page from which the content will be loaded. | | path | string | Yes | Path of the page from which the content will be loaded.|
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the execution result. | | callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the execution result. |
- Example - Example
...@@ -2422,10 +2427,10 @@ Enables listening for window stage lifecycle changes. ...@@ -2422,10 +2427,10 @@ Enables listening for window stage lifecycle changes.
- Parameters - Parameters
| Name | Type | Mandatory | Description | | Name | Type | Mandatory| Description |
| -------- | ------------------------------------------------------------ | --------- | ------------------------------------------------------------ | | -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| type | string | Yes | Listening type.<br>Set it to **windowStageEvent**, which indicates listening for window stage lifecycle changes. | | type | string | Yes | Listening type.<br>Set it to **windowStageEvent**, which indicates listening for window stage lifecycle changes.|
| callback | Callback&lt;[WindowStageEventType](#windowstageeventtype9)&gt; | Yes | Callback used to return the information. | | callback | Callback&lt;[WindowStageEventType](#windowstageeventtype9)&gt; | Yes | Callback used to return the information. |
- Example - Example
...@@ -2451,10 +2456,10 @@ Disables listening for window stage lifecycle changes. ...@@ -2451,10 +2456,10 @@ Disables listening for window stage lifecycle changes.
- Parameters - Parameters
| Name | Type | Mandatory | Description | | Name | Type | Mandatory| Description |
| -------- | ------------------------------------------------------------ | --------- | ------------------------------------------------------------ | | -------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| type | string | Yes | Listening type.<br>Set it to **windowStageEvent**, which indicates listening for window stage lifecycle changes. | | type | string | Yes | Listening type.<br>Set it to **windowStageEvent**, which indicates listening for window stage lifecycle changes.|
| callback | Callback&lt;[WindowStageEventType](#windowstageeventtype9)&gt; | No | Callback used to return the information. | | callback | Callback&lt;[WindowStageEventType](#windowstageeventtype9)&gt; | No | Callback used to return the information. |
- Example - Example
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册