| TYPE_APP | 0 | Application subwindow. This type can be used only in the FA model.|
| TYPE_APP | 0 | Application subwindow.<br>**Model restriction**: This API can be used only in the FA model.|
| TYPE_SYSTEM_ALERT | 1 | System alert window.|
| TYPE_SYSTEM_ALERT | 1 | System alert window.|
| TYPE_INPUT_METHOD<sup>9+</sup> | 2 | Input method window. This type can be used only in the stage model.<br>This is a system API and cannot be called by third-party applications.|
| TYPE_INPUT_METHOD<sup>9+</sup> | 2 | Input method window.<br>**Model restriction**: This API can be used only in the stage model.<br>**System API**: This is a system API.|
| TYPE_STATUS_BAR<sup>9+</sup> | 3 | Status bar. This type can be used only in the stage model.<br>This is a system API and cannot be called by third-party applications.|
| TYPE_STATUS_BAR<sup>9+</sup> | 3 | Status bar.<br>**Model restriction**: This API can be used only in the stage model.<br>**System API**: This is a system API.|
| TYPE_PANEL<sup>9+</sup> | 4 | Notification panel. This type can be used only in the stage model.<br>This is a system API and cannot be called by third-party applications.|
| TYPE_PANEL<sup>9+</sup> | 4 | Notification panel.<br>**Model restriction**: This API can be used only in the stage model.<br>**System API**: This is a system API.|
| TYPE_KEYGUARD<sup>9+</sup> | 5 | Lock screen. This type can be used only in the stage model.<br>This is a system API and cannot be called by third-party applications.|
| TYPE_KEYGUARD<sup>9+</sup> | 5 | Lock screen.<br>**Model restriction**: This API can be used only in the stage model.<br>**System API**: This is a system API.|
| TYPE_VOLUME_OVERLAY<sup>9+</sup> | 6 | Volume bar. This type can be used only in the stage model.<br>This is a system API and cannot be called by third-party applications.|
| TYPE_VOLUME_OVERLAY<sup>9+</sup> | 6 | Volume bar.<br>**Model restriction**: This API can be used only in the stage model.<br>**System API**: This is a system API.|
| TYPE_NAVIGATION_BAR<sup>9+</sup> | 7 | Navigation bar. This type can be used only in the stage model.<br>This is a system API and cannot be called by third-party applications.|
| TYPE_NAVIGATION_BAR<sup>9+</sup> | 7 | Navigation bar.<br>**Model restriction**: This API can be used only in the stage model.<br>**System API**: This is a system API.|
| TYPE_FLOAT<sup>9+</sup> | 8 | Floating window. This type can be used only in the stage model.<br>**Required permissions**: ohos.permission.SYSTEM_FLOAT_WINDOW|
| TYPE_FLOAT<sup>9+</sup> | 8 | Floating window.<br>**Model restriction**: This API can be used only in the stage model.<br>**Required permissions**: ohos.permission.SYSTEM_FLOAT_WINDOW|
| TYPE_WALLPAPER<sup>9+</sup> | 9 | Wallpaper. This type can be used only in the stage model.<br>This is a system API and cannot be called by third-party applications.|
| TYPE_WALLPAPER<sup>9+</sup> | 9 | Wallpaper.<br>**Model restriction**: This API can be used only in the stage model.<br>**System API**: This is a system API.|
| TYPE_DESKTOP<sup>9+</sup> | 10 | Home screen. This type can be used only in the stage model.<br>This is a system API and cannot be called by third-party applications.|
| TYPE_DESKTOP<sup>9+</sup> | 10 | Home screen.<br>**Model restriction**: This API can be used only in the stage model.<br>**System API**: This is a system API.|
| TYPE_LAUNCHER_RECENT<sup>9+</sup> | 11 | Recent tasks screen. This type can be used only in the stage model.<br>This is a system API and cannot be called by third-party applications.|
| TYPE_LAUNCHER_RECENT<sup>9+</sup> | 11 | Recent tasks screen.<br>**Model restriction**: This API can be used only in the stage model.<br>**System API**: This is a system API.|
| TYPE_LAUNCHER_DOCK<sup>9+</sup> | 12 | Dock bar on the home screen. This type can be used only in the stage model.<br>This is a system API and cannot be called by third-party applications.|
| TYPE_LAUNCHER_DOCK<sup>9+</sup> | 12 | Dock bar on the home screen.<br>**Model restriction**: This API can be used only in the stage model.<br>**System API**: This is a system API.|
| TYPE_VOICE_INTERACTION<sup>9+</sup> | 13 | Voice assistant. This type can be used only in the stage model.<br>This is a system API and cannot be called by third-party applications.|
| TYPE_VOICE_INTERACTION<sup>9+</sup> | 13 | Voice assistant.<br>**Model restriction**: This API can be used only in the stage model.<br>**System API**: This is a system API.|
| TYPE_POINTER<sup>9+</sup> | 14 | Mouse. This type can be used only in the stage model.<br>This is a system API and cannot be called by third-party applications.|
| TYPE_POINTER<sup>9+</sup> | 14 | Mouse.<br>**Model restriction**: This API can be used only in the stage model.<br>**System API**: This is a system API.|
## AvoidAreaType<sup>7+</sup>
## AvoidAreaType<sup>7+</sup>
...
@@ -58,7 +58,7 @@ Enumerates the types of the area where the window cannot be displayed.
...
@@ -58,7 +58,7 @@ Enumerates the types of the area where the window cannot be displayed.
Enumerates the window modes.
Enumerates the window modes.
This is a system API and cannot be called by third-party applications.
| 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`. |
...
@@ -201,7 +201,7 @@ Describes the window properties.
...
@@ -201,7 +201,7 @@ Describes the window properties.
| 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. |
| brightness | number | Yes | Yes | Screen brightness. The value ranges from 0 to 1. The value `1` indicates the maximum brightness. |
| dimBehindValue<sup>(deprecated)</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>**NOTE**<br>This attribute is deprecated since API version 9.<br> |
| dimBehindValue<sup>(deprecated)</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>**NOTE**<br>This property is supported since API version 7 and deprecated since API version 9.<br> |
| isKeepScreenOn | boolean | Yes | Yes | Whether the screen is always on. The default value is `false`. |
| isKeepScreenOn | boolean | Yes | Yes | Whether the screen is always on. The default value is `false`. |
| isPrivacyMode<sup>7+</sup> | boolean | Yes | Yes | Whether the window is in privacy mode. The default value is `false`. |
| isPrivacyMode<sup>7+</sup> | boolean | Yes | Yes | Whether the window is in privacy mode. The default value is `false`. |
| isRoundCorner<sup>7+</sup> | boolean | Yes | Yes | Whether the window has rounded corners. The default value is `false`. |
| isRoundCorner<sup>7+</sup> | boolean | Yes | Yes | Whether the window has rounded corners. The default value is `false`. |
console.info('Succeeded in creating the subWindow. Data: '+JSON.stringify(data));
}).catch((err)=>{
}).catch((err)=>{
console.error('Failed to create the subWindow. Cause: '+JSON.stringify(err));
console.error('Failed to create the subWindow. Cause: '+JSON.stringify(err));
});
});
...
@@ -300,7 +301,7 @@ Creates a subwindow (in API version 8) or a system window (from API version 9).
...
@@ -300,7 +301,7 @@ Creates a subwindow (in API version 8) or a system window (from API version 9).
| 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 [ServiceExtensionContext](js-apis-service-extension-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 [ServiceExtensionContext](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<[Window](#window)> | Yes | Callback used to return the window created. |
| callback | AsyncCallback<[Window](#window)> | Yes | Callback used to return the subwindow created. |
**Example**
**Example**
...
@@ -308,11 +309,11 @@ Creates a subwindow (in API version 8) or a system window (from API version 9).
...
@@ -308,11 +309,11 @@ Creates a subwindow (in API version 8) or a system window (from API version 9).
| type | [AvoidAreaType](#avoidareatype7) | Yes | Type of the area. `TYPE_SYSTEM` indicates the default area of the system. `TYPE_CUTOUT` indicates the notch. **TYPE_SYSTEM_GESTURE** indicates the gesture area. **TYPE_KEYBOARD** indicates the soft keyboard area.|
| type | [AvoidAreaType](#avoidareatype7) | Yes | Type of the area. `TYPE_SYSTEM` indicates the default area of the system. `TYPE_CUTOUT` indicates the notch. `TYPE_SYSTEM_GESTURE` indicates the gesture area. `TYPE_KEYBOARD` indicates the soft keyboard area.|
| callback | AsyncCallback<[AvoidArea](#avoidarea7)> | Yes | Callback used to return the area. |
| callback | AsyncCallback<[AvoidArea](#avoidarea7)> | Yes | Callback used to return the area. |
**Example**
**Example**
...
@@ -1211,7 +1212,7 @@ Obtains the area where this window cannot be displayed, for example, the system
...
@@ -1211,7 +1212,7 @@ Obtains the area where this window cannot be displayed, for example, the system
| type | [AvoidAreaType](#avoidareatype7) | Yes | Type of the area. `TYPE_SYSTEM` indicates the default area of the system. `TYPE_CUTOUT` indicates the notch. **TYPE_SYSTEM_GESTURE** indicates the gesture area. **TYPE_KEYBOARD** indicates the soft keyboard area.|
| type | [AvoidAreaType](#avoidareatype7) | Yes | Type of the area. `TYPE_SYSTEM` indicates the default area of the system. `TYPE_CUTOUT` indicates the notch. `TYPE_SYSTEM_GESTURE` indicates the gesture area. `TYPE_KEYBOARD` indicates the soft keyboard area.|
**Return value**
**Return value**
...
@@ -1368,13 +1369,14 @@ Sets whether to display the status bar and navigation bar in this window. This A
...
@@ -1368,13 +1369,14 @@ Sets whether to display the status bar and navigation bar in this window. This A
**Example**
**Example**
```js
```js
varnames=["status","navigation"];
// In this example, the status bar and navigation bar are not displayed.
| 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. |
| storage | LocalStorage | Yes | A storage unit, which provides storage for variable state properties and non-variable state properties of an application.|
| storage | [LocalStorage](../../ui/ui-ts-local-storage.md) | Yes | A storage unit, which provides storage for variable state properties and non-variable state properties of an application.|
| callback | AsyncCallback<void> | Yes | Callback used to return the result. |
| callback | AsyncCallback<void> | Yes | Callback used to return the result. |
| 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. |
| storage | LocalStorage | Yes | A storage unit, which provides storage for variable state properties and non-variable state properties of an application.|
| storage | [LocalStorage](../../ui/ui-ts-local-storage.md) | Yes | A storage unit, which provides storage for variable state properties and non-variable state properties of an application.|
Disables listening for changes to the area where the window cannot be displayed.
Disables listening for changes to the area where the window cannot be displayed.
> **NOTE**
> **NOTE**<br> This API is supported since API version 7 and deprecated since API version 9. Use [off('avoidAreaChange')](#offavoidareachange9) instead.
>
>
>
> This API is deprecated since API version 9. Use [off('avoidAreaChange')](#offavoidareachange9) instead.
@@ -1850,8 +1853,8 @@ Enables listening for changes to the area where the window cannot be displayed.
...
@@ -1850,8 +1853,8 @@ Enables listening for changes to the area where the window cannot be displayed.
**Example**
**Example**
```js
```js
windowClass.on('avoidAreaChange',(type,data)=>{
windowClass.on('avoidAreaChange',(data)=>{
console.info('Succeeded in enabling the listener for system avoid area changes. type:'+JSON.stringify(type)+'Data: '+JSON.stringify(data));
console.info('Succeeded in enabling the listener for system avoid area changes. type:'+JSON.stringify(data.type)+', area: '+JSON.stringify(data.area));
| color | string | Yes | Background color to set. The value is a hexadecimal color value and is case insensitive, for example, `#00FF00` or `#FF00FF00`.|
| color | string | Yes | Background color to set. The value is a hexadecimal color and is case insensitive, for example, `#00FF00` or `#FF00FF00`.|
| callback | AsyncCallback<void> | Yes | Callback used to return the result. |
| callback | AsyncCallback<void> | Yes | Callback used to return the result. |
**Example**
**Example**
...
@@ -2166,7 +2171,7 @@ Sets the background color for this window. This API uses a promise to return the
...
@@ -2166,7 +2171,7 @@ Sets the background color for this window. This API uses a promise to return the
| color | string | Yes | Background color to set. The value is a hexadecimal color value and is case insensitive, for example, `#00FF00` or `#FF00FF00`.|
| color | string | Yes | Background color to set. The value is a hexadecimal color and is case insensitive, for example, `#00FF00` or `#FF00FF00`.|
**Return value**
**Return value**
...
@@ -2254,7 +2259,9 @@ Sets the dimness of the window that is not on top. This API uses an asynchronous
...
@@ -2254,7 +2259,9 @@ Sets the dimness of the window that is not on top. This API uses an asynchronous
> **NOTE**
> **NOTE**
>
>
> This API is deprecated since API version 9.
> This API cannot be used.
>
> This API is supported since API version 7 and deprecated since API version 9.
Sets whether this window is in privacy mode. This API uses an asynchronous callback to return the result.
Sets whether this window is in privacy mode. This API uses an asynchronous callback to return the result. When in privacy mode, the window content cannot be captured or recorded.
Sets whether this window is in privacy mode. This API uses a promise to return the result.
Sets whether this window is in privacy mode. This API uses a promise to return the result. When in privacy mode, the window content cannot be captured or recorded.
Loads content from a page associated with a local storage to the main window in this window stage. This API uses an asynchronous callback to return the result.
Loads content from a page associated with a local storage to the main window in this window stage. This API uses an asynchronous callback to return the result.
This API can be used only in the stage model.
**Model restriction**: This API can be used only in the stage model.
| 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. |
| storage | LocalStorage | Yes | A storage unit, which provides storage for variable state properties and non-variable state properties of an application.|
| storage | [LocalStorage](../../ui/ui-ts-local-storage.md) | Yes | A storage unit, which provides storage for variable state properties and non-variable state properties of an application.|
| callback | AsyncCallback<void> | Yes | Callback used to return the result. |
| callback | AsyncCallback<void> | Yes | Callback used to return the result. |
| 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. |
| storage | LocalStorage | No | A storage unit, which provides storage for variable state properties and non-variable state properties of an application.|
| storage | [LocalStorage](../../ui/ui-ts-local-storage.md) | No | A storage unit, which provides storage for variable state properties and non-variable state properties of an application.|