未验证 提交 9d5c0b44 编写于 作者: O openharmony_ci 提交者: Gitee

!18673 翻译完成 18170+17826+17937+17545+17762

Merge pull request !18673 from ester.zhou/TR-18170
......@@ -4,7 +4,7 @@
Generally, local images or online images downloaded from the network need to be displayed on a widget. To obtain local and online images, use the FormExtensionAbility. The following exemplifies how to show local and online images on a widget.
1. Internet access is required for downloading online images. Therefore, you need to apply for the **ohos.permission.INTERNET** permission. For details, see[Declaring Permissions in the Configuration File](../security/accesstoken-guidelines.md).
1. Internet access is required for downloading online images. Therefore, you need to apply for the **ohos.permission.INTERNET** permission. For details, see [Declaring Permissions in the Configuration File](../security/accesstoken-guidelines.md).
2. Update local files in the **onAddForm** lifecycle callback of the EntryFormAbility.
......
......@@ -370,7 +370,7 @@ Obtains the accessibility application list. This API uses a promise to return th
> **NOTE**
>
> This API is supported since API version 7 and deprecated since API version 9.
> You are advised to use[getAccessibilityExtensionList()](#accessibilitygetaccessibilityextensionlist9).
> You are advised to use [getAccessibilityExtensionList()](#accessibilitygetaccessibilityextensionlist9).
**System capability**: SystemCapability.BarrierFree.Accessibility.Core
......
......@@ -54,7 +54,7 @@ let enterpriseInfo = {
name: "enterprise name",
description: "enterprise description"
}
adminManager.enableAdmin(wantTemp, enterpriseInfo, adminManager.AdminType.ADMIN_TYPE_NORMAL, error => {
adminManager.enableAdmin(wantTemp, enterpriseInfo, adminManager.AdminType.ADMIN_TYPE_SUPER, error => {
if (error != null) {
console.log("error occurs" + error);
return;
......@@ -955,5 +955,5 @@ Enumerates the system management events that can be subscribed to.
| -------------------------- | ---- | ------------- |
| MANAGED_EVENT_BUNDLE_ADDED | 0 | Bundle added.|
| MANAGED_EVENT_BUNDLE_REMOVED | 1 | Bundle removed.|
| MANAGED_EVENT_APP_START | 2 | Application started.|
| MANAGED_EVENT_APP_STOP | 3 | Application stopped.|
| MANAGED_EVENT_APP_START<sup>10+</sup> | 2 | Application started.|
| MANAGED_EVENT_APP_STOP<sup>10+</sup> | 3 | Application stopped.|
# InputMethodCommon
> **NOTE**
>
> The initial APIs of this module are supported since API version 10. Newly added APIs will be marked with a superscript to indicate their earliest API version.
The **InputMethodCommon** module provides the common attributes defined by the input method framework.
## Direction
Enumerates the directions of cursor movement.
**System capability**: SystemCapability.MiscServices.InputMethodFramework
| Name | Value | Description |
| ------------ | ---- | ---------- |
| CURSOR_UP | 1 | The cursor moves upward.|
| CURSOR_DOWN | 2 | The cursor moves downward.|
| CURSOR_LEFT | 3 | The caret moves leftward.|
| CURSOR_RIGHT | 4 | The caret moves rightward.|
## Range
Describes the range of the selected text.
**System capability**: SystemCapability.MiscServices.InputMethodFramework
| Name | Type | Readable| Writable| Description |
| ----- | ------ | ---- | ---- | ---------------------------------- |
| start | number | Yes | Yes | Index of the first selected character in the text box.|
| end | number | Yes | Yes | Index of the last selected character in the text box.|
## Movement
Describes the direction in which the cursor moves when the text is selected.
**System capability**: SystemCapability.MiscServices.InputMethodFramework
| Name | Type | Readable| Writable| Description |
| --------- | ----------------------- | ---- | ---- | ---------------------------------- |
| direction | [Direction](#direction) | Yes | Yes | Direction in which the cursor moves when the text is selected.|
......@@ -38,9 +38,9 @@ Called when the **InputMethodExtension** ability is started to implement initial
```js
class InputMethodExt extends InputMethodExtensionAbility {
onCreate(want) {
console.log('onCreate, want:' + want.abilityName);
}
onCreate(want) {
console.log('onCreate, want:' + want.abilityName);
}
}
```
......@@ -56,8 +56,8 @@ Called when this **InputMethodExtension** ability is destroyed to clear resource
```js
class InputMethodExt extends InputMethodExtensionAbility {
onDestroy() {
console.log('onDestroy');
}
onDestroy() {
console.log('onDestroy');
}
}
```
......@@ -21,9 +21,9 @@ Before using the **InputMethodExtensionContext** module, you must define a child
```js
import InputMethodExtensionAbility from '@ohos.InputMethodExtensionAbility';
class EntryAbility extends InputMethodExtensionAbility {
onCreate() {
let context = this.context;
}
onCreate() {
let context = this.context;
}
}
```
......@@ -44,8 +44,8 @@ Terminates this ability. This API uses an asynchronous callback to return the re
**Example**
```js
this.context.destroy((err) => {
console.log('destroy result:' + JSON.stringify(err));
this.context.destroy(() => {
console.log('Succeeded in destroying context.');
});
```
......@@ -67,8 +67,6 @@ Terminates this ability. This API uses a promise to return the result.
```js
this.context.destroy().then(() => {
console.log('Succeeded in destroying context.');
}).catch((error) => {
console.log('Failed to destroy context: ' + JSON.stringify(error));
console.log('Succeed in destroying context.');
});
```
......@@ -38,7 +38,7 @@ The input method process is suspended.
**Solution**
Check whether the input method process is running properly. For example, click the input text box in an appliccation and check whether the input keyboard is displayed.
Check whether the input method process is running properly. For example, click the input text box in an application and check whether the input keyboard is displayed.
## 12800003 Input Method Client Error
......@@ -58,23 +58,23 @@ The input method is disconnected from the third-party application due to a servi
Bind the input method to the third-party application again: Close the background process of the third-party application, start the application again, and touch an input text box. If the keyboard is displayed properly, the issue is resolved.
## 12800004 Key Event Processing Error
## 12800004 Not an Input Method.
**Error Message**
Key event processing error.
Not an input method extension.
**Description**
This error code is reported when a key event error occurs.
This error code is reported when an API exclusive to input methods is called by an application of another type.
**Possible Causes**
An exception occurs during key event distribution, consumption, or listening.
An API that can be called only by an input method is called by an application of another type.
**Solution**
None
Call the API only in an input method.
## 12800005 Configuration Persistence Error
......@@ -147,3 +147,21 @@ The input method manager service fails to be obtained.
**Solution**
Run the **ps -A|grep inputmethod** command to check for the process ID of the input method service. If the process ID is found, the service is working properly.
## 12800009 Input Method Client Detached
**Error Message**
Input method client is detached.
**Description**
This error code is reported when the current application is not attached to an input method.
**Possible Causes**
The current application calls **showTextInput** or **hideTextInput** when not attached to an input method.
**Solution**
Call the **attach** API and then try again.
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册