提交 158ee3c0 编写于 作者: 赵还行 提交者: Gitee

Merge branch 'master' of gitee.com:openharmony/docs into master

Signed-off-by: N赵还行 <x8688997@163.com>
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
#!/bin/bash
# Copyright (c) 2020 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
docker build -t openharmony-docker:1.0.0 .
......@@ -39,33 +39,36 @@ OpenHarmony does not support creation of a Service Extension ability for third-p
```
2. Customize a class that inherits from **ServiceExtensionAbility** in the .ts file in the directory where the Service Extension ability is defined and override the lifecycle callbacks of the base class. The code sample is as follows:
2. Customize a class that inherits from **ServiceExtensionAbility** in the .ts file in the directory where the Service Extension ability is defined (**entry\src\main\ets\ServiceExtAbility\ServiceExtAbility.ts** by default) and override the lifecycle callbacks of the base class. The code sample is as follows:
```js
import ServiceExtensionAbility from '@ohos.application.ServiceExtensionAbility'
import rpc from '@ohos.rpc'
class StubTest extends rpc.RemoteObject {
constructor(des) {
constructor(des) {
super(des);
}
onRemoteRequest(code, data, reply, option) {
}
}
onRemoteRequest(code, data, reply, option) {
}
}
class ServiceExt extends ServiceExtensionAbility {
console.log('onCreate, want:' + want.abilityName);
}
onRequest(want, startId) {
console.log('onRequest, want:' + want.abilityName);
}
onConnect(want) {
console.log('onConnect , want:' + want.abilityName);
return new StubTest("test");
}
onDisconnect(want) {
console.log('onDisconnect, want:' + want.abilityName);
}
onDestroy() {
console.log('onDestroy');
}
class ServiceExtAbility extends ServiceExtensionAbility {
onCreate(want) {
console.log('onCreate, want:' + want.abilityName);
}
onRequest(want, startId) {
console.log('onRequest, want:' + want.abilityName);
}
onConnect(want) {
console.log('onConnect , want:' + want.abilityName);
return new StubTest("test");
}
onDisconnect(want) {
console.log('onDisconnect, want:' + want.abilityName);
}
onDestroy() {
console.log('onDestroy');
}
}
```
```
\ No newline at end of file
......@@ -65,9 +65,9 @@ For details about the APIs, see [Vibrator](../reference/apis/js-apis-vibrator.md
import vibrator from "@ohos.vibrator"
vibrator.vibrate(1000).then((error) => {
if (error) { // The call fails, and error.code and error.message are printed.
Console.log("Promise return failed.error.code " + error.code + "error.message " + error.message);
console.log("Promise return failed.error.code " + error.code + "error.message " + error.message);
} else { // The call is successful, and the device starts to vibrate.
Console.log("Promise returned to indicate a successful vibration.")
console.log("Promise returned to indicate a successful vibration.")
}
})
```
......@@ -78,9 +78,9 @@ For details about the APIs, see [Vibrator](../reference/apis/js-apis-vibrator.md
import vibrator from "@ohos.vibrator"
vibrator.stop(vibrator.VibratorStopMode.VIBRATOR_STOP_MODE_PRESET).then((error) => {
if (error) { // The call fails, and error.code and error.message are printed.
Console.log("Promise return failed.error.code " + error.code + "error.message " + error.message);
console.log("Promise return failed.error.code " + error.code + "error.message " + error.message);
} else { // The call is successful, and the device stops vibrating.
Console.log("Promise returned to indicate a successful stop.");
console.log("Promise returned to indicate successful.");
}
})
```
......@@ -267,7 +267,7 @@ imageSourceApi.getImageInfo(imageInfo => {
})
// Update incremental data.
imageSourceIncrementalSApi.updateData(array, false, 0, 10,(error,data )=> {})
imageSourceIncrementalSApi.updateData(array, false, 0, 10,(error, data)=> {})
```
......
......@@ -888,7 +888,7 @@ Disconnects a connection. This API uses an asynchronous callback to return the r
startAbilityByCall(want: Want): Promise&lt;Caller&gt;;
Obtains the caller interface of the specified ability, and if the specified ability is not started, starts the ability in the background.
Starts an ability in the foreground or background and obtains the caller interface for communication with the ability.
**System capability**: SystemCapability.Ability.AbilityRuntime.Core
......@@ -896,7 +896,7 @@ Obtains the caller interface of the specified ability, and if the specified abil
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| want | [Want](js-apis-application-Want.md) | Yes| Information about the target ability, including the ability name, bundle name, and device ID. If the device ID is left blank or the default value is used, it indicates the local device.|
| want | [Want](js-apis-application-Want.md) | Yes| Information about the ability to start, including **abilityName**, **moduleName**, **bundleName**, **deviceId** (optional), and **parameters** (optional). If **deviceId** is left blank or null, the local ability is started. If **parameters** is left blank or null, the ability is started in the background.|
**Return value**
......@@ -907,22 +907,40 @@ Obtains the caller interface of the specified ability, and if the specified abil
**Example**
```js
import Ability from '@ohos.application.Ability';
var caller;
export default class MainAbility extends Ability {
onWindowStageCreate(windowStage) {
this.context.startAbilityByCall({
bundleName: "com.example.myservice",
abilityName: "MainAbility",
deviceId: ""
}).then((obj) => {
caller = obj;
console.log('Caller GetCaller Get ' + caller);
}).catch((e) => {
console.log('Caller GetCaller error ' + e);
});
let caller = undefined;
// Start an ability in the background without passing parameters.
var wantBackground = {
bundleName: "com.example.myservice",
moduleName: "entry",
abilityName: "MainAbility",
deviceId: ""
};
this.context.startAbilityByCall(wantBackground)
.then((obj) => {
caller = obj;
console.log('GetCaller success');
}).catch((error) => {
console.log(`GetCaller failed with ${error}`);
});
// Start an ability in the foreground with ohos.aafwk.param.callAbilityToForeground in parameters set to true.
var wantForeground = {
bundleName: "com.example.myservice",
moduleName: "entry",
abilityName: "MainAbility",
deviceId: "",
parameters: {
"ohos.aafwk.param.callAbilityToForeground": true
}
}
};
this.context.startAbilityByCall(wantForeground)
.then((obj) => {
caller = obj;
console.log('GetCaller success');
}).catch((error) => {
console.log(`GetCaller failed with ${error}`);
});
```
## AbilityContext.startAbilityWithAccount
......
......@@ -1327,7 +1327,7 @@ This is a system API.
| Name | Type | Mandatory| Description |
| -------- | ----------------------------------------------------------- | ---- | ------------------------------------------------------------ |
| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2 |
| callback | AsyncCallback&lt;[CallWaitingStatus](#callwaitingstatus7)\> | Yes | Callback used to return the result.<br> <br>- **0**: Call waiting is disabled.<br>- **1**: Call waiting is enabled.|
| callback | AsyncCallback&lt;[CallWaitingStatus](#callwaitingstatus7)\> | Yes | Callback used to return the result.<br><br>- **0**: Call waiting is disabled.<br>- **1**: Call waiting is enabled.|
**Example**
......@@ -2743,13 +2743,13 @@ Defines the dialup options.
**System capability**: SystemCapability.Telephony.CallManager
| Name | Type | Mandatory| Description |
| ---------- | ---------------------------------- | ---- | ------------------------------------------------------------ |
| extras | boolean | No | Indication of a video call. <br>- **true**: video call<br>- **false** (default): voice call|
| accountId | number | No | Account ID. This API is supported since API version 8. It is a system API. |
| videoState | [VideoStateType](#videostatetype7) | No | Video state type. This API is supported since API version 8. It is a system API. |
| dialScene | [DialScene](#dialscene8) | No | Dialup scenario. This API is supported since API version 8. It is a system API. |
| dialType | [DialType](#dialtype8) | No | Dialup type. This API is supported since API version 8. It is a system API. |
| Name | Type | Mandatory| Description |
| ------------------------ | ---------------------------------- | ---- | ------------------------------------------------------------ |
| extras | boolean | No | Indication of a video call. <br>- **true**: video call<br>- **false** (default): voice call|
| accountId <sup>8+</sup> | number | No | Account ID. This is a system API. |
| videoState <sup>8+</sup> | [VideoStateType](#videostatetype7) | No | Video state type. This is a system API. |
| dialScene <sup>8+</sup> | [DialScene](#dialscene8) | No | Dialup scenario. This is a system API. |
| dialType <sup>8+</sup> | [DialType](#dialtype8) | No | Dialup type. This is a system API. |
## CallState
......
......@@ -9,7 +9,7 @@ System applications can call the APIs to do the following:
- Authenticate or deauthenticate a device.
- Query the trusted device list.
- Query local device information, including the device name, type, and ID.
- Publish device information for discovery purposes.
> **NOTE**
>
> - The initial APIs of this module are supported since API version 7. Newly added APIs will be marked with a superscript to indicate their earliest API version.
......@@ -31,23 +31,24 @@ Creates a **DeviceManager** instance.
**System capability**: SystemCapability.DistributedHardware.DeviceManager
- **Parameters**
| Name | Type | Mandatory | Description |
| ---------- | ---------------------------------------- | ---- | ------------------------------------ |
| bundleName | string | Yes | Bundle name of an application. |
| callback | AsyncCallback&lt;[DeviceManager](#devicemanager)&gt; | Yes | Callback used to return the **DeviceManager** instance created.|
**Parameters**
| Name | Type | Mandatory | Description |
| ---------- | ---------------------------------------- | ---- | ------------------------------------ |
| bundleName | string | Yes | Bundle name of an application. |
| callback | AsyncCallback&lt;[DeviceManager](#devicemanager)&gt; | Yes | Callback used to return the **DeviceManager** instance created.|
- Example
```
deviceManager.createDeviceManager("ohos.samples.jshelloworld", (err, data) => {
if (err) {
console.info("createDeviceManager err:" + JSON.stringify(err));
return;
}
console.info("createDeviceManager success");
let dmInstance = data;
});
```
**Example**
```
deviceManager.createDeviceManager("ohos.samples.jshelloworld", (err, data) => {
if (err) {
console.info("createDeviceManager err:" + JSON.stringify(err));
return;
}
console.info("createDeviceManager success");
let dmInstance = data;
});
```
## DeviceInfo
......@@ -61,7 +62,7 @@ Defines device information.
| deviceName | string | Yes | Device name. |
| deviceType | [DeviceType](#devicetype) | Yes | Device type. |
| networkId<sup>8+</sup> | string | Yes | Network ID of the device. |
| range<sup>9+</sup> | number | Yes | Distance between the device (discovered device) and the device that initiates device discovery. |
## DeviceType
......@@ -184,6 +185,18 @@ Defines authentication information.
| token | number | Yes | Authentication token. |
| extraInfo | {[key:string] : any} | No | Extended field.|
## PublishInfo
Defines published device information.
**System capability**: SystemCapability.DistributedHardware.DeviceManager
| Name | Type | Mandatory | Description |
| ------------- | --------------------------------- | ---- | ----------------- |
| publishId | number | Yes | ID used to identify a publication period.|
| mode | [DiscoverMode ](#discovermode) | Yes | Device discovery mode. |
| freq | [ExchangeFreq](#exchangefreq) | Yes | Frequency of device discovery. |
| ranging | boolean | Yes | Whether the device supports distance reporting. |
## DeviceManager
......@@ -198,10 +211,11 @@ Releases this **DeviceManager** instance when it is no longer used.
**System capability**: SystemCapability.DistributedHardware.DeviceManager
- Example
```js
dmInstance.release();
```
**Example**
```js
dmInstance.release();
```
### getTrustedDeviceListSync
......@@ -212,15 +226,17 @@ Obtains all trusted devices synchronously.
**System capability**: SystemCapability.DistributedHardware.DeviceManager
- Return value
| Name | Description |
| -------------------------------------- | --------- |
| Array&lt;[DeviceInfo](#deviceinfo)&gt; | List of trusted devices obtained.|
**Return value**
- Example
```js
var deviceInfoList = dmInstance.getTrustedDeviceListSync();
```
| Name | Description |
| -------------------------------------- | --------- |
| Array&lt;[DeviceInfo](#deviceinfo)&gt; | List of trusted devices obtained.|
**Example**
```js
var deviceInfoList = dmInstance.getTrustedDeviceListSync();
```
### getTrustedDeviceList<sup>8+</sup>
......@@ -231,12 +247,12 @@ Obtains all trusted devices. This API uses an asynchronous callback to return th
**System capability**: SystemCapability.DistributedHardware.DeviceManager
- **Parameters**
| Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | --------------------- |
| callback | AsyncCallback&lt;Array&lt;[DeviceInfo](#deviceinfo)&gt;&gt; | Yes | Callback used to return the list of trusted devices.|
**Parameters**
| Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | --------------------- |
| callback | AsyncCallback&lt;Array&lt;[DeviceInfo](#deviceinfo)&gt;&gt; | Yes | Callback used to return the list of trusted devices.|
- Example
**Example**
```js
dmInstance.getTrustedDeviceList((err, data) => {
console.log("getTrustedDeviceList err: " + JSON.stringify(err));
......@@ -253,12 +269,12 @@ Obtains all trusted devices. This API uses a promise to return the result.
**System capability**: SystemCapability.DistributedHardware.DeviceManager
- Return value
| Type | Description |
| ---------------------------------------- | --------------------- |
| Promise&lt;Array&lt;[DeviceInfo](#deviceinfo)&gt;&gt; | Promise used to return the list of trusted devices.|
**Return value**
| Type | Description |
| ---------------------------------------- | --------------------- |
| Promise&lt;Array&lt;[DeviceInfo](#deviceinfo)&gt;&gt; | Promise used to return the list of trusted devices.|
- Example
**Example**
```js
dmInstance.getTrustedDeviceList().then((data) => {
console.log('get trusted device info: ' + JSON.stringify(data));
......@@ -275,12 +291,12 @@ Obtains local device information synchronously.
**System capability**: SystemCapability.DistributedHardware.DeviceManager
- Return value
| Name | Description |
| -------------------------------------- | --------- |
| Array&lt;[DeviceInfo](#deviceinfo)&gt; | List of local devices obtained.|
**Return value**
| Name | Description |
| -------------------------------------- | --------- |
| Array&lt;[DeviceInfo](#deviceinfo)&gt; | List of local devices obtained.|
- Example
**Example**
```js
var deviceInfo = dmInstance.getLocalDeviceInfoSync();
```
......@@ -294,12 +310,12 @@ Obtains local device information. This API uses an asynchronous callback to retu
**System capability**: SystemCapability.DistributedHardware.DeviceManager
- **Parameters**
| Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | --------- |
| callback | AsyncCallback&lt;[DeviceInfo](#deviceinfo)&gt; | Yes | Callback used to return the local device information.|
**Parameters**
| Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | --------- |
| callback | AsyncCallback&lt;[DeviceInfo](#deviceinfo)&gt; | Yes | Callback used to return the local device information.|
- Example
**Example**
```js
dmInstance.getLocalDeviceInfo((err, data) => {
console.log("getLocalDeviceInfo err: " + JSON.stringify(err));
......@@ -316,12 +332,12 @@ Obtains local device information. This API uses a promise to return the result.
**System capability**: SystemCapability.DistributedHardware.DeviceManager
- Return value
| Type | Description |
| ---------------------------------------- | --------------------- |
| Promise&lt;[DeviceInfo](#deviceinfo)&gt; | Promise used to return the local device information.|
**Return value**
| Type | Description |
| ---------------------------------------- | --------------------- |
| Promise&lt;[DeviceInfo](#deviceinfo)&gt; | Promise used to return the local device information.|
- Example
**Example**
```js
dmInstance.getLocalDeviceInfo().then((data) => {
console.log('get local device info: ' + JSON.stringify(data));
......@@ -338,12 +354,12 @@ Starts to discover peripheral devices.
**System capability**: SystemCapability.DistributedHardware.DeviceManager
- **Parameters**
| Name | Type | Mandatory | Description |
| ------------- | ------------------------------- | ---- | ----- |
| subscribeInfo | [SubscribeInfo](#subscribeinfo) | Yes | Subscription information.|
**Parameters**
| Name | Type | Mandatory | Description |
| ------------- | ------------------------------- | ---- | ----- |
| subscribeInfo | [SubscribeInfo](#subscribeinfo) | Yes | Subscription information.|
- Example
**Example**
```js
// Automatically generate a unique subscription ID.
var subscribeId = Math.floor(Math.random() * 10000 + 1000);
......@@ -359,6 +375,45 @@ Starts to discover peripheral devices.
dmInstance.startDeviceDiscovery(subscribeInfo); // The deviceFound callback is invoked to notify the application when a device is discovered.
```
### startDeviceDiscovery9+</sup>
startDeviceDiscovery(subscribeInfo: SubscribeInfo, filterOptions: string): void
Starts to discover peripheral devices and filters discovered devices.
**System capability**: SystemCapability.DistributedHardware.DeviceManager
**Parameters**
| Name | Type | Mandatory | Description |
| ------------- | ------------------------------- | ---- | ----- |
| subscribeInfo | [SubscribeInfo](#subscribeinfo) | Yes | Subscription information.|
| filterOptions | string | No | Options for filtering discovered devices.|
**Example**
```js
// Automatically generate a unique subscription ID.
var subscribeId = Math.floor(Math.random() * 10000 + 1000);
var subscribeInfo = {
"subscribeId": subscribeId,
"mode": 0xAA, // Active discovery
"medium": 0, // Automatic. Multiple media can be used for device discovery.
"freq": 2, // High frequency
"isSameAccount": false,
"isWakeRemote": false,
"capability": 1
};
var filterOptions = {
"filter_op": "OR", // Optional. The default value is OR.
"filters": [
{
"type": "range",
"value": 50 // Filter discovered devices based on the distance (in cm).
}
]
};
dmInstance.startDeviceDiscovery(subscribeInfo, JSON.stringify(filterOptions)); // The deviceFound callback is invoked to notify the application when a device is discovered.
```
### stopDeviceDiscovery
stopDeviceDiscovery(subscribeId: number): void
......@@ -367,17 +422,63 @@ Stops device discovery.
**System capability**: SystemCapability.DistributedHardware.DeviceManager
- **Parameters**
| Name | Type | Mandatory | Description |
| ----------- | ------ | ---- | ----- |
| subscribeId | number | Yes | Subscription ID.|
**Parameters**
| Name | Type | Mandatory | Description |
| ----------- | ------ | ---- | ----- |
| subscribeId | number | Yes | Subscription ID.|
- Example
**Example**
```js
// The subscribeId input must be the same as that automatically generated in startDeviceDiscovery.
dmInstance.stopDeviceDiscovery(subscribeId);
```
### publishDeviceDiscovery9+</sup>
publishDeviceDiscovery(publishInfo: PublishInfo): void
Publishes device information for discovery purposes.
**System capability**: SystemCapability.DistributedHardware.DeviceManager
**Parameters**
| Name | Type | Mandatory| Description |
| ------------- | ------------------------------- | ---- | ----- |
| publishInfo | [PublishInfo](#publishinfo) | Yes | Device information to publish.|
**Example**
```js
// Automatically generate a unique subscription ID.
var publishId = Math.floor(Math.random() * 10000 + 1000);
var publishInfo = {
"publishId": publishId,
"mode": 0xAA, // Active discovery
"freq": 2, // High frequency
"ranging": 1 // The device supports reporting the distance to the discovery initiator.
};
dmInstance.publishDeviceDiscovery(publishInfo); // A callback is invoked to notify the application when the device information is published.
```
### unPublishDeviceDiscovery
unPublishDeviceDiscovery(publishId: number): void
Stops publishing device information.
**System capability**: SystemCapability.DistributedHardware.DeviceManager
**Parameters**
| Name | Type| Mandatory| Description |
| ----------- | -------- | ---- | ----- |
| publishId | number | Yes | Publish ID.|
**Example**
```js
// The publishId input must be the same as that automatically generated in publishDeviceDiscovery.
dmInstance.unPublishDeviceDiscovery(publishId);
```
### authenticateDevice
authenticateDevice(deviceInfo: DeviceInfo, authParam: AuthParam, callback: AsyncCallback<{deviceId: string, pinToken ?: number}>): void
......@@ -386,14 +487,14 @@ Authenticates a device.
**System capability**: SystemCapability.DistributedHardware.DeviceManager
- **Parameters**
| Name | Type | Mandatory | Description |
| ---------- | ---------------------------------------- | ---- | ------- |
| deviceInfo | [DeviceInfo](#deviceinfo) | Yes | Device information. |
| authParam | [AuthParam](#authparam) | Yes | Authentication parameter. |
| callback | AsyncCallback<{ deviceId: string, pinToken ?: number }> | Yes | Callback used to return the authentication result.|
**Parameters**
| Name | Type | Mandatory | Description |
| ---------- | ---------------------------------------- | ---- | ------- |
| deviceInfo | [DeviceInfo](#deviceinfo) | Yes | Device information. |
| authParam | [AuthParam](#authparam) | Yes | Authentication parameter. |
| callback | AsyncCallback<{ deviceId: string, pinToken ?: number }> | Yes | Callback used to return the authentication result.|
- Example
**Example**
```js
// Information about the device to authenticate. The information can be obtained from the device discovery result.
var deviceInfo ={
......@@ -423,12 +524,13 @@ Deauthenticates a device.
**System capability**: SystemCapability.DistributedHardware.DeviceManager
- **Parameters**
| Name | Type | Mandatory | Description |
| ---------- | ------------------------- | ---- | ----- |
| deviceInfo | [DeviceInfo](#deviceinfo) | Yes | Device information.|
**Parameters**
| Name | Type | Mandatory | Description |
| ---------- | ------------------------- | ---- | ----- |
| deviceInfo | [DeviceInfo](#deviceinfo) | Yes | Device information.|
- Example
**Example**
```js
dmInstance.unAuthenticateDevice(deviceInfo);
```
......@@ -442,13 +544,13 @@ Verifies authentication information.
**System capability**: SystemCapability.DistributedHardware.DeviceManager
- **Parameters**
| Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | ------- |
| authInfo | [AuthInfo](#authinfo) | Yes | Authentication information. |
| authInfo | AsyncCallback<{ deviceId: string, level: number }> | Yes | Callback used to return the verification result.|
**Parameters**
| Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | ------- |
| authInfo | [AuthInfo](#authinfo) | Yes | Authentication information. |
| authInfo | AsyncCallback<{ deviceId: string, level: number }> | Yes | Callback used to return the verification result.|
- Example
**Example**
```js
let authInfo = {
"authType": 1,
......@@ -473,13 +575,13 @@ Subscribes to changes in the device state.
**System capability**: SystemCapability.DistributedHardware.DeviceManager
- **Parameters**
| Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | ------------------------------ |
| type | string | Yes | Event type. The value **'deviceStateChange'** indicates a device state change event.|
| callback | Callback&lt;{ action: [DeviceStateChangeAction](#devicestatechangeaction), device: [DeviceInfo](#deviceinfo) }&gt; | Yes | Callback invoked to return the device information and state. |
**Parameters**
| Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | ------------------------------ |
| type | string | Yes | Event type. The value **'deviceStateChange'** indicates a device state change event.|
| callback | Callback&lt;{ action: [DeviceStateChangeAction](#devicestatechangeaction), device: [DeviceInfo](#deviceinfo) }&gt; | Yes | Callback invoked to return the device information and state. |
- Example
**Example**
```js
dmInstance.on('deviceStateChange', (data) => {
console.info("deviceStateChange on:" + JSON.stringify(data));
......@@ -496,19 +598,20 @@ Unsubscribes from changes in the device state.
**System capability**: SystemCapability.DistributedHardware.DeviceManager
- **Parameters**
| Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | --------------------------- |
| type | string | Yes | Event type. The value **'deviceStateChange'** indicates a device state change event. |
| callback | Callback&lt;{ action: [DeviceStateChangeAction](#devicestatechangeaction), device: [DeviceInfo](#deviceinfo) }&gt; | Yes | Callback invoked to return the device information and state.|
**Parameters**
| Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | --------------------------- |
| type | string | Yes | Event type. The value **'deviceStateChange'** indicates a device state change event. |
| callback | Callback&lt;{ action: [DeviceStateChangeAction](#devicestatechangeaction), device: [DeviceInfo](#deviceinfo) }&gt; | Yes | Callback invoked to return the device information and state.|
- Example
```js
dmInstance.off('deviceStateChange', (data) => {
console.info('deviceStateChange' + JSON.stringify(data));
}
);
```
**Example**
```js
dmInstance.off('deviceStateChange', (data) => {
console.info('deviceStateChange' + JSON.stringify(data));
}
);
```
### on('deviceFound')
......@@ -519,13 +622,13 @@ Subscribes to device discovery events.
**System capability**: SystemCapability.DistributedHardware.DeviceManager
- **Parameters**
| Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | -------------------------- |
| type | string | Yes | Event type. The value **'deviceFound'** indicates an event reported when a device is discovered.|
| callback | Callback&lt;{ subscribeId: number, device: DeviceInfo }&gt; | Yes | Callback used for device discovery. |
**Parameters**
| Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | -------------------------- |
| type | string | Yes | Event type. The value **'deviceFound'** indicates an event reported when a device is discovered.|
| callback | Callback&lt;{ subscribeId: number, device: DeviceInfo }&gt; | Yes | Callback used for device discovery. |
- Example
**Example**
```js
dmInstance.on('deviceFound', (data) => {
console.info("deviceFound:" + JSON.stringify(data));
......@@ -541,13 +644,13 @@ Unsubscribes from device discovery events.
**System capability**: SystemCapability.DistributedHardware.DeviceManager
- **Parameters**
| Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | --------------------------- |
| type | string | Yes | Event type. The value **'deviceFound'** indicates an event reported when a device is discovered. |
| callback | Callback&lt;{ subscribeId: number, device: [DeviceInfo](#deviceinfo) }&gt; | Yes | Callback used for device discovery, which is invoked to return the device information and state.|
**Parameters**
| Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | --------------------------- |
| type | string | Yes | Event type. The value **'deviceFound'** indicates an event reported when a device is discovered. |
| callback | Callback&lt;{ subscribeId: number, device: [DeviceInfo](#deviceinfo) }&gt; | Yes | Callback invoked to return the device information and state.|
- Example
**Example**
```js
dmInstance.off('deviceFound', (data) => {
console.info('deviceFound' + JSON.stringify(data));
......@@ -563,13 +666,13 @@ Subscribes to device discovery failures.
**System capability**: SystemCapability.DistributedHardware.DeviceManager
- **Parameters**
| Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | ------------------------------ |
| type | string | Yes | Event type. The event **'discoverFail'** indicates an event reported when device discovery fails.|
| callback | Callback&lt;{ subscribeId: number, reason: number }&gt; | Yes | Callback used for the device discovery failure. |
**Parameters**
| Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | ------------------------------ |
| type | string | Yes | Event type. The event **'discoverFail'** indicates an event reported when device discovery fails.|
| callback | Callback&lt;{ subscribeId: number, reason: number }&gt; | Yes | Callback used for the device discovery failure. |
- Example
**Example**
```js
dmInstance.on('discoverFail', (data) => {
this.log("discoverFail on:" + JSON.stringify(data));
......@@ -585,13 +688,13 @@ Unsubscribes from device discovery failures.
**System capability**: SystemCapability.DistributedHardware.DeviceManager
- **Parameters**
| Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | ----------------- |
| type | string | Yes | Event type. The event **'discoverFail'** indicates an event reported when device discovery fails. |
| callback | Callback&lt;{ subscribeId: number, reason: number }&gt; | Yes | Callback used for the device discovery failure.|
**Parameters**
| Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | ----------------- |
| type | string | Yes | Event type. The event **'discoverFail'** indicates an event reported when device discovery fails. |
| callback | Callback&lt;{ subscribeId: number, reason: number }&gt; | Yes | Callback used for the device discovery failure.|
- Example
**Example**
```js
dmInstance.off('deviceFound', (data) => {
console.info('deviceFound' + JSON.stringify(data));
......@@ -599,6 +702,93 @@ Unsubscribes from device discovery failures.
);
```
### on('publishSuccess')
on(type: 'publishSuccess', callback: Callback&lt;{ publishId: number }&gt;): void
Subscribes to device information publication success events.
**System capability**: SystemCapability.DistributedHardware.DeviceManager
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ---------------------------------------- | ---- | -------------------------- |
| type | string | Yes | Event type. The value **'publishSuccess'** indicates an event reported when device information is published.|
| callback | Callback&lt;{ publishId: number }&gt; | Yes | Callback invoked to return the publish ID. |
**Example**
```js
dmInstance.on('publishSuccess', (data) => {
console.info("publishSuccess:" + JSON.stringify(data));
}
);
```
### off('publishSuccess')
off(type: 'publishSuccess', callback?: Callback&lt;{ publishId: number }&gt;): void
Unsubscribes from device information publication success events.
**System capability**: SystemCapability.DistributedHardware.DeviceManager
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ---------------------------------------- | ---- | --------------------------- |
| type | string | Yes | Event type. The value **'publishSuccess'** indicates an event reported when device information is published. |
| callback | Callback&lt;{ publishId: number }&gt; | Yes | Callback used to return the publish ID.|
**Example**
```js
dmInstance.off('publishSuccess', (data) => {
console.info('publishSuccess' + JSON.stringify(data));
}
);
```
### on('publishFail')
on(type: 'publishFail', callback: Callback&lt;{ publishId: number, reason: number }&gt;): void
Subscribes to device information publication failures.
**System capability**: SystemCapability.DistributedHardware.DeviceManager
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ----------------------------------------------------- | ---- | ------------------------------ |
| type | string | Yes | Event type. The event **'publishFail'** indicates an event reported when publishing device information fails.|
| callback | Callback&lt;{ publishId: number, reason: number }&gt; | Yes | Callback used for the publication failure. |
**Example**
```js
dmInstance.on('publishFail', (data) => {
this.log("publishFail on:" + JSON.stringify(data));
}
);
```
### off('publishFail')
off(type: 'publishFail', callback?: Callback&lt;{ publishId: number, reason: number }&gt;): void
Unsubscribes from device information publication failures.
**System capability**: SystemCapability.DistributedHardware.DeviceManager
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ----------------------------------------------------- | ---- | ----------------- |
| type | string | Yes | Event type. The event **'publishFail'** indicates an event reported when publishing device information fails. |
| callback | Callback&lt;{ publishId: number, reason: number }&gt; | Yes | Callback used for the device discovery failure.|
**Example**
```js
dmInstance.off('publishFail', (data) => {
console.info('publishFail' + JSON.stringify(data));
}
);
```
### on('serviceDie')
......@@ -608,13 +798,13 @@ Subscribes to dead events of the **DeviceManager** service.
**System capability**: SystemCapability.DistributedHardware.DeviceManager
- **Parameters**
| Name | Type | Mandatory | Description |
| -------- | ----------------------- | ---- | ---------------------------------------- |
| type | string | Yes | Event type. The value **'serviceDie'** indicates an event reported when the **DeviceManager** service is terminated unexpectedly.|
| callback | () =&gt; void | Yes | Callback invoked when a dead event of the **DeviceManager** service occurs. |
**Parameters**
| Name | Type | Mandatory | Description |
| -------- | ----------------------- | ---- | ---------------------------------------- |
| type | string | Yes | Event type. The value **'serviceDie'** indicates an event reported when the **DeviceManager** service is terminated unexpectedly.|
| callback | () =&gt; void | Yes | Callback invoked when a dead event of the **DeviceManager** service occurs. |
- Example
**Example**
```js
dmInstance.on("serviceDie", () => {
console.info("serviceDie on");
......@@ -631,13 +821,13 @@ Unsubscribes from dead events of the **DeviceManager** service.
**System capability**: SystemCapability.DistributedHardware.DeviceManager
- **Parameters**
| Name | Type | Mandatory | Description |
| -------- | ----------------------- | ---- | ---------------------------------------- |
| type | string | Yes | Event type. The value **'serviceDie'** indicates an event reported when the **DeviceManager** service is terminated unexpectedly.|
| callback | () =&gt; void | No | Callback used to return the dead event of the **DeviceManager** service. |
**Parameters**
| Name | Type | Mandatory | Description |
| -------- | ----------------------- | ---- | ---------------------------------------- |
| type | string | Yes | Event type. The value **'serviceDie'** indicates an event reported when the **DeviceManager** service is terminated unexpectedly.|
| callback | () =&gt; void | No | Callback used to return the dead event of the **DeviceManager** service. |
- Example
**Example**
```js
dmInstance.off("serviceDie", () => {
console.info("serviceDie off");
......
# Distributed Mission Management
The **distributedMissionManager** module implements system mission management across devices. You can use the APIs provided by this module to register or deregister a mission status listener, and start or stop synchronizing the remote mission list.
> **NOTE**
>
> The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version.
>
> The APIs provided by this module are system APIs.
## Modules to Import
```js
import distributedMissionManager from '@ohos.distributedMissionManager'
```
## distributedMissionManager.registerMissionListener
registerMissionListener(parameter: MissionDeviceInfo, options: MissionCallback, callback: AsyncCallback&lt;void&gt;): void;
Registers a mission status listener. This API uses an asynchronous callback to return the result.
**Required permissions**: ohos.permission.MANAGE_MISSIONS
**System capability**: SystemCapability.Ability.AbilityRuntime.Mission
**Parameters**
| Name | Type | Mandatory | Description |
| --------- | --------------------------------------- | ---- | --------- |
| parameter | [MissionDeviceInfo](#missiondeviceinfo) | Yes | Information about the device to listen for.|
| options | [MissionCallback](#missioncallback) | Yes | Callback to register. |
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result.|
**Example**
```ts
function NotifyMissionsChanged(deviceId) {
console.log('NotifyMissionsChanged deviceId ' + JSON.stringify(deviceId));
}
function NotifySnapshot(deviceId, missionId) {
console.log('NotifySnapshot deviceId ' + JSON.stringify(deviceId));
console.log('NotifySnapshot missionId ' + JSON.stringify(missionId));
}
function NotifyNetDisconnect(deviceId, state) {
console.log('NotifyNetDisconnect deviceId ' + JSON.stringify(deviceId));
console.log('NotifyNetDisconnect state ' + JSON.stringify(state));
}
var parameter = {
deviceId: remoteDeviceId
};
var options = {
notifyMissionsChanged: NotifyMissionsChanged,
notifySnapshot: NotifySnapshot,
notifyNetDisconnect: NotifyNetDisconnect
}
distributedMissionManager.registerMissionListener(parameter, options, (error) => {
console.log("error.code = " + error.code)
})
```
## distributedMissionManager.registerMissionListener
registerMissionListener(parameter: MissionDeviceInfo, options: MissionCallback): Promise&lt;void&gt;
Registers a mission status listener. This API uses a promise to return the result.
**Required permissions**: ohos.permission.MANAGE_MISSIONS
**System capability**: SystemCapability.Ability.AbilityRuntime.Mission
**Parameters**
| Name | Type | Mandatory | Description |
| --------- | ---------------------------------------- | ---- | -------- |
| parameter | [MissionDeviceInfo](#missiondeviceinfo) | Yes | Information about the device to listen for. |
| options | <a href="#missioncallback">MissionCallback</a> | Yes | Callback to register.|
**Return value**
| Type | Description |
| ------------------- | ---------------- |
| Promise&lt;void&gt; | Promise used to return the result.|
**Example**
```ts
function NotifyMissionsChanged(deviceId) {
console.log('NotifyMissionsChanged deviceId ' + JSON.stringify(deviceId));
}
function NotifySnapshot(deviceId, missionId) {
console.log('NotifySnapshot deviceId ' + JSON.stringify(deviceId));
console.log('NotifySnapshot missionId ' + JSON.stringify(missionId));
}
function NotifyNetDisconnect(deviceId, state) {
console.log('NotifyNetDisconnect deviceId ' + JSON.stringify(deviceId));
console.log('NotifyNetDisconnect state ' + JSON.stringify(state));
}
var parameter = {
deviceId: remoteDeviceId
};
var options = {
notifyMissionsChanged: NotifyMissionsChanged,
notifySnapshot: NotifySnapshot,
notifyNetDisconnect: NotifyNetDisconnect
}
distributedMissionManager.registerMissionListener(parameter, options)
.then(data => {
console.info('success data is ' + data);
}).catch(error => {
console.info('error error is ' + error);
})
```
## distributedMissionManager.unregisterMissionListener
unregisterMissionListener(parameter: MissionDeviceInfo, callback: AsyncCallback&lt;void&gt;): void;
Deregisters a mission status listener. This API uses an asynchronous callback to return the result.
**Required permissions**: ohos.permission.MANAGE_MISSIONS
**System capability**: SystemCapability.Ability.AbilityRuntime.Mission
**Parameters**
| Name | Type | Mandatory | Description |
| --------- | --------------------------------------- | ---- | --------- |
| parameter | [MissionDeviceInfo](#missiondeviceinfo) | Yes | Information about the device to listen for. |
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result.|
**Example**
```ts
var parameter = {
deviceId: remoteDeviceId
};
distributedMissionManager.unregisterMissionListener(parameter, (error) => {
console.log("error.code = " + error.code)
})
```
## distributedMissionManager.unregisterMissionListener
unregisterMissionListener(parameter: MissionDeviceInfo): Promise&lt;void&gt;
Deregisters a mission status listener. This API uses a promise to return the result.
**Required permissions**: ohos.permission.MANAGE_MISSIONS
**System capability**: SystemCapability.Ability.AbilityRuntime.Mission
**Parameters**
| Name | Type | Mandatory | Description |
| --------- | --------------------------------------- | ---- | ----- |
| parameter | [MissionDeviceInfo](#missiondeviceinfo) | Yes | Information about the device to listen for.|
**Return value**
| Type | Description |
| ------------------- | ---------------- |
| Promise&lt;void&gt; | Promise used to return the result.|
**Example**
```ts
var parameter = {
deviceId: remoteDeviceId
};
distributedMissionManager.unregisterMissionListener(parameter)
.then(data => {
console.info('success data is ' + data);
}).catch(error => {
console.info('error error is ' + error);
})
```
## distributedMissionManager.startSyncRemoteMissions
startSyncRemoteMissions(parameter: MissionParameter, callback: AsyncCallback&lt;void&gt;): void;
Starts to synchronize the remote mission list. This API uses an asynchronous callback to return the result.
**Required permissions**: ohos.permission.MANAGE_MISSIONS
**System capability**: SystemCapability.Ability.AbilityRuntime.Mission
**Parameters**
| Name | Type | Mandatory | Description |
| --------- | ------------------------------------- | ---- | --------- |
| parameter | [MissionParameter](#missionparameter) | Yes | Parameters required for synchronization. |
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result.|
**Example**
```ts
var parameter = {
deviceId: remoteDeviceId,
fixConflict: false,
tag: 0
};
distributedMissionManager.startSyncRemoteMissions(parameter, (error) => {
console.log("error.code = " + error.code)
})
```
## distributedMissionManager.startSyncRemoteMissions
startSyncRemoteMissions(parameter: MissionParameter): Promise&lt;void&gt;
Starts to synchronize the remote mission list. This API uses a promise to return the result.
**Required permissions**: ohos.permission.MANAGE_MISSIONS
**System capability**: SystemCapability.Ability.AbilityRuntime.Mission
**Parameters**
| Name | Type | Mandatory | Description |
| --------- | ------------------------------------- | ---- | ----- |
| parameter | [MissionParameter](#missionparameter) | Yes | Parameters required for synchronization.|
**Return value**
| Type | Description |
| ------------------- | ---------------- |
| Promise&lt;void&gt; | Promise used to return the result.|
**Example**
```ts
var parameter = {
deviceId: remoteDeviceId,
fixConflict: false,
tag: 0
};
distributedMissionManager.startSyncRemoteMissions(parameter)
.then(data => {
console.info('success data is ' + data);
}).catch(error => {
console.info('error error is ' + error);
})
```
## distributedMissionManager.stopSyncRemoteMissions
stopSyncRemoteMissions(parameter: MissionDeviceInfo, callback: AsyncCallback&lt;void&gt;): void;
Stops synchronizing the remote mission list. This API uses an asynchronous callback to return the result.
**Required permissions**: ohos.permission.MANAGE_MISSIONS
**System capability**: SystemCapability.Ability.AbilityRuntime.Mission
**Parameters**
| Name | Type | Mandatory | Description |
| --------- | --------------------------------------- | ---- | --------- |
| parameter | [MissionDeviceInfo](#missiondeviceinfo) | Yes | Parameters required for synchronization. |
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result.|
**Example**
```ts
var parameter = {
deviceId: remoteDeviceId
};
distributedMissionManager.stopSyncRemoteMissions(parameter, (error) => {
console.log("error.code = " + error.code)
})
```
## distributedMissionManager.stopSyncRemoteMissions
stopSyncRemoteMissions(parameter: MissionDeviceInfo): Promise&lt;void&gt;
Stops synchronizing the remote mission list. This API uses a promise to return the result.
**Required permissions**: ohos.permission.MANAGE_MISSIONS
**System capability**: SystemCapability.Ability.AbilityRuntime.Mission
**Parameters**
| Name | Type | Mandatory | Description |
| --------- | --------------------------------------- | ---- | ----- |
| parameter | [MissionDeviceInfo](#missiondeviceinfo) | Yes | Parameters required for synchronization.|
**Return value**
| Type | Description |
| ------------------- | ---------------- |
| Promise&lt;void&gt; | Promise used to return the result.|
**Example**
```ts
var parameter = {
deviceId: remoteDeviceId
};
distributedMissionManager.stopSyncRemoteMissions(parameter)
.then(data => {
console.info('success data is ' + data);
}).catch(error => {
console.info('error error is ' + error);
})
```
## MissionCallback
Defines the callbacks that can be registered as a mission status listener.
**System capability**: SystemCapability.Ability.AbilityRuntime.Mission
| Name | Type | Readable | Writable | Description |
| --------------------- | -------- | ---- | ---- | ------------------ |
| notifyMissionsChanged | function | Yes | No | Callback used to notify the mission change event and return the device ID. |
| notifySnapshot | function | Yes | No | Callback used to notify the snapshot change event and return the device ID and mission ID.|
| notifyNetDisconnect | function | Yes | No | Callback used to notify the disconnection event and return the device ID and network status.|
## MissionParameter
Defines the parameters required for mission synchronization.
**System capability**: SystemCapability.Ability.AbilityRuntime.Mission
| Name | Type | Readable | Writable | Description |
| ----------- | ------- | ---- | ---- | ----------- |
| deviceId | string | Yes | Yes | Device ID. |
| fixConflict | boolean | Yes | Yes | Whether a version conflict occurs.|
| tag | number | Yes | Yes | Tag of the mission. |
## MissionDeviceInfo
Defines the parameters required for registering a listener.
**System capability**: SystemCapability.Ability.AbilityRuntime.Mission
| Name | Type | Readable | Writable | Description |
| -------- | ------ | ---- | ---- | ------- |
| deviceId | string | Yes | Yes | Device ID.|
......@@ -61,7 +61,7 @@ Creates a **VideoPlayer** instance in asynchronous mode. This API uses a callbac
let videoPlayer
media.createVideoPlayer((error, video) => {
if (typeof(video) != 'undefined') {
if (video != null) {
videoPlayer = video;
console.info('video createVideoPlayer success');
} else {
......@@ -90,7 +90,7 @@ Creates a **VideoPlayer** instance in asynchronous mode. This API uses a promise
let videoPlayer
media.createVideoPlayer().then((video) => {
if (typeof(video) != 'undefined') {
if (video != null) {
videoPlayer = video;
console.info('video createVideoPlayer success');
} else {
......@@ -143,7 +143,7 @@ Only one **AudioRecorder** instance can be created per device.
let videoRecorder
media.createVideoRecorder((error, video) => {
if (typeof(video) != 'undefined') {
if (video != null) {
videoRecorder = video;
console.info('video createVideoRecorder success');
} else {
......@@ -173,7 +173,7 @@ Only one **AudioRecorder** instance can be created per device.
let videoRecorder
media.createVideoRecorder().then((video) => {
if (typeof(video) != 'undefined') {
if (video != null) {
videoRecorder = video;
console.info('video createVideoRecorder success');
} else {
......@@ -370,7 +370,7 @@ Seeks to the specified playback position.
```js
audioPlayer.on('timeUpdate', (seekDoneTime) => { // Set the 'timeUpdate' event callback.
if (typeof (seekDoneTime) == 'undefined') {
if (seekDoneTime == null) {
console.info('audio seek fail');
return;
}
......@@ -443,7 +443,7 @@ function printfDescription(obj) {
}
audioPlayer.getTrackDescription((error, arrlist) => {
if (typeof (arrlist) != 'undefined') {
if (arrlist != null) {
for (let i = 0; i < arrlist.length; i++) {
printfDescription(arrlist[i]);
}
......@@ -479,7 +479,7 @@ function printfDescription(obj) {
}
audioPlayer.getTrackDescription().then((arrlist) => {
if (typeof (arrlist) != 'undefined') {
if (arrlist != null) {
arrayDescription = arrlist;
} else {
console.log('audio getTrackDescription fail');
......@@ -505,7 +505,7 @@ Subscribes to the audio buffering update event.
| Name | Type | Mandatory| Description |
| -------- | -------- | ---- | ------------------------------------------------------------ |
| type | string | Yes | Event type, which is **'bufferingUpdate'** in this case. |
| type | string | Yes | Event type, which is **'bufferingUpdate'** in this case. |
| callback | function | Yes | Callback invoked when the event is triggered.<br>When [BufferingInfoType](#bufferinginfotype8) is set to **BUFFERING_PERCENT** or **CACHED_DURATION**, **value** is valid. Otherwise, **value** is fixed at **0**.|
**Example**
......@@ -554,7 +554,7 @@ audioPlayer.on('reset', () => { // Set the 'reset' event callback.
audioPlayer = undefined;
});
audioPlayer.on('timeUpdate', (seekDoneTime) => { // Set the 'timeUpdate' event callback.
if (typeof(seekDoneTime) == "undefined") {
if (seekDoneTime == null) {
console.info('audio seek fail');
return;
}
......@@ -602,14 +602,14 @@ Subscribes to the **'timeUpdate'** event.
| Name | Type | Mandatory| Description |
| -------- | ----------------- | ---- | ------------------------------------------------------------ |
| type | string | Yes | Event type, which is **'timeUpdate'** in this case.<br>The **'timeUpdate'** event is triggered when the [seek()](#audioplayer_seek) API is called. |
| type | string | Yes | Event type, which is **'timeUpdate'** in this case.<br>The **'timeUpdate'** event is triggered when the [seek()](#audioplayer_seek) API is called.|
| callback | Callback\<number> | Yes | Callback invoked when the event is triggered. The input parameter of the callback is the time when the seek operation is successful. |
**Example**
```js
audioPlayer.on('timeUpdate', (seekDoneTime) => { // Set the 'timeUpdate' event callback.
if (typeof (seekDoneTime) == 'undefined') {
if (seekDoneTime == null) {
console.info('audio seek fail');
return;
}
......@@ -630,7 +630,7 @@ Subscribes to audio playback error events. After an error event is reported, you
| Name | Type | Mandatory| Description |
| -------- | ------------- | ---- | ------------------------------------------------------------ |
| type | string | Yes | Event type, which is **'error'** in this case.<br>The **'error'** event is triggered when an error occurs during audio playback. |
| type | string | Yes | Event type, which is **'error'** in this case.<br>The **'error'** event is triggered when an error occurs during audio playback.|
| callback | ErrorCallback | Yes | Callback invoked when the event is triggered. |
**Example**
......@@ -727,7 +727,7 @@ Sets **SurfaceId**. This API uses a callback to return the result.
```js
videoPlayer.setDisplaySurface(surfaceId, (err) => {
if (typeof (err) == 'undefined') {
if (err == null) {
console.info('setDisplaySurface success!');
} else {
console.info('setDisplaySurface fail!');
......@@ -785,7 +785,7 @@ Prepares for video playback. This API uses a callback to return the result.
```js
videoPlayer.prepare((err) => {
if (typeof (err) == 'undefined') {
if (err == null) {
console.info('prepare success!');
} else {
console.info('prepare fail!');
......@@ -835,7 +835,7 @@ Starts to play video resources. This API uses a callback to return the result.
```js
videoPlayer.play((err) => {
if (typeof (err) == 'undefined') {
if (err == null) {
console.info('play success!');
} else {
console.info('play fail!');
......@@ -885,7 +885,7 @@ Pauses video playback. This API uses a callback to return the result.
```js
videoPlayer.pause((err) => {
if (typeof (err) == 'undefined') {
if (err == null) {
console.info('pause success!');
} else {
console.info('pause fail!');
......@@ -935,7 +935,7 @@ Stops video playback. This API uses a callback to return the result.
```js
videoPlayer.stop((err) => {
if (typeof (err) == 'undefined') {
if (err == null) {
console.info('stop success!');
} else {
console.info('stop fail!');
......@@ -985,7 +985,7 @@ Switches the video resource to be played. This API uses a callback to return the
```js
videoPlayer.reset((err) => {
if (typeof (err) == 'undefined') {
if (err == null) {
console.info('reset success!');
} else {
console.info('reset fail!');
......@@ -1037,7 +1037,7 @@ Seeks to the specified playback position. The next key frame at the specified po
```js
let seekTime = 5000;
videoPlayer.seek(seekTime, (err, result) => {
if (typeof (err) == 'undefined') {
if (err == null) {
console.info('seek success!');
} else {
console.info('seek fail!');
......@@ -1068,7 +1068,7 @@ import media from '@ohos.multimedia.media'
let seekTime = 5000;
let seekMode = media.SeekMode.SEEK_NEXT_SYNC;
videoPlayer.seek(seekTime, seekMode, (err, result) => {
if (typeof (err) == 'undefined') {
if (err == null) {
console.info('seek success!');
} else {
console.info('seek fail!');
......@@ -1134,7 +1134,7 @@ Sets the volume. This API uses a callback to return the result.
```js
let vol = 0.5;
videoPlayer.setVolume(vol, (err, result) => {
if (typeof (err) == 'undefined') {
if (err == null) {
console.info('setVolume success!');
} else {
console.info('setVolume fail!');
......@@ -1191,7 +1191,7 @@ Releases the video playback resource. This API uses a callback to return the res
```js
videoPlayer.release((err) => {
if (typeof (err) == 'undefined') {
if (err == null) {
console.info('release success!');
} else {
console.info('release fail!');
......@@ -1249,7 +1249,7 @@ function printfDescription(obj) {
}
videoPlayer.getTrackDescription((error, arrlist) => {
if (typeof (arrlist) != 'undefined') {
if (arrlist) != null) {
for (let i = 0; i < arrlist.length; i++) {
printfDescription(arrlist[i]);
}
......@@ -1286,7 +1286,7 @@ function printfDescription(obj) {
let arrayDescription;
videoPlayer.getTrackDescription().then((arrlist) => {
if (typeof (arrlist) != 'undefined') {
if (arrlist != null) {
arrayDescription = arrlist;
} else {
console.log('video getTrackDescription fail');
......@@ -1321,7 +1321,7 @@ import media from '@ohos.multimedia.media'
let speed = media.PlaybackSpeed.SPEED_FORWARD_2_00_X;
videoPlayer.setSpeed(speed, (err, result) => {
if (typeof (err) == 'undefined') {
if (err == null) {
console.info('setSpeed success!');
} else {
console.info('setSpeed fail!');
......@@ -1382,7 +1382,7 @@ Selects a bit rate from available ones, which can be obtained by calling [availa
```js
let bitrate = 1024000;
videoPlayer.selectBitrate(bitrate, (err, result) => {
if (typeof (err) == 'undefined') {
if (err == null) {
console.info('selectBitrate success!');
} else {
console.info('selectBitrate fail!');
......@@ -1433,7 +1433,7 @@ Subscribes to the video playback completion event.
| Name | Type | Mandatory| Description |
| -------- | -------- | ---- | ----------------------------------------------------------- |
| type | string | Yes | Event type, which is **'playbackCompleted'** in this case. |
| type | string | Yes | Event type, which is **'playbackCompleted'** in this case.|
| callback | function | Yes | Callback invoked when the event is triggered. |
**Example**
......@@ -1456,7 +1456,7 @@ Subscribes to the video buffering update event.
| Name | Type | Mandatory| Description |
| -------- | -------- | ---- | ------------------------------------------------------------ |
| type | string | Yes | Event type, which is **'bufferingUpdate'** in this case. |
| type | string | Yes | Event type, which is **'bufferingUpdate'** in this case. |
| callback | function | Yes | Callback invoked when the event is triggered.<br>When [BufferingInfoType](#bufferinginfotype8) is set to **BUFFERING_PERCENT** or **CACHED_DURATION**, **value** is valid. Otherwise, **value** is fixed at **0**.|
**Example**
......@@ -1480,7 +1480,7 @@ Subscribes to the frame rendering start event.
| Name | Type | Mandatory| Description |
| -------- | --------------- | ---- | ------------------------------------------------------------ |
| type | string | Yes | Event type, which is **'startRenderFrame'** in this case. |
| type | string | Yes | Event type, which is **'startRenderFrame'** in this case.|
| callback | Callback\<void> | Yes | Callback invoked when the event is triggered. |
**Example**
......@@ -1503,7 +1503,7 @@ Subscribes to the video width and height change event.
| Name | Type | Mandatory| Description |
| -------- | -------- | ---- | ------------------------------------------------------------ |
| type | string | Yes | Event type, which is **'videoSizeChanged'** in this case. |
| type | string | Yes | Event type, which is **'videoSizeChanged'** in this case.|
| callback | function | Yes | Callback invoked when the event is triggered. **width** indicates the video width, and **height** indicates the video height. |
**Example**
......@@ -1527,7 +1527,7 @@ Subscribes to video playback error events. After an error event is reported, you
| Name | Type | Mandatory| Description |
| -------- | ------------- | ---- | ------------------------------------------------------------ |
| type | string | Yes | Event type, which is **'error'** in this case.<br>The **'error'** event is triggered when an error occurs during video playback. |
| type | string | Yes | Event type, which is **'error'** in this case.<br>The **'error'** event is triggered when an error occurs during video playback.|
| callback | ErrorCallback | Yes | Callback invoked when the event is triggered. |
**Example**
......@@ -1640,7 +1640,7 @@ function printfItemDescription(obj, key) {
}
audioPlayer.getTrackDescription((error, arrlist) => {
if (typeof (arrlist) != 'undefined') {
if (arrlist != null) {
for (let i = 0; i < arrlist.length; i++) {
printfItemDescription(arrlist[i], MD_KEY_TRACK_TYPE); // Print the MD_KEY_TRACK_TYPE value of each track.
}
......@@ -1866,7 +1866,7 @@ Subscribes to audio recording error events. After an error event is reported, yo
| Name | Type | Mandatory| Description |
| -------- | ------------- | ---- | ------------------------------------------------------------ |
| type | string | Yes | Event type, which is **'error'** in this case.<br>The **'error'** event is triggered when an error occurs during audio recording. |
| type | string | Yes | Event type, which is **'error'** in this case.<br>The **'error'** event is triggered when an error occurs during audio recording.|
| callback | ErrorCallback | Yes | Callback invoked when the event is triggered. |
**Example**
......@@ -1996,7 +1996,7 @@ let eventEmitter = new events.EventEmitter();
eventEmitter.on('prepare', () => {
videoRecorder.prepare(videoConfig, (err) => {
if (typeof (err) == 'undefined') {
if (err == null) {
console.info('prepare success');
} else {
console.info('prepare failed and error is ' + err.message);
......@@ -2005,7 +2005,7 @@ eventEmitter.on('prepare', () => {
});
media.createVideoRecorder((err, recorder) => {
if (typeof (err) == 'undefined' && typeof (recorder) != 'undefined') {
if (err == null && recorder != null) {
videoRecorder = recorder;
console.info('createVideoRecorder success');
eventEmitter.emit('prepare'); // Trigger the 'prepare' event.
......@@ -2065,7 +2065,7 @@ let videoConfig = {
// promise
let videoRecorder = null;
media.createVideoRecorder().then((recorder) => {
if (typeof (recorder) != 'undefined') {
if (recorder != null) {
videoRecorder = recorder;
console.info('createVideoRecorder success');
} else {
......@@ -2106,7 +2106,7 @@ This API can be called only after [prepare()](#videorecorder_prepare1) is called
// asyncallback
let surfaceID = null; // Surface ID passed to the external system.
videoRecorder.getInputSurface((err, surfaceId) => {
if (typeof (err) == 'undefined') {
if (err == null) {
console.info('getInputSurface success');
surfaceID = surfaceId;
} else {
......@@ -2167,7 +2167,7 @@ This API can be called only after [prepare()](#videorecorder_prepare1) and [getI
```js
// asyncallback
videoRecorder.start((err) => {
if (typeof (err) == 'undefined') {
if (err == null) {
console.info('start videorecorder success');
} else {
console.info('start videorecorder failed and error is ' + err.message);
......@@ -2223,7 +2223,7 @@ This API can be called only after [start()](#videorecorder_start1) is called. Yo
```js
// asyncallback
videoRecorder.pause((err) => {
if (typeof (err) == 'undefined') {
if (err == null) {
console.info('pause videorecorder success');
} else {
console.info('pause videorecorder failed and error is ' + err.message);
......@@ -2277,7 +2277,7 @@ Resumes video recording in asynchronous mode. This API uses a callback to return
```js
// asyncallback
videoRecorder.resume((err) => {
if (typeof (err) == 'undefined') {
if (err == null) {
console.info('resume videorecorder success');
} else {
console.info('resume videorecorder failed and error is ' + err.message);
......@@ -2331,7 +2331,7 @@ To start another recording, you must call [prepare()](#videorecorder_prepare1) a
```js
// asyncallback
videoRecorder.stop((err) => {
if (typeof (err) == 'undefined') {
if (err == null) {
console.info('stop videorecorder success');
} else {
console.info('stop videorecorder failed and error is ' + err.message);
......@@ -2385,7 +2385,7 @@ Releases the video recording resource in asynchronous mode. This API uses a call
```js
// asyncallback
videoRecorder.release((err) => {
if (typeof (err) == 'undefined') {
if (err == null) {
console.info('release videorecorder success');
} else {
console.info('release videorecorder failed and error is ' + err.message);
......@@ -2439,7 +2439,7 @@ To start another recording, you must call [prepare()](#videorecorder_prepare1) a
```js
// asyncallback
videoRecorder.reset((err) => {
if (typeof (err) == 'undefined') {
if (err == null) {
console.info('reset videorecorder success');
} else {
console.info('reset videorecorder failed and error is ' + err.message);
......@@ -2486,13 +2486,13 @@ Subscribes to video recording error events. After an error event is reported, yo
| Name | Type | Mandatory| Description |
| -------- | ------------- | ---- | ------------------------------------------------------------ |
| type | string | Yes | Event type, which is **'error'** in this case.<br>The **'error'** event is triggered when an error occurs during video recording. |
| type | string | Yes | Event type, which is **'error'** in this case.<br>The **'error'** event is triggered when an error occurs during video recording.|
| callback | ErrorCallback | Yes | Callback invoked when the event is triggered. |
**Example**
```js
videoRecorder.on('error', (error) => { // Set the 'error event' callback.
videoRecorder.on('error', (error) => { // Set the 'error' event callback.
console.info(`audio error called, errName is ${error.name}`); // Print the error name.
console.info(`audio error called, errCode is ${error.code}`); // Print the error code.
console.info(`audio error called, errMessage is ${error.message}`); // Print the detailed description of the error type.
......
......@@ -2280,7 +2280,7 @@ Describes options for fetching media files.
| ----------------------- | ------------------- | ---- | ---- | ---- | ------------------------------------------------------------ |
| selections | string | Yes | Yes | Yes | Conditions for fetching files. The enumerated values in [FileKey](#filekey8) are used as the column names of the conditions. Example:<br>selections: mediaLibrary.FileKey.MEDIA_TYPE + '= ? OR ' +mediaLibrary.FileKey.MEDIA_TYPE + '= ?', |
| selectionArgs | Array&lt;string&gt; | Yes | Yes | Yes | Value of the condition, which corresponds to the value of the condition column in **selections**.<br>Example:<br>selectionArgs: [mediaLibrary.MediaType.IMAGE.toString(), mediaLibrary.MediaType.VIDEO.toString()], |
| order | string | Yes | Yes | No | Sorting mode of the search results, which can be ascending or descending. The enumerated values in [FileKey](#filekey8) are used as the columns for sorting the search results. Example:<br>Ascending: order: mediaLibrary.FileKey.DATE_ADDED + " AESC"<br>Descending: order: mediaLibrary.FileKey.DATE_ADDED + " DESC"|
| order | string | Yes | Yes | No | Sorting mode of the search results, which can be ascending or descending. The enumerated values in [FileKey](#filekey8) are used as the columns for sorting the search results. Example:<br>Ascending: order: mediaLibrary.FileKey.DATE_ADDED + " ASC"<br>Descending: order: mediaLibrary.FileKey.DATE_ADDED + " DESC" |
| uri<sup>8+</sup> | string | Yes | Yes | No | File URI. |
| networkId<sup>8+</sup> | string | Yes | Yes | No | Network ID of the registered device. |
| extendArgs<sup>8+</sup> | string | Yes | Yes | No | Extended parameters for fetching the files. Currently, no extended parameters are available. |
......
# Mouse Pointer
The mouse pointer module provides APIs related to pointer attribute management.
> **NOTE**
>
> The initial APIs of this module are supported since API version 9. Newly added APIs will be marked with a superscript to indicate their earliest API version.
## Modules to Import
```js
import pointer from '@ohos.multimodalInput.pointer';
```
## pointer.setPointerVisibele
setPointerVisible(visible: boolean, callback: AsyncCallback&lt;void&gt;): void
Sets the visible status of the mouse pointer. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.MultimodalInput.Input.Pointer
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ------------------------- | ---- | ------------------------------------------------------------------- |
| visible | boolean | Yes | Whether the mouse pointer is visible. The value **true** indicates that the mouse pointer is visible, and the value **false** indicates the opposite.|
| callback | AysncCallback&lt;void&gt; | Yes | Callback used to return the result. |
**Example**
```js
pointer.setPointerVisible(true, (err, data) => {
if (err) {
console.log(`set pointer visible failed. err=${JSON.stringify(err)}`);
return;
}
console.log(`set pointer visible success.`);
);
```
## pointer.setPointerVisible
setPointerVisible(visible: boolean): Promise&lt;void&gt;
Sets the visible status of the mouse pointer. This API uses a promise to return the result.
**System capability**: SystemCapability.MultimodalInput.Input.Pointer
**Parameters**
| Name | Type | Mandatory| Description |
| ------- | ------- | ---- | ------------------------------------------------------------------- |
| visible | boolean | Yes | Whether the mouse pointer is visible. The value **true** indicates that the mouse pointer is visible, and the value **false** indicates the opposite.|
**Return value**
| Parameter | Description |
| ------------------- | ------------------------------- |
| Promise&lt;void&gt; | Promise used to return the result.|
**Example**
```js
pointer.setPointerVisible(false).then( data => {
console.log(`set mouse pointer visible success`);
}, data => {
console.log(`set mouse pointer visible failed err=${JSON.stringify(data)}`);
});
```
## pointer.isPointerVisible
isPointerVisible(callback: AsyncCallback&lt;boolean&gt;): void
Checks the visible status of the mouse pointer. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.MultimodalInput.Input.Pointer
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ---------------------------- | ---- | ---------------------------- |
| callback | AsyncCallback&lt;boolean&gt; | Yes | Callback used to return the result.|
**Example**
```js
pointer.isPointerVisible((visible)=>{
console.log("The mouse pointer visible attributes is " + visible);
});
```
## pointer.isPointerVisible
isPointerVisible(): Promise&lt;boolean&gt;
Checks the visible status of the mouse pointer. This API uses a promise to return the result.
**System capability**: SystemCapability.MultimodalInput.Input.Pointer
**Return value**
| Parameter | Description |
| ---------------------- | ------------------------------- |
| Promise&lt;boolean&gt; | Promise used to return the result.|
**Example**
```js
pointer.isPointerVisible().then( data => {
console.log(`isPointerThen success data=${JSON.stringify(data)}`);
});
```
......@@ -1588,6 +1588,128 @@ promise.then(data => {
});
```
## radio.getImsRegInfo<sup>9+</sup>
getImsRegInfo(slotId: number, imsType: ImsServiceType, callback: AsyncCallback<ImsRegInfo\>): void
Obtains the IMS registration status of the specified IMS service type. This API uses an asynchronous callback to return the result.
This is a system API.
**Required permission**: ohos.permission.GET_TELEPHONY_STATE
**System capability**: SystemCapability.Telephony.CoreService
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ------------------------------------------ | ---- | -------------------------------------- |
| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
| imsType | [ImsServiceType](#imsservicetype9) | Yes | IMS service type. |
| callback | AsyncCallback<[ImsRegInfo](#imsreginfo9)\> | Yes | Callback used to return the result. |
**Example**
```js
radio.getImsRegInfo(0, 1, (err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```
## radio.getImsRegInfo<sup>9+</sup>
getImsRegInfo(slotId: number, imsType: ImsServiceType): Promise<ImsRegInfo\>
Obtains the IMS registration status of the specified IMS service type. This API uses a promise to return the result.
This is a system API.
**Required permission**: ohos.permission.GET_TELEPHONY_STATE
**System capability**: SystemCapability.Telephony.CoreService
**Parameters**
| Name | Type | Mandatory| Description |
| ------- | ---------------------------------- | ---- | -------------------------------------- |
| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
| imsType | [ImsServiceType](#imsservicetype9) | Yes | IMS service type. |
**Return value**
| Type | Description |
| ------------------------------------- | ----------------------- |
| Promise\<[ImsRegInfo](#imsreginfo9)\> | Promise used to return the result.|
**Example**
```js
let promise = radio.getImsRegInfo(0, 1);
promise.then(data => {
console.log(`getImsRegInfo success, promise: data->${JSON.stringify(data)}`);
}).catch(err => {
console.log(`getImsRegInfo fail, promise: err->${JSON.stringify(err)}`);
});
```
## radio.on('imsRegStateChange')<sup>9+</sup>
on(type: 'imsRegStateChange', slotId: number, imsType: ImsServiceType, callback: Callback<ImsRegInfo\>): void
Enables listening for **imsRegStateChange** events. This API uses an asynchronous callback to return the result.
This is a system API.
**Required permission**: ohos.permission.GET_TELEPHONY_STATE
**System capability**: SystemCapability.Telephony.CoreService
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ------------------------------------ | ---- | -------------------------------------- |
| type | string | Yes | IMS registration status changes. |
| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
| imsType | [ImsServiceType](#imsservicetype9) | Yes | IMS service type. |
| callback | Callback<[ImsRegInfo](#imsreginfo9)> | Yes | Callback used to return the result. |
**Example**
```js
radio.on('imsRegStateChange', 0, 1, (err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```
## radio.off('imsRegStateChange')<sup>9+</sup>
off(type: 'imsRegStateChange', slotId: number, imsType: ImsServiceType, callback?: Callback<ImsRegInfo\>): void
Disables listening for **imsRegStateChange** events. This API uses an asynchronous callback to return the result.
This is a system API.
**Required permission**: ohos.permission.GET_TELEPHONY_STATE
**System capability**: SystemCapability.Telephony.CoreService
**Parameters**
| Name | Type | Mandatory| Description |
| -------- | ------------------------------------ | ---- | -------------------------------------- |
| type | string | Yes | IMS registration status changes. |
| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
| imsType | [ImsServiceType](#imsservicetype9) | Yes | IMS service type. |
| callback | Callback<[ImsRegInfo](#imsreginfo9)> | No | Callback used to return the result. |
**Example**
```js
radio.off('imsRegStateChange', 0, 1, (err, data) => {
console.log(`callback: err->${JSON.stringify(err)}, data->${JSON.stringify(data)}`);
});
```
## RadioTechnology
Enumerates radio access technologies.
......@@ -1755,11 +1877,11 @@ This is a system API.
| Name | Type | Description |
| ----------------- | ------------------------------------------------------------ | ------------------------------------------------------------ |
| networkType | [NetworkType](#networkType) | Network type of the cell. |
| networkType | [NetworkType](#networktype) | Network type of the cell. |
| isCamped | boolean | Status of the cell. |
| timeStamp | number | Timestamp when cell information is obtained. |
| signalInformation | [SignalInformation](#signalinformation) | Signal information. |
| data | [CdmaCellInformation](#cdmacellinformation) \| [GsmCellInformation](#gsmcellinformation) \| [LteCellInformation](#ltecellinformation) \| [NrCellInformation](#nrcellinformation) \| [TdscdmaCellInformation](#tdscdmacellinformation) | CDMA cell information \| GSM cell information \| LTE cell information \| NR cell information \| TD-SCDMA cell information |
| data | [CdmaCellInformation](#cdmacellinformation8) \| [GsmCellInformation](#gsmcellinformation8) \| [LteCellInformation](#ltecellinformation8) \| [NrCellInformation](#nrcellinformation8) \| [TdscdmaCellInformation](#tdscdmacellinformation8) | CDMA cell information \|GSM cell information \|LTE cell information \|NR cell information \|TD-SCDMA cell information|
## CdmaCellInformation<sup>8+</sup>
......@@ -1883,6 +2005,8 @@ This is a system API.
Defines the network search result.
This is a system API.
**System capability**: SystemCapability.Telephony.CoreService
| Name | Type | Description |
......@@ -1934,3 +2058,59 @@ This is a system API.
| selectMode | [NetworkSelectionMode](#networkselectionmode) | Network selection mode. |
| networkInformation | [NetworkInformation](#networkinformation) | Network information. |
| resumeSelection | boolean | Whether to resume selection. |
## ImsRegState<sup>9+</sup>
Enumerates IMS registration states.
This is a system API.
**System capability**: SystemCapability.Telephony.CoreService
| Name | Value | Description |
| ---------------- | ---- | -------- |
| IMS_UNREGISTERED | 0 | Not registered.|
| IMS_REGISTERED | 1 | Registered.|
## ImsRegTech<sup>9+</sup>
Enumerates IMS registration technologies.
This is a system API.
**System capability**: SystemCapability.Telephony.CoreService
| Name | Value | Description |
| ----------------------- | ---- | --------------- |
| REGISTRATION_TECH_NONE | 0 | None. |
| REGISTRATION_TECH_LTE | 1 | LTE. |
| REGISTRATION_TECH_IWLAN | 2 | I-WLAN.|
| REGISTRATION_TECH_NR | 3 | NR. |
## ImsRegInfo<sup>9+</sup>
Defines the IMS registration information.
This is a system API.
**System capability**: SystemCapability.Telephony.CoreService
| Name | Type | Description |
| ----------- | ---------------------------- | ------------- |
| imsRegState | [ImsRegState](#imsregstate9) | IMS registration state.|
| imsRegTech | [ImsRegTech](#imsregtech9) | IMS registration technology.|
## ImsServiceType<sup>9+</sup>
Enumerates IMS service types.
This is a system API.
**System capability**: SystemCapability.Telephony.CoreService
| Name | Value | Description |
| ---------- | ---- | ---------- |
| TYPE_VOICE | 0 | Voice service.|
| TYPE_VIDEO | 1 | Video service.|
| TYPE_UT | 2 | UT service. |
| TYPE_SMS | 3 | SMS service.|
......@@ -5,7 +5,7 @@ The **Router** module provides APIs to access pages through URLs. You can use th
> **NOTE**
>
> - The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version.
>
>
> - Page routing APIs can be invoked only after page rendering is complete. Do not call these APIs in **onInit** and **onReady** when the page is still in the rendering phase.
## Modules to Import
......@@ -23,9 +23,9 @@ Navigates to a specified page in the application.
**System capability**: SystemCapability.ArkUI.ArkUI.Full
**Parameters**
| Name | Type | Mandatory| Description |
| ------- | ------------------------------- | ---- | ------------------ |
| options | [RouterOptions](#routeroptions) | Yes | Page routing parameters.|
| Name | Type | Mandatory | Description |
| ------- | ------------------------------- | ---- | --------- |
| options | [RouterOptions](#routeroptions) | Yes | Page routing parameters.|
**Example**
......@@ -49,10 +49,10 @@ Navigates to a specified page in the application.
**System capability**: SystemCapability.ArkUI.ArkUI.Full
**Parameters**
| Name | Type | Mandatory| Description |
| ----------------- | ------------------------------- | ---- | -------------------- |
| options | [RouterOptions](#routeroptions) | Yes | Page routing parameters. |
| mode<sup>9+</sup> | [RouterMode](#routermode9) | Yes | Routing mode.|
| Name | Type | Mandatory | Description |
| ------- | ------------------------------- | ---- | ---------- |
| options | [RouterOptions](#routeroptions) | Yes | Page routing parameters. |
| mode | [RouterMode](#routermode9) | Yes | Routing mode.|
**Example**
......@@ -77,6 +77,7 @@ Replaces the current page with another one in the application and destroys the c
**System capability**: SystemCapability.ArkUI.ArkUI.Full
**Parameters**
| Name | Type | Mandatory| Description |
| ------- | ------------------------------- | ---- | ------------------ |
| options | [RouterOptions](#routeroptions) | Yes | Description of the new page.|
......@@ -101,10 +102,10 @@ Replaces the current page with another one in the application and destroys the c
**System capability**: SystemCapability.ArkUI.ArkUI.Full
**Parameters**
| Name | Type | Mandatory| Description |
| ----------------- | ------------------------------- | ---- | -------------------- |
| options | [RouterOptions](#routeroptions) | Yes | Description of the new page. |
| mode<sup>9+</sup> | [RouterMode](#routermode9) | Yes | Routing mode.|
| Name | Type | Mandatory | Description |
| ------- | ------------------------------- | ---- | ---------- |
| options | [RouterOptions](#routeroptions) | Yes | Description of the new page. |
| mode | [RouterMode](#routermode9) | Yes | Routing mode.|
**Example**
......@@ -128,7 +129,7 @@ Returns to the previous page or a specified page.
**Parameters**
| Name | Type | Mandatory| Description |
| ------- | ------------------------------- | ---- | ------------------------------------------------------------ |
| options | [RouterOptions](#routeroptions) | No | Description of the page. The **url** parameter indicates the URL of the page to return to. If the specified page does not exist in the page stack, the application does not respond. If this parameter is not set, the application returns to the previous page.|
| options | [RouterOptions](#routeroptions) | No | Description of the page. The **url** parameter indicates the URL of the page to return to. If the specified page does not exist in the page stack, the application does not respond. If no URL is set, the previous page is returned, and the page in the page stack is not reclaimed. It will be reclaimed after being popped up.|
**Example**
......@@ -159,8 +160,8 @@ Obtains the number of pages in the current stack.
**System capability**: SystemCapability.ArkUI.ArkUI.Full
**Return value**
| Type | Description |
| ------ | ---------------------------------- |
| Type | Description |
| ------ | ------------------ |
| string | Number of pages in the stack. The maximum value is **32**.|
**Example**
......@@ -179,8 +180,8 @@ Obtains state information about the current page.
**Return value**
| Type | Description |
| --------------------------- | -------------- |
| Type | Description |
| --------------------------- | ------- |
| [RouterState](#routerstate) | Page routing state.|
**Example**
......@@ -197,11 +198,11 @@ Describes the page routing state.
**System capability**: SystemCapability.ArkUI.ArkUI.Full
| Name | Type | Description |
| ----- | ------ | ------------------------------------------------------------ |
| Name | Type | Description |
| ----- | ------ | ---------------------------------- |
| index | number | Index of the current page in the stack. The index starts from 1 from the bottom to the top of the stack.|
| name | string | Name of the current page, that is, the file name. |
| path | string | Path of the current page. |
| name | string | Name of the current page, that is, the file name. |
| path | string | Path of the current page. |
## router.enableAlertBeforeBackPage
......@@ -212,9 +213,9 @@ Enables the display of a confirm dialog box before returning to the previous pag
**System capability**: SystemCapability.ArkUI.ArkUI.Full
**Parameters**
| Name | Type | Mandatory| Description |
| ------- | ----------------------------------------- | ---- | ------------------ |
| options | [EnableAlertOptions](#enablealertoptions) | Yes | Description of the dialog box.|
| Name | Type | Mandatory | Description |
| ------- | ---------------------------------------- | ---- | --------- |
| options | [EnableAlertOptions](#enablealertoptions) | Yes | Description of the dialog box.|
**Example**
......@@ -229,9 +230,9 @@ Describes the confirm dialog box.
**System capability**: SystemCapability.ArkUI.ArkUI.Full
| Name | Type | Mandatory| Description |
| ------- | ------ | ---- | ---------------- |
| message | string | Yes | Content displayed in the confirm dialog box.|
| Name | Type | Mandatory | Description |
| ------- | ------ | ---- | -------- |
| message | string | Yes | Content displayed in the confirm dialog box.|
## router.disableAlertBeforeBackPage
......@@ -256,8 +257,8 @@ Obtains the parameters passed from the page that initiates redirection to the cu
**Return value**
| Type | Description |
| ------ | ---------------------------------- |
| Type | Description |
| ------ | ----------------- |
| Object | Parameters passed from the page that initiates redirection to the current page.|
**Example**
......@@ -272,14 +273,13 @@ Describes the page routing options.
**System capability**: SystemCapability.ArkUI.ArkUI.Lite
| Name | Type | Mandatory| Description |
| ------ | ------ | ---- | ------------------------------------------------------------ |
| url | string | Yes | URI of the destination page, in either of the following formats:<br>- Absolute path of the page. The value is available in the pages list in the **config.json** file, for example:<br>- pages/index/index<br>- pages/detail/detail<br>- Particular path. If the URI is a slash (/), the home page is displayed. |
| params | Object | No | Data that needs to be passed to the destination page during redirection. After the destination page is displayed, it can use the passed data, for example, **this.data1** (**data1** is a key in **params**). If there is the same key (for example, **data1**) on the destination page, the passed **data1** value will replace the original value on the destination page.|
| Name | Type | Mandatory | Description |
| ------ | ------ | ---- | ---------------------------------------- |
| url | string | Yes | URI of the destination page, in either of the following formats:<br>- Absolute path of the page. The value is available in the pages list in the **config.json** file, for example:<br>- pages/index/index<br>- pages/detail/detail<br>- Particular path. If the URI is a slash (/), the home page is displayed.|
| params | Object | No | Data that needs to be passed to the destination page during redirection. After the destination page is displayed, it can use the passed data, for example, **this.data1** (**data1** is a key in **params**). If there is the same key (for example, **data1**) on the destination page, the passed **data1** value will replace the original value on the destination page.|
> **NOTE**
>
> The page routing stack supports a maximum of 32 pages.
## RouterMode<sup>9+</sup>
......@@ -288,9 +288,9 @@ Enumerates the routing modes.
**System capability**: SystemCapability.ArkUI.ArkUI.Full
| Name | Description |
| -------- | ------------------------------------------------------------ |
| Standard | Standard mode. |
| Name | Description |
| -------- | ---------------------------------------- |
| Standard | Standard mode. |
| Single | Singleton mode.<br>If the URL of the target page already exists in the page stack, the page closest to the top of the stack is moved as a new page to the top of the stack.<br>If the URL of the target page does not exist in the page stack, the page is redirected to in standard mode.|
## Examples
......
......@@ -1482,7 +1482,7 @@ promise.then(data => {
## sim.**unlockPin**2<sup>8+</sup>
****unlockPin2****(slotId: number,pin2: string ,callback: AsyncCallback<LockStatusResponse\>): void
unlockPin2(slotId: number,pin2: string ,callback: AsyncCallback<LockStatusResponse\>): void
Unlocks PIN 2 of the SIM card in the specified slot. This API uses an asynchronous callback to return the result.
......@@ -1549,7 +1549,7 @@ promise.then(data => {
## sim.**unlockPuk**2<sup>8+</sup>
unlockPuk2(slotId: number,newPin2: string,puk2: string ,callback: AsyncCallback<LockStatusResponse\>): void
unlockPuk2(slotId: number, newPin2: string, puk2: string, callback: AsyncCallback<LockStatusResponse\>): void
Unlocks PUK 2 of the SIM card in the specified slot. This API uses an asynchronous callback to return the result.
......@@ -1581,7 +1581,7 @@ sim.unlockPuk2(0, newPin2, puk2, (err, data) => {
## sim.**unlockPuk2**<sup>8+</sup>
unlockPuk2slotId: number,newPin2: string,puk2: string): Promise&lt;LockStatusResponse\>
unlockPuk2(slotId: number, newPin2: string, puk2: string): Promise&lt;LockStatusResponse\>
Unlocks PUK 2 of the SIM card in the specified slot. This API uses a promise to return the result.
......@@ -2653,7 +2653,7 @@ promise.then(data => {
## sim.getOpKey<sup>9+</sup>
getOpKey(slotId: number, callback: AsyncCallback<number\>): void
getOpKey(slotId: number, callback: AsyncCallback<string\>): void
Obtains the opkey of the SIM card in the specified slot. This API uses an asynchronous callback to return the result.
......@@ -2666,7 +2666,7 @@ This is a system API.
| Name | Type | Mandatory| Description |
| -------- | ---------------------- | ---- | -------------------------------------- |
| slotId | number | Yes | Card slot ID.<br>- **0**: card slot 1<br>- **1**: card slot 2|
| callback | AsyncCallback<number\> | Yes | Callback used to return the result. |
| callback | AsyncCallback<string\> | Yes | Callback used to return the result. |
**Example**
......@@ -2679,7 +2679,7 @@ sim.getOpKey(0, (err, data) => {
## sim.getOpKey<sup>9+</sup>
getOpKey(slotId: number): Promise<number\>
getOpKey(slotId: number): Promise<string\>
Obtains the opkey of the SIM card in the specified slot. This API uses a promise to return the result.
......@@ -2697,7 +2697,7 @@ This is a system API.
| Type | Description |
| ---------------- | ----------------------------------------- |
| Promise<number\> | Promise used to return the result.|
| Promise<string\> | Promise used to return the result.|
**Example**
......
......@@ -678,7 +678,7 @@ This is a system API.
| Name | Type | Mandatory| Description |
| -------- | ----------------------------------------------------------- | ---- | ----------------------------------------- |
| slotId | number | Yes | SIM card slot ID. <br>- **0**: card slot 1<br>- **1**: card slot 2|
| callback | AsyncCallback<Array<[SimShortMessage](#simshortmessage8)\>> | Yes | Callback used to return the result. |
| callback | AsyncCallback<Array<[SimShortMessage](#simshortmessage7)\>> | Yes | Callback used to return the result. |
**Example**
......@@ -712,7 +712,7 @@ This is a system API.
| Type | Description |
| ------------------------------------------------------- | ---------------------------------- |
| PromiseArray<[SimShortMessage](#simshortmessage8)\>&gt; | Promise used to return the result.|
| PromiseArray<[SimShortMessage](#simshortmessage7)\>&gt; | Promise used to return the result.|
**Example**
......@@ -742,7 +742,7 @@ This is a system API.
| Name | Type | Mandatory| Description |
| -------- | ------------------------------------ | ---- | ------------ |
| options | [CBConfigOptions](#cbconfigoptions8) | Yes | Cell broadcast configuration options.|
| options | [CBConfigOptions](#cbconfigoptions7) | Yes | Cell broadcast configuration options.|
| callback | AsyncCallback&lt;void&gt; | Yes | Callback used to return the result. |
**Example**
......@@ -776,7 +776,7 @@ This is a system API.
| Name | Type | Mandatory| Description |
| ------- | ------------------------------------ | ---- | ------------ |
| options | [CBConfigOptions](#cbconfigoptions8) | Yes | Cell broadcast configuration options.|
| options | [CBConfigOptions](#cbconfigoptions7) | Yes | Cell broadcast configuration options.|
**Return value**
......@@ -818,7 +818,7 @@ This is a system API.
| slotId | number | Yes | SIM card slot ID. <br>- **0**: card slot 1<br>- **1**: card slot 2|
| message | string | Yes | SMS message. |
| force7bit | boolean | Yes | Whether to use 7-bit coding. |
| callback | AsyncCallback&lt;[SmsSegmentsInfo](#<smssegmentsinfo8)&gt; | Yes | Callback used to return the result. |
| callback | | Yes | Callback used to return the result. |
**Example**
......@@ -852,7 +852,7 @@ This is a system API.
| Type | Description |
| ------------------------------------------------------- | ----------------------------- |
| Promise&lt;[SmsSegmentsInfo](#<smssegmentsinfo8)&gt; | Promise used to return the result.|
| | Promise used to return the result.|
**Example**
......@@ -1331,6 +1331,25 @@ This is a system API.
| date | number | Yes | Date. |
| readStatus | number | Yes | Read status.|
## MmsReadRecInd<sup>8+</sup>
Defines the MMS message reading index.
This is a system API.
**System capability**: SystemCapability.Telephony.SmsMms
| Name | Type | Mandatory| Description |
| ---------- | ---------------------------------- | ---- | -------- |
| version | [MmsVersionType](#mmsversiontype8) | Yes | Version |
| messageId | string | Yes | Message ID. |
| to | Array<[MmsAddress](#mmsaddress8)\> | Yes | Destination. |
| from | [MmsAddress](#mmsaddress8) | Yes | Source. |
| readStatus | number | Yes | Read state.|
| date | number | No | Date. |
## MmsAttachment<sup>8+</sup>
Defines the attachment of an MMS message.
......@@ -1466,7 +1485,7 @@ This is a system API.
| MMS_YES | 128 | YES |
| MMS_NO | 129 | NO |
## CBConfigOptions<sup>8+</sup>
## CBConfigOptions<sup>7+</sup>
Defines the cell broadcast configuration options.
......@@ -1557,7 +1576,7 @@ This is a system API.
| pdu | string | Yes | Protocol data unit. |
| smsc | string | Yes | Short message service center.|
## SimShortMessage<sup>8+</sup>
## SimShortMessage<sup>7+</sup>
Defines a SIM message.
......
# Page Routing
The **Router** module provides APIs to access pages through URIs.
> **NOTE**
>
> - The APIs of this module are no longer maintained since API version 8. You are advised to use [`@ohos.router`](js-apis-router.md) instead.
......@@ -372,12 +374,12 @@ Defines the **EnableAlertBeforeBackPage** parameters.
**System capability**: SystemCapability.ArkUI.ArkUI.Full
| Name | Type | Mandatory | Description |
| -------- | ------------------------ | ---- | ------------------------- |
| message | string | Yes | Content displayed in the confirm dialog box. |
| success | (errMsg: string) => void | No | Called when a dialog box is displayed. **errMsg** indicates the returned information. |
| fail | (errMsg: string) => void | No | Called when the API fails to be called. **errMsg** indicates the returned information.|
| complete | () => void | No | Called when the API call is complete. |
| Name | Type | Mandatory| Description |
| -------- | ------------------------ | ---- | -------------------------------------------------- |
| message | string | Yes | Content displayed in the confirm dialog box. |
| success | (errMsg: string) => void | No | Called when the **OK** button in the confirm dialog box is clicked. **errMsg** indicates the returned information.|
| cancel | (errMsg: string) => void | No | Called when the **Cancel** button in the confirm dialog box is clicked. **errMsg** indicates the returned information.|
| complete | () => void | No | Called when the API call is complete. |
## DisableAlertBeforeBackPageOptions<sup>6+</sup>
......@@ -385,11 +387,11 @@ Define the **DisableAlertBeforeBackPage** parameters.
**System capability**: SystemCapability.ArkUI.ArkUI.Full
| Name | Type | Mandatory | Description |
| -------- | ------------------------ | ---- | ------------------------- |
| success | (errMsg: string) => void | No | Called when a dialog box is displayed. **errMsg** indicates the returned information. |
| fail | (errMsg: string) => void | No | Called when the API fails to be called. **errMsg** indicates the returned information.|
| complete | () => void | No | Called when the API call is complete. |
| Name | Type | Mandatory| Description |
| -------- | ------------------------ | ---- | -------------------------------------------------- |
| success | (errMsg: string) => void | No | Called when the dialog box is closed. **errMsg** indicates the returned information.|
| cancel | (errMsg: string) => void | No | Called when the dialog box fails to be closed. **errMsg** indicates the returned information.|
| complete | () => void | No | Called when the API call is complete. |
## ParamsInterface
......
......@@ -65,7 +65,7 @@ To draw a 2D image without using WebGL, that is, to implement CPU rather than GP
3. Edit the **index.js** file to add the 2D drawing logic code. The following is an example of the file content:
```
//index.js
// index.js
export default { // Native API interaction code
data: {
title: "DEMO BY TEAMOL",
......@@ -136,7 +136,7 @@ To use WebGL to draw a color triangle (GPU drawing), perform the following steps
3. Edit the JavaScript code file to add the logic code for drawing a color triangle. The following is an example of the file content:
```
//index.js
// index.js
// WebGL-related predefinition
var gl = {
......@@ -696,13 +696,6 @@ To use WebGL to draw a color triangle (GPU drawing), perform the following steps
}
```
**Figure 2** Effect of clicking the button to draw a color triangle
![en-us_image_0000001192429306](figures/en-us_image_0000001192429306.gif)
## Samples
The following sample is provided to help you better understand how to develop WebGL:
- [`JsWbgGL`: WebGL (JS, API version 8)](https://gitee.com/openharmony/app_samples/tree/master/Graphics/JsWebGL)
......@@ -10,12 +10,11 @@ For details about the APIs, see [Display](../reference/apis/js-apis-display.md).
## How to Develop
Call **getDefaultDisplay(): Promise<Display>** to obtain the default display object. An example code snippet is as follows:
Call `getDefaultDisplay(): Promise<Display>` to obtain the default display object. An example code snippet is as follows:
```js
import display from '@ohos.display' // Import the module.
let disp; // disp is used to save the default display object.
display.getDefaultDisplay().then((disp) => {
console.log('display.getDefaultDisplay success, display :' + JSON.stringify(disp));
}, (err) => {
......
......@@ -77,7 +77,6 @@
- [init Module](subsys-boot-init.md)
- [appspawn Module](subsys-boot-appspawn.md)
- [bootstrap Module](subsys-boot-bootstrap.md)
- [syspara Module](subsys-boot-syspara.md)
- [FAQs](subsys-boot-faqs.md)
- [Reference](subsys-boot-ref.md)
- [Test Case Development](subsys-testguide-test.md)
......
......@@ -20,7 +20,7 @@
};
```
The preceding code implements the **IPlugin** API provided by the server. [Table 1](#table567211582104) shows the mapping between the client APIs and the plug-in APIs.
The preceding code implements the **IPlugin** API provided by the server. The following table shows the mapping between the client APIs and the plug-in APIs.
**Table 1** Mapping between the client APIs and the plug-in APIs
......
......@@ -15,15 +15,19 @@ In the overall planning of the AI engine framework, northbound SDKs are a part o
- SDK code directory: //foundation/ai/engine/services/client/algorithm\_sdk
e.g. //foundation/ai/engine/services/client/algorithm\_sdk/cv
Examples:
//foundation/ai/engine/services/client/algorithm\_sdk/cv
e.g. //foundation/ai/engine/services/client/algorithm\_sdk/nlu
//foundation/ai/engine/services/client/algorithm\_sdk/nlu
- Plug-in code directory: //foundation/ai/engine/services/server/plugin
e.g. //foundation/ai/engine/services/server/plugin/cv
Examples:
e.g. //foundation/ai/engine/services/server/plugin/nlu
//foundation/ai/engine/services/server/plugin/cv
//foundation/ai/engine/services/server/plugin/nlu
## Rule: Store all external APIs provided by plug-ins in the **interfaces/kits** directory of the AI subsystem.<a name="section2551029111312"></a>
......
......@@ -160,6 +160,20 @@ A job is a command set, where you can manage the commands to be executed. A maxi
Small and standard systems
</td>
</tr>
<tr height="162" style="height:121.5pt">
<td height="162" class="xl6621952" width="140" style="height:121.5pt;border-top: none;width:105pt">
write
</td>
<td class="xl6621952" width="215" style="border-top:none;border-left:none; width:161pt">
write filename value<br>Example:<br>write /data/testfile 0
</td>
<td class="xl6621952" width="225" style="border-top:none;border-left:none; width:169pt">
Writes a file. <strong>filename</strong> and <strong>value</strong> respectively indicate the absolute file path and the string to write.
</td>
<td class="xl6621952" width="190" style="border-top:none;border-left:none; width:143pt">
Standard system
</td>
</tr>
<tr height="185" style="height:138.75pt">
<td height="185" class="xl6621952" width="140" style="height:138.75pt;border-top: none;width:105pt">
stop
......@@ -300,6 +314,20 @@ A job is a command set, where you can manage the commands to be executed. A maxi
Small and standard systems
</td>
</tr>
<tr height="162" style="height:121.5pt">
<td height="162" class="xl6621952" width="140" style="height:121.5pt;border-top: none;width:105pt">
syncexec
</td>
<td class="xl6621952" width="215" style="border-top:none;border-left:none; width:161pt">
syncexec <i>Path of the executable file</i> <i>Parameters passed by the executable file</i><br>Example:<br>syncexec /system/bin/udevadm trigger
</td>
<td class="xl6621952" width="225" style="border-top:none;border-left:none; width:169pt">
Runs an executable file synchronously. The **wait** function will be called to wait for the child process to end. The command must not contain more than 10 parameters.
</td>
<td class="xl6621952" width="190" style="border-top:none;border-left:none; width:143pt">
Standard system
</td>
</tr>
<tr height="231" style="height:173.25pt">
<td height="231" class="xl6621952" width="140" style="height:173.25pt;border-top: none;width:105pt">
mknode
......
......@@ -17,7 +17,7 @@ bootchart is available only for the standard system, and begetctl is available f
## How to Develop
### Parameters
**Table 1** Description of begetctl commands
**Table 1** Description of begetctl commands<a name="table14737791480"></a>
| Command| Format and Example| Description|
| :---------- | :---------- |:--------|
| init group test [stage] | init group test | For details about **stage**, see **ServiceStatus**.|
......
......@@ -114,7 +114,7 @@ The service management module is available only for the mini system and standard
By parsing the <strong>*.cfg</strong> file, you can obtain **service** fields, and then set and start the service.
### Parameters
**Table 1** Description of service fields
**Table 1** Description of service fields<a name="table14737791471"></a>
<table border="0" cellpadding="0" cellspacing="0" width="737" style="border-collapse: collapse;table-layout:fixed;width:554pt;border-spacing: 0px;font-variant-ligatures: normal; font-variant-caps: normal;orphans: 2;widows: 2;-webkit-text-stroke-width: 0px; text-decoration-thickness: initial;text-decoration-style: initial;text-decoration-color: initial">
<tbody>
<tr height="24" style="height:18.0pt">
......@@ -208,11 +208,11 @@ By parsing the <strong>*.cfg</strong> file, you can obtain **service** fields, a
importance
</td>
<td class="xl6621805" width="196" style="border-top:none;border-left:none; width:147pt">
Current service priority.
Service priority (for the standard system) or service importance (for the mini system).
</td>
<td class="xl6621805" width="242" style="border-top:none;border-left:none; width:182pt">
Standard system: The service priority ranges from -20 to 19. A value beyond the range is invalid.<br>
Small system: The value <strong>0</strong> indicates an unimportant process and a value greater than <strong>0</strong> indicates an important process.
Small system: The value <strong>0</strong> indicates that a system restart is not required, and a value greater than <strong>0</strong> indicates the opposite.
</td>
<td class="xl6621805" width="173" style="border-top:none;border-left:none; width:130pt">
Small and standard systems
......@@ -362,7 +362,7 @@ By parsing the <strong>*.cfg</strong> file, you can obtain **service** fields, a
| option | Socket option. This field is passed when **setsockopt** is called. Currently, the available options include <strong>SOCKET_OPTION_PASSCRED</strong>, <strong>SOCKET_OPTION_RCVBUFFORCE</strong>, <strong>SOCK_CLOEXEC</strong>, and <strong>SOCK_NONBLOCK</strong>.|
### Available APIs
**Table 3** FD proxy APIs
**Table 3** FD proxy APIs<a name="table14737791479"></a>
| API | Function| Description |
| ---------- | ---------- |--------|
| int *ServiceGetFd(const char *serviceName, size_t *outfdCount) | Obtains the proxy FD from the init process.| Return value: Returns the pointer to the fd array if the operation is successful; returns **NULL** otherwise. (Note: Manual release is required.)<br>Arguments:<br> **serviceName**: service name.<br>**outfdCount**: length of the returned fd array.|
......
......@@ -4,7 +4,6 @@
- **[init Module](subsys-boot-init.md)**
- **[appspawn Module](subsys-boot-appspawn.md)**
- **[bootstrap Module](subsys-boot-bootstrap.md)**
- **[syspara Module](subsys-boot-syspara.md)**
- **[FAQs](subsys-boot-faqs.md)**
- **[Reference](subsys-boot-ref.md)**
......
......@@ -23,13 +23,14 @@ Use HiSysEvent logging to flush logged event data to disks.
HiSysEvent logging is implemented using the API provided by the **HiSysEvent** class. For details, see the API Reference.
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**
>
> In OpenHarmony-3.2-Beta3, HiSysEvent logging is open for restricted use to avoid event storms. The **HiSysEvent::Write** API in Table 1 is replaced by the **HiSysEventWrite** API in Table 2. The **HiSysEvent::Write** API has been deprecated. Use the **HiSysEventWrite** API instead for HiSysEvent logging.
**Table 1** C++ event logging API (deprecated)
| API | Description |
| ------------------------------------------------------------ | ---------------------- |
| template&lt;typename...&nbsp;Types&gt;&nbsp;<br>static&nbsp;int&nbsp;Write(const&nbsp;std::string&nbsp;&amp;domain,&nbsp;const&nbsp;std::string&nbsp;&amp;eventName,&nbsp;EventType&nbsp;type,&nbsp;Types...&nbsp;keyValues) | Flushes logged event data to disks.|
| template&lt;typename... Types&gt; <br>static int Write(const std::string &amp;domain, const std::string &amp;eventName, EventType type, Types... keyValues) | Flushes logged event data to disks.|
**Table 2** C++ event logging API (in use)
| API | Description |
......@@ -49,7 +50,7 @@ HiSysEvent logging is implemented using the API provided by the **HiSysEvent** c
The following table describes the kernel event logging APIs.
**Table 4** Description of kernel event logging APIs
**Table 4** Kernel event logging APIs
| API | Description |
| ------------------------------------------------------------ | ------------------------------------ |
......
......@@ -15,7 +15,7 @@ If OpenHarmony devices and applications need to be used globally, they must meet
## Architecture<a name="section1558604311012"></a>
**Figure 1** Architecture of the globalization subsystem<a name="fig1687592425010"></a>
**Figure 1** Architecture of the globalization subsystem<a name="fig1687592425010"></a>
![](figures/architecture-of-the-globalization-subsystem.png "architecture-of-the-globalization-subsystem")
......
......@@ -8,7 +8,7 @@ With the location awareness capability offered by OpenHarmony, mobile devices wi
Your application can call location-specific APIs to obtain the location information of a mobile device for offering location-based services such as drive navigation and motion track recording.
Basic Concepts
**Basic Concepts**
Location awareness helps determine where a mobile device locates. The system identifies the location of a mobile device with its coordinates, and uses location technologies such as Global Navigation Satellite System (GNSS) and network positioning (for example, base station positioning or WLAN/Bluetooth positioning) to provide diverse location-based services. These advanced location technologies make it possible to obtain the accurate location of the mobile device, regardless of whether it is indoors or outdoors.
......@@ -28,6 +28,10 @@ Location awareness helps determine where a mobile device locates. The system ide
WLAN or Bluetooth positioning estimates the current location of a mobile device based on the locations of WLANs and Bluetooth devices that can be discovered by the device. The location accuracy of this technology depends on the distribution of fixed WLAN access points (APs) and Bluetooth devices around the device. A high density of WLAN APs and Bluetooth devices can produce a more accurate location result than base station positioning. This technology also requires access to the network.
**Figure 1** ** Location subsystem architecture**<a name="fig4460722185514"></a>
![](figures/location_En-1.png)
![](figures/location_En-1.png)
## Directory Structure<a name="section161941989596"></a>
......@@ -102,7 +106,8 @@ The following table describes APIs available for obtaining device location infor
**Obtaining the device location information:**
1. Before using basic location capabilities, check whether your application has been granted the permission to access the device location information. If not, your application needs to obtain the permission from the user.
The system provides the following location permissions:
The system provides the following location permissions:
- ohos.permission.LOCATION
- ohos.permission.LOCATION_IN_BACKGROUND
......@@ -131,7 +136,7 @@ The following table describes APIs available for obtaining device location infor
}
```
For details about the configuration fields, see the description of the **module.json** file.
For details about the configuration fields, see [Application Package Structure Configuration File](../application-dev/quick-start/stage-structure.md).
2. Import the **geolocation** module by which you can implement all APIs related to the basic location capabilities.
......@@ -204,7 +209,8 @@ The following table describes APIs available for obtaining device location infor
```
4. Instantiate the **Callback** object for the system to report location results.
Your application needs to implement the callback defined by the system. When the system successfully obtains the real-time location of a device, it will report the location result to your application through the callback interface. Your application can implement the callback interface in such a way to complete your own service logic.
Your application needs to implement the callback defined by the system. When the system successfully obtains the real-time location of a device, it will report the location result to your application through the callback interface. Your application can implement the callback interface in such a way to complete your own service logic.
```
var locationChange = (location) => {
......@@ -239,6 +245,7 @@ The following table describes APIs available for obtaining device location infor
**Converting the coordinates and geocoding information:**
> **NOTE**
>
> The **GeoConvert** instance needs to access backend services to obtain information. Therefore, before performing the following steps, ensure that your device is connected to the network.
1. Import the **geolocation** module by which you can implement all APIs related to the geocoding and reverse geocoding conversion capabilities.
......@@ -248,6 +255,7 @@ The following table describes APIs available for obtaining device location infor
```
2. Obtain the conversion result.
- Call **getAddressesFromLocation** to convert coordinates into geographical location information.
```
......@@ -258,6 +266,7 @@ The following table describes APIs available for obtaining device location infor
```
Your application can obtain the **GeoAddress** list that matches the specified coordinates and then read location information from it. For details, see the *API Reference*.
- Call **getAddressesFromLocationName** to convert geographic description into coordinates.
```
......
......@@ -117,7 +117,7 @@
const KEY_TEST_STRING_ELEMENT = 'key_test_string';
const VALUE_TEST_STRING_ELEMENT = 'value-test-string';
try {
kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT, function (err,data) {
kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT, function (err, data) {
if (err != undefined) {
console.log("put err: " + JSON.stringify(err));
return;
......@@ -139,13 +139,13 @@
const KEY_TEST_STRING_ELEMENT = 'key_test_string';
const VALUE_TEST_STRING_ELEMENT = 'value-test-string';
try {
kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT, function (err,data) {
kvStore.put(KEY_TEST_STRING_ELEMENT, VALUE_TEST_STRING_ELEMENT, function (err, data) {
if (err != undefined) {
console.log("put err: " + JSON.stringify(err));
return;
}
console.log("put success");
kvStore.get(KEY_TEST_STRING_ELEMENT, function (err,data) {
kvStore.get(KEY_TEST_STRING_ELEMENT, function (err, data) {
console.log("get success data: " + data);
});
});
......
......@@ -42,4 +42,4 @@
针对位置服务,有以下相关实例可供参考:
-[`Location`:位置服务(eTS)(API9)](https://gitee.com/openharmony/app_samples/tree/master/device/Location)
-[`Location`:位置服务(eTS)(API9)](https://gitee.com/openharmony/applications_app_samples/tree/master/device/Location)
......@@ -320,6 +320,6 @@
针对Intl开发,有以下相关实例可供参考:
-[`International`:国际化(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/International)
-[`International`:国际化(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/International)
-[`International`:国际化(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/common/International)
\ No newline at end of file
-[`International`:国际化(eTS)(API8)(Full SDK)](https://gitee.com/openharmony/applications_app_samples/tree/master/common/International)
\ No newline at end of file
......@@ -15,6 +15,6 @@
下面将详细介绍这些布局能力。
## 相关实例
针对一次开发,多端部署,有以下相关实例可供参考:
- [`AdaptiveCapabilities`:多设备自适应能力(eTS)(API9)](https://gitee.com/openharmony/app_samples/tree/master/MultiDeviceAppDev/AdaptiveCapabilities)
- [`JsAdaptiveCapabilities`:多设备自适应能力(JS)(API9)](https://gitee.com/openharmony/app_samples/tree/master/MultiDeviceAppDev/JsAdaptiveCapabilities)
- [`AdaptiveCapabilities`:多设备自适应能力(eTS)(API9)](https://gitee.com/openharmony/applications_app_samples/tree/master/MultiDeviceAppDev/AdaptiveCapabilities)
- [`JsAdaptiveCapabilities`:多设备自适应能力(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/MultiDeviceAppDev/JsAdaptiveCapabilities)
- [一次开发多端部署(eTS)(API8)](https://gitee.com/openharmony/codelabs/tree/master/ETSUI/MultiDeploymentEts)
......@@ -22,24 +22,24 @@ AudioCapturer提供了用于获取原始音频文件的方法。开发者可以
```js
var audioStreamInfo = {
samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100,
channels: audio.AudioChannel.CHANNEL_1,
sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE,
encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW
}
samplingRate: audio.AudioSamplingRate.SAMPLE_RATE_44100,
channels: audio.AudioChannel.CHANNEL_1,
sampleFormat: audio.AudioSampleFormat.SAMPLE_FORMAT_S16LE,
encodingType: audio.AudioEncodingType.ENCODING_TYPE_RAW
}
var audioCapturerInfo = {
source: audio.SourceType.SOURCE_TYPE_MIC,
capturerFlags: 1
}
var audioCapturerInfo = {
source: audio.SourceType.SOURCE_TYPE_MIC,
capturerFlags: 1
}
var audioCapturerOptions = {
streamInfo: audioStreamInfo,
capturerInfo: audioCapturerInfo
}
var audioCapturerOptions = {
streamInfo: audioStreamInfo,
capturerInfo: audioCapturerInfo
}
let audioCapturer = await audio.createAudioCapturer(audioCapturerOptions);
var state = audioRenderer.state;
let audioCapturer = await audio.createAudioCapturer(audioCapturerOptions);
var state = audioRenderer.state;
```
2. (可选)使用on('stateChange')订阅音频采集器状态更改。
......@@ -49,26 +49,26 @@ AudioCapturer提供了用于获取原始音频文件的方法。开发者可以
audioCapturer.on('stateChange',(state) => {
console.info('AudioCapturerLog: Changed State to : ' + state)
switch (state) {
case audio.AudioState.STATE_PREPARED:
console.info('--------CHANGE IN AUDIO STATE----------PREPARED--------------');
console.info('Audio State is : Prepared');
break;
case audio.AudioState.STATE_RUNNING:
console.info('--------CHANGE IN AUDIO STATE----------RUNNING--------------');
console.info('Audio State is : Running');
break;
case audio.AudioState.STATE_STOPPED:
console.info('--------CHANGE IN AUDIO STATE----------STOPPED--------------');
console.info('Audio State is : stopped');
break;
case audio.AudioState.STATE_RELEASED:
console.info('--------CHANGE IN AUDIO STATE----------RELEASED--------------');
console.info('Audio State is : released');
break;
default:
console.info('--------CHANGE IN AUDIO STATE----------INVALID--------------');
console.info('Audio State is : invalid');
break;
case audio.AudioState.STATE_PREPARED:
console.info('--------CHANGE IN AUDIO STATE----------PREPARED--------------');
console.info('Audio State is : Prepared');
break;
case audio.AudioState.STATE_RUNNING:
console.info('--------CHANGE IN AUDIO STATE----------RUNNING--------------');
console.info('Audio State is : Running');
break;
case audio.AudioState.STATE_STOPPED:
console.info('--------CHANGE IN AUDIO STATE----------STOPPED--------------');
console.info('Audio State is : stopped');
break;
case audio.AudioState.STATE_RELEASED:
console.info('--------CHANGE IN AUDIO STATE----------RELEASED--------------');
console.info('Audio State is : released');
break;
default:
console.info('--------CHANGE IN AUDIO STATE----------INVALID--------------');
console.info('Audio State is : invalid');
break;
}
});
```
......@@ -80,9 +80,9 @@ AudioCapturer提供了用于获取原始音频文件的方法。开发者可以
```js
await audioCapturer.start();
if (audioCapturer.state == audio.AudioState.STATE_RUNNING) {
console.info('AudioRecLog: Capturer started');
console.info('AudioRecLog: Capturer started');
} else {
console.info('AudioRecLog: Capturer start failed');
console.info('AudioRecLog: Capturer start failed');
}
```
......@@ -103,29 +103,29 @@ AudioCapturer提供了用于获取原始音频文件的方法。开发者可以
const path = '/data/data/.pulse_dir/capture_js.wav';
let fd = fileio.openSync(path, 0o102, 0o777);
if (fd !== null) {
console.info('AudioRecLog: file fd created');
console.info('AudioRecLog: file fd created');
}
else{
console.info('AudioRecLog: file fd create : FAILED');
return;
console.info('AudioRecLog: file fd create : FAILED');
return;
}
fd = fileio.openSync(path, 0o2002, 0o666);
if (fd !== null) {
console.info('AudioRecLog: file fd opened in append mode');
console.info('AudioRecLog: file fd opened in append mode');
}
var numBuffersToCapture = 150;
while (numBuffersToCapture) {
var buffer = await audioCapturer.read(bufferSize, true);
if (typeof(buffer) == undefined) {
console.info('read buffer failed');
} else {
var number = fileio.writeSync(fd, buffer);
console.info('AudioRecLog: data written: ' + number);
}
var buffer = await audioCapturer.read(bufferSize, true);
if (typeof(buffer) == undefined) {
console.info('read buffer failed');
} else {
var number = fileio.writeSync(fd, buffer);
console.info('AudioRecLog: data written: ' + number);
}
numBuffersToCapture--;
numBuffersToCapture--;
}
```
......@@ -134,9 +134,9 @@ AudioCapturer提供了用于获取原始音频文件的方法。开发者可以
```
await audioCapturer.stop();
if (audioCapturer.state == audio.AudioState.STATE_STOPPED) {
console.info('AudioRecLog: Capturer stopped');
console.info('AudioRecLog: Capturer stopped');
} else {
console.info('AudioRecLog: Capturer stop failed');
console.info('AudioRecLog: Capturer stop failed');
}
```
......@@ -145,8 +145,8 @@ AudioCapturer提供了用于获取原始音频文件的方法。开发者可以
```js
await audioCapturer.release();
if (audioCapturer.state == audio.AudioState.STATE_RELEASED) {
console.info('AudioRecLog: Capturer released');
console.info('AudioRecLog: Capturer released');
} else {
console.info('AudioRecLog: Capturer release failed');
console.info('AudioRecLog: Capturer release failed');
}
```
\ No newline at end of file
......@@ -115,6 +115,7 @@ pixelmap.release(()=>{
done();
})
let path = '/data/local/tmp/test.jpg';
// 用于创建imagesource(uri)
const imageSourceApi = image.createImageSource(path); // '/data/local/tmp/test.jpg'
......@@ -145,7 +146,7 @@ imagePackerApi.release();
### 解码场景
```js
/data/local/tmp/test.jpg // 设置创建imagesource的路径
let path = '/data/local/tmp/test.jpg'; // 设置创建imagesource的路径
// 用路径创建imagesource
const imageSourceApi = image.createImageSource(path); // '/data/local/tmp/test.jpg'
......@@ -222,7 +223,7 @@ catch(error => {
### 编码场景
```js
/data/local/tmp/test.png // 设置创建imagesource的路径
let path = '/data/local/tmp/test.png' // 设置创建imagesource的路径
// 用于设置imagesource
const imageSourceApi = image.createImageSource(path); // '/data/local/tmp/test.png'
......
......@@ -284,6 +284,6 @@ let alarm : reminderAgent.ReminderRequestAlarm = {
- [`AlarmClock`:后台代理提醒(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/Notification/AlarmClock)
- [`FlipClock`:翻页时钟(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/CompleteApps/FlipClock)
- [`FlipClock`:翻页时钟(eTS)(API8)(Full SDK)](https://gitee.com/openharmony/applications_app_samples/tree/master/CompleteApps/FlipClock)
- [闹钟应用(eTS)(API9)](https://gitee.com/openharmony/codelabs/tree/master/CommonEventAndNotification/AlarmClock)
\ No newline at end of file
......@@ -182,6 +182,8 @@
- [@ohos.nfc.cardEmulation (标准NFC-cardEmulation)](js-apis-cardEmulation.md)
- [@ohos.nfc.controller (标准NFC)](js-apis-nfcController.md)
- [@ohos.nfc.tag (标准NFC-Tag)](js-apis-nfcTag.md)
- [@ohos.nfc.tag (标准NFC-Tag Nfc 技术)](js-apis-nfctech.md)
- [@ohos.nfc.tag (标准NFC-Tag TagSession)](js-apis-tagSession.md)
- [@ohos.rpc (RPC通信)](js-apis-rpc.md)
- [@ohos.wifi (WLAN)](js-apis-wifi.md)
- [@ohos.wifiext (WLAN)](js-apis-wifiext.md)
......
......@@ -195,6 +195,44 @@ context.requestPermissionsFromUser(
```
## Context.requestPermissionsFromUser<sup>7+</sup>
requestPermissionsFromUser(permissions: Array\<string>, requestCode: number): Promise\<[PermissionRequestResult](#permissionrequestresult7)>
从系统请求某些权限(promise形式)。
**系统能力**:SystemCapability.Ability.AbilityRuntime.Core
**参数:**
| 名称 | 类型 | 必填 | 描述 |
| -------------- | ------------------- | ----- | -------------------------------------------- |
| permissions | Array\<string> | 是 | 指示要请求的权限列表。此参数不能为null。 |
| requestCode | number | 是 | 指示要传递给PermissionRequestResult的请求代码。 |
**返回值:**
| 类型 | 说明 |
| ------------------------------------------------------------- | ---------------- |
| Promise\<[PermissionRequestResult](#permissionrequestresult7)> | 返回授权结果信息。 |
**示例:**
```js
import featureAbility from '@ohos.ability.featureAbility'
var context = featureAbility.getContext();
context.requestPermissionsFromUser(
["com.example.permission1",
"com.example.permission2",
"com.example.permission3",
"com.example.permission4",
"com.example.permission5"],
1).then((data)=>{
console.info("====>requestdata====>" + JSON.stringify(data));
});
```
## Context.getApplicationInfo<sup>7+</sup>
......
......@@ -9,10 +9,18 @@ AccessibilityExtensionContext模块提供扩展的上下文的能力,包括允
> 本模块首批接口从API version 9开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
> 本模块接口仅可在Stage模型下使用。
## 导入模块
## 使用说明
在使用AccessibilityExtensionContext的功能前,需要通过AccessibilityExtensionAbility子类实例获取。
```js
import AccessibilityExtensionAbility from '@ohos.application.AccessibilityExtensionAbility'
class MainAbility extends AccessibilityExtensionAbility {
onConnect(): void {
console.log("AxExtensionAbility onConnect");
let axContext = this.context;
}
}
```
## FocusDirection
......@@ -203,9 +211,9 @@ this.context.getWindows().then(windows => {
})
```
## AccessibilityExtensionContext.gestureInject
## AccessibilityExtensionContext.injectGesture
gestureInject(gesturePath: GesturePath, listener: Callback\<boolean>): Promise\<boolean
injectGesture(gesturePath: GesturePath, listener: Callback\<boolean>): Promise\<boolean
注入手势。
......
......@@ -268,6 +268,8 @@ constructor(jsonObject)
构造函数。
**系统能力**:SystemCapability.BarrierFree.Accessibility.Core
- **参数:**
| 参数名 | 参数类型 | 必填 | 说明 |
......
......@@ -797,7 +797,7 @@ getAssociatedData(name: string, key: string): Promise&lt;string&gt;
});
```
### getAssociatedDataSync
### getAssociatedDataSync<sup>9+</sup>
getAssociatedDataSync(name: string, key: string): string;
......
......@@ -18,7 +18,7 @@ import AccessibilityExtensionAbility from '@ohos.application.AccessibilityExtens
辅助事件信息。
**系统能力**:以下各项对应的系统能力均为 SystemCapability.Barrierfree.Accessibility.Core
**系统能力**:以下各项对应的系统能力均为 SystemCapability.BarrierFree.Accessibility.Core
### 属性
......@@ -32,7 +32,7 @@ import AccessibilityExtensionAbility from '@ohos.application.AccessibilityExtens
表示手势路径信息。
**系统能力**:以下各项对应的系统能力均为 SystemCapability.Barrierfree.Accessibility.Core
**系统能力**:以下各项对应的系统能力均为 SystemCapability.BarrierFree.Accessibility.Core
### 属性
......@@ -41,29 +41,11 @@ import AccessibilityExtensionAbility from '@ohos.application.AccessibilityExtens
| points | Array&lt;[GesturePoint](gesturepoint)&gt; | 是 | 是 | 手势。 |
| durationTime | number | 是 | 是 | 手势总耗时。 |
### constructor
constructor(durationTime: number)
构造函数。
- **参数:**
| 参数名 | 参数类型 | 必填 | 说明 |
| ------------ | ------ | ---- | ------ |
| durationTime | number | 是 | 手势总耗时。 |
- **示例:**
```typescript
let gesturePath = new GesturePath(100);
```
## GesturePoint
表示手势触摸点。
**系统能力**:以下各项对应的系统能力均为 SystemCapability.Barrierfree.Accessibility.Core
**系统能力**:以下各项对应的系统能力均为 SystemCapability.BarrierFree.Accessibility.Core
### 属性
......@@ -72,30 +54,11 @@ constructor(durationTime: number)
| positionX | number | 是 | 是 | 触摸点X坐标。 |
| positionY | number | 是 | 是 | 触摸点Y坐标。 |
### constructor
constructor(positionX: number, positionY: number)
构造函数。
- **参数:**
| 参数名 | 参数类型 | 必填 | 说明 |
| --------- | ------ | ---- | ------- |
| positionX | number | 是 | 触摸点X坐标。 |
| positionY | number | 是 | 触摸点Y坐标。 |
- **示例:**
```typescript
let gesturePoint = new GesturePoint(100, 200);
```
## GestureType
手势事件类型。
**系统能力**:以下各项对应的系统能力均为 SystemCapability.Barrierfree.Accessibility.Core
**系统能力**:以下各项对应的系统能力均为 SystemCapability.BarrierFree.Accessibility.Core
| 名称 | 描述 |
| ------------- | ------------ |
......@@ -120,7 +83,7 @@ constructor(positionX: number, positionY: number)
页面刷新类型。
**系统能力**:以下各项对应的系统能力均为 SystemCapability.Barrierfree.Accessibility.Core
**系统能力**:以下各项对应的系统能力均为 SystemCapability.BarrierFree.Accessibility.Core
| 名称 | 描述 |
| ----------------- | --------- |
......@@ -131,7 +94,7 @@ constructor(positionX: number, positionY: number)
触摸浏览事件类型。
**系统能力**:以下各项对应的系统能力均为 SystemCapability.Barrierfree.Accessibility.Core
**系统能力**:以下各项对应的系统能力均为 SystemCapability.BarrierFree.Accessibility.Core
| 名称 | 描述 |
| ---------- | ------------ |
......@@ -205,7 +168,7 @@ onAccessibilityEvent(event: AccessibilityEvent): void {
## AccessibilityExtensionAbility.onKeyEvent
onKeyEvent(keyEvent: inputEventClient.KeyEvent): boolean;
onKeyEvent(keyEvent: KeyEvent): boolean;
在物理按键按下时回调此方法,可以在该方法中根据业务判断是否对事件进行拦截。
......@@ -215,7 +178,7 @@ onKeyEvent(keyEvent: inputEventClient.KeyEvent): boolean;
| 参数名 | 参数类型 | 必填 | 说明 |
| -------- | ---------------------------------------- | ---- | ----------------------- |
| keyEvent | [KeyEvent](js-apis-inputeventclient.md#KeyEvent) | 是 | 按键事件回调函数。返回true表示拦截此按键。 |
| keyEvent | [KeyEvent](js-apis-keyevent.md#KeyEvent) | 是 | 按键事件回调函数。返回true表示拦截此按键。 |
**示例:**
......
......@@ -762,6 +762,56 @@ getVolumeGroupInfos();
管理音频音量和音频设备。在调用AudioManager的接口前,需要先通过[getAudioManager](#audiogetaudiomanager)创建实例。
### getRoutingManager<sup>9+</sup>
getRoutingManager(callback: AsyncCallback&lt;AudioRoutingManager&gt;): void
获取AudioRoutingManager对象,使用callback方式异步返回结果。
**系统能力:** SystemCapability.Multimedia.Audio.Device
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| ---------- | ---------------------------------------------------------------- | ---- | --------------------------------- |
| callback | AsyncCallback&lt;[AudioRoutingManager](#audioroutingmanager9)&gt; | 是 | 回调,返回AudioRoutingManager对象。 |
**示例:**
```js
await audioManager.getRoutingManager((err,callback) => {
if (err) {
console.error(`Result ERROR: ${err.message}`);
}
console.info('getRoutingManager Callback SUCCESS.');
var audioRoutingManager;
audioRoutingManager = callback;
});
```
### getRoutingManager<sup>9+</sup>
getRoutingManager(): Promise&lt;AudioRoutingManager&gt;
获取AudioRoutingManager对象,使用Promise方式异步返回结果。
**系统能力:** SystemCapability.Multimedia.Audio.Device
**返回值:**
| 类型 | 说明 |
| ----------------------------------------------------------- | --------------------------------------- |
| Promise&lt;[AudioRoutingManager](#audioroutingmanager9)&gt; | Promise回调返回AudioRoutingManager对象。 |
**示例:**
```js
await audioManager.getRoutingManager().then((value) => {
var routingManager = value;
console.info('getRoutingManager Promise SUCCESS.');
}).catch((err) => {
console.error(`Result ERROR: ${err.message}`);
});
```
### setVolume
setVolume(volumeType: AudioVolumeType, volume: number, callback: AsyncCallback&lt;void&gt;): void
......@@ -2805,6 +2855,172 @@ let result = audioStreamManager.isAudioRendererLowLatencySupported(AudioStreamIn
console.info(`isAudioRendererLowLatencySupported success var ${result}`);
```
## AudioRoutingManager<sup>9+</sup>
音频路由管理。在使用AudioRoutingManager的接口前,需要使用[getRoutingManager](#getroutingmanager9)获取AudioRoutingManager实例。
### selectOutputDevice<sup>9+</sup>
selectOutputDevice(audiodevicedescriptors: AudioDeviceDescriptors, callback: AsyncCallback&lt;void&gt;): void
选择音频输出设备,当前只能选择一个输出设备,使用callback方式异步返回结果。该接口为系统应用接口。
**系统能力:** SystemCapability.Multimedia.Audio.Device
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| --------------------------- | ------------------------------------------------------------ | ---- | ------------------------- |
| audiodevicedescriptors | [AudioDeviceDescriptors](#audiodevicedescriptors) | 是 | 输出设备类。 |
| callback | AsyncCallback&lt;void&gt; | 是 | 回调,返回获取输出设备结果。 |
**示例:**
```js
let outputAudioDeviceDescriptor = [{
"deviceRole":audio.DeviceRole.OUTPUT_DEVICE,
"networkId":audio.LOCAL_NETWORK_ID,
"interruptGroupId":1,
"volumeGroupId":1 }];
var audioRoutingManager;
await audioManager.getRoutingManager().then((value) => {
audioRoutingManager = value;
audioRoutingManager.selectOutputDevice(outputAudioDeviceDescriptor, (err) => {
if (err) {
console.error(`Result ERROR: ${err.message}`);
} else {
console.info('Select output devices result callback: SUCCESS'); }
});
});
```
### selectOutputDevice<sup>9+</sup>
selectOutputDevice(audiodevicedescriptors: AudioDeviceDescriptors): Promise&lt;void&gt;
选择音频输出设备,当前只能选择一个输出设备,使用Promise方式异步返回结果。该接口为系统应用接口。
**系统能力:** SystemCapability.Multimedia.Audio.Device
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| --------------------------- | ------------------------------------------------------------ | ---- | ------------------------- |
| audiodevicedescriptors | [AudioDeviceDescriptors](#audiodevicedescriptors) | 是 | 输出设备类。 |
**返回值:**
| 类型 | 说明 |
| --------------------- | --------------------------- |
| Promise&lt;void&gt; | Promise返回选择输出设备结果。 |
**示例:**
```js
let outputAudioDeviceDescriptor =[{
"deviceRole":audio.DeviceRole.OUTPUT_DEVICE,
"networkId":audio.LOCAL_NETWORK_ID,
"interruptGroupId":1,
"volumeGroupId":1 }];
var audioRoutingManager;
await audioManager.getRoutingManager().then((value) => {
audioRoutingManager = value;
audioRoutingManager.selectOutputDevice(outputAudioDeviceDescriptor).then(() => {
console.info('Select output devices result promise: SUCCESS');
}).catch((err) => {
console.error(`Result ERROR: ${err.message}`);
});
});
```
### selectOutputDeviceByFilter<sup>9+</sup>
selectOutputDeviceByFilter(audiorendererfilter: AudioRendererFilter, audiodevicedescriptors: AudioDeviceDescriptors, callback: AsyncCallback&lt;void&gt;): void
根据过滤条件,选择音频输出设备,当前只能选择一个输出设备,使用callback方式异步返回结果。该接口为系统应用接口。
**系统能力:** SystemCapability.Multimedia.Audio.Device
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| --------------------------- | ------------------------------------------------------------ | ---- | ------------------------- |
| audiorendererfilter | [AudioRendererFilter](#audiorendererfilter9) | 是 | 过滤条件类。 |
| audiodevicedescriptors | [AudioDeviceDescriptors](#audiodevicedescriptors) | 是 | 输出设备类。 |
| callback | AsyncCallback&lt;void&gt; | 是 | 回调,返回获取输出设备结果。 |
**示例:**
```js
let outputAudioRendererFilter = {
"uid":20010041,
"rendererInfo": {
"contentType":audio.ContentType.CONTENT_TYPE_MUSIC,
"streamUsage":audio.StreamUsage.STREAM_USAGE_MEDIA,
"rendererFlags":0 },
"rendererId":0 };
let outputAudioDeviceDescriptor = [{
"deviceRole":audio.DeviceRole.OUTPUT_DEVICE,
"networkId":audio.LOCAL_NETWORK_ID,
"interruptGroupId":1,
"volumeGroupId":1 }];
var audioRoutingManager;
await audioManager.getRoutingManager().then((value) => {
audioRoutingManager = value;
audioRoutingManager.selectOutputDeviceByFilter(outputAudioRendererFilter, outputAudioDeviceDescriptor, (err) => {
if (err) {
console.error(`Result ERROR: ${err.message}`);
} else {
console.info('Select output devices by filter result callback: SUCCESS'); }
});
});
```
### selectOutputDeviceByFilter<sup>9+</sup>
selectOutputDeviceByFilter(audiorendererfilter: AudioRendererFilter, audiodevicedescriptors: AudioDeviceDescriptors): Promise&lt;void&gt;
根据过滤条件,选择音频输出设备,当前只能选择一个输出设备,使用Promise方式异步返回结果。该接口为系统应用接口。
**系统能力:** SystemCapability.Multimedia.Audio.Device
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| ---------------------------- | ------------------------------------------------------------ | ---- | ------------------------- |
| audiorendererfilter | [AudioRendererFilter](#audiorendererfilter9) | 是 | 过滤条件类。 |
| audiodevicedescriptors | [AudioDeviceDescriptors](#audiodevicedescriptors) | 是 | 输出设备类。 |
**返回值:**
| 类型 | 说明 |
| --------------------- | --------------------------- |
| Promise&lt;void&gt; | Promise返回选择输出设备结果。 |
**示例:**
```js
let outputAudioRendererFilter = {
"uid":20010041,
"rendererInfo": {
"contentType":audio.ContentType.CONTENT_TYPE_MUSIC,
"streamUsage":audio.StreamUsage.STREAM_USAGE_MEDIA,
"rendererFlags":0 },
"rendererId":0 };
let outputAudioDeviceDescriptor = [{
"deviceRole":audio.DeviceRole.OUTPUT_DEVICE,
"networkId":audio.LOCAL_NETWORK_ID,
"interruptGroupId":1,
"volumeGroupId":1 }];
var audioRoutingManager;
await audioManager.getRoutingManager().then((value) => {
audioRoutingManager = value;
audioRoutingManager.selectOutputDeviceByFilter(outputAudioRendererFilter, outputAudioDeviceDescriptor).then(() => {
console.info('Select output devices by filter result promise: SUCCESS');
}).catch((err) => {
console.error(`Result ERROR: ${err.message}`);
})
});
```
## AudioRendererChangeInfo<sup>9+</sup>
描述音频渲染器更改信息。
......@@ -2936,16 +3152,19 @@ audioStreamManager.on('audioCapturerChange', (AudioCapturerChangeInfoArray) =>
**系统能力:** 以下各项对应的系统能力均为SystemCapability.Multimedia.Audio.Device
| 名称 | 类型 | 可读 | 可写 | 说明 |
| -------------------------- | -------------------------- | ---- | ---- | ---------- |
| deviceRole | [DeviceRole](#devicerole) | 是 | 否 | 设备角色。 |
| deviceType | [DeviceType](#devicetype) | 是 | 否 | 设备类型。 |
| id<sup>9+</sup> | number | 是 | 否 | 设备id。 |
| name<sup>9+</sup> | string | 是 | 否 | 设备名称。 |
| address<sup>9+</sup> | string | 是 | 否 | 设备地址。 |
| sampleRates<sup>9+</sup> | Array&lt;number&gt; | 是 | 否 | 支持的采样率。 |
| channelCounts<sup>9+</sup> | Array&lt;number&gt; | 是 | 否 | 支持的通道数。 |
| channelMasks<sup>9+</sup> | Array&lt;number&gt; | 是 | 否 | 支持的通道掩码。 |
| 名称 | 类型 | 可读 | 可写 | 说明 |
| ----------------------------- | -------------------------- | ---- | ---- | ---------- |
| deviceRole | [DeviceRole](#devicerole) | 是 | 否 | 设备角色。 |
| deviceType | [DeviceType](#devicetype) | 是 | 否 | 设备类型。 |
| id<sup>9+</sup> | number | 是 | 否 | 设备id。 |
| name<sup>9+</sup> | string | 是 | 否 | 设备名称。 |
| address<sup>9+</sup> | string | 是 | 否 | 设备地址。 |
| sampleRates<sup>9+</sup> | Array&lt;number&gt; | 是 | 否 | 支持的采样率。 |
| channelCounts<sup>9+</sup> | Array&lt;number&gt; | 是 | 否 | 支持的通道数。 |
| channelMasks<sup>9+</sup> | Array&lt;number&gt; | 是 | 否 | 支持的通道掩码。 |
| networkId<sup>9+</sup> | string | 是 | 否 | 设备组网的ID。 |
| interruptGroupId<sup>9+</sup> | number | 是 | 否 | 设备所处的焦点组ID。 |
| volumeGroupId<sup>9+</sup> | number | 是 | 否 | 设备所处的音量组ID。 |
## AudioDeviceDescriptors
......@@ -2975,6 +3194,30 @@ promise.then(function (value) {
});
```
## AudioRendererFilter<sup>9+</sup>
过滤条件类。在调用selectOutputDeviceByFilter接口前,需要先创建AudioRendererFilter实例。
**系统能力:** 以下各项对应的系统能力均为SystemCapability.Multimedia.Audio.Device
| 名称 | 类型 | 必填 | 说明 |
| -------------| ---------------------------------------- | ---- | -------------- |
| uid | number | 是 | 表示应用ID。 |
| rendererInfo | [AudioRendererInfo](#audiorendererinfo8) | 否 | 表示渲染器信息。 |
| rendererId | number | 否 | 音频流唯一id。 |
**示例:**
```js
let outputAudioRendererFilter = {
"uid":20010041,
"rendererInfo": {
"contentType":audio.ContentType.CONTENT_TYPE_MUSIC,
"streamUsage":audio.StreamUsage.STREAM_USAGE_MEDIA,
"rendererFlags":0 },
"rendererId":0 };
```
## AudioRenderer<sup>8+</sup>
提供音频渲染的相关接口。在调用AudioRenderer的接口前,需要先通过[createAudioRenderer](#audiocreateaudiorenderer8)创建实例。
......
......@@ -11,10 +11,6 @@
## 系统能力
SystemCapability.BundleManager.BundleFramework
## BundleInstaller.install
install(bundleFilePaths: Array&lt;string&gt;, param: InstallParam, callback: AsyncCallback&lt;InstallStatus&gt;): void;
......@@ -29,6 +25,8 @@ ohos.permission.INSTALL_BUNDLE
SystemCapability.BundleManager.BundleFramework
**系统API:** 此接口为系统接口,三方应用不支持调用
**参数:**
| 名称 | 类型 | 必填 | 描述 |
......@@ -51,6 +49,8 @@ ohos.permission.INSTALL_BUNDLE
SystemCapability.BundleManager.BundleFramework
**系统API:** 此接口为系统接口,三方应用不支持调用
**参数:**
| 名称 | 类型 | 必填 | 描述 |
......@@ -59,7 +59,7 @@ SystemCapability.BundleManager.BundleFramework
| param | [InstallParam](#installparam) | 是 | 指定安装所需的其他参数。 |
| callback | AsyncCallback&lt;[InstallStatus](#installstatus)&gt; | 是 | 程序启动作为入参的回调函数,返回安装状态信息。 |
## BundleInstaller.recover
## BundleInstaller.recover<sup>8+</sup>
recover(bundleName: string, param: InstallParam, callback: AsyncCallback&lt;InstallStatus&gt;): void;
......@@ -73,6 +73,8 @@ ohos.permission.INSTALL_BUNDLE
SystemCapability.BundleManager.BundleFramework
**系统API:** 此接口为系统接口,三方应用不支持调用
**参数:**
| 名称 | 类型 | 必填 | 描述 |
......@@ -81,17 +83,34 @@ SystemCapability.BundleManager.BundleFramework
| param | [InstallParam](#installparam) | 是 | 指定安装所需的其他参数。 |
| callback | AsyncCallback&lt;[InstallStatus](#installstatus)&gt; | 是 | 程序启动作为入参的回调函数,返回安装状态信息。 |
## HashParam<sup>9+</sup>
应用程序安装卸载信息
**系统能力:** 以下各项对应的系统能力均为SystemCapability.BundleManager.BundleFramework
**系统API:** 此接口为系统接口,三方应用不支持调用
| 名称 | 类型 | 说明 |
| ---------- | ------ | ---------------- |
| moduleName | string | 应用程序模块名称 |
| hashValue | string | 哈希值 |
## InstallParam
应用程序安装卸载信息
**系统能力:** 以下各项对应的系统能力均为SystemCapability.BundleManager.BundleFramework
| 名称 | 类型 | 说明 |
| ----------- | ------- | ------------------ |
| userId | number | 指示用户id |
| installFlag | number | 指示安装标志 |
| isKeepData | boolean | 指示参数是否有数据 |
**系统API:** 此接口为系统接口,三方应用不支持调用
| 名称 | 类型 | 说明 |
| ------------------------------ | ------------------------------ | ------------------ |
| userId | number | 指示用户id |
| installFlag | number | 指示安装标志 |
| isKeepData | boolean | 指示参数是否有数据 |
| hashParams<sup>9+</sup> | Array<[HashParam](#hashparam)> | 哈希值参数 |
| crowdtestDeadline<sup>9+</sup> | number | 测试包的被杀死时间 |
## InstallStatus
......@@ -99,7 +118,9 @@ SystemCapability.BundleManager.BundleFramework
**系统能力:** 以下各项对应的系统能力均为SystemCapability.BundleManager.BundleFramework
**系统API:** 此接口为系统接口,三方应用不支持调用
| 名称 | 类型 | 可读 | 可写 | 说明 |
| ------------- | ------------------------------------------------------------ | ---- | ---- | ------------------------------ |
| status | bundle.[InstallErrorCode](js-apis-Bundle.md#installerrorcode) | 是 | 否 | 表示安装或卸载错误状态码 |
| statusMessage | string | 是 | 否 | 表示安装或卸载的字符串结果信息 |
\ No newline at end of file
| statusMessage | string | 是 | 否 | 表示安装或卸载的字符串结果信息 |
......@@ -13,6 +13,8 @@
**系统能力:** 以下各项对应的系统能力均为SystemCapability.BundleManager.BundleFramework
**系统API:** 此接口为系统接口,三方应用不支持调用
| 名称 | 类型 | 可读 | 可写 | 说明 |
| -------------- | ------ | ---- | ---- | -------------- |
| permissionName | string | 是 | 否 | 用户权限名称 |
......
......@@ -18,6 +18,8 @@
**系统能力:** 以下各项对应的系统能力均为SystemCapability.BundleManager.BundleFramework
**系统API:** 此接口为系统接口,三方应用不支持调用
| 名称 | 类型 | 可读 | 可写 | 说明 |
| ------------------------- | ------ | ---- | ---- | -------------------- |
| targetBundle | string | 是 | 否 | 快捷方式的目标捆绑包 |
......
......@@ -11,7 +11,9 @@
## RemoteAbilityInfo
**系统能力:** 以下各项对应的系统能力均为SystemCapability.BundleManager.BundleFramework
**系统能力:** 以下各项对应的系统能力均为SystemCapability.BundleManager.DistributedBundleFramework
**系统API:** 此接口为系统接口,三方应用不支持调用
| 名称 | 类型 | 可读 | 可写 | 说明 |
| ----------- | -------------------------------------------- | ---- | ---- | ----------------------- |
......
......@@ -11,7 +11,8 @@ import deviceInfo from '@ohos.deviceInfo'
## 属性
**系统能力**:以下各项对应的系统能力均为SystemCapability.Startup.SysInfo。
**系统能力**:以下各项对应的系统能力均为SystemCapability.Startup.SystemInfo。
**权限**:以下各项所需要的权限有所不同,详见下表。
| 名称 | 参数类型 | 可读 | 可写 | 描述 |
......
......@@ -2281,6 +2281,8 @@ constructor()
创建Pin码认证的实例。
此接口为系统接口,三方应用不支持调用。
**系统能力**:SystemCapability.Account.OsAccount
**示例:**
......
......@@ -299,6 +299,48 @@ on(type: 'headerReceive', callback: (header: object) =&gt; void): void
```
### on('complete' | 'fail')<sup>9+</sup>
on(type:'complete' | 'fail', callback: Callback&lt;Array&lt;TaskState&gt;&gt;): void;
开启上传任务监听,异步方法,使用callback形式返回结果。
**需要权限**:ohos.permission.INTERNET
**系统能力**: SystemCapability.MiscServices.Upload
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| type | string | 是 | 订阅的事件类型,取值为'complete',表示上传任务完成;取值为'fail',表示上传任务失败。|
| callback | function | 是 | 上传任务完成或失败的回调函数。 |
回调函数的参数
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| taskstates | Array&lt;[TaskState](#taskstate9)&gt; | 是 | 上传任务返回结果 |
**示例:**
```js
uploadTask.on('complete', function callback(taskStates) {
for (let i = 0; i < taskStates.length; i++ ) {
console.info("upOnComplete taskState:" + JSON.stringify(taskStates[i]));
}
}
);
uploadTask.on('fail', function callback(taskStates) {
for (let i = 0; i < taskStates.length; i++ ) {
console.info("upOnFail taskState:" + JSON.stringify(taskStates[i]));
}
}
);
```
### off('progress')
off(type: 'progress', callback?: (uploadedSize: number, totalSize: number) =&gt; void): void
......@@ -365,6 +407,47 @@ off(type: 'headerReceive', callback?: (header: object) =&gt; void): void
);
```
### off('complete' | 'fail')<sup>9+</sup>
off(type:'complete' | 'fail', callback?: Callback&lt;Array&lt;TaskState&gt;&gt;): void;
关闭上传任务监听,异步方法,使用callback形式返回结果。
**需要权限**:ohos.permission.INTERNET
**系统能力**: SystemCapability.MiscServices.Upload
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| type | string | 是 | 订阅的事件类型,取值为'complete',表示上传任务完成;取值为'fail',表示上传任务失败。|
| callback | function | 否 | 上传任务完成或失败的回调函数。 |
回调函数的参数
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| taskstates | Array&lt;[TaskState](#taskstate9)&gt; | 是 | 上传任务返回结果 |
**示例:**
```js
uploadTask.off('complete', function callback(taskStates) {
for (let i = 0; i < taskStates.length; i++ ) {
console.info("upOnComplete taskState:" + JSON.stringify(taskStates[i]));
}
}
);
uploadTask.off('fail', function callback(taskStates) {
for (let i = 0; i < taskStates.length; i++ ) {
console.info("upOnFail taskState:" + JSON.stringify(taskStates[i]));
}
}
);
```
### remove
......@@ -444,6 +527,17 @@ remove(callback: AsyncCallback&lt;boolean&gt;): void
| files | Array&lt;[File](#file)&gt; | 是 | 要上传的文件列表。请使用&nbsp;multipart/form-data提交。 |
| data | Array&lt;[RequestData](#requestdata)&gt; | 是 | 请求的表单数据。 |
## TaskState<sup>9+</sup>
**需要权限**:ohos.permission.INTERNET
**系统能力**: 以下各项对应的系统能力均为SystemCapability.MiscServices.Upload。
| 名称 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| path | string | 是 | 文件路径 |
| responseCode | number | 是 | 上传任务返回值 |
| message | string | 是 | 上传任务结果描述信息 |
## File
......@@ -1118,7 +1212,7 @@ resume(callback: AsyncCallback&lt;void&gt;): void
| filePath<sup>7+</sup> | string | 否 | 设置下载路径(默认在'internal://cache/'路径下)。<br/>-&nbsp;filePath:'workspace/test.txt':默认路径下创建workspace路径,并将文件存储在workspace路径下。<br/>-&nbsp;filePath:'test.txt':将文件存储在默认路径下。<br/>-&nbsp;filePath:'workspace/':默认路径下创建workspace路径,并将文件存储在workspace路径下。 |
| networkType | number | 否 | 设置允许下载的网络类型。<br/>-&nbsp;NETWORK_MOBILE:0x00000001<br/>-&nbsp;NETWORK_WIFI:0x00010000|
| title | string | 否 | 设置下载会话标题。 |
| background | boolean | 否 | 后台任务通知开关,开启后可在通知中显示下载状态。 |
| background<sup>9+</sup> | boolean | 否 | 后台任务通知开关,开启后可在通知中显示下载状态。 |
## DownloadInfo<sup>7+</sup>
......
......@@ -17,7 +17,7 @@ getSync(key: string, def?: string): string
获取系统属性Key对应的值。
**系统能力:** SystemCapability.Startup.SysInfo
**系统能力:** SystemCapability.Startup.SystemInfo
**参数:**
......@@ -50,7 +50,7 @@ get(key: string, callback: AsyncCallback&lt;string&gt;): void
获取系统属性Key对应的值。
**系统能力:** SystemCapability.Startup.SysInfo
**系统能力:** SystemCapability.Startup.SystemInfo
**参数:**
......@@ -81,7 +81,7 @@ get(key: string, def: string, callback: AsyncCallback&lt;string&gt;): void
获取系统属性Key对应的值。
**系统能力:** SystemCapability.Startup.SysInfo
**系统能力:** SystemCapability.Startup.SystemInfo
**参数:**
......@@ -114,7 +114,7 @@ get(key: string, def?: string): Promise&lt;string&gt;
获取系统属性Key对应的值。
**系统能力:** SystemCapability.Startup.SysInfo
**系统能力:** SystemCapability.Startup.SystemInfo
**参数:**
......@@ -151,7 +151,7 @@ setSync(key: string, value: string): void
设置系统属性Key对应的值。
**系统能力:** SystemCapability.Startup.SysInfo
**系统能力:** SystemCapability.Startup.SystemInfo
**参数:**
......@@ -177,7 +177,7 @@ set(key: string, value: string, callback: AsyncCallback&lt;void&gt;): void
设置系统属性Key对应的值。
**系统能力:** SystemCapability.Startup.SysInfo
**系统能力:** SystemCapability.Startup.SystemInfo
**参数:**
......@@ -209,7 +209,7 @@ set(key: string, value: string): Promise&lt;void&gt;
设置系统属性Key对应的值。
**系统能力:** SystemCapability.Startup.SysInfo
**系统能力:** SystemCapability.Startup.SystemInfo
**参数:**
......
......@@ -29,7 +29,7 @@ createTimer(options: TimerOptions, callback: AsyncCallback&lt;number&gt;): void
| options | TimerOptions | 是 | const TIMER_TYPE_REALTIME: 设置为系统启动时间定时器,否则为walltime定时器; <br/>const TIMER_TYPE_WAKEUP: 设置为唤醒定时器,否则为非唤醒; <br/>const TIMER_TYPE_EXACT: 设置为精准定时器,否则为非精准定时器; <br/>const TIMER_TYPE_IDLE: number: 设置为IDLE模式定时器,否则为非IDLE模式定时器(暂不支持) |
| repeat | boolean | 是 | true 为循环定时器,false为单次定时器。 |
| interval | number | 否 | 如果是循环定时器,repeat值应大于5000毫秒,非重复定时器置为0。 |
| wantAgent| wantAgent | 否 | 设置通知的wantagent,定时器到期后通知。 |
| wantAgent| wantAgent | 否 | 设置通知的wantagent,定时器到期后通知。(支持拉起鸿蒙应用MainAbility,暂不支持拉起SA) |
**返回值:**
......@@ -40,17 +40,21 @@ createTimer(options: TimerOptions, callback: AsyncCallback&lt;number&gt;): void
**示例:**
```js
var options = {
type:TIMER_TYPE_REALTIME,
repeat:false
}
systemTime.createTimer(options, (error, data) => {
if (error) {
console.error(`failed to systemTime.createTimer ` + JSON.stringify(error));
return;
}
console.log(`systemTime.createTimer success data : ` + JSON.stringify(data));
});
export default {
systemTimer () {
var options = {
type: systemTimer.TIMER_TYPE_REALTIME,
repeat: false
}
systemTimer.createTimer(options, (error, data) => {
if (error) {
console.error(`failed to systemTime.createTimer ` + JSON.stringify(error));
return;
}
console.log(`systemTime.createTimer success data : ` + JSON.stringify(data));
});
}
}
```
......@@ -69,7 +73,7 @@ createTimer(options: TimerOptions): Promise&lt;number&gt;
| options | TimerOptions | 是 | const TIMER_TYPE_REALTIME: 设置为系统启动时间定时器,否则为walltime定时器; <br/>const TIMER_TYPE_WAKEUP: 设置为唤醒定时器,否则为非唤醒; <br/>const TIMER_TYPE_EXACT: 设置为精准定时器,否则为非精准定时器; <br/>const TIMER_TYPE_IDLE: number: 设置为IDLE模式定时器,否则为非IDLE模式定时器(暂不支持) |
| repeat | boolean | 是 | true 为循环定时器,false为单次定时器。 |
| interval | number | 否 | 如果是循环定时器,repeat值应大于5000毫秒,非重复定时器置为0。 |
| wantAgent| wantAgent | 否 | 设置通知的wantagent,定时器到期后通知。 |
| wantAgent| wantAgent | 否 | 设置通知的wantagent,定时器到期后通知。(支持拉起鸿蒙应用MainAbility,暂不支持拉起SA) |
**返回值:**
......@@ -80,15 +84,19 @@ createTimer(options: TimerOptions): Promise&lt;number&gt;
**示例:**
```js
var options = {
type:TIMER_TYPE_REALTIME,
repeat:false
}
systemTime.createTimer(options).then((data) => {
console.log(`systemTime.createTimer success data : ` + JSON.stringify(data));
}).catch((error) => {
console.error(`failed to systemTime.createTimer because ` + JSON.stringify(error));
});
export default {
systemTimer () {
var options = {
type: systemTimer.TIMER_TYPE_REALTIME,
repeat:false
}
systemTimer.createTimer(options).then((data) => {
console.log(`systemTime.createTimer success data : ` + JSON.stringify(data));
}).catch((error) => {
console.error(`failed to systemTime.createTimer because ` + JSON.stringify(error));
});
}
}
```
......@@ -111,18 +119,22 @@ startTimer(timer: number, triggerTime: number, callback: AsyncCallback&lt;void&g
**示例:**
```js
var options = {
type:TIMER_TYPE_REALTIME,
repeat:false
}
let timerId = systemTimer.Timer(options)
systemTime.startTimer(timerId, 10000, (error, data) => {
if (error) {
console.error(`failed to systemTime.startTimer ` + JSON.stringify(error));
return;
}
console.log(`systemTime.startTimer success data : ` + JSON.stringify(data));
});
export default {
systemTimer () {
var options = {
type: systemTimer.TIMER_TYPE_REALTIME,
repeat:false
}
let timerId = systemTimer.Timer(options)
systemTimer.startTimer(timerId, 10000, (error, data) => {
if (error) {
console.error(`failed to systemTime.startTimer ` + JSON.stringify(error));
return;
}
console.log(`systemTime.startTimer success data : ` + JSON.stringify(data));
});
}
}
```
## systemTime.startTimer
......@@ -144,16 +156,20 @@ startTimer(timer: number, triggerTime: number): Promise&lt;void&gt;
**示例:**
```js
var options = {
type:TIMER_TYPE_REALTIME,
repeat:false
}
let timerId = systemTimer.Timer(options)
systemTime.startTimer(timerId, 10000).then((data) => {
console.log(`systemTime.startTimer success data : ` + JSON.stringify(data));
}).catch((error) => {
console.error(`failed to systemTime.startTimer because ` + JSON.stringify(error));
});
export default {
systemTimer (){
var options = {
type: systemTimer.TIMER_TYPE_REALTIME,
repeat:false
}
let timerId = systemTimer.Timer(options)
systemTimer.startTimer(timerId, 10000).then((data) => {
console.log(`systemTime.startTimer success data : ` + JSON.stringify(data));
}).catch((error) => {
console.error(`failed to systemTime.startTimer because ` + JSON.stringify(error));
});
}
}
```
......@@ -174,19 +190,23 @@ stopTimer(timer: number, callback: AsyncCallback&lt;void&gt;): void
**示例:**
```js
var options = {
type:TIMER_TYPE_REALTIME,
repeat:false
}
let timerId = systemTimer.Timer(options)
let startTimerRes = systemTimer.startTimer(timerId, 100000)
systemTime.stopTimer(timerId, (error, data) => {
if (error) {
console.error(`failed to systemTime.stopTimer ` + JSON.stringify(error));
return;
}
console.log(`systemTime.stopTimer success data : ` + JSON.stringify(data));
});
export default {
systemTimer () {
var options = {
type: systemTimer.TIMER_TYPE_REALTIME,
repeat:false
}
let timerId = systemTimer.Timer(options)
systemTimer.startTimer(timerId, 100000)
systemTimer.stoptTimer(timerId, 10000, (error, data) => {
if (error) {
console.error(`failed to systemTime.startTimer ` + JSON.stringify(error));
return;
}
console.log(`systemTime.startTimer success data : ` + JSON.stringify(data));
});
}
}
```
......@@ -207,17 +227,21 @@ stopTimer(timer: number): Promise&lt;void&gt;
**示例:**
```js
var options = {
type:TIMER_TYPE_REALTIME,
repeat:false
}
let timerId = systemTimer.Timer(options)
let startTimerRes = systemTimer.startTimer(timerId, 100000)
systemTime.stopTimer(timerId).then((data) => {
console.log(`systemTime.stopTimer success data : ` + JSON.stringify(data));
}).catch((error) => {
console.error(`failed to systemTime.stopTimer because ` + JSON.stringify(error));
});
export default {
systemTimer (){
var options = {
type: systemTimer.TIMER_TYPE_REALTIME,
repeat:false
}
let timerId = systemTimer.Timer(options)
systemTimer.startTimer(timerId, 100000)
systemTimer.stoptTimer(timerId, 10000).then((data) => {
console.log(`systemTime.startTimer success data : ` + JSON.stringify(data));
}).catch((error) => {
console.error(`failed to systemTime.startTimer because ` + JSON.stringify(error));
});
}
}
```
......@@ -238,20 +262,24 @@ destroyTimer(timer: number, callback: AsyncCallback&lt;void&gt;): void
**示例:**
```js
var options = {
type:TIMER_TYPE_REALTIME,
repeat:false
}
let timerId = systemTimer.Timer(options)
let startTimerRes = systemTimer.startTimer(timerId, 100000)
let stopTimerRes = systemTimer.stopTimer(timerId)
systemTime.destroyTimer(timerId, (error, data) => {
if (error) {
console.error(`failed to systemTime.destroyTimer ` + JSON.stringify(error));
return;
}
console.log(`systemTime.destroyTimer success data : ` + JSON.stringify(data));
});
export default {
systemTimer () {
var options = {
type: systemTimer.TIMER_TYPE_REALTIME,
repeat:false
}
let timerId = systemTimer.Timer(options)
systemTimer.startTimer(timerId, 100000)
systemTimer.stopTimer(timerId)
systemTimer.destroyTimer(timerId, (error, data) => {
if (error) {
console.error(`failed to systemTime.startTimer ` + JSON.stringify(error));
return;
}
console.log(`systemTime.startTimer success data : ` + JSON.stringify(data));
});
}
}
```
......@@ -272,16 +300,20 @@ destroyTimer(timer: number): Promise&lt;void&gt;
**示例:**
```js
var options = {
type:TIMER_TYPE_REALTIME,
repeat:false
}
let timerId = systemTimer.Timer(options)
let startTimerRes = systemTimer.startTimer(timerId, 100000)
let stopTimerRes = systemTimer.stopTimer(timerId)
systemTime.destroyTimer(timerId).then((data) => {
console.log(`systemTime.destroyTimer success data : ` + JSON.stringify(data));
}).catch((error) => {
console.error(`failed to systemTime.destroyTimer because ` + JSON.stringify(error));
});
export default {
systemTimer (){
var options = {
type: systemTimer.TIMER_TYPE_REALTIME,
repeat:false
}
let timerId = systemTimer.Timer(options)
systemTimer.startTimer(timerId, 100000)
systemTimer.stopTimer(timerId)
systemTimer.destroytTimer(timerId, 10000).then((data) => {
console.log(`systemTime.startTimer success data : ` + JSON.stringify(data));
}).catch((error) => {
console.error(`failed to systemTime.startTimer because ` + JSON.stringify(error));
});
}
}
```
\ No newline at end of file
......@@ -1647,7 +1647,7 @@ async function demo() {
fling(from: Point, to: Point, stepLen: number, speed: number): Promise\<void>
植入从给出的起始坐标点按照指定的间隔与速度滑向给出的目的坐标点的滑动操作。
模拟手指滑动后脱离屏幕的快速滑动操作。
**系统能力**:SystemCapability.Test.UiTest
......@@ -1655,8 +1655,8 @@ fling(from: Point, to: Point, stepLen: number, speed: number): Promise\<void>
| 参数名 | 类型 | 必填 | 说明 |
| ------- | ---------------- | ---- | ------------------------------------------------------------ |
| from | [Point](#point9) | 是 | 起始点的坐标。 |
| to | [Point](#point9) | 是 | 目的点的坐标。 |
| from | [Point](#point9) | 是 | 手指接触屏幕的起始点坐标。 |
| to | [Point](#point9) | 是 | 手指离开屏幕时的坐标点。 |
| stepLen | number | 是 | 间隔距离,单位:像素点。 |
| speed | number | 是 | 滑动速率,范围:200-3000,不在范围内设为默认值为600,单位:像素点/秒。 |
......
......@@ -7,6 +7,8 @@ WebGL标准图形API,对应OpenGL ES 2.0特性集。更多信息请参考[WebG
> **说明:**
>
> 本模块首批接口从API version 7开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
>
> WebGL遵循OpenGL协议,不支持多线程调用。
## 调用方式
......
......@@ -7,6 +7,8 @@ WebGL标准图形API,对应OpenGL ES 3.0特性集。更多信息请参考[WebG
> **说明:**
>
> 本模块首批接口从API version 7开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
>
> WebGL2遵循OpenGL协议,不支持多线程调用。
## 调用方式
......
......@@ -40,12 +40,17 @@ startWork(work: WorkInfo): boolean
```js
let workInfo = {
workId: 1,
batteryLevel:50,
batteryStatus:workScheduler.BatteryStatus.BATTERY_STATUS_LOW,
isRepeat: false,
isPersisted: true,
bundleName: "com.example.myapplication",
abilityName: "MyExtension"
abilityName: "MyExtension",
parameters: {
mykey0: 1,
mykey1: "string value",
mykey2: true,
mykey3: 1.5
}
}
var res = workScheduler.startWork(workInfo);
console.info("workschedulerLog res:" + res);
......@@ -76,12 +81,17 @@ stopWork(work: WorkInfo, needCancel?: boolean): boolean
```js
let workInfo = {
workId: 1,
batteryLevel:50,
batteryStatus:workScheduler.BatteryStatus.BATTERY_STATUS_LOW,
isRepeat: false,
isPersisted: true,
bundleName: "com.example.myapplication",
abilityName: "MyExtension"
abilityName: "MyExtension",
parameters: {
mykey0: 1,
mykey1: "string value",
mykey2: true,
mykey3: 1.5
}
}
var res = workScheduler.stopWork(workInfo, false);
console.info("workschedulerLog res:" + res);
......@@ -299,6 +309,7 @@ isLastWorkTimeOut(workId: number): Promise\<boolean>
| isPersisted | boolean | 否 | 是否持久化保存工作 |
| isDeepIdle | boolean | 否 | 是否要求设备进入空闲状态 |
| idleWaitTime | number | 否 | 空闲等待时间 |
| parameters | {[key: string]: any} | 否 | 携带参数信息 |
## NetworkType
触发工作的网络类型。
......
......@@ -27,10 +27,11 @@ Worker构造函数的选项信息,用于为Worker添加其他信息。
**系统能力:** 以下各项对应的系统能力均为SystemCapability.Utils.Lang。
| 名称 | 参数类型 | 可读 | 可写 | 说明 |
| ---- | --------- | ---- | ---- | ---------------------- |
| type | "classic" | 是 | 是 | 按照指定方式执行脚本。 |
| name | string | 是 | 是 | Worker的名称。 |
| 名称 | 参数类型 | 可读 | 可写 | 说明 |
| ------ | --------- | ---- | ---- | ---------------------- |
| type | "classic" | 是 | 是 | 按照指定方式执行脚本。 |
| name | string | 是 | 是 | Worker的名称。 |
| shared | boolean | 是 | 是 | Worker是否可以被分享。 |
## Worker
......@@ -438,7 +439,7 @@ Worker线程用于与宿主线程通信的类,通过postMessage接口发送消
### postMessage
postMessage(message: Object, options?: PostMessageOptions): void
postMessage(messageObject: Object, options?: PostMessageOptions): void
Worker向宿主线程发送消息。
......
......@@ -17,28 +17,10 @@
| 名称 | 参数类型 | 默认值 | 描述 |
| ---------- | ---------------------------------------- | --------------- | ----------------------- |
| duration | number | 1000 | 单位为毫秒,默认动画时长为1000毫秒。 |
| curve | Curve | Curve.Linear | 默认曲线为线性。 |
| curve | [Curve](ts-appendix-enums.md#curve) | Curve.Linear | 默认曲线为线性。 |
| delay | number | 0 | 单位为毫秒,默认不延时播放。 |
| iterations | number | 1 | 默认播放一次,设置为-1时表示无限次播放。 |
| playMode | [PlayMode](ts-appendix-enums.md#playmode枚举值说明) | PlayMode.Normal | 设置动画播放模式,默认播放完成后重头开始播放。 |
- Curve枚举说明
| 名称 | 描述 |
| ------------------- | ---------------------------------------- |
| Linear | 表示动画从头到尾的速度都是相同的。 |
| Ease | 表示动画以低速开始,然后加快,在结束前变慢,CubicBezier(0.25,&nbsp;0.1,&nbsp;0.25,&nbsp;1.0)。 |
| EaseIn | 表示动画以低速开始,CubicBezier(0.42,&nbsp;0.0,&nbsp;1.0,&nbsp;1.0)。 |
| EaseOut | 表示动画以低速结束,CubicBezier(0.0,&nbsp;0.0,&nbsp;0.58,&nbsp;1.0)。 |
| EaseInOut | 表示动画以低速开始和结束,CubicBezier(0.42,&nbsp;0.0,&nbsp;0.58,&nbsp;1.0)。 |
| FastOutSlowIn | 标准曲线,cubic-bezier(0.4,&nbsp;0.0,&nbsp;0.2,&nbsp;1.0)。 |
| LinearOutSlowIn | 减速曲线,cubic-bezier(0.0,&nbsp;0.0,&nbsp;0.2,&nbsp;1.0)。 |
| FastOutLinearIn | 加速曲线,cubic-bezier(0.4,&nbsp;0.0,&nbsp;1.0,&nbsp;1.0)。 |
| ExtremeDeceleration | 急缓曲线,cubic-bezier(0.0,&nbsp;0.0,&nbsp;0.0,&nbsp;1.0)。 |
| Sharp | 锐利曲线,cubic-bezier(0.33,&nbsp;0.0,&nbsp;0.67,&nbsp;1.0)。 |
| Rhythm | 节奏曲线,cubic-bezier(0.7,&nbsp;0.0,&nbsp;0.2,&nbsp;1.0)。 |
| Smooth | 平滑曲线,cubic-bezier(0.4,&nbsp;0.0,&nbsp;0.4,&nbsp;1.0)。 |
| Friction | 阻尼曲线,CubicBezier(0.2,&nbsp;0.0,&nbsp;0.2,&nbsp;1.0)。 |
| playMode | [PlayMode](ts-appendix-enums.md#playmode) | PlayMode.Normal | 设置动画播放模式,默认播放完成后重头开始播放。 |
## 示例
......
# 文档中涉及到的内置枚举值
## Alignment枚举说明
## Color
| 名称 | 描述 |
| -------- | -------- |
| TopStart | 顶部起始端。 |
| Top | 顶部横向居中。 |
| TopEnd | 顶部尾端。 |
| Start | 起始端纵向居中。 |
| Center | 横向和纵向居中。 |
| End | 尾端纵向居中。 |
| BottomStart | 底部起始端。 |
| Bottom | 底部横向居中。 |
| BottomEnd | 底部尾端。 |
| 颜色名称 | 颜色值 | 颜色示意 |
| ------------------------ | -------- | ------------------------------------------------------------ |
| Black | 0x000000 | ![zh-cn_image_0000001219864153](figures/zh-cn_image_0000001219864153.png) |
| Blue | 0x0000ff | ![zh-cn_image_0000001174104404](figures/zh-cn_image_0000001174104404.png) |
| Brown | 0xa52a2a | ![zh-cn_image_0000001219744201](figures/zh-cn_image_0000001219744201.png) |
| Gray | 0x808080 | ![zh-cn_image_0000001174264376](figures/zh-cn_image_0000001174264376.png) |
| Green | 0x008000 | ![zh-cn_image_0000001174422914](figures/zh-cn_image_0000001174422914.png) |
| Orange | 0xffa500 | ![zh-cn_image_0000001219662661](figures/zh-cn_image_0000001219662661.png) |
| Pink | 0xffc0cb | ![zh-cn_image_0000001219662663](figures/zh-cn_image_0000001219662663.png) |
| Red | 0xff0000 | ![zh-cn_image_0000001219662665](figures/zh-cn_image_0000001219662665.png) |
| White | 0xffffff | ![zh-cn_image_0000001174582866](figures/zh-cn_image_0000001174582866.png) |
| Yellow | 0xffff00 | ![zh-cn_image_0000001174582864](figures/zh-cn_image_0000001174582864.png) |
| Transparent<sup>9+</sup> | rgba(0,0,0,0) | 透明色 |
## ImageFit
## Axis枚举说明
| 名称 | 描述 |
| --------- | ------------------------------------------------------------ |
| Contain | 保持宽高比进行缩小或者放大,使得图片完全显示在显示边界内。 |
| Cover | 保持宽高比进行缩小或者放大,使得图片两边都大于或等于显示边界。 |
| Auto | 自适应显示 |
| Fill | 不保持宽高比进行放大缩小,使得图片充满显示边界。 |
| ScaleDown | 保持宽高比显示,图片缩小或者保持不变。 |
| None | 保持原有尺寸显示。 |
| 名称 | 描述 |
| -------- | -------- |
| Vertical | 方向为纵向。 |
| Horizontal | 方向为横向。 |
## BorderStyle
| 名称 | 描述 |
| ------ | ----------------------------------------------- |
| Dotted | 显示为一系列圆点,圆点半径为borderWidth的一半。 |
| Dashed | 显示为一系列短的方形虚线。 |
| Solid | 显示为一条实线。 |
## ItemAlign枚举说明
## LineJoinStyle
| 名称 | 描述 |
| -------- | -------- |
| Auto | 使用Flex容器中默认配置。 |
| Start | 元素在Flex容器中,交叉轴方向首部对齐。 |
| Center | 元素在Flex容器中,交叉轴方向居中对齐。 |
| End | 元素在Flex容器中,交叉轴方向底部对齐。 |
| Stretch | 元素在Flex容器中,交叉轴方向拉伸填充,在未设置尺寸时,拉伸到容器尺寸。 |
| Baseline | 元素在Flex容器中,交叉轴方向文本基线对齐。 |
| 名称 | 描述 |
| ----- | -------------------- |
| Bevel | 使用斜角连接路径段。 |
| Miter | 使用尖角连接路径段。 |
| Round | 使用圆角连接路径段。 |
## TouchType
## LineCapStyle枚举说明
| 名称 | 描述 |
| ------ | ------------------------------ |
| Down | 手指按下时触发。 |
| Up | 手指抬起时触发。 |
| Move | 手指按压态在屏幕上移动时触发。 |
| Cancel | 触摸事件取消时触发。 |
| 名称 | 描述 |
| -------- | -------- |
| Butt | 分割线两端为平行线。 |
| Round | 分割线两端为半圆。 |
| Square | 分割线两端为平行线。 |
## MouseButton
| 名称 | 描述 |
| ------- | ---------------- |
| Left | 鼠标左键。 |
| Right | 鼠标右键。 |
| Middle | 鼠标中键。 |
| Back | 鼠标左侧后退键。 |
| Forward | 鼠标左侧前进键。 |
| None | 无按键。 |
## PlayMode枚举值说明
## MouseAction
| 名称 | 描述 |
| -------- | -------- |
| Normal | 动画按正常播放。 |
| Reverse | 动画反向播放。 |
| Alternate | 动画在奇数次(1、3、5...)正向播放,在偶数次(2、4、6...)反向播放。 |
| AlternateReverse | 动画在奇数次(1、3、5...)反向播放,在偶数次(2、4、6...)正向播放。 |
| 名称 | 描述 |
| ------- | -------------- |
| Press | 鼠标按键按下。 |
| Release | 鼠标按键松开。 |
| Move | 鼠标移动。 |
## Curve
## ImageRepeat枚举说明
| 名称 | 描述 |
| ------------------- | ------------------------------------------------------------ |
| Linear | 表示动画从头到尾的速度都是相同的。 |
| Ease | 表示动画以低速开始,然后加快,在结束前变慢,CubicBezier(0.25, 0.1, 0.25, 1.0)。 |
| EaseIn | 表示动画以低速开始,CubicBezier(0.42, 0.0, 1.0, 1.0)。 |
| EaseOut | 表示动画以低速结束,CubicBezier(0.0, 0.0, 0.58, 1.0)。 |
| EaseInOut | 表示动画以低速开始和结束,CubicBezier(0.42, 0.0, 0.58, 1.0)。 |
| FastOutSlowIn | 标准曲线,cubic-bezier(0.4, 0.0, 0.2, 1.0)。 |
| LinearOutSlowIn | 减速曲线,cubic-bezier(0.0, 0.0, 0.2, 1.0)。 |
| FastOutLinearIn | 加速曲线,cubic-bezier(0.4, 0.0, 1.0, 1.0)。 |
| ExtremeDeceleration | 急缓曲线,cubic-bezier(0.0, 0.0, 0.0, 1.0)。 |
| Sharp | 锐利曲线,cubic-bezier(0.33, 0.0, 0.67, 1.0)。 |
| Rhythm | 节奏曲线,cubic-bezier(0.7, 0.0, 0.2, 1.0)。 |
| Smooth | 平滑曲线,cubic-bezier(0.4, 0.0, 0.4, 1.0)。 |
| Friction | 阻尼曲线,CubicBezier(0.2, 0.0, 0.2, 1.0)。 |
| 名称 | 描述 |
| -------- | -------- |
| X | 只在水平轴上重复绘制图片。 |
| Y | 只在竖直轴上重复绘制图片。 |
| XY | 在两个轴上重复绘制图片。 |
| NoRepeat | 不重复绘制图片。 |
## AnimationStatus
| 名称 | 描述 |
| ------- | ------------------ |
| Initial | 动画初始状态。 |
| Running | 动画处于播放状态。 |
| Paused | 动画处于暂停状态。 |
| Stopped | 动画处于停止状态。 |
## TextDecorationType枚举说明
## FillMode
| 名称 | 描述 |
| -------- | -------- |
| Underline | 文字下划线修饰。 |
| LineThrough | 穿过文本的修饰线。 |
| Overline | 文字上划线修饰。 |
| None | 不使用文本装饰线。 |
| 名称 | 描述 |
| -------- | -------------------------------- |
| None | 播放完成后恢复初始状态。 |
| Forwards | 播放完成后保持动画结束时的状态。 |
## PlayMode
## TextCase枚举说明
| 名称 | 描述 |
| ---------------- | ------------------------------------------------------------ |
| Normal | 动画按正常播放。 |
| Reverse | 动画反向播放。 |
| Alternate | 动画在奇数次(1、3、5...)正向播放,在偶数次(2、4、6...)反向播放。 |
| AlternateReverse | 动画在奇数次(1、3、5...)反向播放,在偶数次(2、4、6...)正向播放。 |
| 名称 | 描述 |
| -------- | -------- |
| Normal | 保持文本原有大小写。 |
| LowerCase | 文本采用全小写。 |
| UpperCase | 文本采用全大写。 |
## KeyType
| 名称 | 描述 |
| ---- | ---------- |
| Down | 按键按下。 |
| Up | 按键松开。 |
## BarState枚举说明
## KeySource
| 名称 | 描述 |
| -------- | -------- |
| Off | 不显示。 |
| On | 常驻显示。 |
| Auto | 按需显示(触摸时显示,2s后消失)。 |
## LayoutDirection枚举说明
| 名称 | 描述 |
| -------- | -------------------- |
| Unknown | 输入设备类型未知。 |
| Keyboard | 输入设备类型为键盘。 |
| 名称 | 描述 |
| -------- | -------- |
| Row | 主轴与行方向一致作为布局模式。 |
| Column | 主轴与列方向一致作为布局模式。 |
| RowReverse | 与Row相反方向进行布局。 |
| ColumnReverse | 与Column相反方向进行布局。 |
\ No newline at end of file
## Edge
| 名称 | 描述 |
| -------- | ---------------------- |
| Top | 竖直方向上边缘 |
| Center | 竖直方向居中位置 |
| Bottom | 竖直方向下边缘 |
| Baseline | 交叉轴方向文本基线位置 |
| Start | 水平方向起始位置 |
| Middle | 水平方向居中位置 |
| End | 水平方向末尾位置 |
## Week
| 名称 | 描述 |
| -------- | ---------------------- |
| Mon | 星期一 |
| Tue | 星期二 |
| Wed | 星期三 |
| Thur | 星期四 |
| Fri | 星期五 |
| Sat | 星期六 |
| Sun | 星期日 |
## Direction
| 名称 | 描述 |
| ---- | ---------------------- |
| Ltr | 元素从左到右布局。 |
| Rtl | 元素从右到左布局。 |
| Auto | 使用系统默认布局方向。 |
## BarState
| 名称 | 描述 |
| ---- | -------------------------------- |
| Off | 不显示。 |
| On | 常驻显示。 |
| Auto | 按需显示(触摸时显示,2s后消失)。 |
## EdgeEffect
| 名称 | 描述 |
| ------ | ------------------------------------------------------------ |
| Spring | 弹性物理动效,滑动到边缘后可以根据初始速度或通过触摸事件继续滑动一段距离,松手后回弹。 |
| Fade | 阴影效果,滑动到边缘后会有圆弧状的阴影。 |
| None | 滑动到边缘后无效果。 |
## Alignment
| 名称 | 描述 |
| ----------- | ---------------- |
| TopStart | 顶部起始端。 |
| Top | 顶部横向居中。 |
| TopEnd | 顶部尾端。 |
| Start | 起始端纵向居中。 |
| Center | 横向和纵向居中。 |
| End | 尾端纵向居中。 |
| BottomStart | 底部起始端。 |
| Bottom | 底部横向居中。 |
| BottomEnd | 底部尾端。 |
## TransitionType
| 名称 | 描述 |
| ------ | -------------------------------------------------- |
| All | 指定当前的Transition动效生效在组件的所有变化场景。 |
| Insert | 指定当前的Transition动效生效在组件的插入场景。 |
| Delete | 指定当前的Transition动效生效在组件的删除场景。 |
## RelateType
| 名称 | 描述 |
| ------ | ------------------------------- |
| FILL | 缩放当前子组件以填充满父组件 |
| FIT | 缩放当前子组件以自适应父组件 |
## Visibility
| 名称 | 描述 |
| ------- | -------------------------------- |
| Hidden | 隐藏,但参与布局进行占位。 |
| Visible | 显示。 |
| None | 隐藏,但不参与布局,不进行占位。 |
## LineCapStyle
| 名称 | 描述 |
| ------ | -------------------- |
| Butt | 分割线两端为平行线。 |
| Round | 分割线两端为半圆。 |
| Square | 分割线两端为平行线。 |
## Axis
| 名称 | 描述 |
| ---------- | ------------ |
| Vertical | 方向为纵向。 |
| Horizontal | 方向为横向。 |
## HorizontalAlign
| 名称 | 描述 |
| ------ | ------------------------ |
| Start | 按照语言方向起始端对齐。 |
| Center | 居中对齐,默认对齐方式。 |
| End | 按照语言方向末端对齐。 |
## FlexAlign
| 名称 | 描述 |
| ------------ | ------------------------------------------------------------ |
| Start | 元素在主轴方向首端对齐,第一个元素与行首对齐,同时后续的元素与前一个对齐。 |
| Center | 元素在主轴方向中心对齐,第一个元素与行首的距离与最后一个元素与行尾距离相同。 |
| End | 元素在主轴方向尾部对齐,最后一个元素与行尾对齐,其他元素与后一个对齐。 |
| SpaceBetween | Flex主轴方向均匀分配弹性元素,相邻元素之间距离相同。第一个元素与行首对齐,最后一个元素与行尾对齐。 |
| SpaceAround | Flex主轴方向均匀分配弹性元素,相邻元素之间距离相同。第一个元素到行首的距离和最后一个元素到行尾的距离是相邻元素之间距离的一半。 |
| SpaceEvenly | 距、第一个元素与行首的间距、最后一个元素到行尾的间距都完全一样。 |
## ItemAlign
| 名称 | 描述 |
| -------- | ------------------------------------------------------------ |
| Auto | 使用Flex容器中默认配置。 |
| Start | 元素在Flex容器中,交叉轴方向首部对齐。 |
| Center | 元素在Flex容器中,交叉轴方向居中对齐。 |
| End | 元素在Flex容器中,交叉轴方向底部对齐。 |
| Stretch | 元素在Flex容器中,交叉轴方向拉伸填充,在未设置尺寸时,拉伸到容器尺寸。 |
| Baseline | 元素在Flex容器中,交叉轴方向文本基线对齐。 |
## FlexDirection
| 名称 | 描述 |
| ------------- | ------------------------------ |
| Row | 主轴与行方向一致作为布局模式。 |
| RowReverse | 与Row方向相反方向进行布局。 |
| Column | 主轴与列方向一致作为布局模式。 |
| ColumnReverse | 与Column相反方向进行布局。 |
## FlexWrap
| 名称 | 描述 |
| ----------- | ------------------------------------------------- |
| NoWrap | Flex容器的元素单行/列布局,子项不允许超出容器。 |
| Wrap | Flex容器的元素多行/列排布,子项允许超出容器。 |
| WrapReverse | Flex容器的元素反向多行/列排布,子项允许超出容器。 |
## VerticalAlign
| 名称 | 描述 |
| ------ | ------------------------ |
| Top | 顶部对齐。 |
| Center | 居中对齐,默认对齐方式。 |
| Bottom | 底部对齐。 |
## ImageRepeat
| 名称 | 描述 |
| -------- | -------------------------- |
| X | 只在水平轴上重复绘制图片。 |
| Y | 只在竖直轴上重复绘制图片。 |
| XY | 在两个轴上重复绘制图片。 |
| NoRepeat | 不重复绘制图片。 |
## ImageSize
| 类型 | 描述 |
| ------- | ------------------------------------------------------------ |
| Cover | 默认值,保持宽高比进行缩小或者放大,使得图片两边都大于或等于显示边界。 |
| Contain | 保持宽高比进行缩小或者放大,使得图片完全显示在显示边界内。 |
| Auto | 保持原图的比例不变。 |
## GradientDirection
| 名称 | 描述 |
| ----------- | ---------- |
| Left | 从右向左。 |
| Top | 从下向上。 |
| Right | 从左向右。 |
| Bottom | 从上向下。 |
| LeftTop | 左上。 |
| LeftBottom | 左下。 |
| RightTop | 右上。 |
| RightBottom | 右下。 |
| None | 无。 |
## SharedTransitionEffectType
| 名称 | 描述 |
| ----------- | ---------- |
| Static | 目标页面元素的位置保持不变,可以配置透明度动画。目前,只有为重定向到目标页面而配置的静态效果才会生效。 |
| Exchange | 将源页面元素移动到目标页面元素位置并适当缩放。 |
## FontStyle
| 名称 | 描述 |
| ------ | ---------------- |
| Normal | 标准的字体样式。 |
| Italic | 斜体的字体样式。 |
## FontWeight
| 名称 | 描述 |
| ------- | -------------- |
| Lighter | 字体较细。 |
| Normal | 字体粗细正常。 |
| Regular | 字体粗细正常。 |
| Medium | 字体粗细适中。 |
| Bold | 字体较粗。 |
| Bolder | 字体非常粗。 |
## TextAlign
| 名称 | 描述 |
| ------ | -------------- |
| Start | 水平对齐首部。 |
| Center | 水平居中对齐。 |
| End | 水平对齐尾部。 |
## TextOverflow
| 名称 | 描述 |
| -------- | -------------------------------------- |
| Clip | 文本超长时进行裁剪显示。 |
| Ellipsis | 文本超长时显示不下的文本用省略号代替。 |
| None | 文本超长时不进行裁剪。 |
## TextDecorationType
| 名称 | 描述 |
| ----------- | ------------------ |
| Underline | 文字下划线修饰。 |
| LineThrough | 穿过文本的修饰线。 |
| Overline | 文字上划线修饰。 |
| None | 不使用文本装饰线。 |
## TextCase
| 名称 | 描述 |
| --------- | -------------------- |
| Normal | 保持文本原有大小写。 |
| LowerCase | 文本采用全小写。 |
| UpperCase | 文本采用全大写。 |
## ResponseType<sup>8+</sup>
| 名称 | 描述 |
| ---------- | -------------------------- |
| LongPress | 通过长按触发菜单弹出。 |
| RightClick | 通过鼠标右键触发菜单弹出。 |
## HoverEffect<sup>8+</sup>
| 名称 | 描述 |
| --------- | ---------------------------- |
| Auto | 使用组件的系统默认悬浮效果。 |
| Scale | 放大缩小效果。 |
| Highlight | 背景淡入淡出的强调效果。 |
| None | 不设置效果。 |
## Placement<sup>8+</sup>
| 名称 | 描述 |
| ------------- | ------------------------------------------------------------ |
| Left | 气泡提示位于组件左侧,与组件左侧中心对齐。 |
| Right | 气泡提示位于组件右侧,与组件右侧中心对齐。 |
| Top | 气泡提示位于组件上侧,与组件上侧中心对齐。 |
| Bottom | 气泡提示位于组件下侧,与组件下侧中心对齐。 |
| TopLeft | 气泡提示位于组件上侧,从API Version 9开始,与组件左侧边缘对齐。 |
| TopRight | 气泡提示位于组件上侧,从API Version 9开始,与组件右侧边缘对齐。 |
| BottomLeft | 气泡提示位于组件下侧,从API Version 9开始,与组件左侧边缘对齐。 |
| BottomRight | 气泡提示位于组件下侧,从API Version 9开始,与组件右侧边缘对齐。 |
| LeftTop9+ | 气泡提示位于组件左侧,与组件上侧边缘对齐。 |
| LeftBottom9+ | 气泡提示位于组件左侧,与组件下侧边缘对齐。 |
| RightTop9+ | 气泡提示位于组件右侧,与组件上侧边缘对齐。 |
| RightBottom9+ | 气泡提示位于组件右侧,与组件下侧边缘对齐。 |
## CopyOptions<sup>9+</sup>
| 名称 | 描述 |
| ----------- | -------------------- |
| None | 不支持复制粘贴。 |
| InApp | 支持应用内复制粘贴。 |
| LocalDevice | 支持设备内复制粘贴。 |
| CrossDevice | 支持跨设备复制粘贴。 |
## HitTestMode<sup>9+</sup>
| 名称 | 描述 |
| ----------- | -------------------- |
| Default | 自身节点和子节点都响应触摸事件的命中测试,但会阻止被该节点屏蔽的其他节点的命中测试。 |
| Block | 自身节点响应触摸事件的命中测试,但阻止被该节点屏蔽的子节点和其他节点的命中测试。 |
| Transparent | 自身节点和子节点响应触摸事件的命中测试,并允许对被该节点屏蔽的其他节点进行命中测试。 |
| None | 自身节点不会响应触摸事件的命中测试,但子节点会对触摸事件进行命中测试。 |
......@@ -45,25 +45,15 @@ Image(src: string | PixelMap | Resource)
| 名称 | 参数类型 | 默认值 | 描述 |
| --------------------- | ------------------------------------------------------- | ------------------------ | ------------------------------------------------------------ |
| alt | string \| [Resource](../../ui/ts-types.md#resource类型) | - | 加载时显示的占位图,支持本地图片和网络图片。 |
| objectFit | ImageFit | ImageFit.Cover | 设置图片的缩放类型。 |
| objectFit | [ImageFit](ts-appendix-enums.md#imagefit) | ImageFit.Cover | 设置图片的缩放类型。 |
| objectRepeat | [ImageRepeat](ts-appendix-enums.md#imagerepeat) | NoRepeat | 设置图片的重复样式。<br/>> **说明:**<br/>>&nbsp;-&nbsp;svg类型图源不支持该属性。 |
| interpolation | [ImageInterpolation](#imageinterpolation) | ImageInterpolation.None | 设置图片的插值效果,即减轻低清晰度图片在放大显示的时候出现的锯齿问题,仅针对图片放大插值。<br/>>&nbsp;**说明:**<br/>>&nbsp;-&nbsp;svg类型图源不支持该属性。<br/>>&nbsp;-&nbsp;PixelMap资源不支持该属性。 |
| renderMode | [ImageRenderMode](#imagerendermode) | ImageRenderMode.Original | 设置图片渲染的模式。<br/>>&nbsp;**说明:**<br/>>&nbsp;-&nbsp;svg类型图源不支持该属性。 |
| sourceSize | {<br/>width:&nbsp;number,<br/>height:&nbsp;number<br/>} | - | 设置图片裁剪尺寸,将原始图片解码成pixelMap,指定尺寸的图片,单位为px。<br/>>&nbsp;**说明:**<br/>>&nbsp;PixelMap资源不支持该属性。 |
| syncLoad<sup>8+</sup> | boolean | false | 设置是否同步加载图片,默认是异步加载。同步加载时阻塞UI线程,不会显示占位图。 |
| copyOption<sup>9+</sup> | [CopyOptions](#copyoptions) | CopyOptions.None | 设置图片是否可复制(SVG图片不支持复制)。 |
| copyOption<sup>9+</sup> | [CopyOptions](ts-appendix-enums.md#copyoptions9) | CopyOptions.None | 设置图片是否可复制(SVG图片不支持复制)。 |
| colorFilter<sup>9+</sup> | [ColorFilter](../../ui/ts-types.md) | - | 给图像设置颜色滤镜效果。 |
### ImageFit
| 名称 | 描述 |
| --------- | ------------------------------------------------------------ |
| Cover | 保持宽高比进行缩小或者放大,使得图片两边都大于或等于显示边界。 |
| Contain | 保持宽高比进行缩小或者放大,使得图片完全显示在显示边界内。 |
| Fill | 不保持宽高比进行放大缩小,使得图片充满显示边界。 |
| None | 保持原有尺寸显示。 |
| ScaleDown | 保持宽高比显示,图片缩小或者保持不变。 |
### ImageInterpolation
| 名称 | 描述 |
......@@ -80,15 +70,6 @@ Image(src: string | PixelMap | Resource)
| Original | 按照原图进行渲染,包括颜色。 |
| Template | 将图片渲染为模板图片,忽略图片的颜色信息。 |
### CopyOptions<sup>9+</sup>
| 名称 | 描述 |
| -------- | -------- |
| None | 不支持复制粘贴。 |
| InApp | 支持应用内复制粘贴。 |
| LocalDevice | 支持设备内复制粘贴。 |
| CrossDevice | 支持跨设备复制粘贴。 |
## 事件
除支持[通用事件](ts-universal-events-click.md)外,还支持以下事件:
......@@ -171,6 +152,72 @@ struct ImageExample1 {
![zh-cn_image_0000001250492613](figures/zh-cn_image_0000001250492613.gif)
### 网络图片
加载网络图片时,默认网络超时是5分钟,建议使用alt配置加载时的占位图。如果需要更灵活的网络配置,可以使用SDK中提供的[HTTP](../../connectivity/http-request.md)工具包发送网络请求,接着将返回的数据解码为Image组件中的`PixelMap`,图片开发可参考[图片处理](../../media/image.md)。代码如下。
```tsx
// @ts-nocheck
import http from '@ohos.net.http';
import ResponseCode from '@ohos.net.http';
import image from '@ohos.multimedia.image'
@Entry
@Component
struct Index {
// 先创建一个PixelMap状态变量用于接收网络图片
@State image: PixelMap = undefined
build() {
Column({space: 10}) {
Button("获取网络图片")
.onClick(() => {
this.httpRequest();
})
Image(this.image).height(100).width(100)
}
.width('100%')
.height('100%')
.padding(10)
}
// 网络图片请求方法
private httpRequest() {
let httpRequest = http.createHttp();
httpRequest.request(
"https://www.example.com/xxx.png", // 请填写一个具体的网络图片地址
(error, data) => {
if(error) {
console.log("error code: " + error.code + ", msg: " + error.message)
} else {
let code = data.responseCode
if(ResponseCode.ResponseCode.OK == code) {
let imageSource = image.createImageSource(data.result)
let options = {alphaType: 0, // 透明度
editable: false, // 是否可编辑
pixelFormat: 3, // 像素格式
scaleMode: 1, // 缩略值
size: {height: 100, width: 100}} // 创建图片大小
imageSource.createPixelMap(options).then((pixelMap) => {
this.image = pixelMap
})
} else {
console.log("response code: " + code);
}
}
}
)
}
}
```
**说明**:网络图片加载的请求方式、超时、额外请求参数等配置可以参考HTTP工具包中关于[`request()`](../../reference/apis/js-apis-http.md)请求方法的细节。
### 设置属性
```ts
......
......@@ -27,12 +27,12 @@ ImageAnimator()
| 参数名称 | 参数类型 | 默认值 | 必填 | 参数描述 |
| -------- | -------- | -------- | -------- | -------- |
| images | Array&lt;ImageFrameInfo&gt; | [] | 是 | 设置图片帧信息集合。每一帧的帧信息(ImageFrameInfo)包含图片路径、图片大小、图片位置和图片播放时长信息,详见ImageFrameInfo属性说明。 |
| state | AnimationStatus | Initial | 否 | 默认为初始状态,用于控制播放状态。 |
| state | [AnimationStatus](ts-appendix-enums.md#animationstatus) | Initial | 否 | 默认为初始状态,用于控制播放状态。 |
| duration | number | 1000 | 否 | 单位为毫秒,默认时长为1000ms;duration为0时,不播放图片;值的改变只会在下一次循环开始时生效;当images中任意一帧图片设置了单独的duration后,该属性设置无效。 |
| reverse | boolean | false | 否 | 设置播放顺序。false表示从第1张图片播放到最后1张图片;&nbsp;true表示从最后1张图片播放到第1张图片。 |
| fixedSize | boolean | true | 否 | 设置图片大小是否固定为组件大小。&nbsp;true表示图片大小与组件大小一致,此时设置图片的width&nbsp;、height&nbsp;、top&nbsp;和left属性是无效的。false表示每一张图片的width&nbsp;、height&nbsp;、top和left属性都要单独设置。 |
| preDecode | number | 0 | 否 | 是否启用预解码,默认值为0,即不启用预解码,如该值设为2,则播放当前页时会提前加载后面两张图片至缓存以提升性能。 |
| fillMode | FillMode | Forwards | 否 | 设置动画开始前和结束后的状态,可选值参见FillMode说明。 |
| fillMode | [FillMode](ts-appendix-enums.md#fillmode) | Forwards | 否 | 设置动画开始前和结束后的状态,可选值参见FillMode说明。 |
| iterations | number | 1 | 否 | 默认播放一次,设置为-1时表示无限次播放。 |
- ImageFrameInfo属性说明
......@@ -45,20 +45,6 @@ ImageAnimator()
| left | [Length](../../ui/ts-types.md#长度类型) | 0 | 否 | 图片相对于组件左上角的横向坐标 |
| duration | number | 0 | 否 | 每一帧图片的播放时长,单位毫秒 |
- AnimationStatus枚举说明
| 名称 | 描述 |
| -------- | -------- |
| Initial | 动画初始状态。 |
| Running | 动画处于播放状态。 |
| Paused | 动画处于暂停状态。 |
| Stopped | 动画处于停止状态。 |
- FillMode枚举值说明
| 名称 | 描述 |
| -------- | -------- |
| None | 播放完成后恢复初始状态。 |
| Forwards | 播放完成后保持动画结束时的状态。 |
## 事件
......
......@@ -26,7 +26,7 @@ ScrollBar(value: ScrollBarOptions)
| -------- | -------- | -------- | -------- | -------- |
| scroller | [Scroller](ts-container-scroll.md#scroller) | 是 | - | 可滚动组件的控制器。用于与可滚动组件进行绑定。 |
| direction | ScrollBarDirection | 否 | ScrollBarDirection.Vertical | 滚动条的方向,控制可滚动组件对应方向的滚动。 |
| state | BarState | 否 | BarState.Auto | 滚动条状态。 |
| state | [BarState](ts-appendix-enums.md#barstate) | 否 | BarState.Auto | 滚动条状态。 |
> **说明:**
> ScrollBar组件负责定义可滚动区域的行为样式,ScrollBar的子节点负责定义滚动条的行为样式。
......@@ -37,14 +37,7 @@ ScrollBar(value: ScrollBarOptions)
| 名称 | 描述 |
| -------- | -------- |
| Vertical | 纵向滚动条。 |
| Horizontal | 横向滚动条。 |
- BarState枚举说明
| 名称 | 描述 |
| -------- | -------- |
| On | 常驻显示。 |
| Off | 不显示。 |
| Auto | 按需显示(触摸时显示,无操作2s后消失)。 |
| Horizontal | 横向滚动条。 |
## 示例
......
......@@ -30,54 +30,15 @@ Text(content?: string)
| 名称 | 参数类型 | 默认值 | 描述 |
| -------- | -------- | -------- | -------- |
| textAlign | TextAlign | TextAlign.Start | 设置多行文本的文本对齐方式。 |
| textOverflow | {overflow:&nbsp;TextOverflow} | {overflow:&nbsp;TextOverflow.Clip} | 设置文本超长时的显示方式。<br/>**说明:**<br/>文本截断是按字截断。例如,英文以单词为最小单位进行截断,若需要以字母为单位进行截断,可在字母间添加零宽空格:\u200B。<br />需配合`maxLines`使用,单独设置不生效。 |
| textAlign | [TextAlign](ts-appendix-enums.md#textalign) | TextAlign.Start | 设置多行文本的文本对齐方式。 |
| textOverflow | {overflow:&nbsp;[TextOverflow](ts-appendix-enums.md#textoverflow)} | {overflow:&nbsp;TextOverflow.Clip} | 设置文本超长时的显示方式。<br/>**说明:**<br/>文本截断是按字截断。例如,英文以单词为最小单位进行截断,若需要以字母为单位进行截断,可在字母间添加零宽空格:\u200B。<br />需配合`maxLines`使用,单独设置不生效。 |
| maxLines | number | Infinity | 设置文本的最大行数。<br />**说明:**<br />默认情况下,文本是自动折行的,如果指定此参数,则文本最多不会超过指定的行。如果有多余的文本,可以通过 `textOverflow`来指定截断方式。 |
| lineHeight | Length | - | 设置文本的文本行高,设置值不大于0时,不限制文本行高,自适应字体大小,Length为number类型时单位为fp。 |
| decoration | {<br/>type:&nbsp;TextDecorationType,<br/>color?:&nbsp;Color<br/>} | {<br/>type:&nbsp;TextDecorationType.None,<br/>color: Color.Black<br/>} | 设置文本装饰线样式及其颜色。 |
| decoration | {<br/>type:&nbsp;[TextDecorationType](ts-appendix-enums.md#textdecorationtype),<br/>color?:&nbsp;Color<br/>} | {<br/>type:&nbsp;TextDecorationType.None,<br/>color: Color.Black<br/>} | 设置文本装饰线样式及其颜色。 |
| baselineOffset | Length | - | 设置文本基线的偏移量。 |
| textCase | TextCase | TextCase.Normal | 设置文本大小写。 |
| copyOption<sup>9+</sup> | CopyOptions | CopyOptions.None | 组件支持设置文本是否可复制粘贴。 |
- TextAlign枚举说明
| 名称 | 描述 |
| -------- | -------- |
| Center | 文本居中对齐。 |
| Start | 根据文字书写相同的方向对齐。 |
| End | 根据文字书写相反的方向对齐。 |
- TextOverflow枚举说明
| 名称 | 描述 |
| -------- | -------- |
| Clip | 文本超长时进行裁剪显示。 |
| Ellipsis | 文本超长时显示不下的文本用省略号代替。 |
| None | 文本超长时不进行裁剪。 |
- TextDecorationType枚举说明
| 名称 | 描述 |
| -------- | -------- |
| Underline | 文字下划线修饰。 |
| LineThrough | 穿过文本的修饰线。 |
| Overline | 文字上划线修饰。 |
| None | 不使用文本装饰线。 |
- TextCase枚举说明
| textCase | [TextCase](ts-appendix-enums.md#textcase) | TextCase.Normal | 设置文本大小写。 |
| copyOption<sup>9+</sup> | [CopyOptions](ts-appendix-enums.md#copyoptions9) | CopyOptions.None | 组件支持设置文本是否可复制粘贴。 |
| 名称 | 描述 |
| --------- | -------------------- |
| Normal | 保持文本原有大小写。 |
| LowerCase | 文本采用全小写。 |
| UpperCase | 文本采用全大写。 |
- CopyOptions<sup>9+</sup>枚举说明
| 名称 | 描述 |
| -------- | -------- |
| None | 不支持复制粘贴。 |
| InApp | 支持应用内复制粘贴。 |
| LocalDevice | 支持设备内复制粘贴。 |
| CrossDevice | 支持跨设备复制粘贴。 |
> **说明:**
> 不支持Text内同时存在文本内容和Span子组件。如果同时存在,只显示Span内的内容。
......
......@@ -36,18 +36,11 @@ TextArea(value?:{placeholder?: string| Resource, text?: string| Resource, contro
| ------------------------ | ---------------------------------------- | ----- | ---------------------------------------- |
| placeholderColor | Color | - | 设置placeholder文本颜色。 |
| placeholderFont | {<br/>size?:&nbsp;number,<br/>weight?:number&nbsp;\|&nbsp;[FontWeight](ts-universal-attributes-text-style.md),<br/>family?:&nbsp;string,<br/>style?:&nbsp;[FontStyle](ts-universal-attributes-text-style.md)<br/>} | - | 设置placeholder文本样式:<br/>-&nbsp;size:&nbsp;设置文本尺寸,Length为number类型时,使用fp单位。<br/>-&nbsp;weight:&nbsp;设置文本的字体粗细,number类型取值[100,&nbsp;900],取值间隔为100,默认为400,取值越大,字体越粗。<br/>-&nbsp;family:&nbsp;设置文本的字体列表。使用多个字体,使用','进行分割,优先级按顺序生效,例如:'Arial,&nbsp;sans-serif'。<br/>-&nbsp;style:&nbsp;设置文本的字体样式。 |
| textAlign | TextAlign | Start | 设置文本水平对齐方式。 |
| textAlign | [TextAlign](ts-appendix-enums.md#textalign) | Start | 设置文本水平对齐式。 |
| caretColor | Color | - | 设置输入框光标颜色。 |
| inputFilter<sup>8+</sup> | {<br/>value:&nbsp;[ResourceStr](../../ui/ts-types.md)<sup>8+</sup>,<br/>error?:&nbsp;(value:&nbsp;string)<br/>} | - | 通过正则表达式设置输入过滤器。满足表达式的输入允许显示,不满足的输入被忽略。仅支持单个字符匹配,不支持字符串匹配。例如:^(?=.\*\d)(?=.\*[a-z])(?=.\*[A-Z]).{8,10}$,不支持过滤8到10位的强密码。<br/>-&nbsp;value:设置正则表达式。<br/>-&nbsp;error:正则匹配失败时,返回被忽略的内容。 |
| copyOption<sup>9+</sup> | [CopyOptions](ts-basic-components-text.md) | CopyOptions.CrossDevice | 设置文本是否可复制。 |
- TextAlign枚举说明
| 名称 | 描述 |
| ------ | ------- |
| Start | 水平对齐首部。 |
| Center | 水平居中对齐。 |
| End | 水平对齐尾部。 |
## 事件
......
......@@ -91,10 +91,10 @@ fileAccess(fileAccess: boolean)
@Entry
@Component
struct WebComponent {
controller:WebController = new WebController();
controller: WebController = new WebController();
build() {
Column() {
Web({ src:'www.example.com', controller:this.controller })
Web({ src: 'www.example.com', controller: this.controller })
.fileAccess(true)
}
}
......@@ -648,10 +648,10 @@ onPrompt(callback: (event?: { url: string; message: string; value: string; resul
@Entry
@Component
struct WebComponent {
controller:WebController = new WebController();
controller: WebController = new WebController();
build() {
Column() {
Web({ src:'www.example.com', controller:this.controller })
Web({ src: 'www.example.com', controller: this.controller })
.onPrompt((event) => {
console.log("url:" + event.url);
console.log("message:" + event.message);
......@@ -1117,7 +1117,7 @@ onInterceptRequest9+(callback: (event?: { request: WebResourceRequest}) => WebRe
@Entry
@Component
struct WebComponent {
controller:WebController = new WebController();
controller: WebController = new WebController();
responseweb: WebResourceResponse = new WebResourceResponse();
heads:Header[] = new Array();
@State webdata: string = "<!DOCTYPE html>\n" +
......@@ -1131,7 +1131,7 @@ onInterceptRequest9+(callback: (event?: { request: WebResourceRequest}) => WebRe
"</html>"
build() {
Column() {
Web({ src:'www.example.com', controller:this.controller })
Web({ src: 'www.example.com', controller: this.controller })
.onInterceptRequest((event) => {
console.log('url:' + event.request.getRequestUrl());
var head1:Header = {
......@@ -1181,36 +1181,37 @@ onHttpAuthRequest(callback: (event?: { handler: HttpAuthHandler, host: string, r
@Entry
@Component
struct WebComponent {
controller:WebController = new WebController();
httpAuth:boolean = false;
controller: WebController = new WebController();
httpAuth: boolean = false;
build() {
Column() {
Web({ src:'www.example.com', controller:this.controller })
.onHttpAuthRequest((event) => {
AlertDialog.show({
title: 'title',
message: 'text',
confirm: {
value: 'onConfirm',
action: () => {
this.httpAuth = event.handler.isHttpAuthInfoSaved();
if (this.httpAuth == false) {
web.WebDataBase.saveHttpAuthCredentials(
event.host,
event.realm,
"2222",
"2222"
)
event.handler.cancel();
Web({ src: 'www.example.com', controller: this.controller })
.onHttpAuthRequest((event) => {
AlertDialog.show({
title: 'title',
message: 'text',
confirm: {
value: 'onConfirm',
action: () => {
this.httpAuth = event.handler.isHttpAuthInfoSaved();
if (this.httpAuth == false) {
web.WebDataBase.saveHttpAuthCredentials(
event.host,
event.realm,
"2222",
"2222"
)
event.handler.cancel();
}
}
},
cancel: () => {
event.handler.cancel();
}
},
cancel: () => {
event.handler.cancel();
}
})
return true;
})
return true;
})
}
}
}
......@@ -1232,25 +1233,25 @@ onPermissionRequest(callback: (event?: { request: PermissionRequest }) => void)
@Entry
@Component
struct WebComponent {
controller:WebController = new WebController();
controller: WebController = new WebController();
build() {
Column() {
Web({ src:'www.example.com', controller:this.controller })
.onPermissionRequest((event) => {
AlertDialog.show({
title: 'title',
message: 'text',
confirm: {
value: 'onConfirm',
action: () => {
event.request.grant(event.request.getAccessibleResource());
Web({ src: 'www.example.com', controller: this.controller })
.onPermissionRequest((event) => {
AlertDialog.show({
title: 'title',
message: 'text',
confirm: {
value: 'onConfirm',
action: () => {
event.request.grant(event.request.getAccessibleResource());
}
},
cancel: () => {
event.request.deny();
}
},
cancel: () => {
event.request.deny();
}
})
})
})
}
}
}
......@@ -1282,10 +1283,10 @@ onContextMenuShow(callback: (event?: { param: WebContextMenuParam, result: WebCo
@Entry
@Component
struct WebComponent {
controller:WebController = new WebController();
controller: WebController = new WebController();
build() {
Column() {
Web({ src:'www.example.com', controller:this.controller })
Web({ src: 'www.example.com', controller: this.controller })
.onContextMenuShow((event) => {
console.info("x coord = " + event.param.x());
console.info("link url = " + event.param.getLinkUrl());
......@@ -2049,14 +2050,14 @@ backOrForward(step: number): void
@Entry
@Component
struct WebComponent {
controller:WebController = new WebController();
controller: WebController = new WebController();
build() {
Column() {
Button('backOrForward')
.onClick(() => {
this.controller.backOrForward();
})
Web({ src:'www.example.com', controller:this.controller })
Web({ src: 'www.example.com', controller: this.controller })
}
}
```
......
......@@ -2,7 +2,7 @@
> **说明:**
>
> 该组件从API&nbsp;Version&nbsp;9开始支持。
> 该组件从API&nbsp;Version&nbsp;9开始支持。后续版本如有新增内容,则采用上角标单独标记该内容的起始版本。
>
> 本组件均为系统接口,三方应用不支持调用。
......@@ -11,28 +11,13 @@
## 使用约束
使用AbilityComponent必须是平台签名使用,并申请权限。
AbilityComponent为独立层次渲染,不能再之上叠加其他显示内容。
AbilityComponent不支持处理输入事件,事件不经过当前Ability,直接分发给内部的Ability处理。
AbilityComponent需设置且只能设置width、height,且width、height不支持动态更新。
被启动的Ability必须是resizeable。
被启动的Ability需要设置为多任务栏不显示。
## 权限列表
ohos.permission.INFUSE_EVENTS
ohos.permission.CONTROL_ABILITY_STACKS
ohos.permission.INTEGRATED_ABILITY
ohos.permission.INTEGRATED_INTERIOR_WINDOW
被拉起的Ability必须继承[WindowExtension](../apis/js-apis-application-WindowExtensionAbility.md)
## 子组件
......@@ -43,19 +28,26 @@ ohos.permission.INTEGRATED_INTERIOR_WINDOW
AbilityComponent(value: {want : Want})
- 参数
| 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 |
| -------- | -------- | -------- | -------- | -------- |
| want | [Want](../../reference/apis/js-apis-application-Want.md) | 是 | - | 默认加载的Ability描述。 |
**参数:**
| 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 |
| -------- | -------- | -------- | -------- | -------- |
| want | [Want](../../reference/apis/js-apis-application-Want.md) | 是 | - | 默认加载的Ability描述。 |
## 事件
| 名称 | 功能描述 |
| -------- | -------- |
| onConnect()&nbsp;=&gt;&nbsp;void | AbilityComponent环境启动完成时的回调,之后可使用AbilityComponent的方法。 |
| onDisconnect()&nbsp;=&gt;&nbsp;void | AbilityComponent环境销毁时的回调。 |
### onConnect
onConnect()&nbsp;=&gt;&nbsp;void
AbilityComponent环境启动完成时的回调,之后可使用AbilityComponent的方法。
### onDisconnect
onDisconnect()&nbsp;=&gt;&nbsp;void
AbilityComponent环境销毁时的回调。
## 示例
......
......@@ -30,10 +30,10 @@ AlphabetIndexer(value: {arrayValue : Array&lt;string&gt;, selected : number})
| 名称 | 参数类型 | 描述 |
| -------- | -------- | -------- |
| selectedColor | Color | 选中文本文字颜色。 |
| popupColor | Color | 弹出提示文本字体颜色。 |
| selectedBackgroundColor | Color | 选中文本背景颜色。 |
| popupBackground | Color | 弹窗索引背景色。 |
| selectedColor | [ResourceColor](../../ui/ts-types.md) | 选中文本文字颜色。 |
| popupColor | [ResourceColor](../../ui/ts-types.md) | 弹出提示文本字体颜色。 |
| selectedBackgroundColor | [ResourceColor](../../ui/ts-types.md) | 选中文本背景颜色。 |
| popupBackground | [ResourceColor](../../ui/ts-types.md) | 弹窗索引背景色。 |
| usingPopup | boolean | 是否使用弹出索引提示。 |
| selectedFont | {<br/>size?:&nbsp;number,<br/>weight?:&nbsp;FontWeight,<br/>family?:&nbsp;string,<br/>style?:&nbsp;FontStyle<br/>} | 选中文本文字样式。 |
| popupFont | {<br/>size?:&nbsp;number,<br/>weight?:&nbsp;FontWeight,<br/>family?:&nbsp;string,<br/>style?:&nbsp;FontStyle<br/>} | 弹出提示文本字体样式。 |
......
......@@ -32,16 +32,9 @@ Column(value:{space?: Length})
| 名称 | 参数类型 | 默认值 | 描述 |
| -------- | -------- | -------- | -------- |
| alignItems | HorizontalAlign | HorizontalAlign.Center | 设置子组件在水平方向上的对齐格式。 |
| alignItems | [HorizontalAlign](ts-appendix-enums.md#horizontalalign) | HorizontalAlign.Center | 设置子组件在水平方向上的对齐格式。 |
| justifyContent<sup>8+</sup> | [FlexAlign](ts-container-flex.md) | FlexAlign.Start | 设置子组件在垂直方向上的对齐格式。 |
- HorizontalAlign枚举说明
| 名称 | 描述 |
| -------- | -------- |
| Start | 按照语言方向起始端对齐。 |
| Center | 居中对齐,默认对齐方式。 |
| End | 按照语言方向末端对齐。 |
## 示例
......
......@@ -26,36 +26,11 @@ Flex(options?: { direction?: FlexDirection, wrap?: FlexWrap, justifyContent?: F
- 参数
| 参数名 | 参数类型 | 必填 | 默认值 | 参数描述 |
| -------------- | ---------------------------------------- | ---- | ----------------- | ---------------------------------------- |
| direction | FlexDirection | 否 | FlexDirection.Row | 子组件在Flex容器上排列的方向,即主轴的方向。 |
| wrap | FlexWrap | 否 | FlexWrap.NoWrap | Flex容器是单行/列还是多行/列排列。 |
| justifyContent | FlexAlign | 否 | FlexAlign.Start | 子组件在Flex容器主轴上的对齐格式。 |
| alignItems | [ItemAlign](ts-appendix-enums.md#itemalign枚举说明) | 否 | ItemAlign.Stretch | 子组件在Flex容器交叉轴上的对齐格式。 |
| alignContent | FlexAlign | 否 | FlexAlign.Start | 交叉轴中有额外的空间时,多行内容的对齐方式。仅在wrap为Wrap或WrapReverse下生效。 |
- FlexDirection枚举说明
| 名称 | 描述 |
| ------------- | ---------------- |
| Row | 主轴与行方向一致作为布局模式。 |
| RowReverse | 与Row方向相反方向进行布局。 |
| Column | 主轴与列方向一致作为布局模式。 |
| ColumnReverse | 与Column相反方向进行布局。 |
- FlexWrap枚举说明
| 名称 | 描述 |
| ----------- | ------------------------------------------------- |
| NoWrap | Flex容器的元素单行/列布局,子项不允许超出容器。 |
| Wrap | Flex容器的元素多行/列排布,子项允许超出容器。 |
| WrapReverse | Flex容器的元素反向多行/列排布,子项允许超出容器。 |
- FlexAlign枚举说明
| 名称 | 描述 |
| ------------ | ------------------------------------------------------------ |
| Start | 元素在主轴方向首端对齐,第一个元素与行首对齐,同时后续的元素与前一个对齐。 |
| Center | 元素在主轴方向中心对齐,第一个元素与行首的距离与最后一个元素与行尾距离相同。 |
| End | 元素在主轴方向尾部对齐,最后一个元素与行尾对齐,其他元素与后一个对齐。 |
| SpaceBetween | Flex主轴方向均匀分配弹性元素,相邻元素之间距离相同。第一个元素与行首对齐,最后一个元素与行尾对齐。 |
| SpaceAround | Flex主轴方向均匀分配弹性元素,相邻元素之间距离相同。第一个元素到行首的距离和最后一个元素到行尾的距离是相邻元素之间距离的一半。 |
| SpaceEvenly | Flex主轴方向元素等间距布局,相邻元素之间的间距、第一个元素与行首的间距、最后一个元素到行尾的间距都完全一样。 |
| direction | [FlexDirection](ts-appendix-enums.md#flexdirection) | 否 | FlexDirection.Row | 子组件在Flex容器上排列的方向,即主轴的方向。 |
| wrap | [FlexWrap](ts-appendix-enums.md#flexwrap) | 否 | FlexWrap.NoWrap | Flex容器是单行/列还是多行/列排列。 |
| justifyContent | [FlexAlign](ts-appendix-enums.md#flexalign) | 否 | FlexAlign.Start | 子组件在Flex容器主轴上的对齐格式。 |
| alignItems | [ItemAlign](ts-appendix-enums.md#itemalign) | 否 | ItemAlign.Stretch | 子组件在Flex容器交叉轴上的对齐格式。 |
| alignContent | [FlexAlign](ts-appendix-enums.md#flexalign) | 否 | FlexAlign.Start | 交叉轴中有额外的空间时,多行内容的对齐方式。仅在wrap为Wrap或WrapReverse下生效。 |
## 示例
......
......@@ -35,23 +35,16 @@ List(value:{space?: number | string, initialIndex?: number, scroller?: Scroller}
| 名称 | 参数类型 | 默认值 | 描述 |
| -------- | -------- | -------- | -------- |
| listDirection | [Axis](ts-appendix-enums.md#axis枚举说明) | Vertical | 设置List组件排列方向参照Axis枚举说明。 |
| listDirection | [Axis](ts-appendix-enums.md#axis) | Vertical | 设置List组件排列方向参照Axis枚举说明。 |
| divider | {<br/>strokeWidth:&nbsp;Length,<br/>color?:Color,<br/>startMargin?:&nbsp;Length,<br/>endMargin?:&nbsp;Length<br/>} | - | 用于设置ListItem分割线样式,默认无分割线。<br/>strokeWidth:&nbsp;分割线的线宽。<br/>color:&nbsp;分割线的颜色。<br/>startMargin:&nbsp;分割线距离列表侧边起始端的距离。<br/>endMargin:&nbsp;分割线距离列表侧边结束端的距离。 |
| editMode | boolean | false | 声明当前List组件是否处于可编辑模式。 |
| edgeEffect | EdgeEffect | EdgeEffect.Spring | 滑动效果,目前支持的滑动效果参见EdgeEffect的枚举说明。 |
| edgeEffect | [EdgeEffect](ts-appendix-enums.md#edgeeffect) | EdgeEffect.Spring | 滑动效果,目前支持的滑动效果参见EdgeEffect的枚举说明。 |
| chainAnimation | boolean | false | 用于设置当前list是否启用链式联动动效,开启后列表滑动以及顶部和底部拖拽时会有链式联动的效果。链式联动效果:list内的list-item间隔一定距离,在基本的滑动交互行为下,主动对象驱动从动对象进行联动,驱动效果遵循弹簧物理动效。<br/>-&nbsp;false:不启用链式联动。<br/>-&nbsp;true:启用链式联动。 |
| multiSelectable<sup>8+</sup> | boolean | false | 是否开启鼠标框选。<br/>-&nbsp;false:关闭框选。<br/>-&nbsp;true:开启框选。 |
| restoreId<sup>8+</sup> | number | - | 组件迁移标识符,标识后的组件在应用迁移时,组件状态会被迁移到被拉起方的同标识组件。<br/>列表组件状态,包括起始位置显示的item序号。 |
| lanes<sup>9+</sup> | number \|<br>{<br/>minLength: Length,<br/>maxLength: Length<br/>} | 1 | 以列模式为例(listDirection为Axis.Vertical):<br/>lanes用于决定List组件在交叉轴方向按几列布局,规则如下:<br/>- lanes为指定的数量时,根据指定的数量与List组件的交叉轴宽度来决定每列的宽度;<br/>- lane设置了{minLength,maxLength}时,根据List组件的宽度自适应决定lanes数量(即列数),保证缩放过程中lane的宽度符合{minLength,maxLength}的限制。其中,minLength条件会被优先满足,即优先保证符合ListItem的宽度符合最小宽度限制。例如在列模式下,设置了{minLength: 40vp,maxLength: 60vp},则当List组件宽度为70vp时,ListItem为一列,并且根据alignListItem属性做靠左、居中或者靠右布局;当List组件宽度变化至80vp时,符合两倍的minLength,则ListItem自适应为两列。 |
| alignListItem<sup>9+</sup> | ListItemAlign | ListItemAlign.Center | List交叉轴方向宽度大于ListItem交叉轴宽度 * lanes时,ListItem在List交叉轴方向的布局方式,默认为居中。 |
- EdgeEffect枚举说明
| 名称 | 描述 |
| ------ | ------------------------------------------------------------ |
| Spring | 弹性物理动效,滑动到边缘后可以根据初始速度或通过触摸事件继续滑动一段距离,松手后回弹。 |
| None | 滑动到边缘后无效果。 |
- ListItemAlign枚举说明
| 名称 | 描述 |
......
......@@ -29,6 +29,7 @@ ListItem()
| sticky | Sticky | Sticky.None | 设置ListItem吸顶效果,参见Sticky枚举描述。 |
| editable | boolean | false | 当前ListItem元素是否可编辑,进入编辑模式后可删除。 |
| selectable<sup>8+</sup> | boolean | true | 当前ListItem元素是否可以被鼠标框选。<br/>>&nbsp;&nbsp;**说明:**<br/>>&nbsp;外层List容器的鼠标框选开启时,ListItem的框选才生效。 |
| swipeAction<sup>9+</sup> | {<br/>start?:&nbsp;CustomBuilder,<br/>end?:CustomBuilder,<br/>edgeEffect?:&nbsp;SwipeEdgeEffect,<br/>} | - | 用于设置ListItem的划出组件。<br/>start:&nbsp;ListItem向右划动时item左边的组件(List垂直布局时)或ListItem向下划动时item上方的组件(List水平布局时)。<br/>end:&nbsp;ListItem向左划动时item右边的组件(List垂直布局时)或ListItem向上划动时item下方的组件(List水平布局时)。<br/>edgeEffect:&nbsp;滑动效果,参见SwipeEdgeEffect的枚举说明。<br/> |
- Sticky枚举说明
| 名称 | 描述 |
......@@ -36,6 +37,11 @@ ListItem()
| None | 无吸顶效果。 |
| Normal | 当前item吸顶。 |
- SwipeEdgeEffect<sup>9+</sup>枚举说明
| 名称 | 描述 |
| -------- | -------- |
| Spring | ListItem划动距离超过划出组件大小后可以继续划动,松手后按照弹簧阻尼曲线回弹。 |
| None | ListItem划动距离不能超过划出组件大小。 |
## 事件
......@@ -87,3 +93,54 @@ struct ListItemExample {
```
![zh-cn_image_0000001219864159](figures/zh-cn_image_0000001219864159.gif)
```ts
// xxx.ets
@Entry
@Component
struct ListItemExample2 {
@State message: string = 'Hello World'
@Builder itemEnd() {
Row () {
Button("Del").margin("4vp")
Button("Set").margin("4vp")
}.padding("4vp").justifyContent(FlexAlign.SpaceEvenly)
}
build() {
Column() {
List({space:10}) {
ListItem() {
Text(this.message) {
}
.width('100%')
.height(100)
.fontSize(16)
.textAlign(TextAlign.Center)
.borderRadius(10)
.backgroundColor(0xFFFFFF)
}
.swipeAction({ end:this.itemEnd})
ListItem() {
Text(this.message) {
}
.width('100%')
.height(100)
.fontSize(16)
.textAlign(TextAlign.Center)
.borderRadius(10)
.backgroundColor(0xFFFFFF)
}
.swipeAction({ start:this.itemEnd})
}
}
.padding(10)
.backgroundColor(0xDCDCDC)
.width('100%')
.height('100%')
}
}
```
![zh-cn_image_1501929990650](figures/zh-cn_image_1501929990650.jpg)
......@@ -58,7 +58,7 @@ struct RefreshExample {
build() {
Column() {
Refresh({ refreshing: this.isRefreshing, offset: 120, friction: 100 }) {
Refresh({ refreshing: $$this.isRefreshing, offset: 120, friction: 100 }) {
Text('Pull Down and refresh: ' + this.counter)
.fontSize(30)
.margin(10)
......
......@@ -31,15 +31,8 @@ Row(value:{space?: Length})
| 名称 | 参数类型 | 默认值 | 描述 |
| -------- | -------- | -------- | -------- |
| alignItems | VerticalAlign | VerticalAlign.Center | 在垂直方向上子组件的对齐格式。 |
| justifyContent8+ | [FlexAlign](ts-container-flex.md) | FlexAlign.Start | 设置子组件在水平方向上的对齐格式。 |
- VerticalAlign枚举说明
| 名称 | 描述 |
| -------- | -------- |
| Top | 顶部对齐。 |
| Center | 居中对齐,默认对齐方式。 |
| Bottom | 底部对齐。 |
| alignItems | [VerticalAlign](ts-appendix-enums.md#verticalalign) | VerticalAlign.Center | 在垂直方向上子组件的对齐格式。 |
| justifyContent8+ | [FlexAlign](ts-appendix-enums.md#flexalign) | FlexAlign.Start | 设置子组件在水平方向上的对齐格式。 |
## 示例
......
......@@ -29,7 +29,7 @@ Scroll(scroller?: Scroller)
| 名称 | 参数类型 | 默认值 | 描述 |
| -------------- | ---------------------------------------- | ------------------------ | --------- |
| scrollable | ScrollDirection | ScrollDirection.Vertical | 设置滚动方法。 |
| scrollBar | [BarState](ts-appendix-enums.md#barstate枚举说明) | ScrollDirection.Auto | 设置滚动条状态。 |
| scrollBar | [BarState](ts-appendix-enums.md#barstate) | ScrollDirection.Auto | 设置滚动条状态。 |
| scrollBarColor | Color | - | 设置滚动条的颜色。 |
| scrollBarWidth | Length | - | 设置滚动条的宽度。 |
......
......@@ -42,21 +42,13 @@ Shape(value:{target?: PixelMap})
| stroke | Color | - | 否 | 边框颜色。 |
| strokeDashArray | Array&lt;Length&gt; | [] | 否 | 设置边框的间隙。 |
| strokeDashOffset | Length | 0 | 否 | 边框绘制起点的偏移量。 |
| strokeLineCap | [LineCapStyle](ts-appendix-enums.md#LineCapStyle枚举说明) | LineCapStyle.Butt | 否 | 路径端点绘制样式。 |
| strokeLineJoin | LineJoinStyle | LineJoinStyle.Miter | 否 | 边框拐角绘制样式。 |
| strokeLineCap | [LineCapStyle](ts-appendix-enums.md#linecapstyle) | LineCapStyle.Butt | 否 | 路径端点绘制样式。 |
| strokeLineJoin | [LineJoinStyle](ts-appendix-enums.md#linejoinstyle) | LineJoinStyle.Miter | 否 | 边框拐角绘制样式。 |
| strokeMiterLimit | number | 4 | 否 | 锐角绘制成斜角的极限值。 |
| strokeOpacity | number | 1 | 否 | 设置边框的不透明度。 |
| strokeWidth | Length | 1 | 否 | 设置边框的宽度。 |
| antiAlias | boolean | true | 否 | 是否开启抗锯齿。 |
- LineJoinStyle枚举说明
| 名称 | 描述 |
| -------- | -------- |
| Bevel | 使用斜角连接路径段。 |
| Miter | 使用尖角连接路径段。 |
| Round | 使用圆角连接路径段。 |
## 示例
```ts
......
......@@ -21,7 +21,7 @@
| curve | Curve&nbsp;\|&nbsp;Curves | Linear | 动画曲线。 |
| delay | number | 0 | 单位为ms(毫秒),默认不延时播放。 |
| iterations | number | 1 | 默认播放一次,设置为-1时表示无限次播放。 |
| playMode | PlayMode | Normal | 设置动画播放模式,默认播放完成后重头开始播放。 |
| playMode | [PlayMode](ts-appendix-enums.md#playmode) | Normal | 设置动画播放模式,默认播放完成后重头开始播放。 |
- 接口
......
......@@ -710,8 +710,8 @@ fillRect(x: number, y: number, w: number, h: number): void
- 示例
```ts
// xxx.ets
@Entry
// xxx.ets
@Entry
@Component
struct FillRect {
private settings: RenderingContextSettings = new RenderingContextSettings(true)
......@@ -755,8 +755,8 @@ strokeRect(x: number, y: number, w: number, h: number): void
- 示例
```ts
// xxx.ets
@Entry
// xxx.ets
@Entry
@Component
struct StrokeRect {
private settings: RenderingContextSettings = new RenderingContextSettings(true)
......@@ -799,8 +799,8 @@ clearRect(x: number, y: number, w: number, h: number): void
- 示例
```ts
// xxx.ets
@Entry
// xxx.ets
@Entry
@Component
struct ClearRect {
private settings: RenderingContextSettings = new RenderingContextSettings(true)
......@@ -844,8 +844,8 @@ fillText(text: string, x: number, y: number): void
- 示例
```ts
// xxx.ets
@Entry
// xxx.ets
@Entry
@Component
struct FillText {
private settings: RenderingContextSettings = new RenderingContextSettings(true)
......@@ -888,8 +888,8 @@ strokeText(text: string, x: number, y: number): void
- 示例
```ts
// xxx.ets
@Entry
// xxx.ets
@Entry
@Component
struct StrokeText {
private settings: RenderingContextSettings = new RenderingContextSettings(true)
......@@ -940,8 +940,8 @@ measureText(text: string): TextMetrics
- 示例
```ts
// xxx.ets
@Entry
// xxx.ets
@Entry
@Component
struct MeasureText {
private settings: RenderingContextSettings = new RenderingContextSettings(true)
......@@ -983,8 +983,8 @@ stroke(path?: Path2D): void
- 示例
```ts
// xxx.ets
@Entry
// xxx.ets
@Entry
@Component
struct Stroke {
private settings: RenderingContextSettings = new RenderingContextSettings(true)
......@@ -1022,8 +1022,8 @@ beginPath(): void
- 示例
```ts
// xxx.ets
@Entry
// xxx.ets
@Entry
@Component
struct BeginPath {
private settings: RenderingContextSettings = new RenderingContextSettings(true)
......@@ -1069,8 +1069,8 @@ moveTo(x: number, y: number): void
- 示例
```ts
// xxx.ets
@Entry
// xxx.ets
@Entry
@Component
struct MoveTo {
private settings: RenderingContextSettings = new RenderingContextSettings(true)
......@@ -1114,8 +1114,8 @@ lineTo(x: number, y: number): void
- 示例
```ts
// xxx.ets
@Entry
// xxx.ets
@Entry
@Component
struct LineTo {
private settings: RenderingContextSettings = new RenderingContextSettings(true)
......@@ -1153,8 +1153,8 @@ closePath(): void
- 示例
```ts
// xxx.ets
@Entry
// xxx.ets
@Entry
@Component
struct ClosePath {
private settings: RenderingContextSettings = new RenderingContextSettings(true)
......@@ -1200,8 +1200,8 @@ createPattern(image: ImageBitmap, repetition: string): CanvasPattern
- 示例
```ts
// xxx.ets
@Entry
// xxx.ets
@Entry
@Component
struct CreatePattern {
private settings: RenderingContextSettings = new RenderingContextSettings(true)
......@@ -1249,8 +1249,8 @@ bezierCurveTo(cp1x: number, cp1y: number, cp2x: number, cp2y: number, x: number,
- 示例
```ts
// xxx.ets
@Entry
// xxx.ets
@Entry
@Component
struct BezierCurveTo {
private settings: RenderingContextSettings = new RenderingContextSettings(true)
......@@ -1296,8 +1296,8 @@ quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void
- 示例
```ts
// xxx.ets
@Entry
// xxx.ets
@Entry
@Component
struct QuadraticCurveTo {
private settings: RenderingContextSettings = new RenderingContextSettings(true)
......@@ -1345,8 +1345,8 @@ arc(x: number, y: number, radius: number, startAngle: number, endAngle: number,
- 示例
```ts
// xxx.ets
@Entry
// xxx.ets
@Entry
@Component
struct Arc {
private settings: RenderingContextSettings = new RenderingContextSettings(true)
......@@ -1392,8 +1392,8 @@ arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): void
- 示例
```ts
// xxx.ets
@Entry
// xxx.ets
@Entry
@Component
struct ArcTo {
private settings: RenderingContextSettings = new RenderingContextSettings(true)
......@@ -1443,8 +1443,8 @@ ellipse(x: number, y: number, radiusX: number, radiusY: number, rotation: number
- 示例
```ts
// xxx.ets
@Entry
// xxx.ets
@Entry
@Component
struct CanvasExample {
private settings: RenderingContextSettings = new RenderingContextSettings(true)
......@@ -1489,8 +1489,8 @@ rect(x: number, y: number, width: number, height: number): void
- 示例
```ts
// xxx.ets
@Entry
// xxx.ets
@Entry
@Component
struct CanvasExample {
private settings: RenderingContextSettings = new RenderingContextSettings(true)
......@@ -1526,8 +1526,8 @@ fill(): void
- 示例
```ts
// xxx.ets
@Entry
// xxx.ets
@Entry
@Component
struct Fill {
private settings: RenderingContextSettings = new RenderingContextSettings(true)
......@@ -1563,8 +1563,8 @@ clip(): void
- 示例
```ts
// xxx.ets
@Entry
// xxx.ets
@Entry
@Component
struct Clip {
private settings: RenderingContextSettings = new RenderingContextSettings(true)
......@@ -1608,8 +1608,8 @@ rotate(rotate: number): void
- 示例
```ts
// xxx.ets
@Entry
// xxx.ets
@Entry
@Component
struct Rotate {
private settings: RenderingContextSettings = new RenderingContextSettings(true)
......@@ -1651,8 +1651,8 @@ scale(x: number, y: number): void
- 示例
```ts
// xxx.ets
@Entry
// xxx.ets
@Entry
@Component
struct Scale {
private settings: RenderingContextSettings = new RenderingContextSettings(true)
......@@ -1706,8 +1706,8 @@ transform方法对应一个变换矩阵,想对一个图形进行变化的时
- 示例
```ts
// xxx.ets
@Entry
// xxx.ets
@Entry
@Component
struct Transform {
private settings: RenderingContextSettings = new RenderingContextSettings(true)
......@@ -1759,8 +1759,8 @@ setTransfrom方法使用的参数和transform()方法相同,但setTransform()
- 示例
```ts
// xxx.ets
@Entry
// xxx.ets
@Entry
@Component
struct SetTransform {
private settings: RenderingContextSettings = new RenderingContextSettings(true)
......@@ -1805,8 +1805,8 @@ translate(x: number, y: number): void
- 示例
```ts
// xxx.ets
@Entry
// xxx.ets
@Entry
@Component
struct Translate {
private settings: RenderingContextSettings = new RenderingContextSettings(true)
......@@ -1861,8 +1861,8 @@ drawImage(image: ImageBitmap | PixelMap, sx: number, sy: number, sWidth: number,
- 示例
```ts
// xxx.ets
@Entry
// xxx.ets
@Entry
@Component
struct Index {
private settings: RenderingContextSettings = new RenderingContextSettings(true)
......@@ -1961,8 +1961,8 @@ putImageData(imageData: Object, dx: number, dy: number, dirtyX?: number, dirtyY?
- 示例
```ts
// xxx.ets
@Entry
// xxx.ets
@Entry
@Component
struct PutImageData {
private settings: RenderingContextSettings = new RenderingContextSettings(true)
......@@ -2004,8 +2004,8 @@ restore(): void
- 示例
```ts
// xxx.ets
@Entry
// xxx.ets
@Entry
@Component
struct CanvasExample {
private settings: RenderingContextSettings = new RenderingContextSettings(true)
......@@ -2038,8 +2038,8 @@ save(): void
- 示例
```ts
// xxx.ets
@Entry
// xxx.ets
@Entry
@Component
struct CanvasExample {
private settings: RenderingContextSettings = new RenderingContextSettings(true)
......@@ -2080,8 +2080,8 @@ createLinearGradient(x0: number, y0: number, x1: number, y1: number): void
- 示例
```ts
// xxx.ets
@Entry
// xxx.ets
@Entry
@Component
struct CreateLinearGradient {
private settings: RenderingContextSettings = new RenderingContextSettings(true)
......@@ -2132,8 +2132,8 @@ createRadialGradient(x0: number, y0: number, r0: number, x1: number, y1: number,
- 示例
```ts
// xxx.ets
@Entry
// xxx.ets
@Entry
@Component
struct CreateRadialGradient {
private settings: RenderingContextSettings = new RenderingContextSettings(true)
......
......@@ -16,19 +16,12 @@
- transition入参说明
| 参数名称 | 参数类型 | 默认值 | 必填 | 参数描述 |
| -------- | -------- | -------- | -------- | -------- |
| type | TransitionType | TransitionType.All | 否 | 默认包括组件新增和删除。<br/>>&nbsp;&nbsp;**说明:**<br/>>&nbsp;不指定Type时说明插入删除使用同一种效果。 |
| type | [TransitionType](ts-appendix-enums.md#transitiontype) | TransitionType.All | 否 | 默认包括组件新增和删除。<br/>>&nbsp;&nbsp;**说明:**<br/>>&nbsp;不指定Type时说明插入删除使用同一种效果。 |
| opacity | number | 1 | 否 | 设置组件转场时的透明度效果,为插入时起点和删除时终点的值。 |
| translate | {<br/>x?&nbsp;:&nbsp;number,<br/>y?&nbsp;:&nbsp;number,<br/>z?&nbsp;:&nbsp;number<br/>} | - | 否 | 设置组件转场时的平移效果,为插入时起点和删除时终点的值。<br/>-x:横向的平移距离。<br/>-y:纵向的平移距离。<br/>-z:竖向的平移距离。 |
| scale | {<br/>x?&nbsp;:&nbsp;number,<br/>y?&nbsp;:&nbsp;number,<br/>z?&nbsp;:&nbsp;number,<br/>centerX?&nbsp;:&nbsp;number,<br/>centerY?&nbsp;:&nbsp;number<br/>} | - | 否 | 设置组件转场时的缩放效果,为插入时起点和删除时终点的值。<br/>-x:横向放大倍数(或缩小比例)。<br/>-y:纵向放大倍数(或缩小比例)。<br/>-z:竖向放大倍数(或缩小比例)。<br/>-&nbsp;centerX、centerY缩放中心点。<br/>-&nbsp;中心点为0时,默认的是组件的左上角。<br/> |
| rotate | {<br/>x?:&nbsp;number,<br/>y?:&nbsp;number,<br/>z?:&nbsp;number,<br/>angle?:&nbsp;Angle,<br/>centerX?:&nbsp;Length,<br/>centerY?:&nbsp;Length<br/>} | - | 否 | 设置组件转场时的旋转效果,为插入时起点和删除时终点的值。<br/>-x:横向的旋转向量。<br/>-y:纵向的旋转向量。<br/>-z:竖向的旋转向量。<br/>-&nbsp;centerX,centerY指旋转中心点。<br/>-&nbsp;中心点为(0,0)时,默认的是组件的左上角。 |
- TransitionType枚举说明
| 名称 | 描述 |
| -------- | -------- |
| All | 指定当前的Transition动效生效在组件的所有变化场景。 |
| Insert | 指定当前的Transition动效生效在组件的插入场景。 |
| Delete | 指定当前的Transition动效生效在组件的删除场景。 |
## 示例
......
......@@ -17,17 +17,9 @@
| 名称 | 参数类型 | 默认值 | 描述 |
| -------- | -------- | -------- | -------- |
| backgroundColor | [ResourceColor](../../ui/ts-types.md) | - | 设置组件的背景色。 |
| backgroundImage | src:&nbsp;[ResourceStr](../../ui/ts-types.md),<br/>repeat?:&nbsp;[ImageRepeat](ts-appendix-enums.md#imagerepeat枚举说明) | - | src参数:图片地址,支持网络图片资源和本地图片资源地址(不支持svg类型的图片)。<br/>repeat参数:设置背景图片的重复样式,默认不重复。 |
| backgroundImageSize | {<br/>width?:&nbsp;Length,<br/>height?:&nbsp;Length<br/>}&nbsp;\|&nbsp;ImageSize | Auto | 设置背景图像的高度和宽度。当输入为{width:&nbsp;Length,&nbsp;height:&nbsp;Length}对象时,如果只设置一个属性,则第二个属性保持图片原始宽高比进行调整。默认保持原图的比例不变。 |
| backgroundImagePosition | {<br/>x?:&nbsp;Length,<br/>y?:&nbsp;Length<br/>}&nbsp;\|&nbsp;[Alignment](ts-appendix-enums.md#alignment枚举说明) | {<br/>x:&nbsp;0,<br/>y:&nbsp;0<br/>} | 设置背景图在组件中显示位置。 |
- ImageSize枚举说明
| 类型 | 描述 |
| -------- | -------- |
| Cover | 默认值,保持宽高比进行缩小或者放大,使得图片两边都大于或等于显示边界。 |
| Contain | 保持宽高比进行缩小或者放大,使得图片完全显示在显示边界内。 |
| Auto | 保持原图的比例不变。 |
| backgroundImage | src:&nbsp;[ResourceStr](../../ui/ts-types.md),<br/>repeat?:&nbsp;[ImageRepeat](ts-appendix-enums.md#imagerepeat) | - | src参数:图片地址,支持网络图片资源和本地图片资源地址(不支持svg类型的图片)。<br/>repeat参数:设置背景图片的重复样式,默认不重复。 |
| backgroundImageSize | {<br/>width?:&nbsp;Length,<br/>height?:&nbsp;Length<br/>}&nbsp;\|&nbsp;[ImageSize](ts-appendix-enums.md#imagesize) | Auto | 设置背景图像的高度和宽度。当输入为{width:&nbsp;Length,&nbsp;height:&nbsp;Length}对象时,如果只设置一个属性,则第二个属性保持图片原始宽高比进行调整。默认保持原图的比例不变。 |
| backgroundImagePosition | {<br/>x?:&nbsp;Length,<br/>y?:&nbsp;Length<br/>}&nbsp;\|&nbsp;[Alignment](ts-appendix-enums.md#alignment) | {<br/>x:&nbsp;0,<br/>y:&nbsp;0<br/>} | 设置背景图在组件中显示位置。 |
## 示例
......
......@@ -20,7 +20,7 @@
| 名称 | 参数类型 | 默认值 | 描述 |
| ------------ | ------------- | ----------------------- | ------------------------ |
| border | BorderOptions | - | 统一边框样式设置接口。 |
| borderStyle | BorderStyle | &nbsp;BorderStyle.Solid | 设置元素的边框样式。 |
| borderStyle | [BorderStyle](ts-appendix-enums.md#borderstyle) | &nbsp;BorderStyle.Solid | 设置元素的边框样式。 |
| borderWidth | Length | 0 | 设置元素的边框宽度。 |
| borderColor | [ResourceColor](../../ui/ts-types.md) | - | 设置元素的边框颜色。 |
| borderRadius | Length \| BorderRadiuses<sup>9+</sup> | 0 | 设置元素的边框圆角半径。 |
......@@ -32,7 +32,7 @@
| width | [Length](../../ui/ts-types.md#长度类型) \| EdgeWidth<sup>9+</sup> | 0 | 否 | 边框宽度。 |
| color | [ResourceColor](../../ui/ts-types.md) \| EdgeColor<sup>9+</sup> | 'Black' | 否 | 边框颜色。 |
| radius | [Length](../../ui/ts-types.md#长度类型) \| BorderRadiuses<sup>9+</sup> | 0 | 否 | 边框角度。 |
| style | BorderStyle \| EdgeStyle<sup>9+</sup> | BorderStyle.Solid | 否 | 边框样式。 |
| style | [BorderStyle](ts-appendix-enums.md#borderstyle) \| EdgeStyle<sup>9+</sup> | BorderStyle.Solid | 否 | 边框样式。 |
- EdgeWidth<sup>9+</sup>对象说明
......@@ -74,19 +74,10 @@
| 名称 | 参数类型 | 必填 | 默认值 | 描述 |
| ------ | ----------- | ---- | ----------------- | -------------- |
| left | BorderStyle | 否 | BorderStyle.Solid | 左侧边框样式。 |
| right | BorderStyle | 否 | BorderStyle.Solid | 右侧边框样式。 |
| top | BorderStyle | 否 | BorderStyle.Solid | 上侧边框样式。 |
| bottom | BorderStyle | 否 | BorderStyle.Solid | 下侧边框样式。 |
- BorderStyle枚举说明
| 名称 | 描述 |
| ------ | ----------------------------------------------- |
| Dotted | 显示为一系列圆点,圆点半径为borderWidth的一半。 |
| Dashed | 显示为一系列短的方形虚线。 |
| Solid | 显示为一条实线。 |
| left | [BorderStyle](ts-appendix-enums.md#borderstyle) | 否 | BorderStyle.Solid | 左侧边框样式。 |
| right | [BorderStyle](ts-appendix-enums.md#borderstyle) | 否 | BorderStyle.Solid | 右侧边框样式。 |
| top | [BorderStyle](ts-appendix-enums.md#borderstyle) | 否 | BorderStyle.Solid | 上侧边框样式。 |
| bottom | [BorderStyle](ts-appendix-enums.md#borderstyle) | 否 | BorderStyle.Solid | 下侧边框样式。 |
## 示例
......
......@@ -17,27 +17,11 @@
| 名称 | 参数类型 | 默认值 | 描述 |
| -------- | -------- | -------- | -------- |
| linearGradient | {<br/>angle?:&nbsp;[Angle](../../ui/ts-types.md),<br/>direction?:&nbsp;GradientDirection,<br/>colors:&nbsp;Array&lt;[ColorStop](../../ui/ts-types.md)&gt;<br/>repeating?:&nbsp;boolean<br/>} | - | 线性渐变。<br/>angle:&nbsp;线性渐变的角度。<br/>direction:&nbsp;线性渐变的方向,设置angle后不生效。<br/>colors:&nbsp;为渐变的颜色描述。<br/>repeating:&nbsp;为渐变的颜色重复着色。 |
| linearGradient | {<br/>angle?:&nbsp;[Angle](../../ui/ts-types.md),<br/>direction?:&nbsp;[GradientDirection](ts-appendix-enums.md#gradientdirection),<br/>colors:&nbsp;Array&lt;[ColorStop](../../ui/ts-types.md)&gt;<br/>repeating?:&nbsp;boolean<br/>} | - | 线性渐变。<br/>angle:&nbsp;线性渐变的角度。<br/>direction:&nbsp;线性渐变的方向,设置angle后不生效。<br/>colors:&nbsp;为渐变的颜色描述。<br/>repeating:&nbsp;为渐变的颜色重复着色。 |
| sweepGradient | {<br/>center:&nbsp;Point,<br/>start?:&nbsp;angle,<br/>end?:&nbsp;angle,<br/>colors:&nbsp;Array&lt;[ColorStop](../../ui/ts-types.md)&gt;<br/>repeating?:&nbsp;boolean<br/>} | - | 角度渐变。<br/>center:为角度渐变的中心点。<br/>start:角度渐变的起点。<br/>end:角度渐变的终点。<br/>colors:&nbsp;为渐变的颜色描述。<br/>repeating:&nbsp;为渐变的颜色重复着色。 |
| radialGradient | {<br/>center:&nbsp;Point,<br/>radius:&nbsp;Length,<br/>colors:&nbsp;Array&lt;[ColorStop](../../ui/ts-types.md)&gt;<br/>repeating:&nbsp;boolean<br/>} | - | 径向渐变。<br/>center:径向渐变的中心点。<br/>radius:径向渐变的半径。<br/>colors:&nbsp;为渐变的颜色描述。<br/>repeating:&nbsp;为渐变的颜色重复着色。 |
- GradientDirection枚举说明<br>
GradientDirection用于描述渐变方向。
| 名称 | 描述 |
| -------- | -------- |
| Left | 从右向左。 |
| Top | 从下向上。 |
| Right | 从左向右。 |
| Bottom | 从上向下。 |
| LeftTop | 左上。 |
| LeftBottom | 左下。 |
| RightTop | 右上。 |
| RightBottom | 右下。 |
| None | 无。 |
## 示例
```ts
......
......@@ -15,15 +15,7 @@
| 名称 | 参数类型 | 默认值 | 描述 |
| -------- | -------- | -------- | -------- |
| hoverEffect | HoverEffect | HoverEffect.Auto | 设置当前组件悬停态下的悬浮效果。 |
- HoverEffect 枚举说明
| 名称 | 描述 |
| -------- | -------- |
| Auto | 使用组件的系统默认悬浮效果。 |
| Scale | 放大缩小效果。 |
| Highlight | 背景淡入淡出的强调效果。 |
| None | 不设置效果。 |
| hoverEffect | [HoverEffect](ts-appendix-enums.md#hovereffect8) | HoverEffect.Auto | 设置当前组件悬停态下的悬浮效果。 |
## 示例
......
......@@ -16,21 +16,13 @@
| 名称 | 参数类型 | 默认值 | 描述 |
| -------- | -------- | -------- | -------- |
| align | [Alignment](ts-appendix-enums.md#alignment枚举说明) | Center | 设置元素内容的对齐方式,只有当设置的width和height大小超过元素本身内容大小时生效。 |
| direction | Direction | Auto | 设置元素水平方向的布局,可选值参照Direction枚举说明。 |
| align | [Alignment](ts-appendix-enums.md#alignment) | Center | 设置元素内容的对齐方式,只有当设置的width和height大小超过元素本身内容大小时生效。 |
| direction | [Direction](ts-appendix-enums.md#direction) | Auto | 设置元素水平方向的布局,可选值参照Direction枚举说明。 |
| position | {<br/>x:&nbsp;Length,<br/>y:&nbsp;Length<br/>} | - | 使用绝对定位,设置元素锚点相对于父容器顶部起点偏移位置。在布局容器中,设置该属性不影响父容器布局,仅在绘制时进行位置调整。 |
| markAnchor | {<br/>x:&nbsp;Length,<br/>y:&nbsp;Length<br/>} | {<br/>x:&nbsp;0,<br/>y:&nbsp;0<br/>} | 设置元素在位置定位时的锚点,以元素顶部起点作为基准点进行偏移。 |
| offset | {<br/>x:&nbsp;Length,<br/>y:&nbsp;Length<br/>} | {<br/>x:&nbsp;0,<br/>y:&nbsp;0<br/>} | 相对布局完成位置坐标偏移量,设置该属性,不影响父容器布局,仅在绘制时进行位置调整。 |
- Direction枚举说明
| 名称 | 描述 |
| -------- | -------- |
| Ltr | 元素从左到右布局。 |
| Rtl | 元素从右到左布局。 |
| Auto | 使用系统默认布局方向。 |
## 示例
```ts
......
......@@ -17,7 +17,7 @@
| 名称 | 参数类型 | 默认值 | 描述 |
| ---------------------------- | ---------------------------------------- | ---- | ---------------------------------- |
| bindMenu | Array<MenuItem&gt;&nbsp;\|&nbsp;[CustomBuilder](../../ui/ts-types.md)<sup>8+</sup> | - | 给组件绑定菜单,点击后弹出菜单。弹出菜单项支持文本和自定义两种功能。 |
| bindContextMenu<sup>8+</sup> | content:&nbsp;[CustomBuilder](../../ui/ts-types.md),<br>responseType:&nbsp;ResponseType | - | 给组件绑定菜单,触发方式为长按或者右键点击,弹出菜单项需要自定义。右键点击当前仅支持真机运行。 |
| bindContextMenu<sup>8+</sup> | content:&nbsp;[CustomBuilder](../../ui/ts-types.md),<br>responseType:&nbsp;[ResponseType](ts-appendix-enums.md#responsetype8) | - | 给组件绑定菜单,触发方式为长按或者右键点击,弹出菜单项需要自定义。 |
- MenuItem
......@@ -26,11 +26,6 @@
| value | string | 菜单项文本。 |
| action | ()&nbsp;=&gt;&nbsp;void | 点击菜单项的事件回调。 |
- ResponseType<sup>8+</sup>
| 参数值 | 描述 |
| ---------- | ------------- |
| LongPress | 通过长按触发菜单弹出。 |
| RightClick | 通过鼠标右键触发菜单弹出。 |
## 示例
......
......@@ -33,7 +33,7 @@
| 名称 | 类型 | 必填 | 默认值 | 描述 |
| -------- | -------- | -------- | -------- | -------- |
| builder | ()&nbsp;=&gt;&nbsp;any | 是 | - | 提示气泡内容的构造器。 |
| placement | Placement | 否 | Placement.Bottom | 气泡组件优先显示的位置,当前位置显示不下时,会自动调整位置。 |
| placement | [Placement](ts-appendix-enums.md#placement8) | 否 | Placement.Bottom | 气泡组件优先显示的位置,当前位置显示不下时,会自动调整位置。 |
| arrowOffset<sup>9+</sup> | Length | 否 | - | popup箭头在弹窗处的偏移。箭头在气泡上下方时,默认居左;箭头在气泡左右侧,默认居上。 |
| maskColor | [ResourceColor](../../ui/ts-types.md) | 否 | - | 提示气泡遮障层的颜色。 |
| popupColor | [ResourceColor](../../ui/ts-types.md) | 否 | - | 提示气泡的颜色。 |
......@@ -41,22 +41,6 @@
| autoCancel | boolean | 否 | true | 页面有操作时,是否自动关闭气泡 |
| onStateChange | (isVisible:&nbsp;boolean)&nbsp;=&gt;&nbsp;void | 否 | - | 弹窗状态变化事件回调,参数为弹窗当前的显示状态。 |
- Placement<sup>8+</sup>枚举说明
| 名称 | 描述 |
| -------- | -------- |
| Left | 气泡提示位于组件左侧,与组件左侧中心对齐。 |
| Right | 气泡提示位于组件右侧,与组件右侧中心对齐。 |
| Top | 气泡提示位于组件上侧,与组件上侧中心对齐。 |
| Bottom | 气泡提示位于组件下侧,与组件下侧中心对齐。 |
| TopLeft | 气泡提示位于组件上侧,从API Version 9开始,与组件左侧边缘对齐。 |
| TopRight | 气泡提示位于组件上侧,从API Version 9开始,与组件右侧边缘对齐。 |
| BottomLeft | 气泡提示位于组件下侧,从API Version 9开始,与组件左侧边缘对齐。 |
| BottomRight | 气泡提示位于组件下侧,从API Version 9开始,与组件右侧边缘对齐。 |
| LeftTop<sup>9+</sup> | 气泡提示位于组件左侧,与组件上侧边缘对齐。 |
| LeftBottom<sup>9+</sup> | 气泡提示位于组件左侧,与组件下侧边缘对齐。 |
| RightTop<sup>9+</sup> | 气泡提示位于组件右侧,与组件上侧边缘对齐。 |
| RightBottom<sup>9+</sup> | 气泡提示位于组件右侧,与组件下侧边缘对齐。 |
## 示例
......
......@@ -20,29 +20,11 @@
| -------- | -------- | -------- | -------- |
| fontColor | [ResourceColor](../../ui/ts-types.md) | - | 设置文本颜色。 |
| fontSize | Length&nbsp;\|&nbsp;[Resource](../../ui/ts-types.md#resource类型) | - | 设置文本尺寸,Length为number类型时,使用fp单位。 |
| fontStyle | FontStyle | FontStyle.Normal | 设置文本的字体样式。 |
| fontWeight | number&nbsp;\|&nbsp;FontWeight&nbsp;\|&nbsp;string | FontWeight.FontWeightNormal | 设置文本的字体粗细,number类型取值[100,&nbsp;900],取值间隔为100,默认为400,取值越大,字体越粗。<br/>提供常用枚举值,参考:FontWeight枚举说明。 |
| fontStyle | [FontStyle](ts-appendix-enums.md#fontstyle) | FontStyle.Normal | 设置文本的字体样式。 |
| fontWeight | number&nbsp;\|&nbsp;[FontWeight](ts-appendix-enums.md#fontweight)&nbsp;\|&nbsp;string | FontWeight.FontWeightNormal | 设置文本的字体粗细,number类型取值[100,&nbsp;900],取值间隔为100,默认为400,取值越大,字体越粗。<br/>提供常用枚举值,参考:FontWeight枚举说明。 |
| fontFamily | string&nbsp;\|&nbsp;[Resource](../../ui/ts-types.md#resource类型) | - | 设置文本的字体列表。使用多个字体,使用','进行分割,优先级按顺序生效。例如:'Arial,&nbsp;sans-serif'。 |
- FontStyle枚举说明
| 名称 | 描述 |
| -------- | -------- |
| Normal | 标准的字体样式。 |
| Italic | 斜体的字体样式。 |
- FontWeight枚举说明
| 名称 | 描述 |
| -------- | -------- |
| Lighter | 字体较细。 |
| Normal | 字体粗细正常。 |
| Regular | 字体粗细正常。 |
| Medium | 字体粗细适中。 |
| Bold | 字体较粗。 |
| Bolder | 字体非常粗。 |
## 示例
```ts
......
......@@ -16,15 +16,7 @@
| 名称 | 参数类型 | 默认值 | 描述 |
| -------- | -------- | -------- | -------- |
| visibility | Visibility | Visibility.Visible | 控制当前组件显示或隐藏。注意,即使组件处于隐藏状态,在页面刷新时仍存在重新创建过程,因此当对性能有严格要求时建议使用[条件渲染](../../ui/ts-rending-control-syntax-if-else.md)代替。|
- Visibility枚举说明
| 名称 | 描述 |
| -------- | -------- |
| Hidden | 隐藏,但参与布局进行占位。 |
| Visible | 显示。 |
| None | 隐藏,但不参与布局,不进行占位。 |
| visibility | [Visibility](ts-appendix-enums.md#visibility) | Visibility.Visible | 控制当前组件显示或隐藏。注意,即使组件处于隐藏状态,在页面刷新时仍存在重新创建过程,因此当对性能有严格要求时建议使用[条件渲染](../../ui/ts-rending-control-syntax-if-else.md)代替。|
## 示例
......
......@@ -23,10 +23,10 @@
- 属性
| 属性名称 | 类型 | 描述 |
| ------------------------------------- | --------------------------- | -------------------------- |
| type | [KeyType](#keytype枚举说明) | 按键的类型。 |
| type | [KeyType](ts-appendix-enums.md#keytype) | 按键的类型。 |
| [keyCode](../apis/js-apis-keycode.md) | number | 按键的键码。 |
| keyText | string | 按键的键值。 |
| keySource | [KeySource](#keysource枚举说明) | 触发当前按键的输入设备类型。 |
| keySource | [KeySource](ts-appendix-enums.md#keysource) | 触发当前按键的输入设备类型。 |
| deviceId | number | 触发当前按键的输入设备ID。 |
| metaKey | number | 按键发生时元键的状态,1表示按压态,0表示未按压态。 |
| timestamp | number | 按键发生时的时间戳。 |
......@@ -37,21 +37,6 @@
| ---------------------------- | --------- |
| stopPropagation():&nbsp;void | 阻塞事件冒泡传递。 |
## KeyType枚举说明
| 名称 | 描述 |
| ---- | ----- |
| Down | 按键按下。 |
| Up | 按键松开。 |
## KeySource枚举说明
| 名称 | 描述 |
| -------- | ---------- |
| Unknown | 输入设备类型未知。 |
| Keyboard | 输入设备类型为键盘。 |
## 示例
......
......@@ -21,13 +21,13 @@
## TouchEvent对象说明
- 属性
| 属性名称 | 类型 | 描述 |
| ------------------- | ------------------------------------------------------------ | ---------------------------------- |
| type | TouchType | 触摸事件的类型。 |
| touches | Array&lt;[TouchObject](#touchobject对象说明)&gt; | 全部手指信息。 |
| changedTouches | Array&lt;[TouchObject](#touchobject对象说明)&gt; | 当前发生变化的手指信息。 |
| timestamp | number | 距离开机时间的时间戳,单位为毫秒。 |
| target<sup>8+</sup> | [EventTarget](ts-universal-events-click.md#eventtarget8对象说明) | 被触摸元素对象。 |
| 属性名称 | 类型 | 描述 |
| ------------------- | ---------------------------------------- | ------------ |
| type | [TouchType](ts-appendix-enums.md#touchtype) | 触摸事件的类型。 |
| touches | Array&lt;[TouchObject](#touchobject对象说明)&gt; | 全部手指信息。 |
| changedTouches | Array&lt;[TouchObject](#touchobject对象说明)&gt; | 当前发生变化的手指信息。 |
| timestamp | number | 距离开机时间的时间戳,单位为毫秒。 |
| target<sup>8+</sup> | [EventTarget](ts-universal-events-click.md#eventtarget8对象说明) | 被触摸元素对象。 |
- 接口
......@@ -39,23 +39,13 @@
## TouchObject对象说明
| 属性名称 | 类型 | 描述 |
| ------- | --------------------------- | ------------------- |
| type | [TouchType](#touchtype枚举说明) | 触摸事件的类型。 |
| type | [TouchType](ts-appendix-enums.md#touchtype) | 触摸事件的类型。 |
| id | number | 手指唯一标识符。 |
| screenX | number | 触摸点相对于设备屏幕左边沿的X坐标。 |
| screenY | number | 触摸点相对于设备屏幕上边沿的Y坐标。 |
| x | number | 触摸点相对于被触摸元素左边沿的X坐标。 |
| y | number | 触摸点相对于被触摸元素上边沿的Y坐标。 |
## TouchType枚举说明
| 名称 | 描述 |
| ------ | ---------------------------------- |
| Down | 手指按下时触发。 |
| Up | 手指抬起时触发。 |
| Move | 手指按压态在屏幕上移动时触发。 |
| Cancel | 触摸交互过程中应用退到后台时触发。 |
## 示例
```ts
......
......@@ -27,27 +27,8 @@
| screenY | number | 点击触点相对于屏幕左上角的y轴坐标。 |
| x | number | 点击触点相对于当前组件左上角的x轴坐标。 |
| y | number | 点击触点相对于当前组件左上角的y轴坐标。 |
| button | [MouseButton](#mousebutton类型说明) | 鼠标按键。 |
| action | [MouseAction](#mouseaction类型说明) | 事件动作。 |
## MouseButton类型说明
| 属性名称 | 属性类型 | 描述 |
| ------- | ------ | -------- |
| Left | number | 鼠标左键。 |
| Right | number | 鼠标右键。 |
| Middle | number | 鼠标中键。 |
| Back | number | 鼠标左侧后退键。 |
| Forward | number | 鼠标左侧前进键。 |
| None | number | 无按键。 |
## MouseAction类型说明
| 属性名称 | 属性类型 | 描述 |
| ------- | ------ | ------- |
| Press | number | 鼠标按键按下。 |
| Release | number | 鼠标按键松开。 |
| Move | number | 鼠标移动。 |
| button | [MouseButton](ts-appendix-enums.md#mousebutton) | 鼠标按键。 |
| action | [MouseAction](ts-appendix-enums.md#mouseaction) | 事件动作。 |
## 示例
......
......@@ -20,7 +20,6 @@
| ohos.permission.REMOVE_CACHE_FILES | system_basic | system_grant | TRUE | 允许清理指定应用的缓存。 |
| ohos.permission.REBOOT | system_basic | system_grant | TRUE | 允许应用重启设备。 |
| ohos.permission.RUNNING_LOCK | normal | system_grant | TRUE | 允许应用获取运行锁,保证应用在后台的持续运行。 |
| ohos.permission.ACCESS_BIOMETRIC | normal | system_grant | FALSE | 允许应用使用生物特征识别能力进行身份认证。 |
| ohos.permission.SET_TIME | system_basic | system_grant | TRUE | 允许应用修改系统时间。 |
| ohos.permission.SET_TIME_ZONE | system_basic | system_grant | TRUE | 允许应用修改系统时区。 |
| ohos.permission.<br>DOWNLOAD_SESSION_MANAGER | system_core | system_grant | TRUE | 允许应用管理下载任务会话。 |
......
......@@ -483,4 +483,4 @@ export default class BgTaskAbility extends Ability {
基于后台任务管理,有以下相关实例可供参考:
- [`BackgroundTaskManager`:后台任务管理(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/ResourcesSchedule/BackgroundTaskManager)
\ No newline at end of file
- [`BackgroundTaskManager`:后台任务管理(eTS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/ResourcesSchedule/BackgroundTaskManager)
\ No newline at end of file
......@@ -50,6 +50,7 @@ storageRequest|存储状态| StorageRequest
isRepeat|是否循环任务| boolean
repeatCycleTime |循环间隔| number
repeatCount |循环次数| number
parameters |携带参数信息| {[key: string]: any}
**表3** 延迟任务回调接口
......@@ -80,12 +81,17 @@ onWorkStop(work: WorkInfo): void; | 延迟调度任务结束回调
let workInfo = {
workId: 1,
batteryLevel:50,
batteryStatus:workScheduler.BatteryStatus.BATTERY_STATUS_LOW,
isRepeat: false,
isPersisted: true,
bundleName: "com.example.myapplication",
abilityName: "MyExtension"
abilityName: "MyExtension",
parameters: {
mykey0: 1,
mykey1: "string value",
mykey2: true,
mykey3: 1.5
}
}
var res = workScheduler.startWork(workInfo);
console.info("workschedulerLog res:" + res);
......@@ -98,12 +104,17 @@ onWorkStop(work: WorkInfo): void; | 延迟调度任务结束回调
let workInfo = {
workId: 1,
batteryLevel:50,
batteryStatus:workScheduler.BatteryStatus.BATTERY_STATUS_LOW,
isRepeat: false,
isPersisted: true,
bundleName: "com.example.myapplication",
abilityName: "MyExtension"
abilityName: "MyExtension",
parameters: {
mykey0: 1,
mykey1: "string value",
mykey2: true,
mykey3: 1.5
}
}
var res = workScheduler.stopWork(workInfo, false);
console.info("workschedulerLog res:" + res);
......
......@@ -28,4 +28,6 @@
(2)至少要设置一个满足的条件。
(3)重复任务时间间隔至少20分钟,当设置重复任务时间间隔时,必须设置始终重复和重复次数中的一个。
\ No newline at end of file
(3)重复任务时间间隔至少20分钟,当设置重复任务时间间隔时,必须设置始终重复和重复次数中的一个。
(4)携带参数信息支持number、string、bool三种类型。
\ No newline at end of file
......@@ -151,4 +151,4 @@ plural.json文件的内容如下:
针对访问应用资源,有以下相关实例可供参考:
- [`ResourceManager`:资源管理器(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/common/ResourceManager)
- [`ResourceManager`:资源管理器(eTS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/common/ResourceManager)
......@@ -27,24 +27,7 @@
| 名称 | 类型定义 | 描述 |
| ----- | ---------------------------------------- | ---------------------------------------- |
| Color | string&nbsp;\|&nbsp;number&nbsp;\|&nbsp;Color | 用于描述颜色信息,输入为string类型时,使用rgb或者rgba进行描述;输入为number类型是,使用HEX格式颜色;输入类型为Color枚举时,使用颜色枚举值。<br/>-&nbsp;'rgb(255,&nbsp;255,&nbsp;255)'。<br/>-&nbsp;'rgba(255,&nbsp;255,&nbsp;255,&nbsp;1.0)'。<br/>-&nbsp;HEX格式:0xrrggbb,0xaarrggbb,'\#FFFFFF'。<br/>-&nbsp;枚举格式:Color.Black,Color.White等。 |
当前支持的Color颜色枚举:
| 颜色名称 | 颜色值 | 颜色示意 |
| ------ | -------- | ---------------------------------------- |
| Black | 0x000000 | ![zh-cn_image_0000001219864153](figures/zh-cn_image_0000001219864153.png) |
| Blue | 0x0000ff | ![zh-cn_image_0000001174104404](figures/zh-cn_image_0000001174104404.png) |
| Brown | 0xa52a2a | ![zh-cn_image_0000001219744201](figures/zh-cn_image_0000001219744201.png) |
| Gray | 0x808080 | ![zh-cn_image_0000001174264376](figures/zh-cn_image_0000001174264376.png) |
| Green | 0x008000 | ![zh-cn_image_0000001174422914](figures/zh-cn_image_0000001174422914.png) |
| Orange | 0xffa500 | ![zh-cn_image_0000001219662661](figures/zh-cn_image_0000001219662661.png) |
| Pink | 0xffc0cb | ![zh-cn_image_0000001219662663](figures/zh-cn_image_0000001219662663.png) |
| Red | 0xff0000 | ![zh-cn_image_0000001219662665](figures/zh-cn_image_0000001219662665.png) |
| White | 0xffffff | ![zh-cn_image_0000001174582866](figures/zh-cn_image_0000001174582866.png) |
| Yellow | 0xffff00 | ![zh-cn_image_0000001174582864](figures/zh-cn_image_0000001174582864.png) |
| Color | string&nbsp;\|&nbsp;number&nbsp;\|&nbsp;[Color](../reference/arkui-ts/ts-appendix-enums.md#color) | 用于描述颜色信息,输入为string类型时,使用rgb或者rgba进行描述;输入为number类型是,使用HEX格式颜色;输入类型为Color枚举时,使用颜色枚举值。<br/>-&nbsp;'rgb(255,&nbsp;255,&nbsp;255)'。<br/>-&nbsp;'rgba(255,&nbsp;255,&nbsp;255,&nbsp;1.0)'。<br/>-&nbsp;HEX格式:0xrrggbb,0xaarrggbb,'\#FFFFFF'。<br/>-&nbsp;枚举格式:Color.Black,Color.White等。 |
## ColorStop类型
......
......@@ -90,4 +90,4 @@
针对background-position样式动画开发,有以下相关实例可供参考:
- [`JsImage`:基本动画(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/JsImage)
\ No newline at end of file
- [`JsImage`:基本动画(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/JsImage)
\ No newline at end of file
......@@ -580,13 +580,13 @@ transform可以设置多个值并且多个值可同时设置,下面案例中
针对transform样式动画开发,有以下相关实例可供参考:
- [`JsAnimation`:动效示例应用(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/JsAnimation)
- [`JsAnimation`:动效示例应用(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/JsAnimation)
- [`JsAnimationStyle`:动画与自定义字体(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/JsAnimationStyle)
- [`JsAnimationStyle`:动画与自定义字体(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/JsAnimationStyle)
- [`Clock`:时钟(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/common/Clock)
- [`Clock`:时钟(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/common/Clock)
- [`JsAnimator`:动画(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/JsAnimation)
- [`JsAnimator`:动画(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/JsAnimation)
- [动画样式(JS)(API8)](https://gitee.com/openharmony/codelabs/tree/master/JSUI/AnimationDemo)
......
......@@ -25,19 +25,19 @@
针对组件开发,有以下相关实例可供参考:
- [`JsPanel`:内容展示面板(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/JsPanel)
- [`JsPanel`:内容展示面板(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/JsPanel)
- [`Popup`:气泡(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/Popup)
- [`Popup`:气泡(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/Popup)
- [`RefreshContainer`:下拉刷新容器(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/RefreshContainer)
- [`RefreshContainer`:下拉刷新容器(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/RefreshContainer)
- [`JSComponments`:Js组件(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/JSComponments)
- [`JSComponments`:Js组件(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/JSComponments)
- [`JsUserRegistration`:用户注册(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/JsUserRegistration)
- [`JsUserRegistration`:用户注册(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/JsUserRegistration)
- [`Badge`:事件标记控件(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/Badge)
- [`JsVideo`:视频播放(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/media/JsVideo)
- [`JsVideo`:视频播放(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/media/JsVideo)
- [rating(JS)(API8)](https://gitee.com/openharmony/codelabs/tree/master/JSUI/RatingApplication)
......
......@@ -89,4 +89,4 @@ export default {
针对页面路由开发,有以下相关实例可供参考:
- [`JsRouter`:页面路由(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/JsRouter)
- [`JsRouter`:页面路由(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/JsRouter)
......@@ -314,4 +314,4 @@ export default {
针对tabs开发,有以下相关实例可供参考:
- [`Tabs`:页签容器(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/Tabs)
\ No newline at end of file
- [`Tabs`:页签容器(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/Tabs)
\ No newline at end of file
......@@ -144,4 +144,4 @@ export default {
针对Canvas开发,有以下相关实例可供参考:
- [`JsCanvas`:画布组件(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/JsCanvas)
- [`JsCanvas`:画布组件(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/JsCanvas)
......@@ -624,6 +624,6 @@ export default {
针对chart开发,有以下相关实例可供参考:
- [`chart`:图表组件(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/chart)
- [`chart`:图表组件(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/chart)
- [chart(JS)(API8)](https://gitee.com/openharmony/codelabs/tree/master/JSUI/SwitchApplication)
......@@ -325,6 +325,6 @@ export default {
针对dialog开发,有以下相关实例可供参考:
- [`JsDialog`:页面弹窗(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/JsDialog)
- [`JsDialog`:页面弹窗(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/JsDialog)
- [Dialog(JS)(API8)](https://gitee.com/openharmony/codelabs/tree/master/JSUI/DialogDemo)
......@@ -248,4 +248,4 @@ export default {
针对Grid开发,有以下相关实例可供参考:
- [`JsGrid`:栅格组件(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/JsGrid)
- [`JsGrid`:栅格组件(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/JsGrid)
......@@ -314,4 +314,4 @@ export default {
针对list开发,有以下相关实例可供参考:
- [`JsList`:商品列表(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/JsList)
\ No newline at end of file
- [`JsList`:商品列表(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/JsList)
\ No newline at end of file
......@@ -283,4 +283,4 @@ export default {
针对menu开发,有以下相关实例可供参考:
- [`JSMenu`:菜单(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/JSMenu)
- [`JSMenu`:菜单(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/JSMenu)
......@@ -301,4 +301,4 @@ export default {
针对picker开发,有以下相关实例可供参考:
- [`Picker`:滑动选择器(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/Picker)
- [`Picker`:滑动选择器(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/Picker)
......@@ -217,6 +217,6 @@ export default{
针对slider开发,有以下相关实例可供参考:
- [`Slider`:滑动条(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/Slider)
- [`Slider`:滑动条(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/Slider)
- [slider(JS)(API8)](https://gitee.com/openharmony/codelabs/tree/master/JSUI/SliderApplication)
\ No newline at end of file
......@@ -408,4 +408,4 @@ export default {
针对stepper开发,有以下相关实例可供参考:
- [`StepNavigator`:步骤导航器(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/StepNavigator)
- [`StepNavigator`:步骤导航器(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/StepNavigator)
......@@ -87,4 +87,4 @@ svg{
针对Svg开发,有以下相关实例可供参考:
- [`JsSvg`:可缩放矢量图形(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/JsSvg)
- [`JsSvg`:可缩放矢量图形(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/JsSvg)
......@@ -370,4 +370,4 @@ export default {
针对swiper开发,有以下相关实例可供参考:
- [`Swiper`:内容滑动容器(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/Swiper)
- [`Swiper`:内容滑动容器(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/Swiper)
......@@ -276,4 +276,4 @@ export default {
针对text开发,有以下相关实例可供参考:
- [`JstextComponents`:基础组件(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/JsBasicComponents)
- [`JstextComponents`:基础组件(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/JsBasicComponents)
......@@ -235,4 +235,4 @@ export default {
针对toolbar开发,有以下相关实例可供参考:
- [`Toolbar`:工具栏(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/Toolbar)
- [`Toolbar`:工具栏(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/Toolbar)
......@@ -103,6 +103,6 @@
针对自定义组件开发,有以下相关实例可供参考:
- [`JSUICustomComponent`:自定义组件(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/JSUICustomComponent)
- [`JSUICustomComponent`:自定义组件(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/JSUICustomComponent)
- [自定义组件(JS)(API8)](https://gitee.com/openharmony/codelabs/tree/master/JSUI/JSCanvasComponet)
......@@ -34,20 +34,20 @@
基于JS扩展的类Web开发范式的方舟开发框架,有以下相关实例可供参考:
- [`AtomicLayout`:原子布局(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/AtomicLayout)
- [`AtomicLayout`:原子布局(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/AtomicLayout)
- [`JsFA`:FA示例应用(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/JsFA)
- [`JsFA`:FA示例应用(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/JsFA)
- [`JsShopping`:购物示例应用(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/JsShopping)
- [`JsShopping`:购物示例应用(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/JsShopping)
- [`Stack`:堆叠容器(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/Stack)
- [`JsAdaptivePortalList`:多设备自适应的效率型首页(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/JsAdaptivePortalList)
- [`JsAdaptivePortalList`:多设备自适应的效率型首页(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/JsAdaptivePortalList)
- [`JsAdaptivePortalPage`:多设备自适应的FA页面(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/JsAdaptivePortalPage)
- [`JsAdaptivePortalPage`:多设备自适应的FA页面(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/JsAdaptivePortalPage)
- [`JsGallery`:图库示例应用(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/JsGallery)
- [`JsGallery`:图库示例应用(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/JsGallery)
- [`Badge`:事件标记控件(JS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/UI/Badge)
- [`Badge`:事件标记控件(JS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/UI/Badge)
- [购物应用(JS)(API8)](https://gitee.com/openharmony/codelabs/tree/master/JSUI/ShoppingOpenHarmony)
......@@ -76,3 +76,7 @@
已完成好健康饮食应用的数据资源准备,接下来将通过加载这些数据来创建食物列表页面。
## 相关实例
针对构建食物分类列表页面和食物详情页,有以下相关实例可供参考:
- [DefiningPageLayoutAndConnection:页面布局和连接(eTS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/ETSUI/DefiningPageLayoutAndConnection)
......@@ -198,6 +198,6 @@ struct WebComponent {
针对Web开发,有以下相关实例可供参考:
- [`Web`:Web(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/ETSUI/Web)
- [`Web`:Web(eTS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/ETSUI/Web)
- [Web组件加载本地H5小程序(eTS)(API9)](https://gitee.com/openharmony/codelabs/tree/master/ETSUI/WebComponent)
\ No newline at end of file
......@@ -528,6 +528,6 @@
针对创建简单视图,有以下示例工程可供参考:
- [`BuildCommonView`:创建简单视图(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/ETSUI/BuildCommonView)
- [`BuildCommonView`:创建简单视图(eTS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/ETSUI/BuildCommonView)
本示例为构建了简单页面展示食物番茄的图片和营养信息,主要为了展示简单页面的Stack布局和Flex布局。
......@@ -154,5 +154,5 @@ listener.on('change', onPortrait)
针对媒体查询开发,有以下相关实例可供参考:
- [`MediaQuery`:媒体查询(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/ETSUI/MediaQuery)
- [`MediaQuery`:媒体查询(eTS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/ETSUI/MediaQuery)
......@@ -61,43 +61,41 @@
基于TS扩展的声明式开发范式的方舟开发框架,有以下相关实例可供参考:
- [`Canvas`:画布组件(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/ETSUI/Canvas)
- [`Canvas`:画布组件(eTS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/ETSUI/Canvas)
- [`Drag`:拖拽事件(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/ETSUI/Drag)
- [`Drag`:拖拽事件(eTS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/ETSUI/Drag)
- [`ArkUIAnimation`:动画(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/ETSUI/ArkUIAnimation)
- [`ArkUIAnimation`:动画(eTS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/ETSUI/ArkUIAnimation)
- [`Xcomponent`:XComponent(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/ETSUI/XComponent)
- [`Xcomponent`:XComponent(eTS)(API9)](https://gitee.com/openharmony/applications_app_samples/tree/master/ETSUI/XComponent)
- [`MouseEvent`:鼠标事件(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/ETSUI/MouseEvent)
- [`MouseEvent`:鼠标事件(eTS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/ETSUI/MouseEvent)
- [`Gallery`:组件集合(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/ETSUI/Gallery)
- [`Gallery`:组件集合(eTS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/ETSUI/Gallery)
- [`BringApp`:拉起系统应用(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/ETSUI/BringApp)
- [`BringApp`:拉起系统应用(eTS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/ETSUI/BringApp)
- [`Chat`:聊天示例应用(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/AppSample/Chat)
- [`Chat`:聊天示例应用(eTS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/AppSample/Chat)
- [`Shopping`:购物示例应用(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/AppSample/Shopping)
- [`Shopping`:购物示例应用(eTS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/AppSample/Shopping)
- [`Lottie`:Lottie(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/ETSUI/Lottie)
- [`Lottie`:Lottie(eTS)(API8)(Full SDK)](https://gitee.com/openharmony/applications_app_samples/tree/master/ETSUI/Lottie)
- [`Clock`:简单时钟(eTS)(API9)](https://gitee.com/openharmony/app_samples/tree/master/Preset/Clock)
- [`Clock`:简单时钟(eTS)(API9)](https://gitee.com/openharmony/applications_app_samples/tree/master/Preset/Clock)
- [`Flybird`:小鸟避障游戏(eTS)(API9)](https://gitee.com/openharmony/app_samples/tree/master/ResourcesSchedule/Flybird)
- [`News`:新闻浏览(eTS)(API9)](https://gitee.com/openharmony/app_samples/tree/master/ResourcesSchedule/News)
- [`Flybird`:小鸟避障游戏(eTS)(API9)](https://gitee.com/openharmony/applications_app_samples/tree/master/ResourcesSchedule/Flybird)
- [`AdaptiveCapabilities`:多设备自适应能力(eTS)(API9)](https://gitee.com/openharmony/app_samples/tree/master/MultiDeviceAppDev/AdaptiveCapabilities)
- [`Game2048`:2048游戏(eTS)(API9)](https://gitee.com/openharmony/app_samples/tree/master/ETSUI/Game2048)
- [`Game2048`:2048游戏(eTS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/ETSUI/Game2048)
- [`TransitionAnimation`:转场动画(eTS)(API9)](https://gitee.com/openharmony/app_samples/tree/master/ETSUI/TransitionAnimation)
- [`TransitionAnimation`:转场动画(eTS)(API9)](https://gitee.com/openharmony/applications_app_samples/tree/master/ETSUI/TransitionAnimation)
- [`PatternLock`:图案密码锁组件(eTS)(API9)](https://gitee.com/openharmony/app_samples/tree/master/ETSUI/PatternLock)
- [`PatternLock`:图案密码锁组件(eTS)(API9)](https://gitee.com/openharmony/applications_app_samples/tree/master/ETSUI/PatternLock)
- [`Search`:Search组件(eTS)(API9)](https://gitee.com/openharmony/app_samples/tree/master/ETSUI/Search)
- [`Search`:Search组件(eTS)(API9)](https://gitee.com/openharmony/applications_app_samples/tree/master/ETSUI/Search)
- [`QRCode`:二维码(eTS)(API9)](https://gitee.com/openharmony/app_samples/tree/master/ETSUI/QRCode)
- [`QRCode`:二维码(eTS)(API9)](https://gitee.com/openharmony/applications_app_samples/tree/master/ETSUI/QRCode)
- [极简声明式UI范式(eTS)(API8)](https://gitee.com/openharmony/codelabs/tree/master/ETSUI/SimpleGalleryEts)
......@@ -109,4 +107,6 @@
- [弹窗(eTS)(API8)](https://gitee.com/openharmony/codelabs/tree/master/ETSUI/CustomDialogEts)
- [CustomComponent:组件化(eTS)(API8)](https://gitee.com/openharmony/app_samples/tree/master/ETSUI/CustomComponent)
\ No newline at end of file
- [`UpgradePopup`:自定义弹窗(eTS)(API9)](https://gitee.com/openharmony/applications_app_samples/tree/master/ETSUI/UpgradePopup)
- [CustomComponent:组件化(eTS)(API8)](https://gitee.com/openharmony/applications_app_samples/tree/master/ETSUI/CustomComponent)
\ No newline at end of file
......@@ -33,20 +33,10 @@
### 窗口类型
OpenHarmony的窗口模块将窗口界面分为系统窗口、应用窗口两种基本类型。
- **系统窗口**
系统窗口指完成系统特定功能的窗口。如音量条、壁纸、通知栏、状态栏、导航栏等。
- **应用窗口**
应用窗口区别于系统窗口,指与应用显示相关的窗口。根据显示内容的不同,应用窗口又分为应用主窗口、应用子窗口两种类型。
- 应用主窗口
​ 应用主窗口用于显示应用界面,会在"任务管理界面"显示。
- 应用子窗口
​ 应用子窗口用于显示应用的弹窗、悬浮窗等辅助窗口,不会在"任务管理界面"显示。
- **系统窗口**:系统窗口指完成系统特定功能的窗口。如音量条、壁纸、通知栏、状态栏、导航栏等。
- **应用窗口**:应用窗口区别于系统窗口,指与应用显示相关的窗口。根据显示内容的不同,应用窗口又分为应用主窗口、应用子窗口两种类型。
- 应用主窗口:应用主窗口用于显示应用界面,会在"任务管理界面"显示。
- 应用子窗口:应用子窗口用于显示应用的弹窗、悬浮窗等辅助窗口,不会在"任务管理界面"显示。
......@@ -56,11 +46,9 @@ OpenHarmony的窗口模块将窗口界面分为系统窗口、应用窗口两种
应用窗口模式指应用主窗口启动时的显示方式。OpenHarmony目前支持全屏、分屏、自由窗口三种应用窗口模式。这种对多种应用窗口模式的支持能力,也称为操作系统的“多窗口能力”。
- **全屏** :应用主窗口启动时铺满整个屏幕。
- **分屏** :应用主窗口启动时占据屏幕的某个部分,当前支持二分屏。两个分屏窗口之间具有分界线,可通过拖拽分界线调整两个部分的窗口尺寸。
- **自由窗口** :自由窗口的大小和位置可自由改变。同一个屏幕上可同时显示多个自由窗口,这些自由窗口按照打开或者获取焦点的顺序在Z轴排布。当自由窗口被点击或触摸时,将导致其Z轴高度提升,并获取焦点。
- **全屏**:应用主窗口启动时铺满整个屏幕。
- **分屏**:应用主窗口启动时占据屏幕的某个部分,当前支持二分屏。两个分屏窗口之间具有分界线,可通过拖拽分界线调整两个部分的窗口尺寸。
- **自由窗口**:自由窗口的大小和位置可自由改变。同一个屏幕上可同时显示多个自由窗口,这些自由窗口按照打开或者获取焦点的顺序在Z轴排布。当自由窗口被点击或触摸时,将导致其Z轴高度提升,并获取焦点。
![windowMode](figures/windowMode.png)
......
......@@ -70,7 +70,7 @@
- [应用权限管理开发指导](subsys-security-rightmanagement.md)
- [IPC通信鉴权开发指导](subsys-security-communicationverify.md)
- [设备安全等级管理开发指导](subsys-security-devicesecuritylevel.md)
- [OpenHarmony通用密钥库系统开发](subsys-security-huks-guide.md)
- [OpenHarmony通用密钥库系统开发指导](subsys-security-huks-guide.md)
- 启动恢复
- [启动恢复子系统概述](subsys-boot-overview.md)
- init启动引导组件
......
......@@ -20,6 +20,10 @@ OpenHarmony安全子系统目前提供给开发者的安全能力主要包含应
OpenHarmony设备安全等级管理(DSLM)模块,负责管理各种不同形态和种类的OpenHarmony设备的设备安全等级。对于OpenHarmony中的各类分布式业务,当其对各类用户数据进行流转或处理的时候,可以调用本模块提供的接口获取相关目标设备的安全等级,并根据获取到的等级进行相应的处理。
- OpenHarmony通用密钥库
通用密钥库(HUKS)提供系统级的密钥管理能力,实现密钥全生命周期(生成、存储、使用、销毁)的管理和安全使用,满足生态应用和上层业务的诉求。上层应用可以通过调用本模块提供的接口执行密钥操作,同时明文密钥的存储和使用不能出现在非安全环境中,需要保证在安全环境中使用。
## 基本概念
......
# OpenHarmony 1.1.5 LTS
## 版本概述
此版本为OpenHarmony 1.0.1 Release分支上的维护版本,基于OpenHarmony-v1.1.4-LTS版本修复一些缺陷及安全问题,通过集成验证后发布最新且稳定的标签版本。
## 配套关系
**表1** 版本软件和工具配套关系
| 软件 | 版本 | 备注 |
| -------- | -------- | -------- |
| OpenHarmony | 1.1.5&nbsp;LTS | NA |
| HUAWEI&nbsp;DevEco&nbsp;Device&nbsp;Tool(可选) | 2.2&nbsp;Beta2 | OpenHarmony智能设备集成开发环境推荐使用。 |
## 源码获取
### 通过repo获取
**方式一(推荐)**:通过repo + ssh 下载(需注册公钥,请参考[码云帮助中心](https://gitee.com/help/articles/4191))。
```
repo init -u git@gitee.com:openharmony/manifest.git -b refs/tags/OpenHarmony-v1.1.5-LTS --no-repo-verify
repo sync -c
repo forall -c 'git lfs pull'
```
**方式二**:通过repo + https 下载。
```
repo init -u https://gitee.com/openharmony/manifest.git -b refs/tags/OpenHarmony-v1.1.5-LTS --no-repo-verify
repo sync -c
repo forall -c 'git lfs pull'
```
### 从镜像站点获取
**表2** 获取源码路径
| 版本源码 | 版本信息 | 下载站点 | SHA256校验码 |
| -------- | -------- | -------- | -------- |
| 全量代码 | 1.1.5 | [站点](https://repo.huaweicloud.com/harmonyos/os/1.1.5/code-v1.1.5-LTS.tar.gz) | [SHA256校验码](https://repo.huaweicloud.com/harmonyos/os/1.1.5/code-v1.1.5-LTS.tar.gz.sha256) |
| 轻量级设备Hi3861解决方案(二进制) | 1.1.5 | [站点](https://repo.huaweicloud.com/harmonyos/os/1.1.5/wifiiot-1.1.5.tar.gz) | [SHA256校验码](https://repo.huaweicloud.com/harmonyos/os/1.1.5/wifiiot-1.1.5.tar.gz.sha256) |
| 小型设备Hi3518解决方案(二进制) | 1.1.5 | [站点](https://repo.huaweicloud.com/harmonyos/os/1.1.5/ipcamera_hi3518ev300-1.1.5.tar.gz) | [SHA256校验码](https://repo.huaweicloud.com/harmonyos/os/1.1.5/ipcamera_hi3518ev300-1.1.5.tar.gz.sha256) |
| 小型设备Hi3516解决方案(二进制) | 1.1.5 | [站点](https://repo.huaweicloud.com/harmonyos/os/1.1.5/ipcamera_hi3516dv300-1.1.5.tar.gz) | [SHA256校验码](https://repo.huaweicloud.com/harmonyos/os/1.1.5/ipcamera_hi3516dv300-1.1.5.tar.gz.sha256) |
## 更新说明
本版本在OpenHarmony v1.1.4 LTS的基础上有如下变更。
### 特性变更
当前维护版本不涉及新需求及新特性的接纳与变更。
### API变更
此版本不涉及API变更。
### 芯片及开发板适配
芯片及开发板适配状态请参考[SIG-Devboard](https://gitee.com/openharmony/community/blob/master/sig/sig-devboard/sig_devboard_cn.md)信息。
## 修复缺陷列表
**表3** 已修复的安全漏洞列表
| ISSUE单号 | 问题描述 | 合入链接 |
| -------- | -------- | -------- |
| I58X0S | 修复curl组件的CVE-2022-27781、CVE-2022-27782安全漏洞 | [PR](https://gitee.com/openharmony/third_party_curl/pulls/60) |
| I56PV4 | 修复curl组件的CVE-2022-22576、CVE-2022-27775、CVE-2022-27774、CVE-2022-27776安全漏洞 | [PR](https://gitee.com/openharmony/third_party_curl/pulls/54) |
| NA | 修复curl组件的CVE-2021-22945、CVE-2021-22946、CVE-2021-22947安全漏洞 | [PR](https://gitee.com/openharmony/third_party_curl/pulls/56) |
| I4QT0K/I56GI9 | 修复mbed&nbsp;tls组件的CVE-2021-44732、CVE-2021-45450安全漏洞 | [PR](https://gitee.com/openharmony/third_party_mbedtls/pulls/30) |
| I5F0WG | 修复freetype组件的CVE-2022-27404、CVE-2022-27406安全漏洞 | [PR](https://gitee.com/openharmony/third_party_freetype/pulls/22) |
| I4TLI9 | 修复freetype组件的CVE-2020-15999安全漏洞 | [PR](https://gitee.com/openharmony/third_party_freetype/pulls/7) |
| I51D98 | 修复zlib组件的CVE-2018-25032安全漏洞 | [PR](https://gitee.com/openharmony/third_party_zlib/pulls/31) |
| I5F13F/I4UHO4 | 修复ffmpeg组件的CVE-2020-35964、CVE-2022-1475、CVE-2021-38291、CVE-2020-35965、CVE-2020-22042、CVE-2020-22038、CVE-2020-22037、CVE-2020-22021、CVE-2020-22019安全漏洞 | [PR](https://gitee.com/openharmony/device_hisilicon_third_party_ffmpeg/pulls/17) |
**表4** 已修复的缺陷列表
| ISSUE单号 | 问题描述 |
| -------- | -------- |
| [I4VKNM](https://gitee.com/openharmony/xts_acts/issues/I4VKNM) | 小型系统Hi3518开发板执行testSigtimedwaitBlock用例时概率性失败 |
| [I4S098](https://gitee.com/openharmony/applications_sample_camera/issues/I4S098) | 小型系统Hi3516开发板点击设置-WiFi,进入WiFi列表界面后退出,重复此操作会使开发板概率性无响应 |
# OpenHarmony 3.1.2 Release
## 版本概述
当前版本在OpenHarmony 3.1.1 Release的基础上,做了如下更新:
修复部分子系统acts测试用例执行失败问题,同时补齐部分子系统的acts用例覆盖。
修复了linux kernel、OpenSSL、curl、node等三方组件的已知漏洞,增强了系统安全性。
修复了备忘录、设置、通知栏等系统应用的部分已知缺陷,提升了标准系统开发板的用户体验。
修复了SDK已知缺陷问题并配套发布最新的SDK版本。
## 配套关系
**表1** 版本软件和工具配套关系
| 软件 | 版本 | 备注 |
| -------- | -------- | -------- |
| OpenHarmony | 3.1.2&nbsp;Release | NA |
| Full&nbsp;SDK | Ohos_sdk_full&nbsp;3.1.7.5&nbsp;(API&nbsp;Version&nbsp;8&nbsp;Release) | 面向OEM厂商提供,包含了需要使用系统权限的系统接口。<br/>使用Full&nbsp;SDK时需要手动从镜像站点获取,并在DevEco&nbsp;Studio中替换,具体操作可参考[替换指南](https://gitee.com/openharmony/docs/blob/master/zh-cn/application-dev/quick-start/full-sdk-switch-guide.md)。 |
| Public&nbsp;SDK | Ohos_sdk_public&nbsp;3.1.7.5&nbsp;(API&nbsp;Version&nbsp;8&nbsp;Release) | 面向应用开发者提供,不包含需要使用系统权限的系统接口。<br/>DevEco&nbsp;Studio&nbsp;3.0&nbsp;Beta4版本起,通过DevEco&nbsp;Studio获取的SDK默认为Public&nbsp;SDK。 |
| HUAWEI&nbsp;DevEco&nbsp;Studio(可选) | 3.0&nbsp;Beta4&nbsp;for&nbsp;OpenHarmony | OpenHarmony应用开发推荐使用 |
| HUAWEI&nbsp;DevEco&nbsp;Device&nbsp;Tool(可选) | 3.0&nbsp;Release | OpenHarmony智能设备集成开发环境推荐使用 |
## 源码获取
### 前提条件
1. 注册码云gitee账号。
2. 注册码云SSH公钥,请参考[码云帮助中心](https://gitee.com/help/articles/4191)
3. 安装[git客户端](https://gitee.com/link?target=https%3A%2F%2Fgit-scm.com%2Fbook%2Fzh%2Fv2%2F%25E8%25B5%25B7%25E6%25AD%25A5-%25E5%25AE%2589%25E8%25A3%2585-Git)[git-lfs](https://gitee.com/vcs-all-in-one/git-lfs?_from=gitee_search#downloading)并配置用户信息。
```
git config --global user.name "yourname"
git config --global user.email "your-email-address"
git config --global credential.helper store
```
4. 安装码云repo工具,可以执行如下命令。
```
curl -s https://gitee.com/oschina/repo/raw/fork_flow/repo-py3 > /usr/local/bin/repo #如果没有权限,可下载至其他目录,并将其配置到环境变量中chmod a+x /usr/local/bin/repo
pip3 install -i https://repo.huaweicloud.com/repository/pypi/simple requests
```
### 通过repo获取
**方式一(推荐)**
通过repo + ssh 下载(需注册公钥,请参考[码云帮助中心](https://gitee.com/help/articles/4191))。
```
repo init -u git@gitee.com:openharmony/manifest.git -b refs/tags/OpenHarmony-v3.1.2-Release --no-repo-verify
repo sync -c
repo forall -c 'git lfs pull'
```
**方式二**
通过repo + https 下载。
```
repo init -u https://gitee.com/openharmony/manifest.git -b refs/tags/OpenHarmony-v3.1.2-Release --no-repo-verify
repo sync -c
repo forall -c 'git lfs pull'
```
### 从镜像站点获取
**表2** 获取源码路径
| 版本源码 | **版本信息** | **下载站点** | **SHA256校验码** |
| -------- | -------- | -------- | -------- |
| 全量代码(标准、轻量和小型系统) | 3.1.2&nbsp;Release | [站点](https://mirrors.huaweicloud.com/harmonyos/os/3.1.2/code-v3.1.2-Release.tar.gz) | [SHA256校验码](https://mirrors.huaweicloud.com/harmonyos/os/3.1.2/code-v3.1.2-Release.tar.gz.sha256) |
| Hi3516标准系统解决方案(二进制) | 3.1.2&nbsp;Release | [站点](https://mirrors.huaweicloud.com/harmonyos/os/3.1.2/standard_hi3516.tar.gz) | [SHA256校验码](https://mirrors.huaweicloud.com/harmonyos/os/3.1.2/standard_hi3516.tar.gz.sha256) |
| RK3568标准系统解决方案(二进制) | 3.1.2&nbsp;Release | [站点](https://mirrors.huaweicloud.com/harmonyos/os/3.1.2/standard_rk3568.tar.gz) | [SHA256校验码](https://mirrors.huaweicloud.com/harmonyos/os/3.1.2/standard_rk3568.tar.gz.sha256) |
| Hi3861轻量系统解决方案(二进制) | 3.1.2&nbsp;Release | [站点](https://mirrors.huaweicloud.com/harmonyos/os/3.1.2/hispark_pegasus.tar.gz) | [SHA256校验码](https://mirrors.huaweicloud.com/harmonyos/os/3.1.2/hispark_pegasus.tar.gz.sha256) |
| Hi3516轻量系统解决方案-LiteOS(二进制) | 3.1.2&nbsp;Release | [站点](https://mirrors.huaweicloud.com/harmonyos/os/3.1.2/hispark_taurus.tar.gz) | [SHA256校验码](https://mirrors.huaweicloud.com/harmonyos/os/3.1.2/hispark_taurus.tar.gz.sha256) |
| Hi3516轻量系统解决方案-Linux(二进制) | 3.1.2&nbsp;Release | [站点](https://mirrors.huaweicloud.com/harmonyos/os/3.1.2/hispark_taurus_linux.tar.gz) | [SHA256校验码](https://mirrors.huaweicloud.com/harmonyos/os/3.1.2/hispark_taurus_linux.tar.gz.sha256) |
| 标准系统Full&nbsp;SDK包(Mac) | 3.1.2&nbsp;Release | [站点](https://mirrors.huaweicloud.com/harmonyos/os/3.1.2/ohos-sdk-mac-full.tar.gz) | [SHA256校验码](https://mirrors.huaweicloud.com/harmonyos/os/3.1.2/ohos-sdk-mac-full.tar.gz.sha256) |
| 标准系统Full&nbsp;SDK包(Windows\Linux) | 3.1.2&nbsp;Release | [站点](https://mirrors.huaweicloud.com/harmonyos/os/3.1.2/ohos-sdk-full.tar.gz) | [SHA256校验码](https://mirrors.huaweicloud.com/harmonyos/os/3.1.2/ohos-sdk-full.tar.gz.sha256) |
| 标准系统Public&nbsp;SDK包(Mac) | 3.1.2&nbsp;Release | [站点](https://mirrors.huaweicloud.com/harmonyos/os/3.1.2/ohos-sdk-mac-public.tar.gz) | [SHA256校验码](https://mirrors.huaweicloud.com/harmonyos/os/3.1.2/ohos-sdk-mac-public.tar.gz.sha256) |
| 标准系统Public&nbsp;SDK包(Windows\Linux) | 3.1.2&nbsp;Release | [站点](https://mirrors.huaweicloud.com/harmonyos/os/3.1.2/ohos-sdk-public.tar.gz) | [SHA256校验码](https://mirrors.huaweicloud.com/harmonyos/os/3.1.2/ohos-sdk-public.tar.gz.sha256) |
## 更新说明
本版本在OpenHarmony 3.1.1 Release的基础上有如下变更。
### 特性变更
本次版本无新增特性及变更。
API变更
3.1.2 Release对比3.1.1 Release API接口无变更。
### 芯片及开发板适配
芯片及开发板适配状态请参考[SIG-Devboard](https://gitee.com/openharmony/community/blob/master/sig/sig-devboard/sig_devboard_cn.md)信息。
## 修复缺陷列表
**表3** 修复缺陷ISSUE列表
| 子系统 | 问题描述 |
| -------- | -------- |
| acts子系统 | -&nbsp;修复ActsFeatureAbilityTest模块1条用例执行失败的问题([I5G8Q5](https://gitee.com/openharmony/xts_acts/issues/I5G8Q5))<br/>-&nbsp;修复usb的sdk中的参数target未覆盖的问题([I5FU0F](https://gitee.com/openharmony/xts_acts/issues/I5FU0F))<br/>-&nbsp;修复graphic/webGL/src/main/js/default/test下用例未覆盖的问题([I5FMJJ](https://gitee.com/openharmony/xts_acts/issues/I5FMJJ))<br/>-&nbsp;修复ActsFeatureAbilityTest模块22条用例执行失败的问题([I5FILR](https://gitee.com/openharmony/xts_acts/issues/I5FILR))<br/>-&nbsp;删除Webgl下graphic/webGL/src/main/js/default/test测试套未使用的引用'\@ohos.napi_context'([I5FAF7](https://gitee.com/openharmony/xts_acts/issues/I5FAF7))<br/>-&nbsp;修复ActsAudioManagerJsTest的Test.json配置错误问题([I5EJPP](https://gitee.com/openharmony/xts_acts/issues/I5EJPP))<br/>-&nbsp;修复ohos.multimedia.mediaLibrary测试用例导包大小写错误问题([I5EJ3W](https://gitee.com/openharmony/xts_acts/issues/I5EJ3W))<br/>-&nbsp;修复通知子系统对应的4个测试套执行失败的问题([I5EA00](https://gitee.com/openharmony/xts_acts/issues/I5EA00))<br/>-&nbsp;修复ActsUpdateJsTest模块index.js源码引入测试套的api异常问题([I5D5BV](https://gitee.com/openharmony/xts_acts/issues/I5D5BV))<br/>-&nbsp;修复Test.json配置的命令无法创建push资源的目录问题([I5D50G](https://gitee.com/openharmony/xts_acts/issues/I5D50G))<br/>-&nbsp;修复ActsAnsActiveTest测试套用例兼容性问题([I5BQB0](https://gitee.com/openharmony/xts_acts/issues/I5BQB0))<br/>-&nbsp;修复ActsStServiceAbilityClientCaseTest模块五条用例执行失败问题([I5GHRE](https://gitee.com/openharmony/xts_acts/issues/I5GHRE))<br/>-&nbsp;修复ActsSubscriberTestUnorderSystemTest模块两条用例执行失败的问题([I5GHP5](https://gitee.com/openharmony/xts_acts/issues/I5GHP5))<br/>-&nbsp;修复ActsAudioRecorderJsTest、ActsMediaLibraryJsTest模块测试套无法执行问题([I5H431](https://gitee.com/openharmony/xts_acts/issues/I5H431)) |
| SDK子系统 | -&nbsp;解决了预览器相关的一些问题。<br/>-&nbsp;解决了c++调试相关的一些问题。 |
| 应用子系统 | -&nbsp;修复通知管理界面相关的问题([I5FLLB](https://gitee.com/openharmony/applications_systemui/issues/I5FLLB))<br/>-&nbsp;修复备忘录的一些缺陷问题([5FJGJ](https://gitee.com/openharmony/applications_notes/issues/I5FJGJ))([I5FJ9L](https://gitee.com/openharmony/applications_notes/issues/I5FJ9L))([I5FJCS](https://gitee.com/openharmony/applications_notes/issues/I5FJCS)) |
## 修复安全漏洞列表
**表4** 修复安全问题列表
| ISSUE | 问题描述 | 修复链接 |
| -------- | -------- | -------- |
| I5FZTU | 修复组件linux&nbsp;kernel&nbsp;5.10上的CVE-2022-21125、CVE-2022-2153、CVE-2022-32296安全漏洞。 | [PR](https://gitee.com/openharmony/kernel_linux_5.10/pulls/307) |
| I5FZT0 | 修复组件linux&nbsp;kernel&nbsp;5.10上的CVE-2022-1508、CVE-2022-1972、CVE-2022-1998、CVE-2022-21499、CVE-2022-32981安全漏洞。 | [PR](https://gitee.com/openharmony/kernel_linux_5.10/pulls/301) |
| I5FZSH | 修复组件linux&nbsp;kernel&nbsp;5.10上的CVE-2022-1974、CVE-2022-1975、CVE-2022-20153、CVE-2022-20154、CVE-2022-20132安全漏洞。 | [PR](https://gitee.com/openharmony/kernel_linux_5.10/pulls/302) |
| I5FZQS | 修复组件linux&nbsp;kernel&nbsp;5.10上的CVE-2022-1729、CVE-2022-29581安全漏洞。 | [PR](https://gitee.com/openharmony/kernel_linux_5.10/pulls/299) |
| I5CQMC | 修复组件third_party_chromium上的CVE-2022-2158、CVE-2022-2161、CVE-2022-2163、CVE-2022-2164、CVE-2022-2157、CVE-2022-2165、CVE-2022-2160、CVE-2022-2156、CVE-2022-1501、CVE-2022-2008、CVE-2022-2010、CVE-2022-2011、CVE-2022-1857、CVE-2022-1874、CVE-2022-0311、CVE-2022-1314安全漏洞。 | [PR](https://gitee.com/openharmony/third_party_chromium/pulls/29) |
| I5GG74 | 修复组件third_party_openssl上的CVE-2022-2097安全漏洞。 | [PR](https://gitee.com/openharmony/third_party_openssl/pulls/64) |
| I5GQI2 | 修复组件third_party_curl上的CVE-2022-22576、CVE-2022-27775、CVE-2022-27774、CVE-2022-27776安全漏洞。 | [PR](https://gitee.com/openharmony/third_party_curl/pulls/51) |
| I5H1HU | 修复组件third_party_flutter下libjpeg-turbo组件的CVE-2021-46822安全漏洞。 | [PR](https://gitee.com/openharmony/third_party_flutter/pulls/117) |
| I5KI54 | 修复组件third_party_freetype的CVE-2022-27405安全漏洞。 | [PR](https://gitee.com/openharmony/third_party_freetype/pulls/32) |
| I5J8V2 | 升级组件third_party_node到14.19.1版本,解决CVE-2022-32212、CVE-2022-32213、CVE-2022-2097、CVE-2022-32215安全漏洞。 | [PR](https://gitee.com/openharmony/third_party_node/pulls/29) |
| I59ZPI | 升级组件third_party_ntfs-3g到2022.5.17版本,修复2021.8.22版本上的已知安全漏洞。 | [PR](https://gitee.com/openharmony/third_party_ntfs-3g/pulls/18) |
| I5EEXE | 修复组件third_party_pcre2组件的CVE-2022-1586、CVE-2022-1587安全漏洞。 | [PR](https://gitee.com/openharmony/third_party_pcre2/pulls/24) |
| I5I9YX | 修复组件third_party_selinux上的CVE-2021-36085CVE-2021-36084CVE-2021-36087安全漏洞。 | [PR](https://gitee.com/openharmony/third_party_selinux/pulls/31) |
## 遗留缺陷列表
**表5** 遗留缺陷列表
| ISSUE | 问题描述 | 影响 | 计划解决日期 |
| -------- | -------- | -------- | -------- |
| [I5M0GH](https://gitee.com/openharmony/applications_notes/issues/I5M0GH) | 备忘录—最近删除界面选中笔记点击恢复按钮无反应。 | 备忘录demo应用,影响开发者体验。 | 2022/9/30 |
# OpenHarmony Release Notes
## OpenHarmony 3.x Releases
- [OpenHarmony v3.1.2 Release (2022-08-24)](OpenHarmony-v3.1.2-release.md)
- [OpenHarmony v3.2 Beta2 (2022-07-30)](OpenHarmony-v3.2-beta2.md)
- [OpenHarmony v3.2 Beta1 (2022-05-31)](OpenHarmony-v3.2-beta1.md)
- [OpenHarmony v3.1.1 Release (2022-05-31)](OpenHarmony-v3.1.1-release.md)
......@@ -15,7 +17,9 @@
- [OpenHarmony v2.2 beta2 (2021-08-04)](OpenHarmony-v2.2-beta2.md)
- [OpenHarmony 2.0 Canary (2021-06-01)](OpenHarmony-2-0-Canary.md)
## OpenHarmony 1.x Releases
- [OpenHarmony v1.1.5 LTS (2022-08-24)](OpenHarmony-v1.1.5-LTS.md)
- [OpenHarmony v1.1.4 LTS (2022-02-11)](OpenHarmony-v1-1-4-LTS.md)
- [OpenHarmony v1.1.3 LTS (2021-09-30)](OpenHarmony-v1-1-3-LTS.md)
- [OpenHarmony v1.1.2 LTS (2021-08-04)](OpenHarmony-v1.1.2-LTS.md)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册