提交 30b02d48 编写于 作者: L lixia7819

增加安全水印接口说明文档

Signed-off-by: Nlixia7819 <lixia110@huawei.com>
上级 a205e10a
......@@ -916,103 +916,6 @@ try {
}
```
## window.on('waterMarkFlagChange')<sup>10+</sup>
on(type: 'waterMarkFlagChange', callback: Callback&lt;boolean&gt;): void
Subscribes to the watermark flag status change event.
**System API**: This is a system API.
**System capability**: SystemCapability.WindowManager.WindowManager.Core
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ----------------------- | ---- | ----------------------------------------------------------------------------- |
| type | string | Yes | Event type. The value is fixed at **'waterMarkFlagChange'**, indicating the watermark flag status change event. |
| callback | Callback&lt;boolean&gt; | Yes | Callback used to return the watermark flag status. The value **true** means that the watermark is currently enabled, and **false** means that the watermark is changed to disabled.|
**Error codes**
For details about the error codes, see [Window Error Codes](../errorcodes/errorcode-window.md).
| ID| Error Message|
| ------- | -------------------------------------------- |
| 1300003 | This window manager service works abnormally. |
**Example**
```js
try {
window.on('waterMarkFlagChange', (data) => {
console.info('Succeeded in enabling the listener for watermark flag status changes. Data: ' + JSON.stringify(data));
});
} catch (exception) {
console.error('Failed to enable the listener for watermark flag status changes. Cause: ' + JSON.stringify(exception));
}
```
## window.off('waterMarkFlagChange')<sup>10+</sup>
off(type: 'waterMarkFlagChange', callback?: Callback&lt;boolean&gt;): void
Unsubscribes from the watermark flag status change event.
**System API**: This is a system API.
**System capability**: SystemCapability.WindowManager.WindowManager.Core
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ----------------------- | -- | ------------------------------------------------------------ |
| type | string | Yes| Event type. The value is fixed at **'waterMarkFlagChange'**, indicating the watermark flag status change event.|
| callback | Callback&lt;boolean&gt; | No| Callback function that has been used for registering the listener. If a value is passed in, the corresponding subscription is canceled. If no value is passed in, all subscriptions to the specified event are canceled.|
**Error codes**
For details about the error codes, see [Window Error Codes](../errorcodes/errorcode-window.md).
| ID| Error Message|
| ------- | -------------------------------------------- |
| 1300003 | This window manager service works abnormally. |
**Example**
```js
try {
window.off('waterMarkFlagChange');
} catch (exception) {
console.error('Failed to disable the listener for watermark flag status changes. Cause: ' + JSON.stringify(exception));
}
```
## window.setGestureNavigationEnabled<sup>10+</sup>
setGestureNavigationEnabled(enable: boolean, callback: AsyncCallback&lt;void&gt;): void
Enables or disables gesture navigation. This API uses an asynchronous callback to return the result.
**System API**: This is a system API.
**System capability**: SystemCapability.WindowManager.WindowManager.Core
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ------------------------- | ---- | -------------- |
| enable | boolean | Yes | Whether to enable gesture navigation. The value **true** means to enable gesture navigation, and **false** means the opposite.|
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result.|
**Error codes**
For details about the error codes, see [Window Error Codes](../errorcodes/errorcode-window.md).
| ID| Error Message|
| ------- | --------------------------------------------- |
| 1300002 | This window state is abnormal. |
| 1300003 | This window manager service works abnormally. |
**Example**
```js
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册