diff --git a/en/application-dev/device/usb-guidelines.md b/en/application-dev/device/usb-guidelines.md index 63723d92c64c1c1e7ecc6f74fcd82fe73e904ad7..5d2eefbc9602f5bebbd6fc40d9cbf0b939e78995 100644 --- a/en/application-dev/device/usb-guidelines.md +++ b/en/application-dev/device/usb-guidelines.md @@ -89,8 +89,9 @@ You can set a USB device as the USB host to connect to other USB devices for dat ] } ] - */ - ``` + */ + + ``` 2. Obtain the device operation permissions. diff --git a/en/application-dev/reference/apis/js-apis-window.md b/en/application-dev/reference/apis/js-apis-window.md index 90a20044c16f8c9fe2dd11d3aaa294e7d869c55b..bc1ad05712b63c8b2d990af46c8bf70242134e77 100644 --- a/en/application-dev/reference/apis/js-apis-window.md +++ b/en/application-dev/reference/apis/js-apis-window.md @@ -1864,7 +1864,7 @@ Obtains the area where this window cannot be displayed, for example, the system | Name| Type| Mandatory| Description| | ---- |----------------------------------| -- | ------------------------------------------------------------ | -| 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. | **Return value** @@ -2500,7 +2500,7 @@ Disables listening for window size changes. | Name | Type | Mandatory| Description | | -------- | ----------------------------- | ---- | -------------------------------------------------------- | | type | string | Yes | Event type. The value is fixed at **'windowSizeChange'**, indicating the window size change event.| -| callback | Callback<[Size](#size)> | No | Callback used to return the window size. | +| callback | Callback<[Size](#size7)> | No | Callback used to return the window size. | **Example** @@ -3006,7 +3006,7 @@ Sets a color space for this window. This API uses an asynchronous callback to re | Name| Type| Mandatory| Description| | ---------- | ------------------------- | -- | ----------- | -| colorSpace | [ColorSpace](#colorspace) | Yes| Color space to set.| +| colorSpace | [ColorSpace](#colorspace8) | Yes| Color space to set.| | callback | AsyncCallback<void> | Yes| Callback used to return the result. | **Error codes** @@ -3045,7 +3045,7 @@ Sets a color space for this window. This API uses a promise to return the result | Name| Type| Mandatory| Description| | ---------- | ------------------------- | -- | ------------- | -| colorSpace | [ColorSpace](#colorspace) | Yes| Color space to set.| +| colorSpace | [ColorSpace](#colorspace8) | Yes| Color space to set.| **Return value** @@ -3088,7 +3088,7 @@ Obtains the color space of this window. | Type| Description| | ------------------------- | ------------- | -| [ColorSpace](#colorspace) | Color space obtained.| +| [ColorSpace](#colorspace8) | Color space obtained.| **Error codes** @@ -4631,7 +4631,7 @@ Obtains the area where this window cannot be displayed, for example, the system | Name | Type | Mandatory | Description | | -------- | --------------------------------------------- | --------- | ------------------------------------------------------------ | -| 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. | | callback | AsyncCallback<[AvoidArea](#avoidarea7)> | Yes | Callback used to return the area. | **Example** @@ -4664,7 +4664,7 @@ Obtains the area where this window cannot be displayed, for example, the system | Name | Type | Mandatory | Description | | ---- | -------------------------------- | --------- | ------------------------------------------------------------ | -| 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. | **Return value** @@ -5239,7 +5239,7 @@ Sets a color space for this window. This API uses an asynchronous callback to re | Name | Type | Mandatory | Description | | ---------- | ------------------------- | --------- | ----------------------------------- | -| colorSpace | [ColorSpace](#colorspace) | Yes | Color space to set. | +| colorSpace | [ColorSpace](#colorspace8) | Yes | Color space to set. | | callback | AsyncCallback<void> | Yes | Callback used to return the result. | **Example** @@ -5271,7 +5271,7 @@ Sets a color space for this window. This API uses a promise to return the result | Name | Type | Mandatory | Description | | ---------- | ------------------------- | --------- | ------------------- | -| colorSpace | [ColorSpace](#colorspace) | Yes | Color space to set. | +| colorSpace | [ColorSpace](#colorspace8) | Yes | Color space to set. | **Return value** @@ -5307,7 +5307,7 @@ Obtains the color space of this window. This API uses an asynchronous callback t | Name | Type | Mandatory | Description | | -------- | ---------------------------------------------- | --------- | ------------------------------------------------------------ | -| callback | AsyncCallback<[ColorSpace](#colorspace)> | Yes | Callback used to return the result. When the color space is obtained successfully, **err** is **undefined**, and **data** is the current color space. | +| callback | AsyncCallback<[ColorSpace](#colorspace8)> | Yes | Callback used to return the result. When the color space is obtained successfully, **err** is **undefined**, and **data** is the current color space. | **Example** @@ -5338,7 +5338,7 @@ Obtains the color space of this window. This API uses a promise to return the re | Type | Description | | ---------------------------------------- | ----------------------------------------------- | -| Promise<[ColorSpace](#colorspace)> | Promise used to return the current color space. | +| Promise<[ColorSpace](#colorspace8)> | Promise used to return the current color space. | **Example** diff --git a/en/application-dev/windowmanager/application-window-fa.md b/en/application-dev/windowmanager/application-window-fa.md index 66a5b4b8ff24da777a4c559c7c7a18d638751eca..b2123e720b1bf1cb15cfe648597e6f82e7b3dae4 100644 --- a/en/application-dev/windowmanager/application-window-fa.md +++ b/en/application-dev/windowmanager/application-window-fa.md @@ -47,30 +47,30 @@ You can create a subwindow, such as a dialog box, and set its properties. - Call **window.createWindow** to create a subwindow. - Call **window.findWindow** to find an available subwindow. -```js - import window from '@ohos.window'; + ```js + import window from '@ohos.window'; - let windowClass = null; - // Method 1: Create a subwindow. - let config = {name: "subWindow", windowType: window.WindowType.TYPE_APP, ctx: this.context}; - window.createWindow(config, (err, data) => { - if (err.code) { - console.error('Failed to create the subWindow. Cause: ' + JSON.stringify(err)); - return; - } - console.info('Succeeded in creating subWindow. Data: ' + JSON.stringify(data)); - windowClass = data; - }); - // Method 2: Find a subwindow. - window.findWindow("subWindow", (err, data) => { - if (err.code) { - console.error('Failed to find the subWindow. Cause: ' + JSON.stringify(err)); - return; - } - console.info('Succeeded in finding subWindow. Data: ' + JSON.stringify(data)); - windowClass = data; - }); -``` + let windowClass = null; + // Method 1: Create a subwindow. + let config = {name: "subWindow", windowType: window.WindowType.TYPE_APP, ctx: this.context}; + window.createWindow(config, (err, data) => { + if (err.code) { + console.error('Failed to create the subWindow. Cause: ' + JSON.stringify(err)); + return; + } + console.info('Succeeded in creating subWindow. Data: ' + JSON.stringify(data)); + windowClass = data; + }); + // Method 2: Find a subwindow. + window.findWindow("subWindow", (err, data) => { + if (err.code) { + console.error('Failed to find the subWindow. Cause: ' + JSON.stringify(err)); + return; + } + console.info('Succeeded in finding subWindow. Data: ' + JSON.stringify(data)); + windowClass = data; + }); + ``` 2. Set the properties of the subwindow. diff --git a/zh-cn/application-dev/reference/apis/js-apis-window.md b/zh-cn/application-dev/reference/apis/js-apis-window.md index 70e2b7854890a1ffc9cb9063f12b4444a9210438..60d0ddcdfb2a8f66639a8eaff58591703c266c9a 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-window.md +++ b/zh-cn/application-dev/reference/apis/js-apis-window.md @@ -1864,7 +1864,7 @@ getWindowAvoidArea(type: AvoidAreaType): AvoidArea | 参数名 | 类型 | 必填 | 说明 | | ---- |----------------------------------| -- | ------------------------------------------------------------ | -| type | [AvoidAreaType](#avoidareatype7) | 是 | 表示规避区类型。type为TYPE_SYSTEM,表示系统默认区域。type为TYPE_CUTOUT,表示刘海屏区域。type为TYPE_SYSTEM_GESTURE,表示手势区域。type为TYPE_KEYBOARD,表示软键盘区域。 | +| type | [AvoidAreaType](#avoidareatype7) | 是 | 表示规避区类型。 | **返回值:** @@ -2500,7 +2500,7 @@ off(type: 'windowSizeChange', callback?: Callback<Size>): void | 参数名 | 类型 | 必填 | 说明 | | -------- | ----------------------------- | ---- | -------------------------------------------------------- | | type | string | 是 | 监听事件,固定为'windowSizeChange',即窗口尺寸变化事件。 | -| callback | Callback<[Size](#size)> | 否 | 回调函数。返回当前的窗口尺寸。 | +| callback | Callback<[Size](#size7)> | 否 | 回调函数。返回当前的窗口尺寸。 | **示例:** @@ -3006,7 +3006,7 @@ setWindowColorSpace(colorSpace:ColorSpace, callback: AsyncCallback<void>): | 参数名 | 类型 | 必填 | 说明 | | ---------- | ------------------------- | -- | ----------- | -| colorSpace | [ColorSpace](#colorspace) | 是 | 设置色域模式。 | +| colorSpace | [ColorSpace](#colorspace8) | 是 | 设置色域模式。 | | callback | AsyncCallback<void> | 是 | 回调函数。 | **错误码:** @@ -3045,7 +3045,7 @@ setWindowColorSpace(colorSpace:ColorSpace): Promise<void> | 参数名 | 类型 | 必填 | 说明 | | ---------- | ------------------------- | -- | ------------- | -| colorSpace | [ColorSpace](#colorspace) | 是 | 设置色域模式。 | +| colorSpace | [ColorSpace](#colorspace8) | 是 | 设置色域模式。 | **返回值:** @@ -3088,7 +3088,7 @@ getWindowColorSpace(): ColorSpace | 类型 | 说明 | | ------------------------- | ------------- | -| [ColorSpace](#colorspace) | 当前色域模式。 | +| [ColorSpace](#colorspace8) | 当前色域模式。 | **错误码:** @@ -4615,7 +4615,7 @@ getAvoidArea(type: [AvoidAreaType](#avoidareatype7), callback: AsyncCallback< | 参数名 | 类型 | 必填 | 说明 | | -------- |-----------------------------------------------| ---- | ------------------------------------------------------------ | -| type | [AvoidAreaType](#avoidareatype7) | 是 | 表示规避区类型。type为TYPE_SYSTEM,表示系统默认区域。type为TYPE_CUTOUT,表示刘海屏区域。type为TYPE_SYSTEM_GESTURE,表示手势区域。type为TYPE_KEYBOARD,表示软键盘区域。 | +| type | [AvoidAreaType](#avoidareatype7) | 是 | 表示规避区类型。| | callback | AsyncCallback<[AvoidArea](#avoidarea7)> | 是 | 回调函数。返回窗口内容规避区域。 | **示例:** @@ -4647,7 +4647,7 @@ getAvoidArea(type: [AvoidAreaType](#avoidareatype7)): Promise<[AvoidArea](#av | 参数名 | 类型 | 必填 | 说明 | | ------ |----------------------------------| ---- | ------------------------------------------------------------ | -| type | [AvoidAreaType](#avoidareatype7) | 是 | 表示规避区类型。type为TYPE_SYSTEM,表示系统默认区域。type为TYPE_CUTOUT,表示刘海屏区域。type为TYPE_SYSTEM_GESTURE,表示手势区域。type为TYPE_KEYBOARD,表示软键盘区域。 | +| type | [AvoidAreaType](#avoidareatype7) | 是 | 表示规避区类型。 | **返回值:** @@ -5205,7 +5205,7 @@ setColorSpace(colorSpace:ColorSpace, callback: AsyncCallback<void>): void | 参数名 | 类型 | 必填 | 说明 | | ---------- | ------------------------- | ---- | ------------ | -| colorSpace | [ColorSpace](#colorspace) | 是 | 设置色域模式。 | +| colorSpace | [ColorSpace](#colorspace8) | 是 | 设置色域模式。 | | callback | AsyncCallback<void> | 是 | 回调函数。 | **示例:** @@ -5236,7 +5236,7 @@ setColorSpace(colorSpace:ColorSpace): Promise<void> | 参数名 | 类型 | 必填 | 说明 | | ---------- | ------------------------- | ---- | -------------- | -| colorSpace | [ColorSpace](#colorspace) | 是 | 设置色域模式。 | +| colorSpace | [ColorSpace](#colorspace8) | 是 | 设置色域模式。 | **返回值:** @@ -5271,7 +5271,7 @@ getColorSpace(callback: AsyncCallback<ColorSpace>): void | 参数名 | 类型 | 必填 | 说明 | | -------- | ---------------------------------------------- | ---- | ---------------------------------------------------------- | -| callback | AsyncCallback<[ColorSpace](#colorspace)> | 是 | 回调函数。当获取成功,err为undefined,data为当前色域模式。 | +| callback | AsyncCallback<[ColorSpace](#colorspace8)> | 是 | 回调函数。当获取成功,err为undefined,data为当前色域模式。 | **示例:** @@ -5301,7 +5301,7 @@ getColorSpace(): Promise<ColorSpace> | 类型 | 说明 | | ---------------------------------------- | ------------------------------- | -| Promise<[ColorSpace](#colorspace)> | Promise对象。返回当前色域模式。 | +| Promise<[ColorSpace](#colorspace8)> | Promise对象。返回当前色域模式。 | **示例:** diff --git a/zh-cn/application-dev/windowmanager/application-window-fa.md b/zh-cn/application-dev/windowmanager/application-window-fa.md index 53473d510dee38df38f3782562c53d0cead6c6cc..f3eb1da1e329aa6f4a2df28236dc44fe8f2c56be 100644 --- a/zh-cn/application-dev/windowmanager/application-window-fa.md +++ b/zh-cn/application-dev/windowmanager/application-window-fa.md @@ -49,30 +49,30 @@ - 可以通过`window.createWindow`接口创建子窗口。 - 也可以通过`window.findWindow`接口来查找已经创建的窗口从而得到子窗口。 -```js - import window from '@ohos.window'; + ```js + import window from '@ohos.window'; - let windowClass = null; - // 方式一:创建子窗口。 - let config = {name: "subWindow", windowType: window.WindowType.TYPE_APP}; - window.createWindow(config, (err, data) => { - if (err.code) { - console.error('Failed to create the subWindow. Cause: ' + JSON.stringify(err)); - return; - } - console.info('Succeeded in creating subWindow. Data: ' + JSON.stringify(data)); - windowClass = data; - }); - // 方式二:查找得到子窗口。 - window.findWindow("subWindow", (err, data) => { - if (err.code) { - console.error('Failed to find the subWindow. Cause: ' + JSON.stringify(err)); - return; - } - console.info('Succeeded in finding subWindow. Data: ' + JSON.stringify(data)); - windowClass = data; - }); -``` + let windowClass = null; + // 方式一:创建子窗口。 + let config = {name: "subWindow", windowType: window.WindowType.TYPE_APP}; + window.createWindow(config, (err, data) => { + if (err.code) { + console.error('Failed to create the subWindow. Cause: ' + JSON.stringify(err)); + return; + } + console.info('Succeeded in creating subWindow. Data: ' + JSON.stringify(data)); + windowClass = data; + }); + // 方式二:查找得到子窗口。 + window.findWindow("subWindow", (err, data) => { + if (err.code) { + console.error('Failed to find the subWindow. Cause: ' + JSON.stringify(err)); + return; + } + console.info('Succeeded in finding subWindow. Data: ' + JSON.stringify(data)); + windowClass = data; + }); + ``` 2. 设置子窗口属性。