提交 cac0fb5f 编写于 作者: W wusongqing

updated docs

Signed-off-by: Nwusongqing <wusongqing@huawei.com>
上级 2e5c5994
# Window
The **Window** module provides basic capabilities for managing windows, including creating and destroying windows and setting serial port attributes.
> ![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.
>
......@@ -10,7 +12,7 @@
import window from '@ohos.window';
```
## WindowType<sup>7+</sup><a name="windowtype"></a>
## WindowType<sup>7+</sup>
Enumerates the window types.
......@@ -21,7 +23,7 @@ Enumerates the window types.
| TYPE_APP | 0 | Application subwindow. |
| TYPE_SYSTEM_ALERT | 1 | System alert window.|
## AvoidAreaType<sup>7+</sup><a name="avoidareatype"></a>
## AvoidAreaType<sup>7+</sup>
Enumerates the types of the area where the window cannot be displayed.
......@@ -32,7 +34,7 @@ Enumerates the types of the area where the window cannot be displayed.
| TYPE_SYSTEM | 0 | Default area of the system.|
| TYPE_CUTOUT | 1 | Notch. |
## WindowMode<sup>7+</sup><a name="windowmode"></a>
## WindowMode<sup>7+</sup>
Enumerates the window modes of an application.
......@@ -48,7 +50,7 @@ This is a system API and cannot be called by third-party applications.
| SECONDARY | 4 | The application is displayed in the secondary window in split-screen mode. |
| FLOATING | 5 | The application is displayed in a floating window.|
## SystemBarProperties<a name="systembarproperties"></a>
## SystemBarProperties
Describes the properties of the status bar and navigation bar.
......@@ -63,7 +65,7 @@ Describes the properties of the status bar and navigation bar.
| 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. |
## SystemBarRegionTint<sup>8+</sup><a name="systembartegiontint"></a>
## SystemBarRegionTint<sup>8+</sup>
Describes the callback for a single system bar.
......@@ -73,13 +75,13 @@ This is a system API and cannot be called by third-party applications.
| 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 status bar and navigation bar are supported.|
| isEnable | boolean | Yes | Yes | Whether the system bar is displayed. |
| 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**.|
| contentColor | string | Yes | Yes | Color of the text on the system bar. |
## SystemBarTintState<sup>8+</sup><a name="systembartintstate"></a>
## SystemBarTintState<sup>8+</sup>
Describes the callback for the current system bar.
......@@ -87,12 +89,12 @@ This is a system API and cannot be called by third-party applications.
**System capability**: SystemCapability.WindowManager.WindowManager.Core
| Name | Type | Readable| Writable| Description |
| ---------- | -------------------------------------------------- | ---- | ---- | -------------------------- |
| displayId | number | Yes | No | ID of the current physical screen. |
| regionTint | Array<[SystemBarRegionTint](#systembartegiontint)> | Yes | Yes | All system bar information changed.|
| Name | Type | Readable| Writable| Description |
| ---------- | --------------------------------------------------- | ---- | ---- | -------------------------- |
| displayId | number | Yes | No | ID of the current physical screen. |
| regionTint | Array<[SystemBarRegionTint](#systembarregiontint8)> | Yes | Yes | All system bar information changed.|
## Rect<sup>7+</sup><a name="rect"></a>
## Rect<sup>7+</sup>
Describes a rectangle.
......@@ -105,7 +107,7 @@ Describes a rectangle.
| width | number | Yes | Yes | Width of the rectangle. |
| height | number | Yes | Yes | Height of the rectangle. |
## AvoidArea<sup>7+</sup><a name="avoidarea"></a>
## AvoidArea<sup>7+</sup>
Describes the area where the window cannot be displayed.
......@@ -118,7 +120,7 @@ Describes the area where the window cannot be displayed.
| rightRect | [Rect](#rect) | Yes | Yes | Rectangle on the right 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>
Describes the window size.
......@@ -129,7 +131,7 @@ Describes the window size.
| width | number | Yes | Yes | Window width.|
| height | number | Yes | Yes | Window height.|
## WindowProperties<a name="windowproperties"></a>
## WindowProperties
Describes the window properties.
......@@ -147,10 +149,10 @@ Describes the window properties.
| 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.|
| 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. 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>
Describes the color gamut mode.
......@@ -171,7 +173,7 @@ This API is discarded since API version 8. You are advised to use [window.create
**System capability**: SystemCapability.WindowManager.WindowManager.Core
- Parameters
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | -------------------------------------- | ---- | -------------------------- |
......@@ -179,7 +181,7 @@ This API is discarded since API version 8. You are advised to use [window.create
| type | [WindowType](#windowtype) | Yes | Window type. |
| callback | AsyncCallback&lt;[Window](#window)&gt; | Yes | Callback used to return the subwindow created.|
- Example
**Example**
```js
var windowClass = null;
......@@ -204,20 +206,20 @@ This API is discarded since API version 8. You are advised to use [window.create
**System capability**: SystemCapability.WindowManager.WindowManager.Core
- Parameters
**Parameters**
| Name| Type | Mandatory| Description |
| ------ | ------------------------- | ---- | ---------- |
| id | string | Yes | Window ID. |
| type | [WindowType](#windowtype) | Yes | Window type.|
- Return value
**Return value**
| Type | Description |
| -------------------------------- | ------------------------------------------------- |
| Promise&lt;[Window](#window)&gt; | Promise used to return the subwindow created.|
- Example
**Example**
```js
var windowClass = null;
......@@ -240,7 +242,7 @@ Creates a system window when the context is [ServiceExtensionContext](js-apis-se
**System capability**: SystemCapability.WindowManager.WindowManager.Core
- Parameters
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | -------------------------------------- | ---- | ------------------------------------------------------------ |
......@@ -249,7 +251,7 @@ Creates a system window when the context is [ServiceExtensionContext](js-apis-se
| type | [WindowType](#windowtype) | Yes | Window type. |
| callback | AsyncCallback&lt;[Window](#window)&gt; | Yes | Callback used to return the window created. |
- Example
**Example**
```js
var windowClass = null;
......@@ -274,7 +276,7 @@ Creates a system window when the context is [ServiceExtensionContext](js-apis-se
**System capability**: SystemCapability.WindowManager.WindowManager.Core
- Parameters
**Parameters**
| Name| Type | Mandatory| Description |
| ------ | ------------------------- | ---- | ------------------------------------------------------------ |
......@@ -282,13 +284,13 @@ Creates a system window when the context is [ServiceExtensionContext](js-apis-se
| id | string | Yes | Window ID. |
| type | [WindowType](#windowtype) | Yes | Window type. |
- Return value
**Return value**
| Type | Description |
| -------------------------------- | ----------------------------------------------- |
| Promise&lt;[Window](#window)&gt; | Promise used to return the window created.|
- Example
**Example**
```js
var windowClass = null;
......@@ -309,14 +311,14 @@ Finds a window based on the ID. This API uses an asynchronous callback to return
**System capability**: SystemCapability.WindowManager.WindowManager.Core
- Parameters
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | -------------------------------------- | ---- | ---------------------------- |
| id | string | Yes | Window ID. |
| callback | AsyncCallback&lt;[Window](#window)&gt; | Yes | Callback used to return the window found.|
- Example
**Example**
```js
var windowClass = null;
......@@ -338,19 +340,19 @@ Finds a window based on the ID. This API uses a promise to return the result.
**System capability**: SystemCapability.WindowManager.WindowManager.Core
- Parameters
**Parameters**
| Name| Type | Mandatory| Description |
| ------ | ------ | ---- | -------- |
| id | string | Yes | Window ID.|
- Return value
**Return value**
| Type | Description |
| -------------------------------- | ----------------------------------------------- |
| Promise&lt;[Window](#window)&gt; | Promise used to return the window found.|
- Example
**Example**
```js
var windowClass = null;
......@@ -371,13 +373,13 @@ Obtains the top window of the current application. This API uses an asynchronous
**System capability**: SystemCapability.WindowManager.WindowManager.Core
- Parameters
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | -------------------------------------- | ---- | -------------------------------------- |
| callback | AsyncCallback&lt;[Window](#window)&gt; | Yes | Callback used to return the top window obtained.|
- Example
**Example**
```js
var windowClass = null;
......@@ -399,13 +401,13 @@ Obtains the top window of the current application. This API uses a promise to re
**System capability**: SystemCapability.WindowManager.WindowManager.Core
- Return value
**Return value**
| Type | Description |
| -------------------------------- | --------------------------------------------------------- |
| Promise&lt;[Window](#window)&gt; | Promise used to return the top window obtained.|
- Example
**Example**
```js
var windowClass = null;
......@@ -426,14 +428,14 @@ Obtains the top window of the current application. This API uses an asynchronous
**System capability**: SystemCapability.WindowManager.WindowManager.Core
- Parameters
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | -------------------------------------- | ---- | ------------------------------------------------------------ |
| 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. |
- Example
**Example**
```js
var windowClass = null;
......@@ -455,19 +457,19 @@ Obtains the top window of the current application. This API uses a promise to re
**System capability**: SystemCapability.WindowManager.WindowManager.Core
- Parameters
**Parameters**
| Name| Type | Mandatory| Description |
| ------ | ------- | ---- | ------------------------------------------------------------ |
| 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 |
| -------------------------------- | --------------------------------------------------------- |
| Promise&lt;[Window](#window)&gt; | Promise used to return the top window obtained.|
- Example
**Example**
```js
var windowClass = null;
......@@ -490,14 +492,14 @@ This is a system API and cannot be called by third-party applications.
**System capability**: SystemCapability.WindowManager.WindowManager.Core
- Parameters
**Parameters**
| 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 | Type of event to listen for. The value is fixed at **systemBarTintChange**, indicating the property change event of the status bar and navigation bar.|
| callback | Callback&lt;[SystemBarTintState](#systembartintstate)&gt; | Yes | Callback used to return the information. |
- Example
**Example**
```js
var type = 'systemBarTintChange';
......@@ -510,20 +512,20 @@ This is a system API and cannot be called by third-party applications.
off(type: 'systemBarTintChange', callback?: Callback&lt;SystemBarTintState &gt;): void
Disables listening for the properties changes of the status bar and navigation bar.
Disables listening for properties changes of the status bar and navigation bar.
This is a system API and cannot be called by third-party applications.
**System capability**: SystemCapability.WindowManager.WindowManager.Core
- Parameters
**Parameters**
| 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 | Type of event to listen for. The value is fixed at **systemBarTintChange**, indicating the property change event of the status bar and navigation bar.|
| callback | Callback&lt;[SystemBarTintState](#systembartintstate)&gt; | No | Callback used to return the information. |
- Example
**Example**
```js
var type = 'systemBarTintChange';
......@@ -544,13 +546,13 @@ This is a system API and cannot be called by third-party applications.
**System capability**: SystemCapability.WindowManager.WindowManager.Core
- Parameters
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ------------------------- | ---- | ---------- |
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the execution result.|
- Example
**Example**
```js
windowClass.hide((err, data) => {
......@@ -572,13 +574,13 @@ This is a system API and cannot be called by third-party applications.
**System capability**: SystemCapability.WindowManager.WindowManager.Core
- Return value
**Return value**
| Type | Description |
| ------------------- | ----------------------------------------------- |
| Promise&lt;void&gt; | Promise used to return the execution result.|
- Example
**Example**
```js
let promise = windowClass.hide();
......@@ -597,13 +599,13 @@ Shows this window. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.WindowManager.WindowManager.Core
- Parameters
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ------------------------- | ---- | ---------- |
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the execution result.|
- Example
**Example**
```js
windowClass.show((err, data) => {
......@@ -623,13 +625,13 @@ Shows this window. This API uses a promise to return the result.
**System capability**: SystemCapability.WindowManager.WindowManager.Core
- Return value
**Return value**
| Type | Description |
| ------------------- | ----------------------------------------------- |
| Promise&lt;void&gt; | Promise used to return the execution result.|
- Example
**Example**
```js
let promise = windowClass.show();
......@@ -648,13 +650,13 @@ Destroys this window. This API uses an asynchronous callback to return the resul
**System capability**: SystemCapability.WindowManager.WindowManager.Core
- Parameters
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ------------------------- | ---- | ---------- |
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the execution result.|
- Example
**Example**
```js
windowClass.destroy((err, data) => {
......@@ -674,13 +676,13 @@ Destroys this window. This API uses a promise to return the result.
**System capability**: SystemCapability.WindowManager.WindowManager.Core
- Return value
**Return value**
| Type | Description |
| ------------------- | ----------------------------------------------- |
| Promise&lt;void&gt; | Promise used to return the execution result.|
- Example
**Example**
```js
let promise = windowClass.destroy();
......@@ -699,7 +701,7 @@ Moves the position of this window. This API uses an asynchronous callback to ret
**System capability**: SystemCapability.WindowManager.WindowManager.Core
- Parameters
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ------------------------- | ---- | --------------------------------------- |
......@@ -707,7 +709,7 @@ Moves the position of this window. This API uses an asynchronous callback to ret
| 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. |
- Example
**Example**
```js
windowClass.moveTo(300, 300, (err, data)=>{
......@@ -728,20 +730,20 @@ Moves the position of this window. This API uses a promise to return the result.
**System capability**: SystemCapability.WindowManager.WindowManager.Core
- Parameters
**Parameters**
| 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.|
| 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 |
| ------------------- | ----------------------------------------------- |
| Promise&lt;void&gt; | Promise used to return the execution result.|
- Example
**Example**
```js
let promise = windowClass.moveTo(300, 300);
......@@ -760,7 +762,7 @@ Changes the size of this window. This API uses an asynchronous callback to retur
**System capability**: SystemCapability.WindowManager.WindowManager.Core
- Parameters
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ------------------------- | ---- | ---------------- |
......@@ -768,7 +770,7 @@ Changes the size of this window. This API uses an asynchronous callback to retur
| height | number | Yes | New height of the window.|
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the execution result. |
- Example
**Example**
```js
windowClass.resetSize(500, 1000, (err, data) => {
......@@ -788,20 +790,20 @@ Changes the size of this window. This API uses a promise to return the result.
**System capability**: SystemCapability.WindowManager.WindowManager.Core
- Parameters
**Parameters**
| Name| Type | Mandatory| Description |
| ------ | ------ | ---- | ---------------- |
| width | number | Yes | New width of the window.|
| height | number | Yes | New height of the window.|
- Return value
**Return value**
| Type | Description |
| ------------------- | ----------------------------------------------- |
| Promise&lt;void&gt; | Promise used to return the execution result.|
- Example
**Example**
```js
let promise = windowClass.resetSize(500, 1000);
......@@ -822,14 +824,14 @@ This is a system API and cannot be called by third-party applications.
**System capability**: SystemCapability.WindowManager.WindowManager.Core
- Parameters
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ------------------------- | ---- | ---------- |
| type | [WindowType](#windowtype) | Yes | Window type.|
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the execution result.|
- Example
**Example**
```js
var type = window.TYPE_APP;
......@@ -852,19 +854,19 @@ This is a system API and cannot be called by third-party applications.
**System capability**: SystemCapability.WindowManager.WindowManager.Core
- Parameters
**Parameters**
| Name| Type | Mandatory| Description |
| ------ | ------------------------- | ---- | ---------- |
| type | [WindowType](#windowtype) | Yes | Window type.|
- Return value
**Return value**
| Type | Description |
| ------------------- | ----------------------------------------------- |
| Promise&lt;void&gt; | Promise used to return the execution result.|
- Example
**Example**
```js
var type = window.TYPE_APP;
......@@ -884,13 +886,13 @@ Obtains the properties of this window. This API uses an asynchronous callback to
**System capability**: SystemCapability.WindowManager.WindowManager.Core
- Parameters
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ---------------------------------------------------------- | ---- | ------------------ |
| callback | AsyncCallback&lt;[WindowProperties](#windowproperties)&gt; | Yes | Callback used to return the window properties.|
- Example
**Example**
```js
windowClass.getProperties((err, data) => {
......@@ -910,13 +912,13 @@ Obtains the properties of this window. This API uses a promise to return the res
**System capability**: SystemCapability.WindowManager.WindowManager.Core
- Return value
**Return value**
| Type | Description |
| ---------------------------------------------------- | ------------------------------------- |
| Promise&lt;[WindowProperties](#windowproperties)&gt; | Promise used to return the window properties.|
- Example
**Example**
```js
let promise = windowClass.getProperties();
......@@ -935,14 +937,14 @@ Obtains the area where this window cannot be displayed, for example, the system
**System capability**: SystemCapability.WindowManager.WindowManager.Core
- Parameters
**Parameters**
| 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.|
| callback | AsyncCallback&lt;[AvoidArea](#avoidarea)&gt; | Yes | Callback used to return the area. |
- Example
**Example**
```js
var type = window.AvoidAreaType.TYPE_SYSTEM;
......@@ -963,19 +965,19 @@ Obtains the area where this window cannot be displayed, for example, the system
**System capability**: SystemCapability.WindowManager.WindowManager.Core
- Parameters
**Parameters**
| 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.|
- Return value
**Return value**
| Type | Description |
| -------------------------------------- | --------------------------------------------- |
| Promise&lt;[AvoidArea](#avoidarea)&gt; | Promise used to return the area.|
- Example
**Example**
```js
let promise = windowClass.getAvoidArea();
......@@ -994,14 +996,14 @@ Sets whether to enable the full-screen mode for this window. This API uses an as
**System capability**: SystemCapability.WindowManager.WindowManager.Core
- Parameters
**Parameters**
| Name | Type | Mandatory| Description |
| ------------ | ------------------------- | ---- | ---------------------------------------------- |
| 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. |
- Example
**Example**
```js
var isFullScreen = true;
......@@ -1022,19 +1024,19 @@ Sets whether to enable the full-screen mode for this window. This API uses a pro
**System capability**: SystemCapability.WindowManager.WindowManager.Core
- Parameters
**Parameters**
| Name | Type | Mandatory| Description |
| ------------ | ------- | ---- | ---------------------------------------------- |
| 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 |
| ------------------- | ----------------------------------------------- |
| Promise&lt;void&gt; | Promise used to return the execution result.|
- Example
**Example**
```js
var isFullScreen = true;
......@@ -1054,14 +1056,14 @@ Sets whether the window layout is in full-screen mode. This API uses an asynchro
**System capability**: SystemCapability.WindowManager.WindowManager.Core
- Parameters
**Parameters**
| 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.|
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the execution result. |
- Example
**Example**
```js
var isLayoutFullScreen= true;
......@@ -1082,19 +1084,19 @@ Sets whether the window layout is in full-screen mode. This API uses a promise t
**System capability**: SystemCapability.WindowManager.WindowManager.Core
- Parameters
**Parameters**
| 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.|
- Return value
**Return value**
| Type | Description |
| ------------------- | ----------------------------------------------- |
| Promise&lt;void&gt; | Promise used to return the execution result.|
- Example
**Example**
```js
var isLayoutFullScreen = true;
......@@ -1114,14 +1116,14 @@ Sets whether to display the status bar and navigation bar in this window. This A
**System capability**: SystemCapability.WindowManager.WindowManager.Core
- Parameters
**Parameters**
| 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.|
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the execution result. |
- Example
**Example**
```js
var names = ["status", "navigation"];
......@@ -1142,19 +1144,19 @@ Sets whether to display the status bar and navigation bar in this window. This A
**System capability**: SystemCapability.WindowManager.WindowManager.Core
- Parameters
**Parameters**
| 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.|
- Return value
**Return value**
| Type | Description |
| ------------------- | ----------------------------------------------- |
| Promise&lt;void&gt; | Promise used to return the execution result.|
- Example
**Example**
```js
var names = ["status", "navigation"];
......@@ -1174,14 +1176,14 @@ Sets the properties of the status bar and navigation bar in this window. This AP
**System capability**: SystemCapability.WindowManager.WindowManager.Core
- Parameters
**Parameters**
| Name | Type | Mandatory| Description |
| ------------------- | ------------------------------------------- | ---- | -------------------- |
| 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. |
- Example
**Example**
```js
var SystemBarProperties={
......@@ -1211,19 +1213,19 @@ Sets the properties of the status bar and navigation bar in this window. This AP
**System capability**: SystemCapability.WindowManager.WindowManager.Core
- Parameters
**Parameters**
| Name | Type | Mandatory| Description |
| ------------------- | ------------------------------------------- | ---- | -------------------- |
| SystemBarProperties | [SystemBarProperties](#systembarproperties) | Yes | Properties of the status bar and navigation bar.|
- Return value
**Return value**
| Type | Description |
| ------------------- | ----------------------------------------------- |
| Promise&lt;void&gt; | Promise used to return the execution result.|
- Example
**Example**
```js
var SystemBarProperties={
......@@ -1252,14 +1254,14 @@ Loads content to this window. This API uses an asynchronous callback to return t
**System capability**: SystemCapability.WindowManager.WindowManager.Core
- Parameters
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ------------------------- | ---- | -------------------- |
| 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. |
- Example
**Example**
```js
windowClass.loadContent("pages/page2/page2", (err, data) => {
......@@ -1279,19 +1281,19 @@ Loads content to this window. This API uses a promise to return the result.
**System capability**: SystemCapability.WindowManager.WindowManager.Core
- Parameters
**Parameters**
| Name| Type | Mandatory| Description |
| ------ | ------ | ---- | -------------------- |
| path | string | Yes | Path of the page from which the content will be loaded.|
- Return value
**Return value**
| Type | Description |
| ------------------- | ----------------------------------------------- |
| Promise&lt;void&gt; | Promise used to return the execution result.|
- Example
**Example**
```js
let promise = windowClass.loadContent("pages/page2/page2");
......@@ -1310,13 +1312,13 @@ Checks whether this window is displayed. This API uses an asynchronous callback
**System capability**: SystemCapability.WindowManager.WindowManager.Core
- Parameters
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ---------------------------- | ---- | -------------------------------- |
| callback | AsyncCallback&lt;boolean&gt; | Yes | Callback used to return whether the window is displayed.|
- Example
**Example**
```js
windowClass.isShowing((err, data) => {
......@@ -1336,13 +1338,13 @@ Checks whether this window is displayed. This API uses a promise to return the r
**System capability**: SystemCapability.WindowManager.WindowManager.Core
- Return value
**Return value**
| Type | Description |
| ---------------------- | ----------------------------------------------------- |
| Promise&lt;boolean&gt; | Promise used to return whether the window is displayed.|
- Example
**Example**
```js
let promise = windowClass.isShowing();
......@@ -1361,14 +1363,14 @@ Enables listening for window size changes.
**System capability**: SystemCapability.WindowManager.WindowManager.Core
- Parameters
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ----------------------------- | ---- | ------------------------------------------------------------ |
| 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. |
| Name | Type | Mandatory| Description |
| -------- | ----------------------------- | ---- | -------------------------------------------------------- |
| type | string | Yes | Type of event to listen for. The value is fixed at **windowSizeChange**, indicating the window size change event.|
| callback | Callback&lt;[Size](#size)&gt; | Yes | Callback used to return the information. |
- Example
**Example**
```js
var type = 'windowSizeChange';
......@@ -1385,16 +1387,16 @@ Disables listening for window size changes.
**System capability**: SystemCapability.WindowManager.WindowManager.Core
- Parameters
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ----------------------------- | ---- | ------------------------------------------------------------ |
| 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. |
| Name | Type | Mandatory| Description |
| -------- | ----------------------------- | ---- | -------------------------------------------------------- |
| type | string | Yes | Type of event to listen for. The value is fixed at **windowSizeChange**, indicating the window size change event.|
| callback | Callback&lt;[Size](#size)&gt; | No | Callback used to return the information. |
- Example
**Example**
```
```js
var type = 'windowSizeChange';
windowClass.off(type);
```
......@@ -1407,14 +1409,14 @@ Enables listening for changes to the area where the window cannot be displayed.
**System capability**: SystemCapability.WindowManager.WindowManager.Core
- Parameters
**Parameters**
| 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 | Type of event to listen for. The value is fixed at **systemAvoidAreaChange**, indicating the event of changes to the area where the window cannot be displayed.|
| callback | Callback&lt;[AvoidArea](#avoidarea)&gt; | Yes | Callback used to return the information. |
- Example
**Example**
```js
var type = 'systemAvoidAreaChange';
......@@ -1431,16 +1433,16 @@ Disables listening for changes to the area where the window cannot be displayed.
**System capability**: SystemCapability.WindowManager.WindowManager.Core
- Parameters
**Parameters**
| 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 | Type of event to listen for. The value is fixed at **systemAvoidAreaChange**, indicating the event of changes to the area where the window cannot be displayed.|
| callback | Callback&lt;[AvoidArea](#avoidarea)&gt; | No | Callback used to return the information. |
- Example
**Example**
```
```js
var type = 'systemAvoidAreaChange';
windowClass.off(type);
```
......@@ -1455,14 +1457,14 @@ This API is defined but not implemented in OpenHarmony 3.1 Release. It will be a
**System capability**: SystemCapability.WindowManager.WindowManager.Core
- Parameters
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ------------------ | ---- | ------------------------------------------------------------ |
| type | string | Yes | Listening type.<br>Set it to **keyboardHeightChange**, which indicates listening for keyboard height changes.|
| type | string | Yes | Type of event to listen for. The value is fixed at **keyboardHeightChange**, indicating the keyboard height change event.|
| callback | Callbacknumber&gt; | Yes | Callback used to return the information. |
- Example
**Example**
```js
var type = 'keyboardHeightChange';
......@@ -1481,16 +1483,16 @@ This API is defined but not implemented in OpenHarmony 3.1 Release. It will be a
**System capability**: SystemCapability.WindowManager.WindowManager.Core
- Parameters
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ---------------------- | ---- | ------------------------------------------------------------ |
| type | string | Yes | Listening type.<br>Set it to **keyboardHeightChange**, which indicates listening for keyboard height changes.|
| type | string | Yes | Type of event to listen for. The value is fixed at **keyboardHeightChange**, indicating the keyboard height change event.|
| callback | Callback&lt;number&gt; | No | Callback used to return the information. |
- Example
**Example**
```
```js
var type = 'keyboardHeightChange';
windowClass.off(type);
```
......@@ -1503,13 +1505,13 @@ Checks whether this window supports the wide color gamut mode. This API uses an
**System capability**: SystemCapability.WindowManager.WindowManager.Core
- Parameters
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ---------------------------- | ---- | -------------------------------- |
| callback | AsyncCallback&lt;boolean&gt; | Yes | Callback used to return whether the wide color gamut mode is supported.|
- Example
**Example**
```js
windowClass.isSupportWideGamut((err, data) => {
......@@ -1529,15 +1531,15 @@ Checks whether this window supports the wide color gamut mode. This API uses a p
**System capability**: SystemCapability.WindowManager.WindowManager.Core
- Return value
**Return value**
| Type | Description |
| ---------------------- | ------------------------------------------------------------ |
| Promise&lt;boolean&gt; | Promise used to return whether the wide color gamut mode is supported.|
- Example
**Example**
```
```js
let promise = windowClass.isSupportWideGamut();
promise.then((data)=> {
console.info('Succeeded in checking whether the window support WideGamut. Data: ' + JSON.stringify(data))
......@@ -1554,14 +1556,14 @@ Sets this window to the wide or default color gamut mode. This API uses an async
**System capability**: SystemCapability.WindowManager.WindowManager.Core
- Parameters
**Parameters**
| Name | Type | Mandatory| Description |
| ---------- | ------------------------- | ---- | ------------ |
| colorSpace | [ColorSpace](#colorspace) | Yes | Color gamut mode.|
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the execution result. |
- Example
**Example**
```js
windowClass.setColorSpace(window.ColorSpace.WIDE_GAMUT, (err, data) => {
......@@ -1581,19 +1583,19 @@ Sets this window to the wide or default color gamut mode. This API uses a promis
**System capability**: SystemCapability.WindowManager.WindowManager.Core
- Parameters
**Parameters**
| Name | Type | Mandatory| Description |
| ---------- | ------------------------- | ---- | ------------ |
| colorSpace | [ColorSpace](#colorspace) | Yes | Color gamut mode.|
- Return value
**Return value**
| Type | Description |
| ------------------- | ----------------------------------------------- |
| Promise&lt;void&gt; | Promise used to return the execution result.|
- Example
**Example**
```js
let promise = windowClass.isSupportWideGamut(window.ColorSpace.WIDE_GAMUT);
......@@ -1612,13 +1614,13 @@ Obtains the color gamut mode of this window. This API uses an asynchronous callb
**System capability**: SystemCapability.WindowManager.WindowManager.Core
- Parameters
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ---------------------------------------------- | ---- | -------------------------- |
| callback | AsyncCallback&lt;[ColorSpace](#colorspace)&gt; | Yes | Callback used to return the color gamut mode obtained.|
- Example
**Example**
```js
windowClass.getColorSpace((err, data) => {
......@@ -1638,13 +1640,13 @@ Obtains the color gamut mode of this window. This API uses a promise to return t
**System capability**: SystemCapability.WindowManager.WindowManager.Core
- Return value
**Return value**
| Type | Description |
| ---------------------------------------- | ----------------------------------------- |
| Promise&lt;[ColorSpace](#colorspace)&gt; | Promise used to return the color gamut mode obtained.|
- Example
**Example**
```js
let promise = windowClass.getColorSpace();
......@@ -1665,14 +1667,14 @@ This API is defined but not implemented in OpenHarmony 3.1 Release. It will be a
**System capability**: SystemCapability.WindowManager.WindowManager.Core
- Parameters
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ------------------------- | ---- | ------------------------------------------------------------ |
| 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. |
- Example
**Example**
```js
var color = '#00ff33';
......@@ -1695,19 +1697,19 @@ This API is defined but not implemented in OpenHarmony 3.1 Release. It will be a
**System capability**: SystemCapability.WindowManager.WindowManager.Core
- Parameters
**Parameters**
| Name| Type | Mandatory| Description |
| ------ | ------ | ---- | ------------------------------------------------------------ |
| color | string | Yes | Background color to set. The color is a hexadecimal value, for example, #00FF00 or #FF00FF00.|
- Return value
**Return value**
| Type | Description |
| ------------------- | ----------------------------------------------- |
| Promise&lt;void&gt; | Promise used to return the execution result.|
- Example
**Example**
```js
var color = '#00ff33';
......@@ -1729,14 +1731,14 @@ This API is defined but not implemented in OpenHarmony 3.1 Release. It will be a
**System capability**: SystemCapability.WindowManager.WindowManager.Core
- Parameters
**Parameters**
| Name | Type | Mandatory| Description |
| ---------- | ------------------------- | ---- | ------------------------------------ |
| 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. |
- Example
**Example**
```js
var brightness = 1;
......@@ -1759,19 +1761,19 @@ This API is defined but not implemented in OpenHarmony 3.1 Release. It will be a
**System capability**: SystemCapability.WindowManager.WindowManager.Core
- Parameters
**Parameters**
| Name | Type | Mandatory| Description |
| ---------- | ------ | ---- | ------------------------------------ |
| brightness | number | Yes | Brightness to set, which ranges from 0 to 1. The value **1** indicates the brightest.|
- Return value
**Return value**
| Type | Description |
| ------------------- | ----------------------------------------------- |
| Promise&lt;void&gt; | Promise used to return the execution result.|
- Example
**Example**
```js
var brightness = 1;
......@@ -1793,14 +1795,14 @@ This API is defined but not implemented in OpenHarmony 3.1 Release. It will be a
**System capability**: SystemCapability.WindowManager.WindowManager.Core
- Parameters
**Parameters**
| Name | Type | Mandatory| Description |
| -------------- | ------------------------- | ---- | -------------------------------------------------- |
| dimBehindValue | number | Yes | Dimness of the window to set. The value ranges from 0 to 1. The value **1** indicates the dimmest.|
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the execution result. |
- Example
**Example**
```js
windowClass.setDimBehind(0.5, (err, data) => {
......@@ -1822,19 +1824,19 @@ This API is defined but not implemented in OpenHarmony 3.1 Release. It will be a
**System capability**: SystemCapability.WindowManager.WindowManager.Core
- Parameters
**Parameters**
| Name | Type | Mandatory| Description |
| -------------- | ------ | ---- | -------------------------------------------------- |
| dimBehindValue | number | Yes | Dimness of the window to set. The value ranges from 0 to 1. The value **1** indicates the dimmest.|
- Return value
**Return value**
| Type | Description |
| ------------------- | ----------------------------------------------- |
| Promise&lt;void&gt; | Promise used to return the execution result.|
- Example
**Example**
```js
let promise = windowClass.setDimBehind(0.5);
......@@ -1855,14 +1857,14 @@ This API is defined but not implemented in OpenHarmony 3.1 Release. It will be a
**System capability**: SystemCapability.WindowManager.WindowManager.Core
- Parameters
**Parameters**
| Name | Type | Mandatory| Description |
| ----------- | ------------------------- | ---- | ---------------------------- |
| isFocusable | boolean | Yes | Whether the window can gain focus.|
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the execution result. |
- Example
**Example**
```js
var isFocusable= true;
......@@ -1885,19 +1887,19 @@ This API is defined but not implemented in OpenHarmony 3.1 Release. It will be a
**System capability**: SystemCapability.WindowManager.WindowManager.Core
- Parameters
**Parameters**
| Name | Type | Mandatory| Description |
| ----------- | ------- | ---- | ---------------------------- |
| isFocusable | boolean | Yes | Whether the window can gain focus.|
- Return value
**Return value**
| Type | Description |
| ------------------- | ----------------------------------------------- |
| Promise&lt;void&gt; | Promise used to return the execution result.|
- Example
**Example**
```js
var isFocusable= true;
......@@ -1919,14 +1921,14 @@ This API is defined but not implemented in OpenHarmony 3.1 Release. It will be a
**System capability**: SystemCapability.WindowManager.WindowManager.Core
- Parameters
**Parameters**
| Name | Type | Mandatory| Description |
| -------------- | ------------------------- | ---- | ------------------------ |
| isKeepScreenOn | boolean | Yes | Whether to keep the screen always on.|
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the execution result. |
- Example
**Example**
```js
var isKeepScreenOn = true;
......@@ -1949,19 +1951,19 @@ This API is defined but not implemented in OpenHarmony 3.1 Release. It will be a
**System capability**: SystemCapability.WindowManager.WindowManager.Core
- Parameters
**Parameters**
| Name | Type | Mandatory| Description |
| -------------- | ------- | ---- | ------------------------ |
| isKeepScreenOn | boolean | Yes | Whether to keep the screen always on.|
- Return value
**Return value**
| Type | Description |
| ------------------- | ----------------------------------------------- |
| Promise&lt;void&gt; | Promise used to return the execution result.|
- Example
**Example**
```js
var isKeepScreenOn= true;
......@@ -1983,14 +1985,14 @@ This API is defined but not implemented in OpenHarmony 3.1 Release. It will be a
**System capability**: SystemCapability.WindowManager.WindowManager.Core
- Parameters
**Parameters**
| Name | Type | Mandatory| Description |
| --------- | ------------------------- | ---- | ---------------- |
| touchable | boolean | Yes | Whether the area outside the subwindow is touchable. The value **true** means that such an area is touchable, and **false** means the opposite.|
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the execution result. |
- Example
**Example**
```js
windowClass.setOutsideTouchable(true, (err, data) => {
......@@ -2012,19 +2014,19 @@ This API is defined but not implemented in OpenHarmony 3.1 Release. It will be a
**System capability**: SystemCapability.WindowManager.WindowManager.Core
- Parameters
**Parameters**
| Name | Type | Mandatory| Description |
| --------- | ------- | ---- | ---------------- |
| touchable | boolean | Yes | Whether the area outside the subwindow is touchable. The value **true** means that such an area is touchable, and **false** means the opposite.|
- Return value
**Return value**
| Type | Description |
| ------------------- | ----------------------------------------------- |
| Promise&lt;void&gt; | Promise used to return the execution result.|
- Example
**Example**
```js
let promise = windowClass.setOutsideTouchable(true);
......@@ -2045,14 +2047,14 @@ This API is defined but not implemented in OpenHarmony 3.1 Release. It will be a
**System capability**: SystemCapability.WindowManager.WindowManager.Core
- Parameters
**Parameters**
| Name | Type | Mandatory| Description |
| ------------- | ------------------------- | ---- | -------------------- |
| isPrivacyMode | boolean | Yes | Whether the window is in privacy mode.|
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the execution result. |
- Example
**Example**
```js
var isPrivacyMode = true;
......@@ -2076,19 +2078,19 @@ This API is defined but not implemented in OpenHarmony 3.1 Release. It will be a
**System capability**: SystemCapability.WindowManager.WindowManager.Core
- Parameters
**Parameters**
| Name | Type | Mandatory| Description |
| ------------- | ------- | ---- | -------------------- |
| isPrivacyMode | boolean | Yes | Whether the window is in privacy mode.|
- Return value
**Return value**
| Type | Description |
| ------------------- | ----------------------------------------------- |
| Promise&lt;void&gt; | Promise used to return the execution result.|
- Example
**Example**
```js
var isPrivacyMode = true;
......@@ -2110,14 +2112,14 @@ This API is defined but not implemented in OpenHarmony 3.1 Release. It will be a
**System capability**: SystemCapability.WindowManager.WindowManager.Core
- Parameters
**Parameters**
| Name | Type | Mandatory| Description |
| ----------- | ------------------------- | ---- | -------------------- |
| isTouchable | boolean | Yes | Whether the window is touchable.|
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the execution result. |
- Example
**Example**
```js
var isTouchable = true;
......@@ -2141,19 +2143,19 @@ This API is defined but not implemented in OpenHarmony 3.1 Release. It will be a
**System capability**: SystemCapability.WindowManager.WindowManager.Core
- Parameters
**Parameters**
| Name | Type | Mandatory| Description |
| ----------- | ------- | ---- | -------------------- |
| isTouchable | boolean | Yes | Whether the window is touchable.|
- Return value
**Return value**
| Type | Description |
| ------------------- | ----------------------------------------------- |
| Promise&lt;void&gt; | Promise used to return the execution result.|
- Example
**Example**
```js
var isTouchable = true;
......@@ -2165,7 +2167,7 @@ This API is defined but not implemented in OpenHarmony 3.1 Release. It will be a
});
```
## WindowStageEventType<sup>9+</sup><a name="windowstageeventtype9"></a>
## WindowStageEventType<sup>9+</sup>
Describes the lifecycle of a window stage.
......@@ -2190,13 +2192,13 @@ Obtains the main window of this window stage. This API uses a promise to return
**System capability**: SystemCapability.WindowManager.WindowManager.Core
- Return value
**Return value**
| Type | Description |
| -------------------------------- | ---------------------------------------------------------- |
| Promise&lt;[Window](#window)&gt; | Promise used to return the main window.|
- Example
**Example**
```ts
class myAbility extends Ability {
......@@ -2222,13 +2224,13 @@ Obtains the main window of this window stage. This API uses an asynchronous call
**System capability**: SystemCapability.WindowManager.WindowManager.Core
- Parameters
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | -------------------------------------- | ---- | --------------------------------------- |
| callback | AsyncCallback&lt;[Window](#window)&gt; | Yes | Callback used to return the main window.|
- Example
**Example**
```ts
class myAbility extends Ability {
......@@ -2255,19 +2257,19 @@ Creates a subwindow for this window stage. This API uses a promise to return the
**System capability**: SystemCapability.WindowManager.WindowManager.Core
- Parameters
**Parameters**
| Name| Type | Mandatory| Description |
| ------ | ------ | ---- | -------------- |
| name | String | Yes | Name of the subwindow.|
- Return value
**Return value**
| Type | Description |
| -------------------------------- | ------------------------------------------------- |
| Promise&lt;[Window](#window)&gt; | Promise used to return the subwindow created.|
- Example
**Example**
```ts
class myAbility extends Ability {
......@@ -2293,14 +2295,14 @@ Creates a subwindow for this window stage. This API uses an asynchronous callbac
**System capability**: SystemCapability.WindowManager.WindowManager.Core
- Parameters
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | -------------------------------------- | ---- | ------------------------------ |
| name | String | Yes | Name of the subwindow. |
| callback | AsyncCallback&lt;[Window](#window)&gt; | Yes | Callback used to return the subwindow created.|
- Example
**Example**
```ts
class myAbility extends Ability {
......@@ -2328,13 +2330,13 @@ Obtains all the subwindows of this window stage. This API uses a promise to retu
**System capability**: SystemCapability.WindowManager.WindowManager.Core
- Return value
**Return value**
| Type | Description |
| --------------------------------------------- | ------------------------------------------------------------ |
| Promise&lt;Array&lt;[Window](#window)&gt;&gt; | Promise used to return all the subwindows.|
- Example
**Example**
```ts
class myAbility extends Ability {
......@@ -2360,13 +2362,13 @@ Obtains all the subwindows of this window stage. This API uses an asynchronous c
**System capability**: SystemCapability.WindowManager.WindowManager.Core
- Parameters
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | --------------------------------------------------- | ---- | ------------------------------------------- |
| callback | AsyncCallback&lt;Array&lt;[Window](#window)&gt;&gt; | Yes | Callback used to return all the subwindows.|
- Example
**Example**
```ts
class myAbility extends Ability {
......@@ -2393,14 +2395,14 @@ Loads content to this window stage. This API uses an asynchronous callback to re
**System capability**: SystemCapability.WindowManager.WindowManager.Coretype with the value 'windowSizeChange'
- Parameters
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ------------------------- | ---- | -------------------- |
| 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. |
- Example
**Example**
```ts
class myAbility extends Ability {
......@@ -2425,14 +2427,14 @@ Enables listening for window stage lifecycle changes.
**System capability**: SystemCapability.WindowManager.WindowManager.Core
- Parameters
**Parameters**
| 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 | Type of event to listen for. The value is fixed at **windowStageEvent**, indicating the window stage lifecycle change event.|
| callback | Callback&lt;[WindowStageEventType](#windowstageeventtype9)&gt; | Yes | Callback used to return the information. |
- Example
**Example**
```ts
class myAbility extends Ability {
......@@ -2454,14 +2456,14 @@ Disables listening for window stage lifecycle changes.
**System capability**: SystemCapability.WindowManager.WindowManager.Core
- Parameters
**Parameters**
| 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 | Type of event to listen for. The value is fixed at **windowStageEvent**, indicating the window stage lifecycle change event.|
| callback | Callback&lt;[WindowStageEventType](#windowstageeventtype9)&gt; | No | Callback used to return the information. |
- Example
**Example**
```ts
class myAbility extends Ability {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册