提交 d2749631 编写于 作者: G Gloria

Update docs against 14734+14483+14783

Signed-off-by: wusongqing<wusongqing@huawei.com>
上级 4083258f
......@@ -724,8 +724,8 @@ Defines virtual screen parameters.
| Name | Type| Readable| Writable| Description |
| --------- | -------- | ---- | ---- | ------------------------- |
| name | string | Yes | Yes | Name of a virtual screen. |
| width | number | Yes | Yes | Width of the virtual screen. |
| height | number | Yes | Yes | Height of the virtual screen. |
| width | number | Yes | Yes | Width of the virtual screen, in pixels.|
| height | number | Yes | Yes | Height of the virtual screen, in pixels.|
| density | number | Yes | Yes | Density of the virtual screen. |
| surfaceId | string | Yes | Yes | Surface ID of the virtual screen.|
......@@ -1006,6 +1006,6 @@ Defines the screen mode information.
| Name | Type| Readable| Writable| Description |
| ----------- | -------- | ---- | ---- | -------------------------------------------------- |
| id | number | Yes | Yes | Mode ID. The supported mode is determined by the device resolution and refresh rate.|
| width | number | Yes | Yes | Screen width. |
| height | number | Yes | Yes | Screen height. |
| width | number | Yes | Yes | Width of the screen, in pixels. |
| height | number | Yes | Yes | Height of the screen, in pixels. |
| refreshRate | number | Yes | Yes | Screen refresh rate. |
......@@ -188,10 +188,10 @@ Describes the rectangular area of the window.
| Name | Type| Readable| Writable| Description |
| ------ | -------- | ---- | ---- | ------------------ |
| left | number | Yes | Yes | Left boundary of the rectangle.|
| top | number | Yes | Yes | Top boundary of the rectangle.|
| width | number | Yes | Yes | Width of the rectangle. |
| height | number | Yes | Yes | Height of the rectangle. |
| left | number | Yes | Yes | Left boundary of the rectangle, in pixels.|
| top | number | Yes | Yes | Top boundary of the rectangle, in pixels.|
| width | number | Yes | Yes | Width of the rectangle, in pixels.|
| height | number | Yes | Yes | Height of the rectangle, in pixels.|
## AvoidArea<sup>7+</sup>
......@@ -215,8 +215,8 @@ Describes the window size.
| Name | Type| Readable| Writable| Description |
| ------ | -------- | ---- | ---- | ---------- |
| width | number | Yes | Yes | Window width.|
| height | number | Yes | Yes | Window height.|
| width | number | Yes | Yes | Window width, in pixels.|
| height | number | Yes | Yes | Window height, in pixels.|
## WindowProperties
......@@ -824,7 +824,7 @@ create(id: string, type: WindowType, callback: AsyncCallback&lt;Window&gt;): voi
Creates a subwindow. This API uses an asynchronous callback to return the result.
> **NOTE**
>
>
> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [createWindow()](#windowcreatewindow9) instead.
**Model restriction**: This API can be used only in the FA model.
......@@ -860,7 +860,7 @@ create(id: string, type: WindowType): Promise&lt;Window&gt;
Creates a subwindow. This API uses a promise to return the result.
> **NOTE**
>
>
> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [createWindow()](#windowcreatewindow9-1) instead.
**Model restriction**: This API can be used only in the FA model.
......@@ -900,7 +900,7 @@ create(ctx: BaseContext, id: string, type: WindowType, callback: AsyncCallback&l
Creates a system window. This API uses an asynchronous callback to return the result.
> **NOTE**
>
>
> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [createWindow()](#windowcreatewindow9) instead.
**System capability**: SystemCapability.WindowManager.WindowManager.Core
......@@ -936,7 +936,7 @@ create(ctx: BaseContext, id: string, type: WindowType): Promise&lt;Window&gt;
Creates a system window. This API uses a promise to return the result.
> **NOTE**
>
>
> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [createWindow()](#windowcreatewindow9-1) instead.
**System capability**: SystemCapability.WindowManager.WindowManager.Core
......@@ -975,7 +975,7 @@ find(id: string, callback: AsyncCallback&lt;Window&gt;): void
Finds a window based on the ID. This API uses an asynchronous callback to return the result.
> **NOTE**
>
>
> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [findWindow()](#windowfindwindow9) instead.
**System capability**: SystemCapability.WindowManager.WindowManager.Core
......@@ -1008,7 +1008,7 @@ find(id: string): Promise&lt;Window&gt;
Finds a window based on the ID. This API uses a promise to return the result.
> **NOTE**
>
>
> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [findWindow()](#windowfindwindow9) instead.
**System capability**: SystemCapability.WindowManager.WindowManager.Core
......@@ -1045,7 +1045,7 @@ getTopWindow(callback: AsyncCallback&lt;Window&gt;): void
Obtains the top window of the current application. This API uses an asynchronous callback to return the result.
> **NOTE**
>
>
> This API is supported since API version 6 and deprecated since API version 9. You are advised to use [getLastWindow()](#windowgetlastwindow9) instead.
**Model restriction**: This API can be used only in the FA model.
......@@ -1079,7 +1079,7 @@ getTopWindow(): Promise&lt;Window&gt;
Obtains the top window of the current application. This API uses a promise to return the result.
> **NOTE**
>
>
> This API is supported since API version 6 and deprecated since API version 9. You are advised to use [getLastWindow()](#windowgetlastwindow9-1) instead.
**Model restriction**: This API can be used only in the FA model.
......@@ -1112,7 +1112,7 @@ getTopWindow(ctx: BaseContext, callback: AsyncCallback&lt;Window&gt;): void
Obtains the top window of the current application. This API uses an asynchronous callback to return the result.
> **NOTE**
>
>
> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [getLastWindow()](#windowgetlastwindow9) instead.
**System capability**: SystemCapability.WindowManager.WindowManager.Core
......@@ -1145,7 +1145,7 @@ getTopWindow(ctx: BaseContext): Promise&lt;Window&gt;
Obtains the top window of the current application. This API uses a promise to return the result.
> **NOTE**
>
>
> This API is supported since API version 8 and deprecated since API version 9. You are advised to use [getLastWindow()](#windowgetlastwindow9-1) instead.
**System capability**: SystemCapability.WindowManager.WindowManager.Core
......@@ -2735,58 +2735,6 @@ try {
}
```
### on('dialogTargetTouch')<sup>9+</sup>
on(type: 'dialogTargetTouch', callback: Callback&lt;void&gt;): void
Subscribes to click events of the target window in the modal window mode.
**System capability**: SystemCapability.WindowManager.WindowManager.Core
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ------------------- | ---- | ------------------------------------------------------------ |
| type | string | Yes | Event type. The value is fixed at **'dialogTargetTouch'**, indicating the click event of the target window in the modal window mode.|
| callback | Callback&lt;void&gt;| Yes | Callback invoked when the click event occurs in the target window of the modal window mode.|
**Example**
```js
try {
windowClass.on('dialogTargetTouch', () => {
console.info('touch dialog target');
});
} catch (exception) {
console.error('Failed to register callback. Cause: ' + JSON.stringify(exception));
}
```
### off('dialogTargetTouch')<sup>9+</sup>
off(type: 'dialogTargetTouch', callback?: Callback&lt;void&gt;): void
Unsubscribes from click events of the target window in the modal window mode.
**System capability**: SystemCapability.WindowManager.WindowManager.Core
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ---------------------- | ---- | ------------------------------------------------------------ |
| type | string | Yes | Event type. The value is fixed at **'dialogTargetTouch'**, indicating the click event of the target window in the modal window mode.|
| callback | Callback&lt;void&gt; | No | Callback invoked when the click event occurs in the target window of the modal window mode.|
**Example**
```js
try {
windowClass.off('dialogTargetTouch');
} catch (exception) {
console.error('Failed to unregister callback. Cause: ' + JSON.stringify(exception));
}
```
### bindDialogTarget<sup>9+</sup>
bindDialogTarget(token: rpc.RemoteObject, deathCallback: Callback&lt;void&gt;, callback: AsyncCallback&lt;void&gt;): void
......@@ -3116,7 +3064,7 @@ Sets the background color for this window. In the stage model, this API must be
| Name| Type| Mandatory| Description|
| ----- | ------ | -- | ----------------------------------------------------------------------- |
| color | string | Yes| Background color to set. The value is a hexadecimal color code and is case insensitive, for example, **#00FF00** or **#FF00FF00**.|
| color | string | Yes| Background color to set. The value is a hexadecimal RGB or aRGB color code and is case insensitive, for example, **#00FF00** or **#FF00FF00**.|
**Error codes**
......@@ -4136,7 +4084,7 @@ Sets the shadow for the window borders.
| Name | Type | Mandatory | Description |
| ------- | ------ | --------- | ------------------------------------------------------------ |
| radius | number | Yes | Radius of the shadow. The value is greater than or equal to 0. The value **0** means that the shadow is disabled for the window borders. |
| color | string | No | Color of the shadow. The value is a hexadecimal color code and is case insensitive, for example, **#00FF00** or **#FF00FF00**. |
| color | string | No | Color of the shadow. The value is a hexadecimal RGB or aRGB color code and is case insensitive, for example, **#00FF00** or **#FF00FF00**. |
| offsetX | number | No | Offset of the shadow along the x-axis, in pixels. |
| offsetY | number | No | Offset of the shadow along the y-axis, in pixels. |
......@@ -5330,7 +5278,7 @@ Sets the background color for this window. This API uses an asynchronous callbac
| Name | Type | Mandatory | Description |
| -------- | ------------------------- | --------- | ------------------------------------------------------------ |
| color | string | Yes | Background color to set. The value is a hexadecimal color code and is case insensitive, for example, **#00FF00** or **#FF00FF00**. |
| color | string | Yes | Background color to set. The value is a hexadecimal RGB or aRGB color code and is case insensitive, for example, **#00FF00** or **#FF00FF00**. |
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result. |
**Example**
......@@ -5362,7 +5310,7 @@ Sets the background color for this window. This API uses a promise to return the
| Name | Type | Mandatory | Description |
| ----- | ------ | --------- | ------------------------------------------------------------ |
| color | string | Yes | Background color to set. The value is a hexadecimal color code and is case insensitive, for example, **#00FF00** or **#FF00FF00**. |
| color | string | Yes | Background color to set. The value is a hexadecimal RGB or aRGB color code and is case insensitive, for example, **#00FF00** or **#FF00FF00**. |
**Return value**
......@@ -5873,7 +5821,7 @@ Describes the lifecycle of a window stage.
Implements a window manager, which manages each basic window unit, that is, [Window](#window) instance.
Before calling any of the following APIs, you must use [onWindowStageCreate()](js-apis-application-ability.md#abilityonwindowstagecreate) to create a **WindowStage** instance.
Before calling any of the following APIs, you must use [onWindowStageCreate()](js-apis-app-ability-uiAbility.md#uiabilityonwindowstagecreate) to create a **WindowStage** instance.
### getMainWindow<sup>9+</sup>
......@@ -5903,9 +5851,9 @@ For details about the error codes, see [Window Error Codes](../errorcodes/errorc
**Example**
```ts
import Ability from '@ohos.application.Ability';
import UIAbility from '@ohos.app.ability.UIAbility';
class myAbility extends Ability {
class myAbility extends UIAbility {
onWindowStageCreate(windowStage) {
console.log('onWindowStageCreate');
let windowClass = null;
......@@ -5949,9 +5897,9 @@ For details about the error codes, see [Window Error Codes](../errorcodes/errorc
**Example**
```ts
import Ability from '@ohos.application.Ability';
import UIAbility from '@ohos.app.ability.UIAbility';
class myAbility extends Ability {
class myAbility extends UIAbility {
onWindowStageCreate(windowStage) {
console.log('onWindowStageCreate');
let windowClass = null;
......@@ -5994,9 +5942,9 @@ For details about the error codes, see [Window Error Codes](../errorcodes/errorc
**Example**
```ts
import Ability from '@ohos.application.Ability';
import UIAbility from '@ohos.app.ability.UIAbility';
class myAbility extends Ability {
class myAbility extends UIAbility {
onWindowStageCreate(windowStage) {
console.log('onWindowStageCreate');
try {
......@@ -6037,9 +5985,9 @@ For details about the error codes, see [Window Error Codes](../errorcodes/errorc
**Example**
```ts
import Ability from '@ohos.application.Ability';
import UIAbility from '@ohos.app.ability.UIAbility';
class myAbility extends Ability {
class myAbility extends UIAbility {
onWindowStageCreate(windowStage) {
console.log('onWindowStageCreate');
let windowClass = null;
......@@ -6093,9 +6041,9 @@ For details about the error codes, see [Window Error Codes](../errorcodes/errorc
**Example**
```ts
import Ability from '@ohos.application.Ability';
import UIAbility from '@ohos.app.ability.UIAbility';
class myAbility extends Ability {
class myAbility extends UIAbility {
onWindowStageCreate(windowStage) {
console.log('onWindowStageCreate');
let windowClass = null;
......@@ -6141,9 +6089,9 @@ For details about the error codes, see [Window Error Codes](../errorcodes/errorc
**Example**
```ts
import Ability from '@ohos.application.Ability';
import UIAbility from '@ohos.app.ability.UIAbility';
class myAbility extends Ability {
class myAbility extends UIAbility {
onWindowStageCreate(windowStage) {
console.log('onWindowStageCreate');
let windowClass = null;
......@@ -6185,9 +6133,9 @@ For details about the error codes, see [Window Error Codes](../errorcodes/errorc
**Example**
```ts
import Ability from '@ohos.application.Ability';
import UIAbility from '@ohos.app.ability.UIAbility';
class myAbility extends Ability {
class myAbility extends UIAbility {
onWindowStageCreate(windowStage) {
console.log('onWindowStageCreate');
let windowClass = null;
......@@ -6231,9 +6179,9 @@ For details about the error codes, see [Window Error Codes](../errorcodes/errorc
**Example**
```ts
import Ability from '@ohos.application.Ability';
import UIAbility from '@ohos.app.ability.UIAbility';
class myAbility extends Ability {
class myAbility extends UIAbility {
storage : LocalStorage
onWindowStageCreate(windowStage) {
this.storage = new LocalStorage();
......@@ -6289,9 +6237,9 @@ For details about the error codes, see [Window Error Codes](../errorcodes/errorc
**Example**
```ts
import Ability from '@ohos.application.Ability';
import UIAbility from '@ohos.app.ability.UIAbility';
class myAbility extends Ability {
class myAbility extends UIAbility {
storage : LocalStorage
onWindowStageCreate(windowStage) {
this.storage = new LocalStorage();
......@@ -6340,9 +6288,9 @@ For details about the error codes, see [Window Error Codes](../errorcodes/errorc
**Example**
```ts
import Ability from '@ohos.application.Ability';
import UIAbility from '@ohos.app.ability.UIAbility';
class myAbility extends Ability {
class myAbility extends UIAbility {
onWindowStageCreate(windowStage) {
console.log('onWindowStageCreate');
try {
......@@ -6389,9 +6337,9 @@ For details about the error codes, see [Window Error Codes](../errorcodes/errorc
**Example**
```ts
import Ability from '@ohos.application.Ability';
import UIAbility from '@ohos.app.ability.UIAbility';
class myAbility extends Ability {
class myAbility extends UIAbility {
onWindowStageCreate(windowStage) {
console.log('onWindowStageCreate');
try {
......@@ -6436,9 +6384,9 @@ For details about the error codes, see [Window Error Codes](../errorcodes/errorc
**Example**
```ts
import Ability from '@ohos.application.Ability';
import UIAbility from '@ohos.app.ability.UIAbility';
class myAbility extends Ability {
class myAbility extends UIAbility {
onWindowStageCreate(windowStage) {
console.log('onWindowStageCreate');
try {
......@@ -6475,9 +6423,9 @@ For details about the error codes, see [Window Error Codes](../errorcodes/errorc
**Example**
```ts
import Ability from '@ohos.application.Ability';
import UIAbility from '@ohos.app.ability.UIAbility';
class myAbility extends Ability {
class myAbility extends UIAbility {
onWindowStageCreate(windowStage) {
console.log('disableWindowDecor');
windowStage.disableWindowDecor();
......@@ -6515,9 +6463,9 @@ For details about the error codes, see [Window Error Codes](../errorcodes/errorc
**Example**
```ts
import Ability from '@ohos.application.Ability';
import UIAbility from '@ohos.app.ability.UIAbility';
class myAbility extends Ability {
class myAbility extends UIAbility {
onWindowStageCreate(windowStage) {
console.log('onWindowStageCreate');
try {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册