提交 4e78dcd2 编写于 作者: W wuzhihuitmac

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

Change-Id: I3eed1f10497e71d4f4c0ec9ea7789ca8808b9659
...@@ -4,167 +4,148 @@ ...@@ -4,167 +4,148 @@
You can set your application to call the **ReminderRequest** class to create scheduled reminders for countdown timers, calendar events, and alarm clocks. When the created reminders are published, the timing and pop-up notification functions of your application will be taken over by the reminder agent in the background, even when your application is frozen or exits. You can set your application to call the **ReminderRequest** class to create scheduled reminders for countdown timers, calendar events, and alarm clocks. When the created reminders are published, the timing and pop-up notification functions of your application will be taken over by the reminder agent in the background, even when your application is frozen or exits.
## Available APIs ## Available APIs
**reminderAgent** encapsulates the methods for publishing and canceling reminders. **reminderAgent** encapsulates the methods for publishing and canceling reminders.
**Table 1** Major APIs in reminderAgent **Table 1** Major APIs in reminderAgent
| Name| Description|
| -------- | -------- |
| API | Description | | function publishReminder(reminderReq: ReminderRequest, callback: AsyncCallback&lt;number&gt;): void;<br>function publishReminder(reminderReq: ReminderRequest): Promise&lt;number&gt;; | Publishes a scheduled reminder.<br>The maximum number of valid notifications (excluding expired ones that will not pop up again) is 30 for one application and 2000 for the entire system. |
| ------------------------------------------------------------ | ------------------------------------------------------------ | | function cancelReminder(reminderId: number, callback: AsyncCallback&lt;void&gt;): void;<br>function cancelReminder(reminderId: number): Promise&lt;void&gt;; | Cancels a specified reminder. (The value of **reminderId** is obtained from the return value of **publishReminder**.)|
| function publishReminder(reminderReq: ReminderRequest, callback: AsyncCallback\<number>): void;<br>function publishReminder(reminderReq: ReminderRequest): Promise\<number>; | Publishes a scheduled reminder.<br>The maximum number of valid notifications (excluding expired ones that will not pop up again) is 30 for one application and 2000 for the entire system. | | function getValidReminders(callback: AsyncCallback&lt;Array&lt;ReminderRequest&gt;&gt;): void;<br>function getValidReminders(): Promise&lt;Array&lt;ReminderRequest&gt;&gt;; | Obtains all valid reminders set by the current application.|
| function cancelReminder(reminderId: number, callback: AsyncCallback\<void>): void;<br/>function cancelReminder(reminderId: number): Promise\<void>; | Cancels a specified reminder. (The value of **reminderId** is obtained from the return value of **publishReminder**.) | | function cancelAllReminders(callback: AsyncCallback&lt;void&gt;): void;<br>function cancelAllReminders(): Promise&lt;void&gt;; | Cancels all reminders set by the current application.|
| function getValidReminders(callback: AsyncCallback<Array\<ReminderRequest>>): void;<br/>function getValidReminders(): Promise<Array\<ReminderRequest>>; | Obtains all valid reminders set by the current application. | | function addNotificationSlot(slot: NotificationSlot, callback: AsyncCallback&lt;void&gt;): void;<br>function addNotificationSlot(slot: NotificationSlot): Promise&lt;void&gt;; | Registers a **NotificationSlot** instance to be used by the reminder. |
| function cancelAllReminders(callback: AsyncCallback\<void>): void;<br/>function cancelAllReminders(): Promise\<void>; | Cancels all reminders set by the current application. | | function removeNotificationSlot(slotType: notification.SlotType, callback: AsyncCallback&lt;void&gt;): void;<br>function removeNotificationSlot(slotType: notification.SlotType): Promise&lt;void&gt;; | Removes a **NotificationSlot** instance of a specified type. |
| function addNotificationSlot(slot: NotificationSlot, callback: AsyncCallback\<void>): void;<br/>function addNotificationSlot(slot: NotificationSlot): Promise<void>; | Registers a NotificationSlot instance to be used by the reminder. |
| function removeNotificationSlot(slotType: notification.SlotType, callback: AsyncCallback\<void>): void;function removeNotificationSlot(slotType: notification.SlotType): Promise\<void>; | Removes a NotificationSlot instance of a specified type. |
**ActionButtonType** enumerates types of buttons displayed in a reminder notification. **ActionButtonType** enumerates types of buttons displayed in a reminder notification.
**Table 2** ActionButtonType enumeration **Table 2** ActionButtonType enums
| Name| Description|
| Name | Description | | -------- | -------- |
| ------------------------ | ------------------------------------------------------------ | | ACTION_BUTTON_TYPE_CLOSE | Close button, which can stop the reminder alert tone, close the reminder notification, and cancel the reminder snoozing.|
| ACTION_BUTTON_TYPE_CLOSE | Close button, which can be tapped to stop the reminder alert tone, close the reminder notification, and cancel the reminder snoozing. | | ACTION_BUTTON_TYPE_SNOOZE | Snooze button, which can snooze the reminder.|
**ReminderType** enumerates the reminder types. **ReminderType** enumerates the reminder types.
**Table 3** ReminderType enumeration **Table 3** ReminderType enums
| Name | Description | | Name| Description|
| ---------------------- | ------------------- | | -------- | -------- |
| REMINDER_TYPE_TIMER | Countdown reminder. | | REMINDER_TYPE_TIMER | Countdown reminder.|
| REMINDER_TYPE_CALENDAR | Calendar reminder. | | REMINDER_TYPE_CALENDAR | Calendar reminder.|
| REMINDER_TYPE_ALARM | Alarm reminder. | | REMINDER_TYPE_ALARM | Alarm reminder.|
**ActionButton** defines a button displayed in the reminder notification. **ActionButton** defines a button displayed in the reminder notification.
**Table 4** ActionButton instance **Table 4** ActionButton
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| Name | Type | Mandatory | Description | | title | string | Yes| Text on the button.|
| ----- | ---------------- | --------- | ------------------- | | type | ActionButtonType | Yes| Button type.|
| title | string | Yes | Text on the button. |
| type | ActionButtonType | Yes | Button type. |
**WantAgent** sets the package and ability that are redirected to when the reminder notification is clicked. **WantAgent** sets the package and ability that are redirected to when the reminder notification is clicked.
**Table 5** WantAgent instance **Table 5** WantAgent
| Name | Type | Mandatory | Description | | Name| Type| Mandatory| Description|
| ----------- | ------ | --------- | ------------------------------------------------------------ | | -------- | -------- | -------- | -------- |
| pkgName | string | Yes | Name of the package redirected to when the reminder notification is clicked. | | pkgName | string | Yes| Name of the package redirected to when the reminder notification is clicked.|
| abilityName | string | Yes | Name of the ability redirected to when the reminder notification is clicked. | | abilityName | string | Yes| Name of the ability redirected to when the reminder notification is clicked.|
**MaxScreenWantAgent** sets the name of the target package and ability to start automatically when the reminder arrives and the device is not in use. If the device is in use, a notification will be displayed. **MaxScreenWantAgent** sets the name of the target package and ability to start automatically when the reminder arrives and the device is not in use. If the device is in use, a notification will be displayed.
**Table 6** MaxScreenWantAgent instance **Table 6** MaxScreenWantAgent
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| Name | Type | Mandatory | Description | | pkgName | string | Yes| Name of the package that is automatically started when the reminder arrives and the device is not in use.|
| ----------- | ------ | --------- | ------------------------------------------------------------ | | abilityName | string | Yes| Name of the ability that is automatically started when the reminder arrives and the device is not in use.|
| pkgName | string | Yes | Name of the package that is automatically started when the reminder arrives and the device is not in use. |
| abilityName | string | Yes | Name of the ability that is automatically started when the reminder arrives and the device is not in use. |
**ReminderRequest** defines the reminder to publish. **ReminderRequest** defines the reminder to publish.
**Table 7** ReminderRequest instance **Table 7** ReminderRequest
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| Name | Type | Mandatory | Description | | reminderType | ReminderType | Yes| Type of the reminder.|
| ------------------ | ------------------------------ | --------- | ------------------------------------------------------------ | | actionButton | [ActionButton?,ActionButton?] | No| Action button displayed in the reminder notification.|
| reminderType | ReminderType | Yes | Type of the reminder. | | wantAgent | WantAgent | No| Information about the ability that is redirected to when the notification is clicked.|
| actionButton | [ActionButton?, ActionButton?] | No | Action button displayed in the reminder notification. | | maxScreenWantAgent | MaxScreenWantAgent | No| Information about the ability that is automatically started when the reminder arrives. If the device is in use, a notification will be displayed.|
| wantAgent | WantAgent | No | Information about the ability that is redirected to when the notification is clicked. | | ringDuration | number | No| Ring duration.|
| maxScreenWantAgent | MaxScreenWantAgent | No | Information about the ability that is automatically started when the reminder arrives. If the device is in use, a notification will be displayed. | | snoozeTimes | number | No| Number of reminder snooze times.|
| ringDuration | number | No | Ring duration. | | timeInterval | number | No| Reminder snooze interval.|
| snoozeTimes | number | No | Number of reminder snooze times. | | title | string | No| Reminder title.|
| timeInterval | number | No | Reminder snooze interval. | | content | string | No| Reminder content.|
| title | string | No | Reminder title. | | expiredContent | string | No| Extended content to be displayed when the reminder expires.|
| content | string | No | Reminder content. | | snoozeContent | string | No| Extended content to be displayed when the reminder is snoozing.|
| expiredContent | string | No | Extended content to be displayed when the reminder expires. | | notificationId | number | No| Notification ID used by the reminder. For details, see **NotificationRequest::SetNotificationId(int32_t id)**.|
| snoozeContent | string | No | Extended content to be displayed when the reminder is snoozing. | | slotType | SlotType | No| Type of the slot used by the reminder. |
| notificationId | number | No | Notification ID used by the reminder. For details, see the API reference of the **NotificationRequest.setNotificationId(int id)** method. |
| slotType | SlotType | No | Type of the slot used by the reminder. |
**ReminderRequestCalendar** extends **ReminderRequest** and defines a reminder for a calendar event. **ReminderRequestCalendar** extends **ReminderRequest** and defines a reminder for a calendar event.
For the application to run properly, if both **repeatMonths** and **repeatDays** are not specified, the earliest reminder time must be later than the current time. For the application to run properly, if both **repeatMonths** and **repeatDays** are not specified, the earliest reminder time must be later than the current time.
**Table 8** ReminderRequestCalendar instance **Table 8** ReminderRequestCalendar
| Name | Type | Mandatory | Description | | Name| Type| Mandatory| Description|
| ------------ | -------------- | --------- | ------------------------------------------------------------ | | -------- | -------- | -------- | -------- |
| dateTime | LocalDateTime | Yes | Reminder time, accurate to the minute. | | dateTime | LocalDateTime | Yes| Reminder time, accurate to the minute.|
| repeatMonths | Array\<number> | No | Months in which the reminder repeats. The value range is 1 to 12. | | repeatMonths | Array&lt;number&gt; | No| Months in which the reminder repeats. The value range is 1 to 12.|
| repeatDays | Array\<number> | No | Date on which the reminder repeats. The value range is 1 to 31. | | repeatDays | Array&lt;number&gt; | No| Date on which the reminder repeats. The value range is 1 to 31.|
**ReminderRequestAlarm** extends **ReminderRequest** and defines a reminder for the alarm clock. **ReminderRequestAlarm** extends **ReminderRequest** and defines a reminder for the alarm clock.
**Table 9** ReminderRequestAlarm instance **Table 9** ReminderRequestAlarm
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| Name | Type | Mandatory | Description | | hour | number | Yes| Hour portion of the reminder time. The value range is 0 to 23.|
| ---------- | -------------- | --------- | ------------------------------------------------------------ | | minute | number | Yes| Minute portion of the reminder time. The value range is 0 to 59.|
| hour | number | Yes | Hour portion of the reminder time. The value range is 0 to 23. | | daysOfWeek | Array&lt;number&gt; | No| Days of a week when the reminder repeats. The value range is 1 to 7.|
| minute | number | Yes | Minute portion of the reminder time. The value range is 0 to 59. |
| daysOfWeek | Array\<number> | No | Days of a week when the reminder repeats. The value range is 1 to 7. |
**ReminderRequestTimer** extends **ReminderRequest** and defines a reminder for a scheduled timer. **ReminderRequestTimer** extends **ReminderRequest** and defines a reminder for a scheduled timer.
**Table 10** ReminderRequestTimer instance **Table 10** ReminderRequestTimer
| Name| Type| Mandatory| Description|
| Name | Type | Mandatory | Description | | -------- | -------- | -------- | -------- |
| -------------------- | ------ | --------- | ----------------------------------------- | | triggerTimeInSeconds | number | Yes| Number of seconds in the countdown timer.|
| triggerTimeInSeconds | number | Yes | Number of seconds in the countdown timer. |
**LocalDateTime** defines a **LocalDateTime** instance. **LocalDateTime** defines a **LocalDateTime** instance.
**Table 11** LocalDateTime instance **Table 11** LocalDateTime
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| year | number | Yes| Year.|
| month | number | Yes| Month.|
| day | number | Yes| Date.|
| hour | number | Yes| Hour.|
| minute | number | Yes| Minute.|
| second | number | No| Second.|
| Name | Type | Mandatory | Description |
| ------ | ------ | --------- | ----------- |
| year | number | Yes | Year. |
| month | number | Yes | Month. |
| day | number | Yes | Date. |
| hour | number | Yes | Hour. |
| minute | number | Yes | Minute. |
| second | number | No | Second. |
## How to Develop ## How to Develop
> **NOTE** > **NOTE**
>
> To publish a reminder, your application needs to apply for the **ohos.permission.PUBLISH_AGENT_REMINDER** permission. > To publish a reminder, your application needs to apply for the **ohos.permission.PUBLISH_AGENT_REMINDER** permission.
Publish a 10-second countdown reminder. Publish a 10-second countdown reminder.
1. Define a countdown timer instance. 1. Define a countdown timer instance.
``` ```
import reminderAgent from '@ohos.reminderAgent'; import reminderAgent from '@ohos.reminderAgent';
import notification from '@ohos.notification'; import notification from '@ohos.notification';
export default { export default {
// In JS Project: // For a JS project:
// timer: { // timer: {
// In eTS Project: // For an eTS project:
let timer : reminderAgent.ReminderRequestTimer = { let timer : reminderAgent.ReminderRequestTimer = {
reminderType: reminderAgent.ReminderType.REMINDER_TYPE_TIMER, reminderType: reminderAgent.ReminderType.REMINDER_TYPE_TIMER,
triggerTimeInSeconds: 10, triggerTimeInSeconds: 10,
...@@ -192,7 +173,6 @@ Publish a 10-second countdown reminder. ...@@ -192,7 +173,6 @@ Publish a 10-second countdown reminder.
``` ```
2. Publish the reminder. 2. Publish the reminder.
``` ```
startTimer() { startTimer() {
reminderAgent.publishReminder(this.timer, (err, reminderId) =>{ reminderAgent.publishReminder(this.timer, (err, reminderId) =>{
...@@ -203,7 +183,6 @@ Publish a 10-second countdown reminder. ...@@ -203,7 +183,6 @@ Publish a 10-second countdown reminder.
``` ```
HML page code: HML page code:
``` ```
<div class="container"> <div class="container">
<button type="text" value="publishReminder" onclick="startTimer"></button> <button type="text" value="publishReminder" onclick="startTimer"></button>
...@@ -213,9 +192,9 @@ Publish a 10-second countdown reminder. ...@@ -213,9 +192,9 @@ Publish a 10-second countdown reminder.
Sample code for defining a calendar reminder instance: Sample code for defining a calendar reminder instance:
``` ```
// In JS Project: // For a JS project:
// calendar: { // calendar: {
// In eTS Project: // For an eTS project:
let calendar : reminderAgent.ReminderRequestCalendar = { let calendar : reminderAgent.ReminderRequestCalendar = {
reminderType: reminderAgent.ReminderType.REMINDER_TYPE_CALENDAR, reminderType: reminderAgent.ReminderType.REMINDER_TYPE_CALENDAR,
dateTime: { dateTime: {
...@@ -261,9 +240,9 @@ let calendar : reminderAgent.ReminderRequestCalendar = { ...@@ -261,9 +240,9 @@ let calendar : reminderAgent.ReminderRequestCalendar = {
Sample code for defining an alarm reminder instance: Sample code for defining an alarm reminder instance:
``` ```
// In JS Project: // For a JS project:
// alarm: { // alarm: {
// In eTS Project: // For an eTS project:
let alarm : reminderAgent.ReminderRequestAlarm = { let alarm : reminderAgent.ReminderRequestAlarm = {
reminderType: reminderAgent.ReminderType.REMINDER_TYPE_ALARM, reminderType: reminderAgent.ReminderType.REMINDER_TYPE_ALARM,
hour: 11, hour: 11,
...@@ -297,4 +276,5 @@ let alarm : reminderAgent.ReminderRequestAlarm = { ...@@ -297,4 +276,5 @@ let alarm : reminderAgent.ReminderRequestAlarm = {
notificationId: 100, notificationId: 100,
slotType: notification.SlotType.SOCIAL_COMMUNICATION slotType: notification.SlotType.SOCIAL_COMMUNICATION
} }
``` ```
\ No newline at end of file
...@@ -26,14 +26,14 @@ Blank(min?: Length) ...@@ -26,14 +26,14 @@ Blank(min?: Length)
- Parameters - Parameters
| Name | Type | Mandatory | Default Value | Description | | Name | Type | Mandatory | Default Value | Description |
| -------- | -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- | -------- |
| min | Length | No | 0 | Minimum size of the **&lt;Blank&gt;** component in the container along the main axis. | | min | [Length](../../ui/ts-types.md) | No | 0 | Minimum size of the **&lt;Blank&gt;** component in the container along the main axis. |
## Attributes ## Attributes
| Name | Type | Default Value | Description | | Name | Type | Default Value | Description |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| color | [ResourceColor](../../ui/ts-types.md) | 0x00000000 | Color to fill the blank. | | color | [ResourceColor](../../ui/ts-types.md) | 0xffffff | Color to fill the blank. |
> **NOTE** > **NOTE**
> >
......
# SideBarContainer # SideBarContainer
> **NOTE**<br> > **NOTE**
> This component is supported since API version 8. Updates will be marked with a superscript to indicate their earliest API version. >
> This component is supported since API version 8. Updates will be marked with a superscript to indicate their earliest API version.
The **\<SideBarContainer>** component contains a sidebar and content area as its child components. The sidebar is the first child component and can be shown or hidden as needed. The content area is the second child component. The **\<SideBarContainer>** component contains a sidebar and content area as its child components. The sidebar is the first child component and can be shown or hidden as needed. The content area is the second child component.
...@@ -39,10 +40,11 @@ SideBarContainer( type?: SideBarContainerType ) ...@@ -39,10 +40,11 @@ SideBarContainer( type?: SideBarContainerType )
| showSideBar | boolean | true | Whether to display the sidebar.| | showSideBar | boolean | true | Whether to display the sidebar.|
| controlButton | ButtonStyle | - | Attributes of the sidebar control button.| | controlButton | ButtonStyle | - | Attributes of the sidebar control button.|
| showControlButton | boolean | true | Whether to display the sidebar control button.| | showControlButton | boolean | true | Whether to display the sidebar control button.|
| sideBarWidth | number \| [Length<sup>9+</sup>](../../ui/ts-types.md) | 200 | Width of the sidebar.| | sideBarWidth | number \| [Length<sup>9+</sup>](../../ui/ts-types.md#length-type)| 200 | Width of the sidebar.|
| minSideBarWidth | number \| [Length<sup>9+</sup>](../../ui/ts-types.md) | 200 | Minimum width of the sidebar.| | minSideBarWidth | number \| [Length<sup>9+</sup>](../../ui/ts-types.md#length-type)| 200 | Minimum width of the sidebar.|
| maxSideBarWidth | number \| [Length<sup>9+</sup>](../../ui/ts-types.md) | 280 | Maximum width of the sidebar.| | maxSideBarWidth | number \| [Length<sup>9+</sup>](../../ui/ts-types.md#length-type)| 280 | Maximum width of the sidebar.|
| autoHide<sup>9+</sup> | boolean | true | Whether to automatically hide the sidebar when it is dragged to be smaller than the minimum width.| | autoHide<sup>9+</sup> | boolean | true | Whether to automatically hide the sidebar when it is dragged to be smaller than the minimum width.|
| sideBarPosition<sup>9+</sup> | SideBarPosition | SideBarPosition.Start | Position of the sidebar.|
- ButtonStyle - ButtonStyle
| Name| Type| Mandatory| Default Value| Description| | Name| Type| Mandatory| Default Value| Description|
...@@ -53,6 +55,11 @@ SideBarContainer( type?: SideBarContainerType ) ...@@ -53,6 +55,11 @@ SideBarContainer( type?: SideBarContainerType )
| height | number | No| 32 | Height of the sidebar control button.| | height | number | No| 32 | Height of the sidebar control button.|
| icons | {<br>shown:&nbsp;string \| PixelMap \| [Resource](../../ui/ts-types.md) ,<br>hidden:&nbsp;string \| PixelMap \| [Resource](../../ui/ts-types.md) ,<br>switching?:&nbsp;string \| PixelMap \| [Resource](../../ui/ts-types.md) <br>} | No| - | Icons of the sidebar control button.<br> </p> - **shown**: icon of the control button when the sidebar is shown.<br>- **hidden**: icon of the control button when the sidebar is hidden.<br>- **switching**: icon of the control button when the sidebar is switching between the shown and hidden states.| | icons | {<br>shown:&nbsp;string \| PixelMap \| [Resource](../../ui/ts-types.md) ,<br>hidden:&nbsp;string \| PixelMap \| [Resource](../../ui/ts-types.md) ,<br>switching?:&nbsp;string \| PixelMap \| [Resource](../../ui/ts-types.md) <br>} | No| - | Icons of the sidebar control button.<br> </p> - **shown**: icon of the control button when the sidebar is shown.<br>- **hidden**: icon of the control button when the sidebar is hidden.<br>- **switching**: icon of the control button when the sidebar is switching between the shown and hidden states.|
- SideBarPosition<sup>9+</sup>
| Name| Description|
| -------- | -------- |
| Start | The sidebar is on the left side of the container.|
| End | The sidebar is on the right side of the container.|
...@@ -60,12 +67,13 @@ SideBarContainer( type?: SideBarContainerType ) ...@@ -60,12 +67,13 @@ SideBarContainer( type?: SideBarContainerType )
| Name| Description| | Name| Description|
| -------- | -------- | | -------- | -------- |
| onChange(callback: (value: boolean) =&gt; void) | Triggered when the status of the sidebar switches between shown and hidden. <p>The value **true** means that the sidebar is shown, and **false** means the opposite. | | onChange(callback: (value: boolean) =&gt; void) | Triggered when the status of the sidebar switches between shown and hidden. <p>The value **true** means that the sidebar is shown, and **false** means the opposite.|
## Example ## Example
``` ```ts
// xxx.ets
@Entry @Entry
@Component @Component
struct SideBarContainerExample { struct SideBarContainerExample {
......
# Path # Path
> **NOTE**<br> > **NOTE**
>
> This component is supported since API version 7. Updates will be marked with a superscript to indicate their earliest API version. > This component is supported since API version 7. Updates will be marked with a superscript to indicate their earliest API version.
...@@ -15,16 +16,16 @@ None ...@@ -15,16 +16,16 @@ None
## Child Components ## Child Components
None Not supported
## Attributes ## Attributes
| Name | Type | Default Value | Mandatory | Description | | Name | Type | Default Value | Mandatory | Description |
| -------- | -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- | -------- |
| width | Length | 0 | No | Width of the rectangle where the path is located. | | width | Length | 0 | No | Width of the rectangle where the path is located. |
| height | Length | 0 | No | Height of the rectangle where the path is located. | | height | Length | 0 | No | Height of the rectangle where the path is located. |
| commands | string | '' | Yes | Commands for drawing the path. | | commands | string | '' | Yes | Commands for drawing the path. |
The supported commands are as follows: The supported commands are as follows:
...@@ -56,7 +57,7 @@ For example, the command **M0 20 L50 50 L50 100 Z** defines a path that starts f ...@@ -56,7 +57,7 @@ For example, the command **M0 20 L50 50 L50 100 Z** defines a path that starts f
## Example ## Example
```ts ```ts
@Entry @Entry
@Component @Component
......
# Menu # Menu
The menu bound to a component through [bindContextMenu](./ts-universal-attributes-menu.md#Atrributes) on a page can be closed as needed. The menu bound to a component through [bindContextMenu](../ts-universal-attributes-menu.md#atrributes) on a page can be closed as needed.
> **NOTE** > **NOTE**
> >
> The APIs of this module are supported since API version 8. Updates will be marked with a superscript to indicate their earliest API version. > The APIs of this module are supported since API version 8. Updates will be marked with a superscript to indicate their earliest API version.
## Required Permissions ## Required Permissions
...@@ -13,9 +13,9 @@ None ...@@ -13,9 +13,9 @@ None
## ContextMenu.close ## ContextMenu.close
| API | Description | |Name|Description|
| ---- | --- | |----|---|
|close(): void| Closes the menu bound to this component through [bindContextMenu](./ts-universal-attributes-menu.md#Atrributes) on a page. | | close(): void | Closes the menu bound to this component through [bindContextMenu](../ts-universal-attributes-menu.md#atrributes) on a page. |
## Example ## Example
......
# Grid # Grid
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE** > **NOTE**
>
> - This attribute is supported since API version 7. Updates will be marked with a superscript to indicate their earliest API version. > - This attribute is supported since API version 7. Updates will be marked with a superscript to indicate their earliest API version.
> >
> - The column width and column gap in the grid layout are determined by the nearest parent component **GridContainer**. The component tree that uses grid attributes must contain one **GridContainer** or more. > - The column width and column gap in the grid layout are determined by the nearest parent component **GridContainer**. The component tree that uses grid attributes must contain one **GridContainer** or more.
...@@ -15,17 +16,18 @@ None ...@@ -15,17 +16,18 @@ None
## Attributes ## Attributes
| Name | Type | Default Value | Description | | Name | Type | Default Value | Description |
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| useSizeType | {<br/>xs?: number \| { span: number, offset: number },<br/>sm?: number \| { span: number, offset: number },<br/>md?: number \| { span: number, offset: number },<br/>lg?: number \| { span: number, offset: number }<br/>} | - | Number of occupied columns and offset columns for a specific device width type. **span** indicates the number of occupied columns, and **offset** indicates the number of offset columns.<br/>If the value is of the number type, only the number of columns can be set. If the value is in the format of {"span": 1, "offset": 0}, both the number of occupied columns and the number of offset columns need to be set.<br/>- **xs** indicates that the device width type is **SizeType.XS**.<br/>- **sm** indicates that the device width type is **SizeType.SM**.<br/>- **md** indicates that the device width type is **SizeType.MD**.<br/>- **lg** indicates that the device width type is **SizeType.LG**. | | useSizeType | {<br/>xs?: number \| { span: number, offset: number },<br/>sm?: number \| { span: number, offset: number },<br/>md?: number \| { span: number, offset: number },<br/>lg?: number \| { span: number, offset: number }<br/>} | - | Number of occupied columns and offset columns for a specific device width type. **span** indicates the number of occupied columns, and **offset** indicates the number of offset columns.<br/>If the value is of the number type, only the number of columns can be set. If the value is in the format of {"span": 1, "offset": 0}, both the number of occupied columns and the number of offset columns need to be set.<br/>- **xs** indicates that the device width type is **SizeType.XS**.<br/>- **sm** indicates that the device width type is **SizeType.SM**.<br/>- **md** indicates that the device width type is **SizeType.MD**.<br/>- **lg** indicates that the device width type is **SizeType.LG**. |
| gridSpan | number | 1 | Default number of occupied columns, that is, the number of occupied columns when **span** in **useSizeType** is not set.<br/>> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**<br/>> If the **span** attribute is set, the component width is determined by the grid layout. | | gridSpan | number | 1 | Default number of occupied columns, that is, the number of occupied columns when **span** in **useSizeType** is not set.<br/>> **NOTE**<br/>> If the **span** attribute is set, the component width is determined by the grid layout. |
| gridOffset | number | 0 | Default number of offset columns, that is, the number of offset columns in the start direction of the parent component (which is also the nth column that the component is in) when **offset** in **useSizeType** is not set.<br/>> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**<br/>> 1. After this attribute is set, the horizontal layout of the current component does not follow the original layout of the parent component. Instead, it offsets along the start direction of the parent component.<br/>> <br/>> 2. Offset = (Column width + Gap) x Number of columns<br/>> <br/>> 3. After this attribute is set, sibling components will be arranged relatively to this component, as in the relative layout. | | gridOffset | number | 0 | Default number of offset columns, that is, the number of offset columns in the start direction of the parent component (which is also the nth column that the component is in) when **offset** in **useSizeType** is not set.<br/>> **NOTE**<br/>> 1. After this attribute is set, the horizontal layout of the current component does not follow the original layout of the parent component. Instead, it offsets along the start direction of the parent component.<br/>> 2. Offset = (Column width + Gap) x Number of columns<br/>> 3. After this attribute is set, sibling components will be arranged relatively to this component, as in the relative layout. |
## Example ## Example
``` ```ts
// xxx.ets
@Entry @Entry
@Component @Component
struct GridContainerExample1 { struct GridContainerExample1 {
...@@ -68,11 +70,14 @@ struct GridContainerExample1 { ...@@ -68,11 +70,14 @@ struct GridContainerExample1 {
} }
``` ```
**Figure1** Device width type SM **Figure 1** Device width type SM
![en-us_image_0000001256858405](figures/en-us_image_0000001256858405.png) ![en-us_image_0000001256858405](figures/en-us_image_0000001256858405.png)
**Figure2** Device width type MD **Figure 2** Device width type MD
![en-us_image_0000001257058415](figures/en-us_image_0000001257058415.png) ![en-us_image_0000001257058415](figures/en-us_image_0000001257058415.png)
**Figure3** Device width type LG **Figure 3** Device width type LG
![en-us_image_0000001212378416](figures/en-us_image_0000001212378416.png) ![en-us_image_0000001212378416](figures/en-us_image_0000001212378416.png)
# Event Configuration # Event Configuration
You can use event methods to configure events supported by components. Since API version 9, you can obtain the context associated with the current component from the callback. For details, see [Obtaining the Context on an eTS Page](../ability/context-userguide.md).
You can use event methods to configure events supported by components.
- Example of using a lambda expression to configure the event of a component: - Example of using a lambda expression to configure the event of a component:
```ts ```ts
// Counter is a private data variable defined in the component. // Counter is a private data variable defined in the component.
Button('add counter') Button('add counter')
...@@ -15,8 +13,7 @@ You can use event methods to configure events supported by components. ...@@ -15,8 +13,7 @@ You can use event methods to configure events supported by components.
``` ```
- When using an anonymous function expression to configure the event of a component, bind must be used to ensure that the contained components are referenced by this in the function body. - When using an anonymous function expression to configure the event of a component, **bind** must be used to ensure that the contained components are referenced by **this** in the function body.
```ts ```ts
// Counter is a private data variable defined in the component. // Counter is a private data variable defined in the component.
Button('add counter') Button('add counter')
...@@ -27,14 +24,13 @@ You can use event methods to configure events supported by components. ...@@ -27,14 +24,13 @@ You can use event methods to configure events supported by components.
- Example of using a component's member function to configure the event of the component: - Example of using a component's member function to configure the event of the component:
```ts ```ts
myClickHandler(): void { myClickHandler(): void {
// do something // do something
} }
... ...
Button('add counter') Button('add counter')
.onClick(this.myClickHandler) .onClick(this.myClickHandler)
``` ```
...@@ -11,7 +11,7 @@ When referencing resources in the **rawfile** sub-directory, use the ```"$rawfil ...@@ -11,7 +11,7 @@ When referencing resources in the **rawfile** sub-directory, use the ```"$rawfil
> >
> Resource descriptors accept only strings, such as `'app.type.name'`, and cannot be combined. > Resource descriptors accept only strings, such as `'app.type.name'`, and cannot be combined.
> >
> `$r` returns a **Resource** object. To obtain the corresponding string, use [getString](../../reference/apis/js-apis-resource-manager.md#getstring). > `$r` returns a **Resource** object. To obtain the corresponding string, use [getString](../reference/apis/js-apis-resource-manager.md#getstring).
In the **.ets** file, you can use the resources defined in the **resources** directory. In the **.ets** file, you can use the resources defined in the **resources** directory.
......
...@@ -109,50 +109,45 @@ HCTest and the C language are used to develop test cases. HCTest is enhanced and ...@@ -109,50 +109,45 @@ HCTest and the C language are used to develop test cases. HCTest is enhanced and
│ └──build_lite │ └──build_lite
│ │ └── BUILD.gn │ │ └── BUILD.gn
``` ```
2. Write the test case in the **src** directory. 2. Write the test case in the **src** directory.
(1) Include the test framework header file. (1) Include the test framework header file.
``` ```
#include "hctest.h" #include "hctest.h"
``` ```
(2) Use the **LITE_TEST_SUIT** macro to define names of the subsystem, module, and test suite. (2) Use the **LITE_TEST_SUIT** macro to define names of the subsystem, module, and test suite.
``` ```
/** /**
* @brief register a test suite named "IntTestSuite" * @brief register a test suite named "IntTestSuite"
* @param test subsystem name * @param test subsystem name
* @param example module name * @param example module name
* @param IntTestSuite test suite name * @param IntTestSuite test suite name
*/ */
LITE_TEST_SUIT(test, example, IntTestSuite); LITE_TEST_SUIT(test, example, IntTestSuite);
``` ```
(3) Define Setup and TearDown. (3) Define Setup and TearDown.
Format: Test suite name+Setup, Test suite name+TearDown. ​ Format: Test suite name+Setup, Test suite name+TearDown.
The Setup and TearDown functions must exist, but function bodies can be empty.
(4) Use the **LITE_TEST_CASE** macro to write the test case.
Three parameters are involved: test suite name, test case name, and test case properties (including type, granularity, and level). ​ The Setup and TearDown functions must exist, but function bodies can be empty.
```
LITE_TEST_CASE(IntTestSuite, TestCase001, Function | MediumTest | Level1)
{
// Do something.
};
```
(5) Use the **RUN_TEST_SUITE** macro to register the test suite.
``` (4) Use the **LITE_TEST_CASE** macro to write the test case.
RUN_TEST_SUITE(IntTestSuite);
```
​ Three parameters are involved: test suite name, test case name, and test case properties (including type, granularity, and level).
```
LITE_TEST_CASE(IntTestSuite, TestCase001, Function | MediumTest | Level1)
{
// Do something.
};
```
(5) Use the **RUN_TEST_SUITE** macro to register the test suite.
```
RUN_TEST_SUITE(IntTestSuite);
```
3. Create the configuration file (**BUILD.gn**) of the test module. 3. Create the configuration file (**BUILD.gn**) of the test module.
Create a **BUILD.gn** (example) file in each test module directory, and specify the name of the built static library and its dependent header files and libraries. Create a **BUILD.gn** (example) file in each test module directory, and specify the name of the built static library and its dependent header files and libraries.
......
...@@ -156,8 +156,8 @@ FormProvider类具体的API详见[接口文档](../reference/apis/js-apis-formpr ...@@ -156,8 +156,8 @@ FormProvider类具体的API详见[接口文档](../reference/apis/js-apis-formpr
| supportDimensions | 表示卡片支持的外观规格,取值范围:<br />1 * 2:表示1行2列的二宫格。<br />2 * 2:表示2行2列的四宫格。<br />2 * 4:表示2行4列的八宫格。<br />4 * 4:表示4行4列的十六宫格。 | 字符串数组 | 否 | | supportDimensions | 表示卡片支持的外观规格,取值范围:<br />1 * 2:表示1行2列的二宫格。<br />2 * 2:表示2行2列的四宫格。<br />2 * 4:表示2行4列的八宫格。<br />4 * 4:表示4行4列的十六宫格。 | 字符串数组 | 否 |
| defaultDimension | 表示卡片的默认外观规格,取值必须在该卡片supportDimensions配置的列表中。 | 字符串 | 否 | | defaultDimension | 表示卡片的默认外观规格,取值必须在该卡片supportDimensions配置的列表中。 | 字符串 | 否 |
| updateEnabled | 表示卡片是否支持周期性刷新,取值范围:<br />true:表示支持周期性刷新,可以在定时刷新(updateDuration)和定点刷新(scheduledUpdateTime)两种方式任选其一,优先选择定时刷新。<br />false:表示不支持周期性刷新。 | 布尔类型 | 否 | | updateEnabled | 表示卡片是否支持周期性刷新,取值范围:<br />true:表示支持周期性刷新,可以在定时刷新(updateDuration)和定点刷新(scheduledUpdateTime)两种方式任选其一,优先选择定时刷新。<br />false:表示不支持周期性刷新。 | 布尔类型 | 否 |
| scheduledUpdateTime | 表示卡片的定点刷新的时刻,采用24小时制,精确到分钟。 | 字符串 | 可缺省,缺省值为“0:0”。 | | scheduledUpdateTime | 表示卡片的定点刷新的时刻,采用24小时制,精确到分钟。<br />updateDuration参数优先级高于scheduledUpdateTime,两者同时配置时,以updateDuration配置的刷新时间为准。 | 字符串 | 可缺省,缺省值为“0:0”。 |
| updateDuration | 表示卡片定时刷新的更新周期,单位为30分钟,取值为自然数。<br />当取值为0时,表示该参数不生效。<br />当取值为正整数N时,表示刷新周期为30*N分钟。 | 数值 | 可缺省,缺省值为“0”。 | | updateDuration | 表示卡片定时刷新的更新周期,单位为30分钟,取值为自然数。<br />当取值为0时,表示该参数不生效。<br />当取值为正整数N时,表示刷新周期为30*N分钟。<br />updateDuration参数优先级高于scheduledUpdateTime,两者同时配置时,以updateDuration配置的刷新时间为准。 | 数值 | 可缺省,缺省值为“0”。 |
| formConfigAbility | 表示卡片的配置跳转链接,采用URI格式。 | 字符串 | 可缺省,缺省值为空。 | | formConfigAbility | 表示卡片的配置跳转链接,采用URI格式。 | 字符串 | 可缺省,缺省值为空。 |
| formVisibleNotify | 标识是否允许卡片使用卡片可见性通知。 | 字符串 | 可缺省,缺省值为空。 | | formVisibleNotify | 标识是否允许卡片使用卡片可见性通知。 | 字符串 | 可缺省,缺省值为空。 |
| jsComponentName | 表示JS卡片的Component名称。字符串最大长度为127字节。 | 字符串 | 否 | | jsComponentName | 表示JS卡片的Component名称。字符串最大长度为127字节。 | 字符串 | 否 |
...@@ -188,7 +188,6 @@ FormProvider类具体的API详见[接口文档](../reference/apis/js-apis-formpr ...@@ -188,7 +188,6 @@ FormProvider类具体的API详见[接口文档](../reference/apis/js-apis-formpr
"scheduledUpdateTime": "10:30", "scheduledUpdateTime": "10:30",
"supportDimensions": ["2*2"], "supportDimensions": ["2*2"],
"type": "JS", "type": "JS",
"updateDuration": 1,
"updateEnabled": true "updateEnabled": true
}] }]
}] }]
......
...@@ -175,8 +175,8 @@ FormProvider类具体的API介绍详见[接口文档](../reference/apis/js-apis- ...@@ -175,8 +175,8 @@ FormProvider类具体的API介绍详见[接口文档](../reference/apis/js-apis-
| supportDimensions | 表示卡片支持的外观规格,取值范围:<br />1 * 2:表示1行2列的二宫格。<br />2 * 2:表示2行2列的四宫格。<br />2 * 4:表示2行4列的八宫格。<br />4 * 4:表示4行4列的十六宫格。 | 字符串数组 | 否 | | supportDimensions | 表示卡片支持的外观规格,取值范围:<br />1 * 2:表示1行2列的二宫格。<br />2 * 2:表示2行2列的四宫格。<br />2 * 4:表示2行4列的八宫格。<br />4 * 4:表示4行4列的十六宫格。 | 字符串数组 | 否 |
| defaultDimension | 表示卡片的默认外观规格,取值必须在该卡片supportDimensions配置的列表中。 | 字符串 | 否 | | defaultDimension | 表示卡片的默认外观规格,取值必须在该卡片supportDimensions配置的列表中。 | 字符串 | 否 |
| updateEnabled | 表示卡片是否支持周期性刷新,取值范围:<br />true:表示支持周期性刷新,可以在定时刷新(updateDuration)和定点刷新(scheduledUpdateTime)两种方式任选其一,优先选择定时刷新。<br />false:表示不支持周期性刷新。 | 布尔类型 | 否 | | updateEnabled | 表示卡片是否支持周期性刷新,取值范围:<br />true:表示支持周期性刷新,可以在定时刷新(updateDuration)和定点刷新(scheduledUpdateTime)两种方式任选其一,优先选择定时刷新。<br />false:表示不支持周期性刷新。 | 布尔类型 | 否 |
| scheduledUpdateTime | 表示卡片的定点刷新的时刻,采用24小时制,精确到分钟。 | 字符串 | 可缺省,缺省值为“0:0”。 | | scheduledUpdateTime | 表示卡片的定点刷新的时刻,采用24小时制,精确到分钟。<br />updateDuration参数优先级高于scheduledUpdateTime,两者同时配置时,以updateDuration配置的刷新时间为准。 | 字符串 | 可缺省,缺省值为“0:0”。 |
| updateDuration | 表示卡片定时刷新的更新周期,单位为30分钟,取值为自然数。<br />当取值为0时,表示该参数不生效。<br />当取值为正整数N时,表示刷新周期为30*N分钟。 | 数值 | 可缺省,缺省值为“0”。 | | updateDuration | 表示卡片定时刷新的更新周期,单位为30分钟,取值为自然数。<br />当取值为0时,表示该参数不生效。<br />当取值为正整数N时,表示刷新周期为30*N分钟。<br />updateDuration参数优先级高于scheduledUpdateTime,两者同时配置时,以updateDuration配置的刷新时间为准。 | 数值 | 可缺省,缺省值为“0”。 |
| formConfigAbility | 表示卡片的配置跳转链接,采用URI格式。 | 字符串 | 可缺省,缺省值为空。 | | formConfigAbility | 表示卡片的配置跳转链接,采用URI格式。 | 字符串 | 可缺省,缺省值为空。 |
| formVisibleNotify | 标识是否允许卡片使用卡片可见性通知。 | 字符串 | 可缺省,缺省值为空。 | | formVisibleNotify | 标识是否允许卡片使用卡片可见性通知。 | 字符串 | 可缺省,缺省值为空。 |
| metaData | 表示卡片的自定义信息,包含customizeData数组标签。 | 对象 | 可缺省,缺省值为空。 | | metaData | 表示卡片的自定义信息,包含customizeData数组标签。 | 对象 | 可缺省,缺省值为空。 |
...@@ -199,7 +199,6 @@ FormProvider类具体的API介绍详见[接口文档](../reference/apis/js-apis- ...@@ -199,7 +199,6 @@ FormProvider类具体的API介绍详见[接口文档](../reference/apis/js-apis-
"defaultDimension": "2*2", "defaultDimension": "2*2",
"updateEnabled": true, "updateEnabled": true,
"scheduledUpdateTime": "10:30", "scheduledUpdateTime": "10:30",
"updateDuration": 1,
"formConfigAbility": "ability://ohos.samples.FormApplication.MainAbility" "formConfigAbility": "ability://ohos.samples.FormApplication.MainAbility"
}] }]
} }
......
...@@ -10,6 +10,8 @@ HTTP数据请求功能主要由http模块提供。 ...@@ -10,6 +10,8 @@ HTTP数据请求功能主要由http模块提供。
使用该功能需要申请ohos.permission.INTERNET权限。 使用该功能需要申请ohos.permission.INTERNET权限。
权限申请请参考[访问控制(权限)开发指导](../security/accesstoken-guidelines.md)
具体接口说明如下表。 具体接口说明如下表。
| 接口名 | 功能描述 | | 接口名 | 功能描述 |
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
7. 查询FA使用记录。返回数量最大不超过maxNum设置的值,FA使用记录由近及远排序,maxNum最大为1000,若不填写maxNum参数,则maxNum默认为1000。 7. 查询FA使用记录。返回数量最大不超过maxNum设置的值,FA使用记录由近及远排序,maxNum最大为1000,若不填写maxNum参数,则maxNum默认为1000。
8. 根据起止时间查询应用通知次数。 8. 根据起止时间查询应用通知次数。
9. 根据起止时间查询系统事件(休眠、唤醒、解锁、锁屏)统计信息。 9. 根据起止时间查询系统事件(休眠、唤醒、解锁、锁屏)统计信息。
9. 查询调用者应用或指定应用的优先级群组。 10. 查询调用者应用或指定应用的优先级群组。
- 设置接口 - 设置接口
...@@ -29,11 +29,11 @@ ...@@ -29,11 +29,11 @@
- 注册接口 - 注册接口
1. 注册应用分组变化回调监听,当应用分组发生变化,会给所有已注册的应用返回变化信息 1. 注册应用分组变化回调监听,当应用分组发生变化,会给所有已注册的应用返回变化信息
- 解注册接口 -注册接口
1. 解除注册应用分组变化回调监听 1. 解除注册应用分组变化回调监听
### 设备使用信息统计使用权限 ### 设备使用信息统计使用权限
- 设备使用信息统计的queryBundleActiveStates、queryBundleStateInfos、queryBundleStateInfoByInterval、queryBundleActiveEventStates、queryAppNotificationNumber、queryAppUsagePriorityGroup(bundleName?)、setBundleGroup、registerGroupCallBack、unRegisterGroupCallBack接口为系统api,调用前需要申请ohos.permission.BUNDLE_ACTIVE_INFO权限。 - 设备使用信息统计的queryBundleActiveStates、queryBundleStateInfos、queryBundleStateInfoByInterval、queryBundleActiveEventStates、queryAppNotificationNumber、queryAppUsagePriorityGroup(bundleName?)、setBundleGroup、registerGroupCallBack、unRegisterGroupCallBack接口为系统api,调用前需要申请ohos.permission.BUNDLE_ACTIVE_INFO权限。
......
...@@ -95,7 +95,7 @@ IDE 会根据创建的工程所支持的设置自动配置联想能力集和要 ...@@ -95,7 +95,7 @@ IDE 会根据创建的工程所支持的设置自动配置联想能力集和要
### 单设备应用开发 ### 单设备应用开发
默认应用的联想能力集要求系统能力集和设备的支持系统能力集相等,开发者修改要求能力集需要慎重。 默认应用的联想能力集要求系统能力集和设备的支持系统能力集相等,开发者修改要求能力集需要慎重。
![image-20220326065124911](figures/image-20220326065124911.png) ![image-20220326065124911](figures/image-20220326065124911.png)
......
...@@ -39,7 +39,7 @@ createRdbPredicates(name: string, dataAbilityPredicates: DataAbilityPredicates): ...@@ -39,7 +39,7 @@ createRdbPredicates(name: string, dataAbilityPredicates: DataAbilityPredicates):
**示例:** **示例:**
```js ```js
let dataAbilityPredicates = new dataAbility.DataAbilityPredicates() let dataAbilityPredicates = new dataAbility.DataAbilityPredicates()
dataAbilityPredicates.equalTo("NAME", "Rose").between("AGE", 16, 30) dataAbilityPredicates.equalTo("NAME", "Rose")
let predicates = dataAbility.createRdbPredicates("EMPLOYEE", dataAbilityPredicates) let predicates = dataAbility.createRdbPredicates("EMPLOYEE", dataAbilityPredicates)
``` ```
......
...@@ -122,7 +122,6 @@ off(type: 'change', callback?: Callback&lt;MediaQueryResult&gt;): void ...@@ -122,7 +122,6 @@ off(type: 'change', callback?: Callback&lt;MediaQueryResult&gt;): void
```ts ```ts
import mediaquery from '@ohos.mediaquery' import mediaquery from '@ohos.mediaquery'
let portraitFunc = null
@Entry @Entry
@Component @Component
...@@ -142,7 +141,7 @@ struct MediaQueryExample { ...@@ -142,7 +141,7 @@ struct MediaQueryExample {
} }
aboutToAppear() { aboutToAppear() {
portraitFunc = this.onPortrait.bind(this) //bind current js instance let portraitFunc = this.onPortrait.bind(this) //bind current js instance
this.listener.on('change', portraitFunc) this.listener.on('change', portraitFunc)
} }
......
...@@ -59,7 +59,7 @@ getAtqa(): number[] ...@@ -59,7 +59,7 @@ getAtqa(): number[]
| **类型** | **说明** | | **类型** | **说明** |
| ------------------ | --------------------------| | ------------------ | --------------------------|
| number[] | NfcA 标签的Ataq值。 | | number[] | NfcA 标签的Atqa值。 |
**示例:** **示例:**
...@@ -93,7 +93,7 @@ getRespAppData(): number[] ...@@ -93,7 +93,7 @@ getRespAppData(): number[]
| **类型** | **说明** | | **类型** | **说明** |
| ------------------ | --------------------------| | ------------------ | --------------------------|
| number[] | NfcB 标签的Resp数据。 | | number[] | NfcB 标签的应用程序数据。 |
**示例:** **示例:**
...@@ -153,7 +153,7 @@ getSystemCode(): number[] ...@@ -153,7 +153,7 @@ getSystemCode(): number[]
| **类型** | **说明** | | **类型** | **说明** |
| ------------------ | --------------------------| | ------------------ | --------------------------|
| number[] | NfcF 标签的协议信息。| | number[] | NfcF 标签的系统代码。|
**示例:** **示例:**
...@@ -325,7 +325,7 @@ isExtendedApduSupported(): Promise&lt;boolean&gt; ...@@ -325,7 +325,7 @@ isExtendedApduSupported(): Promise&lt;boolean&gt;
| **类型** | **说明** | | **类型** | **说明** |
| ------------------ | --------------------------| | ------------------ | --------------------------|
| Promise&lt;boolean&gt; | 检查结果,ture: 支持, false: 不支持。| | Promise&lt;boolean&gt; | 检查结果,true: 支持, false: 不支持。|
**示例:** **示例:**
...@@ -352,7 +352,7 @@ isExtendedApduSupported(callback: AsyncCallback\<boolean>): void ...@@ -352,7 +352,7 @@ isExtendedApduSupported(callback: AsyncCallback\<boolean>): void
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------- | ----------------------- | ---- | -------------------------------------- | | -------- | ----------------------- | ---- | -------------------------------------- |
| callback | AsyncCallback\<boolean> | 是 | 回调函数,ture: 支持, false: 不支持。 | | callback | AsyncCallback\<boolean> | 是 | 回调函数,true: 支持, false: 不支持。 |
```js ```js
import tag from '@ohos.nfc.tag'; import tag from '@ohos.nfc.tag';
...@@ -540,7 +540,7 @@ isNdefWritable(): Promise&lt;boolean&gt; ...@@ -540,7 +540,7 @@ isNdefWritable(): Promise&lt;boolean&gt;
| **类型** | **说明** | | **类型** | **说明** |
| ------------------ | --------------------------| | ------------------ | --------------------------|
| Promise&lt;boolean&gt; | 检查结果,ture: 可写, false: 不可写。| | Promise&lt;boolean&gt; | 检查结果,true: 可写, false: 不可写。|
**示例:** **示例:**
...@@ -712,7 +712,7 @@ canSetReadOnly(): Promise\<boolean> ...@@ -712,7 +712,7 @@ canSetReadOnly(): Promise\<boolean>
| **类型** | **说明** | | **类型** | **说明** |
| ------------------ | --------------------------| | ------------------ | --------------------------|
| Promise&lt;boolean&gt; | ture: 标签可设置为只读, false: 标签不可设置为只读。 | | Promise&lt;boolean&gt; | true: 标签可设置为只读, false: 标签不可设置为只读。 |
**示例:** **示例:**
...@@ -727,7 +727,7 @@ tag.NdefTag(taginfo).canSetReadOnly().then(function (has) { ...@@ -727,7 +727,7 @@ tag.NdefTag(taginfo).canSetReadOnly().then(function (has) {
### NdefTag.canSetReadOnly<sup>9+</sup> ### NdefTag.canSetReadOnly<sup>9+</sup>
isNdefWritable(callback: AsyncCallback&lt;boolean&gt;): void; canSetReadOnly(callback: AsyncCallback&lt;boolean&gt;): void;
检查ndef标签是否可以设置为只读,使用callback方式作为异步方法。 检查ndef标签是否可以设置为只读,使用callback方式作为异步方法。
...@@ -784,7 +784,7 @@ tag.NdefTag(taginfo).setReadOnly().then(function (errcode) { ...@@ -784,7 +784,7 @@ tag.NdefTag(taginfo).setReadOnly().then(function (errcode) {
setReadOnly(callback: AsyncCallback<number>): void setReadOnly(callback: AsyncCallback<number>): void
检查ndef标签是否可以设置为只读,使用callback方式作为异步方法。 将Ndef标签设置为只读,使用callback方式作为异步方法。
**需要权限**:ohos.permission.NFC_TAG **需要权限**:ohos.permission.NFC_TAG
......
...@@ -1893,7 +1893,7 @@ sensor.getGeomagneticField({latitude:80, longitude:0, altitude:0}, 1580486400000 ...@@ -1893,7 +1893,7 @@ sensor.getGeomagneticField({latitude:80, longitude:0, altitude:0}, 1580486400000
console.error('Operation failed. Error code: ' + err.code + '; message: ' + err.message); console.error('Operation failed. Error code: ' + err.code + '; message: ' + err.message);
return; return;
} }
console.info('sensor_getGeomagneticField_promise x: ' + data.x + ',y: ' + data.y + ',z: ' + console.info('sensor_getGeomagneticField_callback x: ' + data.x + ',y: ' + data.y + ',z: ' +
data.z + ',geomagneticDip: ' + data.geomagneticDip + ',deflectionAngle: ' + data.deflectionAngle + data.z + ',geomagneticDip: ' + data.geomagneticDip + ',deflectionAngle: ' + data.deflectionAngle +
',levelIntensity: ' + data.levelIntensity + ',totalIntensity: ' + data.totalIntensity); ',levelIntensity: ' + data.levelIntensity + ',totalIntensity: ' + data.totalIntensity);
}); });
...@@ -2011,7 +2011,7 @@ getGeomagneticDip(inclinationMatrix: Array&lt;number&gt;, callback: AsyncCallbac ...@@ -2011,7 +2011,7 @@ getGeomagneticDip(inclinationMatrix: Array&lt;number&gt;, callback: AsyncCallbac
```js ```js
sensor.getGeomagneticDip([1, 0, 0, 0, 1, 0, 0, 0, 1], function(err, data) { sensor.getGeomagneticDip([1, 0, 0, 0, 1, 0, 0, 0, 1], function(err, data) {
if (err) { if (err) {
console.error('SensorJsAPI--->Failed to register data, error code is: ' + err.code + ', message: ' + console.error('SensorJsAPI--->Failed to register data, error code is:' + err.code + ', message: ' +
err.message); err.message);
return; return;
} }
...@@ -2044,7 +2044,7 @@ getGeomagneticDip(inclinationMatrix: Array&lt;number&gt;): Promise&lt;number&gt; ...@@ -2044,7 +2044,7 @@ getGeomagneticDip(inclinationMatrix: Array&lt;number&gt;): Promise&lt;number&gt;
```js ```js
const promise = sensor.getGeomagneticDip([1, 0, 0, 0, 1, 0, 0, 0, 1]); const promise = sensor.getGeomagneticDip([1, 0, 0, 0, 1, 0, 0, 0, 1]);
promise.then((data) => { promise.then((data) => {
console.info(' getGeomagneticDip_promise successed', data); console.info('getGeomagneticDip_promise successed', data);
}).catch((err) => { }).catch((err) => {
console.error("Operation failed"); console.error("Operation failed");
}) })
...@@ -2592,9 +2592,9 @@ createRotationMatrix(gravity: Array&lt;number&gt;, geomagnetic: Array&lt;number& ...@@ -2592,9 +2592,9 @@ createRotationMatrix(gravity: Array&lt;number&gt;, geomagnetic: Array&lt;number&
**系统能力**:以下各项对应的系统能力均为SystemCapability.Sensors.Sensor **系统能力**:以下各项对应的系统能力均为SystemCapability.Sensors.Sensor
| 名称 | 参数类型 | 可读 | 可写 | 说明 | | 名称 | 参数类型 | 可读 | 可写 | 说明 |
| ------ | ------ | ---- | ---- | --------------------------------- | | ------ | -------- | ---- | ---- | ------------------------------------------------------------ |
| status | number | 是 | 是 | 显示霍尔状态。测量设备周围是否存在磁力吸引,0表示有,1表示没有。 | | status | number | 是 | 是 | 显示霍尔状态。测量设备周围是否存在磁力吸引,0表示没有,大于0表示有。 |
## MagneticFieldResponse ## MagneticFieldResponse
......
...@@ -55,9 +55,12 @@ Image(src: string | PixelMap | Resource) ...@@ -55,9 +55,12 @@ Image(src: string | PixelMap | Resource)
| fillColor | [ResourceColor](../../ui/ts-types.md#resourcecolor8) | - | 仅对svg图源生效,设置后会替换svg图片的fill颜色。 | | fillColor | [ResourceColor](../../ui/ts-types.md#resourcecolor8) | - | 仅对svg图源生效,设置后会替换svg图片的fill颜色。 |
| autoResize | boolean | true | 是否需要在图片解码过程中对图源做resize操作,该操作会根据显示区域的尺寸决定用于绘制的图源尺寸,有利于减少内存占用。 | | autoResize | boolean | true | 是否需要在图片解码过程中对图源做resize操作,该操作会根据显示区域的尺寸决定用于绘制的图源尺寸,有利于减少内存占用。 |
| syncLoad<sup>8+</sup> | boolean | false | 设置是否同步加载图片,默认是异步加载。同步加载时阻塞UI线程,不会显示占位图。 | | syncLoad<sup>8+</sup> | boolean | false | 设置是否同步加载图片,默认是异步加载。同步加载时阻塞UI线程,不会显示占位图。 |
| copyOption<sup>9+</sup> | [CopyOptions](ts-appendix-enums.md#copyoptions9) | CopyOptions.None | 设置图片是否可复制(SVG图片不支持复制)。 | | copyOption<sup>9+</sup> | [CopyOptions](ts-appendix-enums.md#copyoptions9) | CopyOptions.None | 设置图片是否可复制(SVG图片不支持复制)。<br/>当设置copyOption为非CopyOptions.None时,支持快捷组合键'CTRL+C'进行复制。 |
| colorFilter<sup>9+</sup> | [ColorFilter](../../ui/ts-types.md#colorfilter9) | - | 给图像设置颜色滤镜效果。 | | colorFilter<sup>9+</sup> | [ColorFilter](../../ui/ts-types.md#colorfilter9) | - | 给图像设置颜色滤镜效果。 |
> **说明:**
> 使用快捷组合键对Image组件复制的前提是,该组件必须处于获焦状态。将Image组件的属性focusable设置为true,即可使用TAB键将焦点切换到Image组件上,再将Image组件的focusOnTouch属性设置为true,即可实现点击获焦。
### ImageInterpolation ### ImageInterpolation
| 名称 | 描述 | | 名称 | 描述 |
......
...@@ -18,7 +18,10 @@ import lottie from '@ohos/lottieETS' ...@@ -18,7 +18,10 @@ import lottie from '@ohos/lottieETS'
``` ```
> **说明:** > **说明:**
>
> 在Terminal窗口使用 `npm install @ohos/lottieETS` 命令下载Lottie,下载之前需要配置权限。 > 在Terminal窗口使用 `npm install @ohos/lottieETS` 命令下载Lottie,下载之前需要配置权限。
>
> 安装ohos npm 三方包时,需要先执行`npm config set @ohos:registry=https://repo.harmonyos.com/npm/`设置仓库地址。
## lottie.loadAnimation ## lottie.loadAnimation
......
...@@ -69,16 +69,12 @@ PageTransitionEnter和PageTransitionExit组件支持的事件: ...@@ -69,16 +69,12 @@ PageTransitionEnter和PageTransitionExit组件支持的事件:
struct PageTransitionExample1 { struct PageTransitionExample1 {
@State scale1: number = 1 @State scale1: number = 1
@State opacity1: number = 1 @State opacity1: number = 1
@State active: boolean = false
build() { build() {
Column() { Column() {
Navigator({ target: 'pages/page1', type: NavigationType.Push }) { Navigator({ target: 'pages/page1', type: NavigationType.Push }) {
Image($r('app.media.bg1')).width("100%").height("100%") Image($r('app.media.bg1')).width("100%").height("100%")
} }
.onClick(() => {
this.active = true
})
}.scale({ x: this.scale1 }).opacity(this.opacity1) }.scale({ x: this.scale1 }).opacity(this.opacity1)
} }
// 自定义方式1:完全自定义转场过程的效果 // 自定义方式1:完全自定义转场过程的效果
...@@ -104,7 +100,6 @@ struct PageTransitionExample1 { ...@@ -104,7 +100,6 @@ struct PageTransitionExample1 {
struct AExample { struct AExample {
@State scale2: number = 1 @State scale2: number = 1
@State opacity2: number = 1 @State opacity2: number = 1
@State active: boolean = false
build() { build() {
Column() { Column() {
...@@ -140,16 +135,12 @@ struct AExample { ...@@ -140,16 +135,12 @@ struct AExample {
struct PageTransitionExample { struct PageTransitionExample {
@State scale1: number = 1 @State scale1: number = 1
@State opacity1: number = 1 @State opacity1: number = 1
@State active: boolean = false
build() { build() {
Column() { Column() {
Navigator({ target: 'pages/page1', type: NavigationType.Push }) { Navigator({ target: 'pages/page1', type: NavigationType.Push }) {
Image($r('app.media.bg1')).width("100%").height("100%") Image($r('app.media.bg1')).width("100%").height("100%")
} }
.onClick(() => {
this.active = true
})
}.scale({ x: this.scale1 }).opacity(this.opacity1) }.scale({ x: this.scale1 }).opacity(this.opacity1)
} }
...@@ -171,16 +162,12 @@ struct PageTransitionExample { ...@@ -171,16 +162,12 @@ struct PageTransitionExample {
struct PageTransitionExample1 { struct PageTransitionExample1 {
@State scale2: number = 1 @State scale2: number = 1
@State opacity2: number = 1 @State opacity2: number = 1
@State active: boolean = false
build() { build() {
Column() { Column() {
Navigator({ target: 'pages/index', type: NavigationType.Push }) { Navigator({ target: 'pages/index', type: NavigationType.Push }) {
Image($r('app.media.bg2')).width ("100%").height("100%") Image($r('app.media.bg2')).width ("100%").height("100%")
} }
.onClick(() => {
this.active = true
})
}.scale({ x: this.scale2 }).opacity(this.opacity2) }.scale({ x: this.scale2 }).opacity(this.opacity2)
} }
......
...@@ -7,11 +7,11 @@ ...@@ -7,11 +7,11 @@
本文描述的后台任务特指应用或业务模块处于后台(无可见界面)时,有需要继续执行或者后续执行的业务。OpenHarmony将后台任务分为三种类型,并执行不同的处理: 本文描述的后台任务特指应用或业务模块处于后台(无可见界面)时,有需要继续执行或者后续执行的业务。OpenHarmony将后台任务分为三种类型,并执行不同的处理:
1. 无后台业务:应用或业务模块退到后台后,无任务需要处理。 **1. 无后台业务** :应用或业务模块退到后台后,无任务需要处理。
2. 短时任务:应用或业务模块退到后台后,如果有紧急不可推迟且短时间能完成的任务,如应用退后台要进行数据压缩,不可中断,则使用短时任务申请延迟进入挂起(Suspend)状态。 **2. 短时任务** :应用或业务模块退到后台后,如果有紧急不可推迟且短时间能完成的任务,如应用退后台要进行数据压缩,不可中断,则使用短时任务申请延迟进入挂起(Suspend)状态。
3. 长时任务:如果是用户发起的可感知业务需要长时间后台运行,如后台播放音乐、导航、设备连接、VoIP等,则使用长时任务避免进入挂起(Suspend)状态。 **3. 长时任务** :如果是用户发起的可感知业务需要长时间后台运行,如后台播放音乐、导航、设备连接、VoIP等,则使用长时任务避免进入挂起(Suspend)状态。
## 短时任务 ## 短时任务
......
...@@ -17,19 +17,19 @@ AdcMethod定义: ...@@ -17,19 +17,19 @@ AdcMethod定义:
``` ```
struct AdcMethod { struct AdcMethod {
int32_t (*read)(struct AdcDevice *device, uint32_t channel, uint32_t *val); int32_t (*read)(struct AdcDevice *device, uint32_t channel, uint32_t *val);
int32_t (*start)(struct AdcDevice *device); int32_t (*start)(struct AdcDevice *device);
int32_t (*stop)(struct AdcDevice *device); int32_t (*stop)(struct AdcDevice *device);
}; };
``` ```
**表1** AdcMethod结构体成员的回调函数功能说明 **表1** AdcMethod结构体成员的回调函数功能说明
| 函数成员 | 入参 | 出参 | 返回值 | 功能 | | 函数成员 | 入参 | 出参 | 返回值 | 功能 |
| -------- | -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- | -------- |
| read | device:结构体指针,核心层ADC控制器<br/>channel:uint32_t,传入的通道号 | val:uint32_t指针,要传出的信号数据 | HDF_STATUS相关状态 | 读取ADC采样的信号数据 | | read | device:结构体指针,核心层ADC控制器<br/>channel:uint32_t,传入的通道号 | val:uint32_t指针,要传出的信号数据 | HDF_STATUS相关状态 | 读取ADC采样的信号数据 |
| stop | device:结构体指针,核心层ADC控制器 | 无 | HDF_STATUS相关状态 | 关闭ADC设备 | | stop | device:结构体指针,核心层ADC控制器 | 无 | HDF_STATUS相关状态 | 关闭ADC设备 |
| start | device:结构体指针,核心层ADC控制器 | 无 | HDF_STATUS相关状态 | 开启ADC设备 | | start | device:结构体指针,核心层ADC控制器 | 无 | HDF_STATUS相关状态 | 开启ADC设备 |
## 开发步骤 ## 开发步骤
...@@ -74,19 +74,19 @@ ADC模块适配必选的三个环节是配置属性文件,实例化驱动入 ...@@ -74,19 +74,19 @@ ADC模块适配必选的三个环节是配置属性文件,实例化驱动入
``` ```
static struct HdfDriverEntry g_hi35xxAdcDriverEntry = { static struct HdfDriverEntry g_hi35xxAdcDriverEntry = {
.moduleVersion = 1, .moduleVersion = 1,
.Init = Hi35xxAdcInit, .Init = Hi35xxAdcInit,
.Release = Hi35xxAdcRelease, .Release = Hi35xxAdcRelease,
.moduleName = "hi35xx_adc_driver", //【必要且与HCS文件里面的名字匹配】 .moduleName = "hi35xx_adc_driver", //【必要且与HCS文件里面的名字匹配】
}; };
HDF_INIT(g_hi35xxAdcDriverEntry); // 调用HDF_INIT将驱动入口注册到HDF框架中 HDF_INIT(g_hi35xxAdcDriverEntry); // 调用HDF_INIT将驱动入口注册到HDF框架中
// 核心层adc_core.c管理器服务的驱动入口 // 核心层adc_core.c管理器服务的驱动入口
struct HdfDriverEntry g_adcManagerEntry = { struct HdfDriverEntry g_adcManagerEntry = {
.moduleVersion = 1, .moduleVersion = 1,
.Init = AdcManagerInit, .Init = AdcManagerInit,
.Release = AdcManagerRelease, .Release = AdcManagerRelease,
.moduleName = "HDF_PLATFORM_ADC_MANAGER",// 这与device_info文件中device0对应 .moduleName = "HDF_PLATFORM_ADC_MANAGER",// 这与device_info文件中device0对应
}; };
HDF_INIT(g_adcManagerEntry); HDF_INIT(g_adcManagerEntry);
``` ```
...@@ -142,27 +142,27 @@ ADC模块适配必选的三个环节是配置属性文件,实例化驱动入 ...@@ -142,27 +142,27 @@ ADC模块适配必选的三个环节是配置属性文件,实例化驱动入
``` ```
root { root {
platform { platform {
adc_config_hi35xx { adc_config_hi35xx {
match_attr = "hisilicon_hi35xx_adc"; match_attr = "hisilicon_hi35xx_adc";
template adc_device { template adc_device {
regBasePhy = 0x120e0000;// 寄存器物理基地址 regBasePhy = 0x120e0000;// 寄存器物理基地址
regSize = 0x34; // 寄存器位宽 regSize = 0x34; // 寄存器位宽
deviceNum = 0; // 设备号 deviceNum = 0; // 设备号
validChannel = 0x1; // 有效通道 validChannel = 0x1; // 有效通道
dataWidth = 10; // 信号接收的数据位宽 dataWidth = 10; // 信号接收的数据位宽
scanMode = 1; // 扫描模式 scanMode = 1; // 扫描模式
delta = 0; // delta参数 delta = 0; // delta参数
deglitch = 0; deglitch = 0;
glitchSample = 5000; glitchSample = 5000;
rate = 20000; rate = 20000;
}
device_0 :: adc_device {
deviceNum = 0;
validChannel = 0x2;
}
}
} }
device_0 :: adc_device {
deviceNum = 0;
validChannel = 0x2;
}
}
}
} }
``` ```
...@@ -172,7 +172,7 @@ ADC模块适配必选的三个环节是配置属性文件,实例化驱动入 ...@@ -172,7 +172,7 @@ ADC模块适配必选的三个环节是配置属性文件,实例化驱动入
从驱动的角度看,自定义结构体是参数和数据的载体,而且adc_config.hcs文件中的数值会被HDF读入并通过DeviceResourceIface来初始化结构体成员,其中一些重要数值也会传递给核心层AdcDevice对象,例如设备号、总线号等。 从驱动的角度看,自定义结构体是参数和数据的载体,而且adc_config.hcs文件中的数值会被HDF读入并通过DeviceResourceIface来初始化结构体成员,其中一些重要数值也会传递给核心层AdcDevice对象,例如设备号、总线号等。
``` ```
struct Hi35xxAdcDevice { struct Hi35xxAdcDevice {
struct AdcDevice device; //【必要】是核心层控制对象,具体描述见下面。 struct AdcDevice device; //【必要】是核心层控制对象,具体描述见下面。
...@@ -223,14 +223,14 @@ ADC模块适配必选的三个环节是配置属性文件,实例化驱动入 ...@@ -223,14 +223,14 @@ ADC模块适配必选的三个环节是配置属性文件,实例化驱动入
HDF_STATUS相关状态(下表为部分展示,如需使用其他状态,可见//drivers/framework/include/utils/hdf_base.h中HDF_STATUS定义)。 HDF_STATUS相关状态(下表为部分展示,如需使用其他状态,可见//drivers/framework/include/utils/hdf_base.h中HDF_STATUS定义)。
| 状态(值) | 问题描述 | | 状态(值) | 问题描述 |
| -------- | -------- | | -------- | -------- |
| HDF_ERR_INVALID_OBJECT | 控制器对象非法 | | HDF_ERR_INVALID_OBJECT | 控制器对象非法 |
| HDF_ERR_INVALID_PARAM | 参数非法 | | HDF_ERR_INVALID_PARAM | 参数非法 |
| HDF_ERR_MALLOC_FAIL | 内存分配失败 | | HDF_ERR_MALLOC_FAIL | 内存分配失败 |
| HDF_ERR_IO | I/O错误 | | HDF_ERR_IO | I/O错误 |
| HDF_SUCCESS | 传输成功 | | HDF_SUCCESS | 传输成功 |
| HDF_FAILURE | 传输失败 | | HDF_FAILURE | 传输失败 |
函数说明: 函数说明:
......
...@@ -14,10 +14,10 @@ I2C(Inter Integrated Circuit)总线是由Philips公司开发的一种简单 ...@@ -14,10 +14,10 @@ I2C(Inter Integrated Circuit)总线是由Philips公司开发的一种简单
I2cMethod和I2cLockMethod定义: I2cMethod和I2cLockMethod定义:
``` ```
struct I2cMethod { struct I2cMethod {
int32_t (*transfer)(struct I2cCntlr *cntlr, struct I2cMsg *msgs, int16_t count); int32_t (*transfer)(struct I2cCntlr *cntlr, struct I2cMsg *msgs, int16_t count);
}; };
struct I2cLockMethod {// 锁机制操作结构体 struct I2cLockMethod {// 锁机制操作结构体
int32_t (*lock)(struct I2cCntlr *cntlr);// 加锁 int32_t (*lock)(struct I2cCntlr *cntlr);// 加锁
...@@ -27,9 +27,9 @@ struct I2cLockMethod {// 锁机制操作结构体 ...@@ -27,9 +27,9 @@ struct I2cLockMethod {// 锁机制操作结构体
**表1** I2cMethod结构体成员的回调函数功能说明 **表1** I2cMethod结构体成员的回调函数功能说明
| 函数成员 | 入参 | 出参 | 返回值 | 功能 | | 函数成员 | 入参 | 出参 | 返回值 | 功能 |
| -------- | -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- | -------- |
| transfer | cntlr:结构体指针,核心层I2C控制器。<br>msgs:结构体指针,用户消息。<br>count:uint16_t,消息数量。 | 无 | HDF_STATUS相关状态 | 传递用户消息 | | transfer | cntlr:结构体指针,核心层I2C控制器。<br>msgs:结构体指针,用户消息。<br>count:uint16_t,消息数量。 | 无 | HDF_STATUS相关状态 | 传递用户消息 |
## 开发步骤 ## 开发步骤
...@@ -74,7 +74,7 @@ I2C模块适配的三个必选环节是实例化驱动入口,配置属性文 ...@@ -74,7 +74,7 @@ I2C模块适配的三个必选环节是实例化驱动入口,配置属性文
I2C管理器服务的驱动由核心层实现,厂商不需要关注这部分内容的实现,但在实现Init函数的时候需要调用核心层的I2cCntlrAdd函数,它会实现相应功能。 I2C管理器服务的驱动由核心层实现,厂商不需要关注这部分内容的实现,但在实现Init函数的时候需要调用核心层的I2cCntlrAdd函数,它会实现相应功能。
``` ```
struct HdfDriverEntry g_i2cDriverEntry = { struct HdfDriverEntry g_i2cDriverEntry = {
.moduleVersion = 1, .moduleVersion = 1,
...@@ -103,71 +103,71 @@ I2C模块适配的三个必选环节是实例化驱动入口,配置属性文 ...@@ -103,71 +103,71 @@ I2C模块适配的三个必选环节是实例化驱动入口,配置属性文
**表2** 统一服务模式的特点 **表2** 统一服务模式的特点
| 成员名 | 值 | | 成员名 | 值 |
| -------- | -------- | | -------- | -------- |
| moduleName | 固定为HDF_PLATFORM_I2C_MANAGER | | moduleName | 固定为HDF_PLATFORM_I2C_MANAGER |
| serviceName | 固定为HDF_PLATFORM_I2C_MANAGER | | serviceName | 固定为HDF_PLATFORM_I2C_MANAGER |
| policy | 具体配置为1或2取决于是否对用户态可见 | | policy | 具体配置为1或2取决于是否对用户态可见 |
| deviceMatchAttr | 没有使用,可忽略 | | deviceMatchAttr | 没有使用,可忽略 |
从第二个节点开始配置具体I2C控制器信息,此节点并不表示某一路I2C控制器,而是代表一个资源性质设备,用于描述一类I2C控制器的信息。多个控制器之间相互区分的参数是busID和reg_pbase,这在i2c_config文件中有所体现。 从第二个节点开始配置具体I2C控制器信息,此节点并不表示某一路I2C控制器,而是代表一个资源性质设备,用于描述一类I2C控制器的信息。多个控制器之间相互区分的参数是busID和reg_pbase,这在i2c_config文件中有所体现。
- device_info.hcs配置参考 - device_info.hcs配置参考
``` ```
root { root {
device_info { device_info {
match_attr = "hdf_manager"; match_attr = "hdf_manager";
device_i2c :: device { device_i2c :: device {
device0 :: deviceNode { device0 :: deviceNode {
policy = 2; policy = 2;
priority = 50; priority = 50;
permission = 0644; permission = 0644;
moduleName = "HDF_PLATFORM_I2C_MANAGER"; moduleName = "HDF_PLATFORM_I2C_MANAGER";
serviceName = "HDF_PLATFORM_I2C_MANAGER"; serviceName = "HDF_PLATFORM_I2C_MANAGER";
deviceMatchAttr = "hdf_platform_i2c_manager"; deviceMatchAttr = "hdf_platform_i2c_manager";
} }
device1 :: deviceNode { device1 :: deviceNode {
policy = 0; // 等于0,不需要发布服务。 policy = 0; // 等于0,不需要发布服务。
priority = 55; // 驱动启动优先级。 priority = 55; // 驱动启动优先级。
permission = 0644; // 驱动创建设备节点权限。 permission = 0644; // 驱动创建设备节点权限。
moduleName = "hi35xx_i2c_driver"; //【必要】用于指定驱动名称,需要与期望的驱动Entry中的moduleName一致。 moduleName = "hi35xx_i2c_driver"; //【必要】用于指定驱动名称,需要与期望的驱动Entry中的moduleName一致。
serviceName = "HI35XX_I2C_DRIVER"; //【必要】驱动对外发布服务的名称,必须唯一。 serviceName = "HI35XX_I2C_DRIVER"; //【必要】驱动对外发布服务的名称,必须唯一。
deviceMatchAttr = "hisilicon_hi35xx_i2c"; //【必要】用于配置控制器私有数据,要与i2c_config.hcs中对应控制器保持一致, deviceMatchAttr = "hisilicon_hi35xx_i2c"; //【必要】用于配置控制器私有数据,要与i2c_config.hcs中对应控制器保持一致,
// 具体的控制器信息在 i2c_config.hcs中。 // 具体的控制器信息在 i2c_config.hcs中。
} }
}
} }
} }
}
``` ```
- i2c_config.hcs 配置参考 - i2c_config.hcs 配置参考
``` ```
root { root {
platform { platform {
i2c_config { i2c_config {
match_attr = "hisilicon_hi35xx_i2c"; //【必要】需要和device_info.hcs中的deviceMatchAttr值一致 match_attr = "hisilicon_hi35xx_i2c"; //【必要】需要和device_info.hcs中的deviceMatchAttr值一致
template i2c_controller { // 模板公共参数,继承该模板的节点如果使用模板中的默认值,则节点字段可以缺省。 template i2c_controller { // 模板公共参数,继承该模板的节点如果使用模板中的默认值,则节点字段可以缺省。
bus = 0; //【必要】i2c识别号 bus = 0; //【必要】i2c识别号
reg_pbase = 0x120b0000; //【必要】物理基地址 reg_pbase = 0x120b0000; //【必要】物理基地址
reg_size = 0xd1; //【必要】寄存器位宽 reg_size = 0xd1; //【必要】寄存器位宽
irq = 0; //【可选】根据厂商需要来使用 irq = 0; //【可选】根据厂商需要来使用
freq = 400000; //【可选】根据厂商需要来使用 freq = 400000; //【可选】根据厂商需要来使用
clk = 50000000; //【可选】根据厂商需要来使用 clk = 50000000; //【可选】根据厂商需要来使用
}
controller_0x120b0000 :: i2c_controller {
bus = 0;
}
controller_0x120b1000 :: i2c_controller {
bus = 1;
reg_pbase = 0x120b1000;
}
...
}
} }
controller_0x120b0000 :: i2c_controller {
bus = 0;
}
controller_0x120b1000 :: i2c_controller {
bus = 1;
reg_pbase = 0x120b1000;
}
...
}
}
} }
``` ```
...@@ -177,7 +177,7 @@ I2C模块适配的三个必选环节是实例化驱动入口,配置属性文 ...@@ -177,7 +177,7 @@ I2C模块适配的三个必选环节是实例化驱动入口,配置属性文
从驱动的角度看,自定义结构体是参数和数据的载体,而且i2c_config.hcs文件中的数值会被HDF读入通过DeviceResourceIface来初始化结构体成员,其中一些重要数值也会传递给核心层I2cCntlr对象,例如设备号、总线号等。 从驱动的角度看,自定义结构体是参数和数据的载体,而且i2c_config.hcs文件中的数值会被HDF读入通过DeviceResourceIface来初始化结构体成员,其中一些重要数值也会传递给核心层I2cCntlr对象,例如设备号、总线号等。
``` ```
// 厂商自定义功能结构体 // 厂商自定义功能结构体
struct Hi35xxI2cCntlr { struct Hi35xxI2cCntlr {
...@@ -204,7 +204,7 @@ I2C模块适配的三个必选环节是实例化驱动入口,配置属性文 ...@@ -204,7 +204,7 @@ I2C模块适配的三个必选环节是实例化驱动入口,配置属性文
``` ```
- I2cCntlr成员回调函数结构体I2cMethod的实例化,和锁机制回调函数结构体I2cLockMethod实例化,其他成员在Init函数中初始化。 - I2cCntlr成员回调函数结构体I2cMethod的实例化,和锁机制回调函数结构体I2cLockMethod实例化,其他成员在Init函数中初始化。
``` ```
// i2c_hi35xx.c中的示例 // i2c_hi35xx.c中的示例
static const struct I2cMethod g_method = { static const struct I2cMethod g_method = {
...@@ -228,20 +228,20 @@ I2C模块适配的三个必选环节是实例化驱动入口,配置属性文 ...@@ -228,20 +228,20 @@ I2C模块适配的三个必选环节是实例化驱动入口,配置属性文
**表3** Init函数入参及返回值参考 **表3** Init函数入参及返回值参考
| 状态(值) | 问题描述 | | 状态(值) | 问题描述 |
| -------- | -------- | | -------- | -------- |
| HDF_ERR_INVALID_OBJECT | 控制器对象非法 | | HDF_ERR_INVALID_OBJECT | 控制器对象非法 |
| HDF_ERR_INVALID_PARAM | 参数非法 | | HDF_ERR_INVALID_PARAM | 参数非法 |
| HDF_ERR_MALLOC_FAIL | 内存分配失败 | | HDF_ERR_MALLOC_FAIL | 内存分配失败 |
| HDF_ERR_IO | I/O&nbsp;错误 | | HDF_ERR_IO | I/O&nbsp;错误 |
| HDF_SUCCESS | 传输成功 | | HDF_SUCCESS | 传输成功 |
| HDF_FAILURE | 传输失败 | | HDF_FAILURE | 传输失败 |
函数说明: 函数说明:
初始化自定义结构体对象,初始化I2cCntlr成员,调用核心层I2cCntlrAdd函数,接入VFS(可选)。 初始化自定义结构体对象,初始化I2cCntlr成员,调用核心层I2cCntlrAdd函数,接入VFS(可选)。
``` ```
static int32_t Hi35xxI2cInit(struct HdfDeviceObject *device) static int32_t Hi35xxI2cInit(struct HdfDeviceObject *device)
{ {
...@@ -301,7 +301,7 @@ I2C模块适配的三个必选环节是实例化驱动入口,配置属性文 ...@@ -301,7 +301,7 @@ I2C模块适配的三个必选环节是实例化驱动入口,配置属性文
释放内存和删除控制器,该函数需要在驱动入口结构体中赋值给Release接口,当HDF框架调用Init函数初始化驱动失败时,可以调用Release释放驱动资源。 释放内存和删除控制器,该函数需要在驱动入口结构体中赋值给Release接口,当HDF框架调用Init函数初始化驱动失败时,可以调用Release释放驱动资源。
``` ```
static void Hi35xxI2cRelease(struct HdfDeviceObject *device) static void Hi35xxI2cRelease(struct HdfDeviceObject *device)
{ {
......
...@@ -14,7 +14,7 @@ DSI(Display Serial Interface)是由移动行业处理器接口联盟(Mobil ...@@ -14,7 +14,7 @@ DSI(Display Serial Interface)是由移动行业处理器接口联盟(Mobil
MipiDsiCntlrMethod定义: MipiDsiCntlrMethod定义:
``` ```
struct MipiDsiCntlrMethod { // 核心层结构体的成员函数 struct MipiDsiCntlrMethod { // 核心层结构体的成员函数
int32_t (*setCntlrCfg)(struct MipiDsiCntlr *cntlr); int32_t (*setCntlrCfg)(struct MipiDsiCntlr *cntlr);
...@@ -31,13 +31,13 @@ struct MipiDsiCntlrMethod { // 核心层结构体的成员函数 ...@@ -31,13 +31,13 @@ struct MipiDsiCntlrMethod { // 核心层结构体的成员函数
**表1** MipiDsiCntlrMethod成员的回调函数功能说明 **表1** MipiDsiCntlrMethod成员的回调函数功能说明
| 成员函数 | 入参 | 出参 | 返回状态 | 功能 | | 成员函数 | 入参 | 出参 | 返回状态 | 功能 |
| -------- | -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- | -------- |
| setCntlrCfg | cntlr:结构体指针,MipiDsi控制器 | 无 | HDF_STATUS相关状态 | 设置控制器参数 | | setCntlrCfg | cntlr:结构体指针,MipiDsi控制器 | 无 | HDF_STATUS相关状态 | 设置控制器参数 |
| setCmd | cntlr:结构体指针,MipiDsi控制器<br>cmd:结构体指针,指令传入值 | 无 | HDF_STATUS相关状态 | 向显示设备发送指令 | | setCmd | cntlr:结构体指针,MipiDsi控制器<br>cmd:结构体指针,指令传入值 | 无 | HDF_STATUS相关状态 | 向显示设备发送指令 |
| getCmd | cntlr:结构体指针,MipiDsi控制器<br>cmd:传入的命令描述结构体指针<br>readLen:读取的数据大小 | out:结构体指针,用于存储读取的数据 | HDF_STATUS相关状态 | 通过发送指令读取数据 | | getCmd | cntlr:结构体指针,MipiDsi控制器<br>cmd:传入的命令描述结构体指针<br>readLen:读取的数据大小 | out:结构体指针,用于存储读取的数据 | HDF_STATUS相关状态 | 通过发送指令读取数据 |
| toHs | cntlr:结构体指针,MipiDsi控制器 | 无 | HDF_STATUS相关状态 | 设置为高速模式 | | toHs | cntlr:结构体指针,MipiDsi控制器 | 无 | HDF_STATUS相关状态 | 设置为高速模式 |
| toLp | cntlr:结构体指针,MipiDsi控制器 | 无 | HDF_STATUS相关状态 | 设置为低电模式 | | toLp | cntlr:结构体指针,MipiDsi控制器 | 无 | HDF_STATUS相关状态 | 设置为低电模式 |
## 开发步骤 ## 开发步骤
...@@ -74,26 +74,26 @@ MIPI DSI模块适配的三个必选环节是配置属性文件,实例化驱动 ...@@ -74,26 +74,26 @@ MIPI DSI模块适配的三个必选环节是配置属性文件,实例化驱动
但本例中MIPI控制器无需配置额外属性,如有厂商需要,则需要在device_info文件的deviceNode增加deviceMatchAttr信息,以及增加mipidsi_config文件。 但本例中MIPI控制器无需配置额外属性,如有厂商需要,则需要在device_info文件的deviceNode增加deviceMatchAttr信息,以及增加mipidsi_config文件。
device_info.hcs 配置参考: device_info.hcs 配置参考:
``` ```
root { root {
device_info { device_info {
match_attr = "hdf_manager"; match_attr = "hdf_manager";
platform :: host { platform :: host {
hostName = "platform_host"; hostName = "platform_host";
priority = 50; priority = 50;
device_mipi_dsi:: device { device_mipi_dsi:: device {
device0 :: deviceNode { device0 :: deviceNode {
policy = 0; policy = 0;
priority = 150; priority = 150;
permission = 0644; permission = 0644;
moduleName = "HDF_MIPI_TX"; // 【必要】用于指定驱动名称,需要与期望的驱动Entry中的moduleName一致。 moduleName = "HDF_MIPI_TX"; // 【必要】用于指定驱动名称,需要与期望的驱动Entry中的moduleName一致。
serviceName = "HDF_MIPI_TX"; // 【必要且唯一】驱动对外发布服务的名称。 serviceName = "HDF_MIPI_TX"; // 【必要且唯一】驱动对外发布服务的名称。
}
}
} }
}
} }
} }
}
``` ```
2. 完成器件属性文件的配置之后,下一步请实例化驱动入口。 2. 完成器件属性文件的配置之后,下一步请实例化驱动入口。
...@@ -120,33 +120,33 @@ MIPI DSI模块适配的三个必选环节是配置属性文件,实例化驱动 ...@@ -120,33 +120,33 @@ MIPI DSI模块适配的三个必选环节是配置属性文件,实例化驱动
从驱动的角度看,自定义结构体是参数和数据的载体,一般来说,config文件中的数值也会用来初始化结构体成员,但本例的mipidsi无器件属性文件,故基本成员结构与MipiDsiCntlr无太大差异。 从驱动的角度看,自定义结构体是参数和数据的载体,一般来说,config文件中的数值也会用来初始化结构体成员,但本例的mipidsi无器件属性文件,故基本成员结构与MipiDsiCntlr无太大差异。
``` ```
typedef struct { typedef struct {
unsigned int devno; // 设备号 unsigned int devno; // 设备号
short laneId[LANE_MAX_NUM]; // lane号 short laneId[LANE_MAX_NUM]; // lane号
OutPutModeTag outputMode; // 输出模式选择:刷新模式,命令行模式或视频流模式 OutPutModeTag outputMode; // 输出模式选择:刷新模式,命令行模式或视频流模式
VideoModeTag videoMode; // 显示设备的同步模式 VideoModeTag videoMode; // 显示设备的同步模式
OutputFormatTag outputFormat; // 输出DSI图像数据格式:RGB或YUV OutputFormatTag outputFormat; // 输出DSI图像数据格式:RGB或YUV
SyncInfoTag syncInfo; // 时序相关的设置 SyncInfoTag syncInfo; // 时序相关的设置
unsigned int phyDataRate; // 数据速率,单位Mbps unsigned int phyDataRate; // 数据速率,单位Mbps
unsigned int pixelClk; // 时钟,单位KHz unsigned int pixelClk; // 时钟,单位KHz
} ComboDevCfgTag; } ComboDevCfgTag;
// MipiDsiCntlr是核心层控制器结构体,其中的成员在Init函数中会被赋值。 // MipiDsiCntlr是核心层控制器结构体,其中的成员在Init函数中会被赋值。
struct MipiDsiCntlr { struct MipiDsiCntlr {
struct IDeviceIoService service; struct IDeviceIoService service;
struct HdfDeviceObject *device; struct HdfDeviceObject *device;
unsigned int devNo; // 设备号 unsigned int devNo; // 设备号
struct MipiCfg cfg; struct MipiCfg cfg;
struct MipiDsiCntlrMethod *ops; struct MipiDsiCntlrMethod *ops;
struct OsalMutex lock; struct OsalMutex lock;
void *priv; void *priv;
}; };
``` ```
- MipiDsiCntlr成员回调函数结构体MipiDsiCntlrMethod的实例化,其他成员在Init函数中初始化。 - MipiDsiCntlr成员回调函数结构体MipiDsiCntlrMethod的实例化,其他成员在Init函数中初始化。
``` ```
static struct MipiDsiCntlrMethod g_method = { static struct MipiDsiCntlrMethod g_method = {
.setCntlrCfg = Hi35xxSetCntlrCfg, .setCntlrCfg = Hi35xxSetCntlrCfg,
...@@ -167,20 +167,20 @@ MIPI DSI模块适配的三个必选环节是配置属性文件,实例化驱动 ...@@ -167,20 +167,20 @@ MIPI DSI模块适配的三个必选环节是配置属性文件,实例化驱动
HDF_STATUS相关状态(下表为部分展示,如需使用其他状态,可见//drivers/framework/include/utils/hdf_base.h中HDF_STATUS定义)。 HDF_STATUS相关状态(下表为部分展示,如需使用其他状态,可见//drivers/framework/include/utils/hdf_base.h中HDF_STATUS定义)。
| 状态(值) | 问题描述 | | 状态(值) | 问题描述 |
| -------- | -------- | | -------- | -------- |
| HDF_ERR_INVALID_OBJECT | 无效对象 | | HDF_ERR_INVALID_OBJECT | 无效对象 |
| HDF_ERR_MALLOC_FAIL | 内存分配失败 | | HDF_ERR_MALLOC_FAIL | 内存分配失败 |
| HDF_ERR_INVALID_PARAM | 无效参数 | | HDF_ERR_INVALID_PARAM | 无效参数 |
| HDF_ERR_IO | I/O&nbsp;错误 | | HDF_ERR_IO | I/O&nbsp;错误 |
| HDF_SUCCESS | 执行成功 | | HDF_SUCCESS | 执行成功 |
| HDF_FAILURE | 执行失败 | | HDF_FAILURE | 执行失败 |
函数说明: 函数说明:
MipiDsiCntlrMethod的实例化对象的挂载,调用MipiDsiRegisterCntlr,以及其他厂商自定义初始化操作。 MipiDsiCntlrMethod的实例化对象的挂载,调用MipiDsiRegisterCntlr,以及其他厂商自定义初始化操作。
``` ```
static int32_t Hi35xxMipiTxInit(struct HdfDeviceObject *device) static int32_t Hi35xxMipiTxInit(struct HdfDeviceObject *device)
{ {
...@@ -232,7 +232,7 @@ MIPI DSI模块适配的三个必选环节是配置属性文件,实例化驱动 ...@@ -232,7 +232,7 @@ MIPI DSI模块适配的三个必选环节是配置属性文件,实例化驱动
> ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:**<br> > ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:**<br>
> 所有强制转换获取相应对象的操作前提是在Init函数中具备对应赋值的操作。 > 所有强制转换获取相应对象的操作前提是在Init函数中具备对应赋值的操作。
``` ```
static void Hi35xxMipiTxRelease(struct HdfDeviceObject *device) static void Hi35xxMipiTxRelease(struct HdfDeviceObject *device)
{ {
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
### 使用场景 ### 使用场景
UISwipeView继承UIViewGroup,除提供容器类组件Add、Remove、Insert等方法外还提供按页面滑动功能,滑动结束后当前页面居中对齐显示。该组件分为水平方向和垂直方向,通过Add方法添加的子组件会根据Add的顺序和UISwipeView方向自动水平对齐或垂直对齐。 UISwipeView继承UIViewGroup,除提供容器类组件Add、Remove、Insert等方法外还提供按页面滑动功能,滑动结束后当前页面居中对齐显示。该组件分为水平方向和垂直方向,通过Add方法添加的子组件会根据Add的顺序和UISwipeView方向自动水平对齐或垂直对齐。
### 接口说明 ### 接口说明
......
...@@ -12,48 +12,48 @@ OpenHarmony为开发者提供了一套全面的自测试框架,开发者可根 ...@@ -12,48 +12,48 @@ OpenHarmony为开发者提供了一套全面的自测试框架,开发者可根
以下是测试框架的目录层级架构,在使用测试框架过程中可在相应目录查找对应组件。 以下是测试框架的目录层级架构,在使用测试框架过程中可在相应目录查找对应组件。
``` ```
test # 测试子系统 test # 测试子系统
├── developertest # 开发者测试组件 ├── developertest # 开发者测试组件
│ ├── aw # 测试框架的静态库 │ ├── aw # 测试框架的静态库
│ ├── config # 测试框架配置 │ ├── config # 测试框架配置
│ │ │ ... │ │ │ ...
│ │ └── user_config.xml # 用户使用配置 │ │ └── user_config.xml # 用户使用配置
│ ├── examples # 测试用例示例 │ ├── examples # 测试用例示例
│ ├── src # 测试框架源码 │ ├── src # 测试框架源码
│ ├── third_party # 测试框架依赖第三方组件适配 │ ├── third_party # 测试框架依赖第三方组件适配
│ ├── reports # 测试结果报告 │ ├── reports # 测试结果报告
│ ├── BUILD.gn # 测试框架编译入口 │ ├── BUILD.gn # 测试框架编译入口
│ ├── start.bat # 开发者测试入口(Windows) │ ├── start.bat # 开发者测试入口(Windows)
│ └── start.sh # 开发者测试入口(Linux) │ └── start.sh # 开发者测试入口(Linux)
└── xdevice # 测试框架依赖组件 └── xdevice # 测试框架依赖组件
``` ```
## 测试用例编写 ## 测试用例编写
### 测试用例目录规划 ### 测试用例目录规划
使用测试框架过程中,可根据以下层级关系规划测试用例目录。 使用测试框架过程中,可根据以下层级关系规划测试用例目录。
``` ```
subsystem # 子系统 subsystem # 子系统
├── partA # 部件A ├── partA # 部件A
│ ├── moduleA # 模块A │ ├── moduleA # 模块A
│ │ ├── include │ │ ├── include
│ │ ├── src # 业务代码 │ │ ├── src # 业务代码
│ │ └── test # 测试目录 │ │ └── test # 测试目录
│ │ ├── unittest # 单元测试 │ │ ├── unittest # 单元测试
│ │ │ ├── common # 公共用例 │ │ │ ├── common # 公共用例
│ │ │ │ ├── BUILD.gn # 测试用例编译配置 │ │ │ │ ├── BUILD.gn # 测试用例编译配置
│ │ │ │ └── testA_test.cpp # 单元测试用例源码 │ │ │ │ └── testA_test.cpp # 单元测试用例源码
│ │ │ ├── phone # 手机形态用例 │ │ │ ├── phone # 手机形态用例
│ │ │ ├── ivi # 车机形态用例 │ │ │ ├── ivi # 车机形态用例
│ │ │ └── liteos-a # ipcamera使用liteos内核的用例 │ │ │ └── liteos-a # ipcamera使用liteos内核的用例
│ │ ├── moduletest # 模块测试 │ │ ├── moduletest # 模块测试
│ │ ... │ │ ...
│ │ │ │
│ ├── moduleB # 模块B │ ├── moduleB # 模块B
│ ├── test │ ├── test
│ │ └── resource # 依赖资源 │ │ └── resource # 依赖资源
│ │ ├── moduleA # 模块A │ │ ├── moduleA # 模块A
│ │ │ ├── ohos_test.xml # 资源配置文件 │ │ │ ├── ohos_test.xml # 资源配置文件
│ │ ... └── 1.txt # 资源 │ │ ... └── 1.txt # 资源
│ │ │ │
│ ├── ohos_build # 编译入口配置 │ ├── ohos_build # 编译入口配置
│ ... │ ...
... ...
......
...@@ -4,34 +4,32 @@ ...@@ -4,34 +4,32 @@
- [术语](glossary.md) - [术语](glossary.md)
- 版本说明 - 版本说明
- OpenHarmony 3.x Releases - OpenHarmony 3.x Releases
- [OpenHarmony v3.2 Beta2 (2022-07-30)](release-notes/OpenHarmony-v3.2-beta2.md)
- [OpenHarmony v3.2 Beta2 (2022-07-30)](release-notes/OpenHarmony-v3.2-beta2.md) - [OpenHarmony v3.2 Beta1 (2022-05-31)](release-notes/OpenHarmony-v3.2-beta1.md)
- [OpenHarmony v3.2 Beta1 (2022-05-31)](release-notes/OpenHarmony-v3.2-beta1.md) - [OpenHarmony v3.1.1 Release (2022-05-31)](release-notes/OpenHarmony-v3.1.1-release.md)
- [OpenHarmony v3.1.1 Release (2022-05-31)](release-notes/OpenHarmony-v3.1.1-release.md) - [OpenHarmony v3.1 Release (2022-03-30)](release-notes/OpenHarmony-v3.1-release.md)
- [OpenHarmony v3.1 Release (2022-03-30)](release-notes/OpenHarmony-v3.1-release.md) - [OpenHarmony v3.1 Beta (2021-12-31)](release-notes/OpenHarmony-v3.1-beta.md)
- [OpenHarmony v3.1 Beta (2021-12-31)](release-notes/OpenHarmony-v3.1-beta.md) - [OpenHarmony v3.0.5 LTS (2022-07-01)](release-notes/OpenHarmony-v3.0.5-LTS.md)
- [OpenHarmony v3.0.5 LTS (2022-07-01)](release-notes/OpenHarmony-v3.0.5-LTS.md) - [OpenHarmony v3.0.3 LTS (2022-04-08)](release-notes/OpenHarmony-v3.0.3-LTS.md)
- [OpenHarmony v3.0.3 LTS (2022-04-08)](release-notes/OpenHarmony-v3.0.3-LTS.md) - [OpenHarmony v3.0.2 LTS (2022-03-18)](release-notes/OpenHarmony-v3.0.2-LTS.md)
- [OpenHarmony v3.0.2 LTS (2022-03-18)](release-notes/OpenHarmony-v3.0.2-LTS.md) - [OpenHarmony v3.0.1 LTS (2022-01-12)](release-notes/OpenHarmony-v3.0.1-LTS.md)
- [OpenHarmony v3.0.1 LTS (2022-01-12)](release-notes/OpenHarmony-v3.0.1-LTS.md) - [OpenHarmony v3.0 LTS (2021-09-30)](release-notes/OpenHarmony-v3.0-LTS.md)
- [OpenHarmony v3.0 LTS (2021-09-30)](release-notes/OpenHarmony-v3.0-LTS.md)
- OpenHarmony 2.x Releases
- [OpenHarmony v2.2 beta2 (2021-08-04)](release-notes/OpenHarmony-v2.2-beta2.md)
- [OpenHarmony 2.0 Canary (2021-06-01)](release-notes/OpenHarmony-2-0-Canary.md)
- OpenHarmony 1.x Releases - OpenHarmony 2.x Releases
- [OpenHarmony v2.2 beta2 (2021-08-04)](release-notes/OpenHarmony-v2.2-beta2.md)
- [OpenHarmony 2.0 Canary (2021-06-01)](release-notes/OpenHarmony-2-0-Canary.md)
- OpenHarmony 1.x Releases
- [OpenHarmony v1.1.4 LTS (2022-02-11)](release-notes/OpenHarmony-v1-1-4-LTS.md) - [OpenHarmony v1.1.4 LTS (2022-02-11)](release-notes/OpenHarmony-v1-1-4-LTS.md)
- [OpenHarmony v1.1.3 LTS (2021-09-30)](release-notes/OpenHarmony-v1-1-3-LTS.md) - [OpenHarmony v1.1.3 LTS (2021-09-30)](release-notes/OpenHarmony-v1-1-3-LTS.md)
- [OpenHarmony v1.1.2 LTS (2021-08-04)](release-notes/OpenHarmony-v1.1.2-LTS.md) - [OpenHarmony v1.1.2 LTS (2021-08-04)](release-notes/OpenHarmony-v1.1.2-LTS.md)
- [OpenHarmony 1.1.1 LTS (2021-06-22)](release-notes/OpenHarmony-1-1-1-LTS.md) - [OpenHarmony 1.1.1 LTS (2021-06-22)](release-notes/OpenHarmony-1-1-1-LTS.md)
- [OpenHarmony 1.1.0 LTS (2021-04-01)](release-notes/OpenHarmony-1-1-0-LTS.md) - [OpenHarmony 1.1.0 LTS (2021-04-01)](release-notes/OpenHarmony-1-1-0-LTS.md)
- [OpenHarmony 1.0 (2020-09-10)](release-notes/OpenHarmony-1-0.md) - [OpenHarmony 1.0 (2020-09-10)](release-notes/OpenHarmony-1-0.md)
- API差异报告 - API差异报告
- OpenHamrony 3.2 Beta2 - OpenHamrony 3.2 Beta2
- JS API差异报告 - JS API差异报告
- [元能力](release-notes/api-change/v3.2-beta2/js-apidiff-ability.md) - [元能力](release-notes/api-change/v3.2-beta2/js-apidiff-ability.md)
...@@ -61,6 +59,9 @@ ...@@ -61,6 +59,9 @@
- [用户身份认证](release-notes/api-change/v3.2-beta2/js-apidiff-user-authentication.md) - [用户身份认证](release-notes/api-change/v3.2-beta2/js-apidiff-user-authentication.md)
- [Web](release-notes/api-change/v3.2-beta2/js-apidiff-web.md) - [Web](release-notes/api-change/v3.2-beta2/js-apidiff-web.md)
- [窗口管理](release-notes/api-change/v3.2-beta2/js-apidiff-window.md) - [窗口管理](release-notes/api-change/v3.2-beta2/js-apidiff-window.md)
- 变更说明
- [3.2 beta2相对3.2 beta1变更详细说明](release-notes/api-change/v3.2-beta2/changelog-v3.2-beta2.md)
- [OpenHarmony启用应用沙箱机制-适配指导](release-notes/api-change/v3.2-beta2/application-sandbox-adaptation-guide.md)
- OpenHarmony 3.2 Beta1 - OpenHarmony 3.2 Beta1
- JS API差异报告 - JS API差异报告
- [元能力](release-notes/api-change/v3.2-beta1/js-apidiff-ability.md) - [元能力](release-notes/api-change/v3.2-beta1/js-apidiff-ability.md)
...@@ -128,17 +129,13 @@ ...@@ -128,17 +129,13 @@
- OpenHarmony 3.1 Beta - OpenHarmony 3.1 Beta
- [JS API差异报告](release-notes/api-change/v3.1-beta/js-apidiff-v3.1-beta.md) - [JS API差异报告](release-notes/api-change/v3.1-beta/js-apidiff-v3.1-beta.md)
- [Native API差异报告](release-notes/api-change/v3.1-beta/native-apidiff-v3.1-beta.md) - [Native API差异报告](release-notes/api-change/v3.1-beta/native-apidiff-v3.1-beta.md)
- [3.1 beta相对于3.0变更详细说明](release-notes/api-change/v3.1-beta/changelog-v3.1-beta.md)
- OpenHarmony 3.0 LTS - OpenHarmony 3.0 LTS
- [JS API差异报告](release-notes/api-change/v3.0-LTS/js-apidiff-v3.0-lts.md) - [JS API差异报告](release-notes/api-change/v3.0-LTS/js-apidiff-v3.0-lts.md)
- OpenHarmony v2.2 Beta2 - OpenHarmony v2.2 Beta2
- [JS API差异报告](release-notes/api-change/v2.2-beta2/js-apidiff-v2.2-beta2.md) - [JS API差异报告](release-notes/api-change/v2.2-beta2/js-apidiff-v2.2-beta2.md)
- [Native API差异报告](release-notes/api-change/v2.2-beta2/native-apidiff-v2.2-beta2.md) - [Native API差异报告](release-notes/api-change/v2.2-beta2/native-apidiff-v2.2-beta2.md)
- 变更说明
- OpenHamrony 3.2 Beta2
- [3.2 beta2相对3.2 beta1变更详细说明](release-notes/changelog/v3.2-beta2/changelog-v3.2-beta2.md)
- [OpenHarmony启用应用沙箱机制-适配指导](release-notes/changelog/v3.2-beta2/application-sandbox-adaptation-guide.md)
- OpenHarmony 3.1 Beta
- [3.1 beta相对于3.0变更详细说明](release-notes/api-change/v3.1-beta/changelog-v3.1-beta.md)
- OpenHarmony三方组件 - OpenHarmony三方组件
- [OpenHarmony三方组件简介](third-party-components/third-party-components-introduction.md) - [OpenHarmony三方组件简介](third-party-components/third-party-components-introduction.md)
- [OpenHarmony JS/TS三方组件使用指导](third-party-components/npm-third-party-guide.md) - [OpenHarmony JS/TS三方组件使用指导](third-party-components/npm-third-party-guide.md)
...@@ -152,4 +149,5 @@ ...@@ -152,4 +149,5 @@
- [贡献文档](contribute/贡献文档.md) - [贡献文档](contribute/贡献文档.md)
- [写作规范](contribute/写作规范.md) - [写作规范](contribute/写作规范.md)
- [社区沟通与交流](contribute/社区沟通与交流.md) - [社区沟通与交流](contribute/社区沟通与交流.md)
- [FAQ](contribute/FAQ.md) - [FAQ](contribute/FAQ.md)
\ No newline at end of file
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册