> The initial APIs of this module are supported since API version 6. Newly added APIs will be marked with a superscript to indicate their earliest API version.
> The initial APIs of this module are supported since API version 6. Newly added APIs will be marked with a superscript to indicate their earliest API version.
## Constraints
## Constraints
...
@@ -17,7 +17,7 @@ import featureAbility from '@ohos.ability.featureAbility'
...
@@ -17,7 +17,7 @@ import featureAbility from '@ohos.ability.featureAbility'
>  **NOTE**<br>The initial APIs of this module are supported since API version 6. Newly added APIs will be marked with a superscript to indicate their earliest API version.
>
>
> The initial APIs of this module are supported since API version 6. Newly added APIs will be marked with a superscript to indicate their earliest API version.
## Modules to Import
## Modules to Import
...
@@ -20,11 +19,11 @@ import pasteboard from '@ohos.pasteboard';
...
@@ -20,11 +19,11 @@ import pasteboard from '@ohos.pasteboard';
| Name | Type | Readable | Writable | Description |
| Name | Type | Readable | Writable | Description |
| localOnly | boolean | Yes | Yes | Whether local access only is set for the pasteboard.<br/>- The default value is **true**.<br/>- **true**: The **PasteData** is set for local access only.<br/>- **false**: The **PasteData** can be shared between devices. |
## PasteDataRecord<sup>7+</sup>
## PasteDataRecord<sup>7+</sup>
...
@@ -263,63 +278,65 @@ A data record is an abstract definition of the content on the pasteboard. The pa
...
@@ -263,63 +278,65 @@ A data record is an abstract definition of the content on the pasteboard. The pa
| Name | Type | Readable | Writable | Description |
| Name | Type | Readable | Writable | Description |
| Promise<void> | Promise used to return the result. If the operation is successful, the plain text content after conversion is returned. Otherwise, error information is returned. |
var record = pasteboard.createUriRecord("dataability:///com.example.myapplication1?user.txt");
record.convertToText().then((data) => {
**Example**
console.info('convertToText success data : ' + JSON.stringify(data));
}).catch((error) => {
```js
console.error('convertToText failed because ' + JSON.stringify(error));
| callback | AsyncCallback<string> | Yes | Callback used to return the result. If this callback is successful, the plain text content after conversion is returned. Otherwise, error information is returned. |
- Example
**Example**
```
var record = pasteboard.createUriRecord("dataability:///com.example.myapplication1?user.txt");
Before calling any **SystemPasteboard** method, you must obtain a **SystemPasteboard** object using [getSystemPasteboard](#pasteboardgetsystempasteboard).
Before calling any **SystemPasteboard** method, you must obtain a **SystemPasteboard** object using [getSystemPasteboard](#pasteboardgetsystempasteboard).
```
```
var systemPasteboard = pasteboard.getSystemPasteboard();
var systemPasteboard = pasteboard.getSystemPasteboard();
...
@@ -794,112 +830,117 @@ var systemPasteboard = pasteboard.getSystemPasteboard();
...
@@ -794,112 +830,117 @@ var systemPasteboard = pasteboard.getSystemPasteboard();