提交 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,10 +39,12 @@ 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) {
super(des);
......@@ -51,7 +53,8 @@ OpenHarmony does not support creation of a Service Extension ability for third-p
}
}
class ServiceExt extends ServiceExtensionAbility {
class ServiceExtAbility extends ServiceExtensionAbility {
onCreate(want) {
console.log('onCreate, want:' + want.abilityName);
}
onRequest(want, startId) {
......
......@@ -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({
let caller = undefined;
// Start an ability in the background without passing parameters.
var wantBackground = {
bundleName: "com.example.myservice",
moduleName: "entry",
abilityName: "MainAbility",
deviceId: ""
}).then((obj) => {
};
this.context.startAbilityByCall(wantBackground)
.then((obj) => {
caller = obj;
console.log('Caller GetCaller Get ' + caller);
}).catch((e) => {
console.log('Caller GetCaller error ' + e);
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**
......@@ -2744,12 +2744,12 @@ 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. |
| 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
......
# 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');
......@@ -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**
......@@ -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.|
......@@ -23,8 +23,8 @@ Navigates to a specified page in the application.
**System capability**: SystemCapability.ArkUI.ArkUI.Full
**Parameters**
| Name | Type | Mandatory| Description |
| ------- | ------------------------------- | ---- | ------------------ |
| Name | Type | Mandatory | Description |
| ------- | ------------------------------- | ---- | --------- |
| options | [RouterOptions](#routeroptions) | Yes | Page routing parameters.|
......@@ -49,10 +49,10 @@ Navigates to a specified page in the application.
**System capability**: SystemCapability.ArkUI.ArkUI.Full
**Parameters**
| Name | Type | Mandatory| Description |
| ----------------- | ------------------------------- | ---- | -------------------- |
| Name | Type | Mandatory | Description |
| ------- | ------------------------------- | ---- | ---------- |
| options | [RouterOptions](#routeroptions) | Yes | Page routing parameters. |
| mode<sup>9+</sup> | [RouterMode](#routermode9) | Yes | Routing mode.|
| 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 |
| ----------------- | ------------------------------- | ---- | -------------------- |
| Name | Type | Mandatory | Description |
| ------- | ------------------------------- | ---- | ---------- |
| options | [RouterOptions](#routeroptions) | Yes | Description of the new page. |
| mode<sup>9+</sup> | [RouterMode](#routermode9) | Yes | Routing mode.|
| 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**
......@@ -160,7 +161,7 @@ Obtains the number of pages in the current stack.
**Return value**
| Type | Description |
| ------ | ---------------------------------- |
| ------ | ------------------ |
| string | Number of pages in the stack. The maximum value is **32**.|
**Example**
......@@ -180,7 +181,7 @@ Obtains state information about the current page.
**Return value**
| Type | Description |
| --------------------------- | -------------- |
| --------------------------- | ------- |
| [RouterState](#routerstate) | Page routing state.|
**Example**
......@@ -198,7 +199,7 @@ Describes the page routing state.
**System capability**: SystemCapability.ArkUI.ArkUI.Full
| 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. |
......@@ -212,8 +213,8 @@ 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 |
| ------- | ----------------------------------------- | ---- | ------------------ |
| Name | Type | Mandatory | Description |
| ------- | ---------------------------------------- | ---- | --------- |
| options | [EnableAlertOptions](#enablealertoptions) | Yes | Description of the dialog box.|
**Example**
......@@ -229,8 +230,8 @@ Describes the confirm dialog box.
**System capability**: SystemCapability.ArkUI.ArkUI.Full
| Name | Type | Mandatory| Description |
| ------- | ------ | ---- | ---------------- |
| Name | Type | Mandatory | Description |
| ------- | ------ | ---- | -------- |
| message | string | Yes | Content displayed in the confirm dialog box.|
## router.disableAlertBeforeBackPage
......@@ -257,7 +258,7 @@ Obtains the parameters passed from the page that initiates redirection to the cu
**Return value**
| 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. |
| 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>
......@@ -289,7 +289,7 @@ Enumerates the routing modes.
**System capability**: SystemCapability.ArkUI.ArkUI.Full
| 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.|
......
......@@ -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,11 +374,11 @@ Defines the **EnableAlertBeforeBackPage** parameters.
**System capability**: SystemCapability.ArkUI.ArkUI.Full
| Name | Type | Mandatory | Description |
| -------- | ------------------------ | ---- | ------------------------- |
| 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.|
| 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,10 +387,10 @@ 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.|
| 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:
e.g. //foundation/ai/engine/services/client/algorithm\_sdk/nlu
//foundation/ai/engine/services/client/algorithm\_sdk/cv
//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:
//foundation/ai/engine/services/server/plugin/cv
e.g. //foundation/ai/engine/services/server/plugin/nlu
//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 |
| ------------------------------------------------------------ | ------------------------------------ |
......
......@@ -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,6 +106,7 @@ 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:
- ohos.permission.LOCATION
......@@ -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,6 +209,7 @@ 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.
```
......@@ -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)
......@@ -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>
描述音频渲染器更改信息。
......@@ -2937,7 +3153,7 @@ audioStreamManager.on('audioCapturerChange', (AudioCapturerChangeInfoArray) =>
**系统能力:** 以下各项对应的系统能力均为SystemCapability.Multimedia.Audio.Device
| 名称 | 类型 | 可读 | 可写 | 说明 |
| -------------------------- | -------------------------- | ---- | ---- | ---------- |
| ----------------------------- | -------------------------- | ---- | ---- | ---------- |
| deviceRole | [DeviceRole](#devicerole) | 是 | 否 | 设备角色。 |
| deviceType | [DeviceType](#devicetype) | 是 | 否 | 设备类型。 |
| id<sup>9+</sup> | number | 是 | 否 | 设备id。 |
......@@ -2946,6 +3162,9 @@ audioStreamManager.on('audioCapturerChange', (AudioCapturerChangeInfoArray) =>
| 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
**系统API:** 此接口为系统接口,三方应用不支持调用
| 名称 | 类型 | 说明 |
| ----------- | ------- | ------------------ |
| ------------------------------ | ------------------------------ | ------------------ |
| userId | number | 指示用户id |
| installFlag | number | 指示安装标志 |
| isKeepData | boolean | 指示参数是否有数据 |
| hashParams<sup>9+</sup> | Array<[HashParam](#hashparam)> | 哈希值参数 |
| crowdtestDeadline<sup>9+</sup> | number | 测试包的被杀死时间 |
## InstallStatus
......@@ -99,6 +118,8 @@ SystemCapability.BundleManager.BundleFramework
**系统能力:** 以下各项对应的系统能力均为SystemCapability.BundleManager.BundleFramework
**系统API:** 此接口为系统接口,三方应用不支持调用
| 名称 | 类型 | 可读 | 可写 | 说明 |
| ------------- | ------------------------------------------------------------ | ---- | ---- | ------------------------------ |
| status | bundle.[InstallErrorCode](js-apis-Bundle.md#installerrorcode) | 是 | 否 | 表示安装或卸载错误状态码 |
......
......@@ -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
export default {
systemTimer () {
var options = {
type:TIMER_TYPE_REALTIME,
repeat:false
type: systemTimer.TIMER_TYPE_REALTIME,
repeat: false
}
systemTime.createTimer(options, (error, data) => {
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
export default {
systemTimer () {
var options = {
type:TIMER_TYPE_REALTIME,
type: systemTimer.TIMER_TYPE_REALTIME,
repeat:false
}
systemTime.createTimer(options).then((data) => {
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
export default {
systemTimer () {
var options = {
type:TIMER_TYPE_REALTIME,
type: systemTimer.TIMER_TYPE_REALTIME,
repeat:false
}
let timerId = systemTimer.Timer(options)
systemTime.startTimer(timerId, 10000, (error, data) => {
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
export default {
systemTimer (){
var options = {
type:TIMER_TYPE_REALTIME,
type: systemTimer.TIMER_TYPE_REALTIME,
repeat:false
}
let timerId = systemTimer.Timer(options)
systemTime.startTimer(timerId, 10000).then((data) => {
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
export default {
systemTimer () {
var options = {
type:TIMER_TYPE_REALTIME,
type: systemTimer.TIMER_TYPE_REALTIME,
repeat:false
}
let timerId = systemTimer.Timer(options)
let startTimerRes = systemTimer.startTimer(timerId, 100000)
systemTime.stopTimer(timerId, (error, data) => {
systemTimer.startTimer(timerId, 100000)
systemTimer.stoptTimer(timerId, 10000, (error, data) => {
if (error) {
console.error(`failed to systemTime.stopTimer ` + JSON.stringify(error));
console.error(`failed to systemTime.startTimer ` + JSON.stringify(error));
return;
}
console.log(`systemTime.stopTimer success data : ` + JSON.stringify(data));
console.log(`systemTime.startTimer success data : ` + JSON.stringify(data));
});
}
}
```
......@@ -207,17 +227,21 @@ stopTimer(timer: number): Promise&lt;void&gt;
**示例:**
```js
export default {
systemTimer (){
var options = {
type:TIMER_TYPE_REALTIME,
type: systemTimer.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));
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.stopTimer because ` + JSON.stringify(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
export default {
systemTimer () {
var options = {
type:TIMER_TYPE_REALTIME,
type: systemTimer.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) => {
systemTimer.startTimer(timerId, 100000)
systemTimer.stopTimer(timerId)
systemTimer.destroyTimer(timerId, (error, data) => {
if (error) {
console.error(`failed to systemTime.destroyTimer ` + JSON.stringify(error));
console.error(`failed to systemTime.startTimer ` + JSON.stringify(error));
return;
}
console.log(`systemTime.destroyTimer success data : ` + JSON.stringify(data));
console.log(`systemTime.startTimer success data : ` + JSON.stringify(data));
});
}
}
```
......@@ -272,16 +300,20 @@ destroyTimer(timer: number): Promise&lt;void&gt;
**示例:**
```js
export default {
systemTimer (){
var options = {
type:TIMER_TYPE_REALTIME,
type: systemTimer.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));
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.destroyTimer because ` + JSON.stringify(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
触发工作的网络类型。
......
......@@ -28,9 +28,10 @@ Worker构造函数的选项信息,用于为Worker添加其他信息。
**系统能力:** 以下各项对应的系统能力均为SystemCapability.Utils.Lang。
| 名称 | 参数类型 | 可读 | 可写 | 说明 |
| ---- | --------- | ---- | ---- | ---------------------- |
| ------ | --------- | ---- | ---- | ---------------------- |
| 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 | 设置动画播放模式,默认播放完成后重头开始播放。 |
## 示例
......
......@@ -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的子节点负责定义滚动条的行为样式。
......@@ -39,13 +39,6 @@ ScrollBar(value: ScrollBarOptions)
| Vertical | 纵向滚动条。 |
| Horizontal | 横向滚动条。 |
- BarState枚举说明
| 名称 | 描述 |
| -------- | -------- |
| On | 常驻显示。 |
| Off | 不显示。 |
| Auto | 按需显示(触摸时显示,无操作2s后消失)。 |
## 示例
......
......@@ -30,53 +30,14 @@ 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枚举说明
| 名称 | 描述 |
| --------- | -------------------- |
| Normal | 保持文本原有大小写。 |
| LowerCase | 文本采用全小写。 |
| UpperCase | 文本采用全大写。 |
- CopyOptions<sup>9+</sup>枚举说明
| 名称 | 描述 |
| -------- | -------- |
| None | 不支持复制粘贴。 |
| InApp | 支持应用内复制粘贴。 |
| LocalDevice | 支持设备内复制粘贴。 |
| CrossDevice | 支持跨设备复制粘贴。 |
| textCase | [TextCase](ts-appendix-enums.md#textcase) | TextCase.Normal | 设置文本大小写。 |
| copyOption<sup>9+</sup> | [CopyOptions](ts-appendix-enums.md#copyoptions9) | CopyOptions.None | 组件支持设置文本是否可复制粘贴。 |
> **说明:**
> 不支持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,11 +1181,12 @@ 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 })
Web({ src: 'www.example.com', controller: this.controller })
.onHttpAuthRequest((event) => {
AlertDialog.show({
title: 'title',
......@@ -1232,10 +1233,10 @@ 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 })
Web({ src: 'www.example.com', controller: this.controller })
.onPermissionRequest((event) => {
AlertDialog.show({
title: 'title',
......@@ -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 | 设置动画播放模式,默认播放完成后重头开始播放。 |
- 接口
......
......@@ -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 | 下侧边框样式。 |
## 示例
......
......@@ -15,15 +15,7 @@
| 名称 | 参数类型 | 默认值 | 描述 |
| -------- | -------- | -------- | -------- |
| hoverEffect | HoverEffect | HoverEffect.Auto | 设置当前组件悬停态下的悬浮效果。 |
- HoverEffect 枚举说明
| 名称 | 描述 |
| -------- | -------- |
| Auto | 使用组件的系统默认悬浮效果。 |
| Scale | 放大缩小效果。 |
| Highlight | 背景淡入淡出的强调效果。 |
| None | 不设置效果。 |
| hoverEffect | [HoverEffect](ts-appendix-enums.md#hovereffect8) | HoverEffect.Auto | 设置当前组件悬停态下的悬浮效果。 |
## 示例
......
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册