From adfdbb9304c0a7b6d43e3fce091a84a47987e798 Mon Sep 17 00:00:00 2001 From: wusongqing Date: Fri, 10 Jun 2022 11:37:22 +0800 Subject: [PATCH] updated window api Signed-off-by: wusongqing --- .../reference/apis/js-apis-window.md | 72 +++++++++++++++---- 1 file changed, 57 insertions(+), 15 deletions(-) diff --git a/en/application-dev/reference/apis/js-apis-window.md b/en/application-dev/reference/apis/js-apis-window.md index c0eb15d9ad..885802b449 100644 --- a/en/application-dev/reference/apis/js-apis-window.md +++ b/en/application-dev/reference/apis/js-apis-window.md @@ -18,10 +18,23 @@ Enumerates the window types. **System capability**: SystemCapability.WindowManager.WindowManager.Core -| Name | Default Value| Description | +| Name | Default Value | Description | | ----------------- | ------ | ------------------ | | TYPE_APP | 0 | Application subwindow. | | TYPE_SYSTEM_ALERT | 1 | System alert window.| +| TYPE_INPUT_METHOD9+ | 2 | Input method window.| +| TYPE_STATUS_BAR9+ | 3 | Status bar.| +| TYPE_PANEL9+ | 4 | Notification panel.| +| TYPE_KEYGUARD9+ | 5 | Lock screen.| +| TYPE_VOLUME_OVERLAY9+ | 6 | Volume bar.| +| TYPE_NAVIGATION_BAR9+ | 7 | Navigation bar.| +| TYPE_FLOAT9+ | 8 | Floating window.| +| TYPE_WALLPAPER9+ | 9 | Wallpaper.| +| TYPE_DESKTOP9+ | 10 | Home screen.| +| TYPE_LAUNCHER_RECENT9+ | 11 | Recent tasks screen.| +| TYPE_LAUNCHER_DOCK9+ | 12 | Dock bar on the home screen.| +| TYPE_VOICE_INTERACTION9+ | 13 | Voice assistant.| +| TYPE_POINTER9+ | 14 | Mouse.| ## AvoidAreaType7+ @@ -29,7 +42,7 @@ Enumerates the types of the area where the window cannot be displayed. **System capability**: SystemCapability.WindowManager.WindowManager.Core -| Name | Default Value| Description | +| Name | Default Value | Description | | ----------- | ------ | ------------------ | | TYPE_SYSTEM | 0 | Default area of the system.| | TYPE_CUTOUT | 1 | Notch. | @@ -42,7 +55,7 @@ This is a system API and cannot be called by third-party applications. **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. | | FULLSCREEN | 2 | The application is displayed in full screen. | @@ -158,7 +171,7 @@ Describes the color gamut mode. **System capability**: SystemCapability.WindowManager.WindowManager.Core -| Name | Default Value| Description | +| Name | Default Value | Description | | ---------- | ------ | -------------- | | DEFAULT | 0 | Default color gamut mode.| | WIDE_GAMUT | 1 | Wide color gamut mode. | @@ -236,7 +249,7 @@ This API is deprecated since API version 8. You are advised to use [window.creat create(ctx: Context, id: string, type: WindowType, callback: AsyncCallback<Window>): void -Creates a subwindow (in API version 8) or a system window (since API version 9). This API uses an asynchronous callback to return the result. +Creates a subwindow (in API version 8) or a system window (from API version 9). This API uses an asynchronous callback to return the result. **System capability**: SystemCapability.WindowManager.WindowManager.Core @@ -244,7 +257,7 @@ Creates a subwindow (in API version 8) or a system window (since API version 9). | 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 [ServiceExtensionContext](js-apis-service-extension-context.md). | +| 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 [ServiceExtensionContext](js-apis-service-extension-context.md).| | id | string | Yes | Window ID. | | type | [WindowType](#windowtype) | Yes | Window type. | | callback | AsyncCallback<[Window](#window)> | Yes | Callback used to return the window created. | @@ -268,7 +281,7 @@ Creates a subwindow (in API version 8) or a system window (since API version 9). create(ctx: Context, id: string, type: WindowType): Promise<Window> -Creates a subwindow (in API version 8) or a system window (since API version 9). This API uses a promise to return the result. +Creates a subwindow (in API version 8) or a system window (from API version 9). This API uses a promise to return the result. **System capability**: SystemCapability.WindowManager.WindowManager.Core @@ -276,7 +289,7 @@ Creates a subwindow (in API version 8) or a system window (since API version 9). | 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 [ServiceExtensionContext](js-apis-service-extension-context.md). | +| 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 [ServiceExtensionContext](js-apis-service-extension-context.md).| | id | string | Yes | Window ID. | | type | [WindowType](#windowtype) | Yes | Window type. | @@ -432,7 +445,7 @@ Obtains the top window of the current application. This API uses an asynchronous | 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.
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 [AbilityContext](js-apis-ability-context.md). | | callback | AsyncCallback<[Window](#window)> | Yes | Callback used to return the top window obtained. | **Example** @@ -461,7 +474,7 @@ Obtains the top window of the current application. This API uses a promise to re | 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.
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 [AbilityContext](js-apis-ability-context.md). | **Return value** @@ -1779,8 +1792,9 @@ setDimBehind(dimBehindValue: number, callback: AsyncCallback<void>): void Sets the dimness of the window that is not on top. This API uses an asynchronous callback to return the result. -> This API is supported since API version 7 and deprecated since API version 9. +> **NOTE** > +> This API is supported since API version 7 and deprecated since API version 9. **System capability**: SystemCapability.WindowManager.WindowManager.Core @@ -1809,8 +1823,9 @@ setDimBehind(dimBehindValue: number): Promise<void> Sets the dimness of the window that is not on top. This API uses a promise to return the result. -> This API is supported since API version 7 and deprecated since API version 9. +> **NOTE** > +> This API is supported since API version 7 and deprecated since API version 9. **System capability**: SystemCapability.WindowManager.WindowManager.Core @@ -1931,8 +1946,9 @@ setOutsideTouchable(touchable: boolean, callback: AsyncCallback<void>): vo Sets whether the area outside the subwindow is touchable. This API uses an asynchronous callback to return the result. -> This API is supported since API version 7 and deprecated since API version 9. +> **NOTE** > +> This API is supported since API version 7 and deprecated since API version 9. **System capability**: SystemCapability.WindowManager.WindowManager.Core @@ -1961,8 +1977,9 @@ setOutsideTouchable(touchable: boolean): Promise<void> Sets whether the area outside the subwindow is touchable. This API uses a promise to return the result. -> This API is supported since API version 7 and deprecated since API version 9. +> **NOTE** > +> This API is supported since API version 7 and deprecated since API version 9. **System capability**: SystemCapability.WindowManager.WindowManager.Core @@ -2149,7 +2166,7 @@ Describes the lifecycle of a window stage. **System capability**: SystemCapability.WindowManager.WindowManager.Core -| Name | Default Value| Description | +| Name | Default Value | Description | | ---------- | ------ | -------- | | FOREGROUND | 1 | The window stage is running in the foreground.| | ACTIVE | 2 | The window stage gains focus.| @@ -2450,3 +2467,28 @@ Disables listening for window stage lifecycle changes. } } ``` + +### setShowOnLockScreen('showOnLockScreen')9+ + +setShowOnLockScreen(showOnLockScreen: boolean): void + +Sets whether to display the window of the application on the lock screen. + +**System capability**: SystemCapability.WindowManager.WindowManager.Core + +**Parameters** + +| Name | Type | Mandatory| Description | +| ---------------- | ------- | ---- | ---------------------------- | +| showOnLockScreen | boolean | Yes | Whether to display the window on the lock screen.| + +**Example** + +```ts +class myAbility extends Ability { + onWindowStageCreate(windowStage) { + console.log('onWindowStageCreate'); + windowStage.setShowOnLockScreen(true); + } +} +``` -- GitLab