未验证 提交 17d1c01a 编写于 作者: O openharmony_ci 提交者: Gitee

!20692 翻译完成 20522+20342+20549+20485+19824:剪贴板资料整改+新增充电空闲模式的公共事件+calc计算特性添加使用方法

Merge pull request !20692 from ester.zhou/TR-20522
......@@ -476,6 +476,9 @@ Indicates that the system starts charging the battery.
## [COMMON_EVENT_CHARGE_TYPE_CHANGED](./common_event/commonEvent-powermgr.md)
Indicates that the system charging type has changed. This event is available only for system applications.
## [COMMON_EVENT_CHARGE_IDLE_MODE_CHANGED](./common_event/commonEvent-powermgr.md)
Indicates that the device enters the charging idle mode.
## [COMMON_EVENT_DEVICE_IDLE_MODE_CHANGED](./common_event/commonEvent-resourceschedule.md)
Indicates that the system idle mode has changed.
## [COMMON_EVENT_DEVICE_IDLE_EXEMPTION_LIST_UPDATED<sup>10+<sup>](./common_event/commonEvent-resourceschedule.md)
......
......@@ -65,6 +65,14 @@ Indicates that the system charging type has changed. This event is available onl
When the system charging type changes, the event notification service is triggered to publish this event.
## COMMON_EVENT_CHARGE_IDLE_MODE_CHANGED
Indicates that the device enters the charging idle mode.
- Value: usual.event.CHARGE_IDLE_MODE_CHANGED
- Required subscriber permissions: none
When the device starts charging in idle mode, and the temperature rise is acceptable, the event notification service is triggered to publish this event.
## COMMON_EVENT_SHUTDOWN
Indicates that the device is being and will be shut down.
......
......@@ -16,9 +16,9 @@ import pasteboard from '@ohos.pasteboard';
**System capability**: SystemCapability.MiscServices.Pasteboard
| Name| Type| Value| Description|
| -------- | -------- | -------- | -------- |
| MAX_RECORD_NUM<sup>7+</sup> | number | 512 | Maximum number of records in a **PasteData** object.|
| Name| Type| Value | Description |
| -------- | -------- |--------------|-------------------------------------------------------------------------------------------------------------------------------------------|
| MAX_RECORD_NUM<sup>7+</sup> | number | - | Maximum number of records in a **PasteData** object. In versions earlier than API version 10, the value is 512, indicating that no more records can be added once the number of records reaches 512.<br>Since API version 10, no limit is placed on the number of records in a **PasteData** object.|
| MIMETYPE_TEXT_HTML<sup>7+</sup> | string | 'text/html' | MIME type of the HTML content.|
| MIMETYPE_TEXT_WANT<sup>7+</sup> | string | 'text/want' | MIME type of the Want content.|
| MIMETYPE_TEXT_PLAIN<sup>7+</sup> | string | 'text/plain' | MIME type of the plain text content.|
......@@ -619,8 +619,6 @@ addRecord(record: PasteDataRecord): void
Adds a data record to this pasteboard, and adds its type to **mimeTypes** in [PasteDataProperty](#pastedataproperty7). The parameters cannot be empty. Otherwise, the operation fails.
The pasteboard supports a maximum number of 512 data records.
**System capability**: SystemCapability.MiscServices.Pasteboard
**Parameters**
......@@ -645,8 +643,6 @@ addRecord(mimeType: string, value: ValueType): void
Adds a custom-type record to this pasteboard, and adds the custom type to **mimeTypes** in [PasteDataProperty](#pastedataproperty7). The parameters cannot be empty. Otherwise, the operation fails.
The pasteboard supports a maximum number of 512 data records.
**System capability**: SystemCapability.MiscServices.Pasteboard
**Parameters**
......@@ -948,7 +944,6 @@ addHtmlRecord(htmlText: string): void
Adds an HTML record to this pasteboard, and adds **MIMETYPE_TEXT_HTML** to **mimeTypes** in [PasteDataProperty](#pastedataproperty7). The parameters cannot be empty. Otherwise, the operation fails.
The pasteboard supports a maximum number of 512 data records.
> **NOTE**
>
> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [addRecord](#addrecord9).
......@@ -975,7 +970,6 @@ addWantRecord(want: Want): void
Adds a Want record to this pasteboard, and adds **MIMETYPE_TEXT_WANT** to **mimeTypes** in [PasteDataProperty](#pastedataproperty7). The parameters cannot be empty. Otherwise, the operation fails.
The pasteboard supports a maximum number of 512 data records.
> **NOTE**
>
> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [addRecord](#addrecord9).
......@@ -1005,7 +999,6 @@ addTextRecord(text: string): void
Adds a plain text record to this pasteboard, and adds **MIME_TEXT_PLAIN** to **mimeTypes** in [PasteDataProperty](#pastedataproperty7). The parameters cannot be empty. Otherwise, the operation fails.
The pasteboard supports a maximum number of 512 data records.
> **NOTE**
>
> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [addRecord](#addrecord9).
......@@ -1031,7 +1024,6 @@ addUriRecord(uri: string): void
Adds a URI record to this pasteboard, and adds **MIMETYPE_TEXT_URI** to **mimeTypes** in [PasteDataProperty](#pastedataproperty7). The parameters cannot be empty. Otherwise, the operation fails.
The pasteboard supports a maximum number of 512 data records.
> **NOTE**
>
> This API is supported since API version 7 and deprecated since API version 9. You are advised to use [addRecord](#addrecord9).
......
......@@ -16,6 +16,11 @@ Not supported
Blank(min?: number | string)
Since API version 10:
- On the main axis of the parent container **\<Row>**, **\<Column>**, or **\<Flex>**, if the size of the **\<Blank>** component is not set, the component will be automatically stretched or shrunk; if the size is not set or the container adapts to the size of its child component, the component will not be stretched or shrunk.
- Relationship between **size** and **min** of the **\<Blank>** component on the main axis: max(min, size).
- On the cross axis of the parent container, if the size of the **\<Blank>** component is set, the component will not fill up the parent container; if the size is not set, the component will fill up the parent container, following the default **alignSelf** settings **ItemAlign.Stretch**.
Since API version 9, this API is supported in ArkTS widgets.
**Parameters**
......
......@@ -12,11 +12,11 @@ The location attributes set the alignment mode, layout direction, and position o
| Name| Type| Description|
| -------- | -------- | -------- |
| align | [Alignment](ts-appendix-enums.md#alignment) | Alignment mode of the component content in the drawing area.<br>Default value: **Alignment.Center**<br>Since API version 9, this API is supported in ArkTS widgets.|
| align | [Alignment](ts-appendix-enums.md#alignment) | Alignment mode of the component content in the drawing area.<br>This attribute is available only in the following components: **\<Stack>**, **\<Button>**, **\<StepperItem>**, **\<Marquee>**, **\<text>**, **\<TextArea>**, and **\<TextInput>**. For details about the alignment results of text-related components (the last four aforementioned components), see [textAlign](ts-basic-components-text.md#attributes).<br>If the component does not support the **textAlign** attribute, horizontal text alignment cannot be set.<br>Default value: **Alignment.Center**<br>Since API version 9, this API is supported in ArkTS widgets.|
| direction | [Direction](ts-appendix-enums.md#direction) | Horizontal layout of the component.<br>Default value: **Direction.Auto**<br>Since API version 9, this API is supported in ArkTS widgets.|
| position | [Position](ts-types.md#position8) | Offset of the component's upper left corner relative to the parent component's upper left corner. This offset is expressed using absolute values. When laying out components, this attribute does not affect the layout of the parent component. It only adjusts the component position during drawing.<br>This attribute is applicable to scenarios where the component is fixed at a position in the parent container, for example, where it is pinned to top or floating above the UI.<br>Since API version 9, this API is supported in ArkTS widgets.|
| markAnchor | [Position](ts-types.md#position8) | Anchor point of the component for positioning. The upper left corner of the component is used as the reference point for offset. Generally, this attribute is used together with the **position** and **offset** attributes. When used independently, this attribute is similar to **offset**.<br>Default value:<br>{<br>x: 0,<br>y: 0<br>}<br>Since API version 9, this API is supported in ArkTS widgets.|
| offset | [Position](ts-types.md#position8) | Offset of the component relative to itself. This offset is expressed using relative values. This attribute does not affect the layout of the parent component. It only adjusts the component position during drawing.<br>Default value:<br>{<br>x: 0,<br>y: 0<br>}<br>Since API version 9, this API is supported in ArkTS widgets.|
| markAnchor | [Position](ts-types.md#position8) | Anchor point of the component for positioning. The upper left corner of the component is used as the reference point for offset. Generally, this attribute is used together with the **position** and **offset** attributes. When used independently, this attribute is similar to **offset**.<br>The default value varies by API version.<br>API version 9 and earlier:<br>{<br>x: 0,<br>y: 0<br>}<br>API version 10: none<br>Since API version 9, this API is supported in ArkTS widgets.|
| offset | [Position](ts-types.md#position8) | Offset of the component relative to itself. This offset is expressed using relative values. This attribute does not affect the layout of the parent component. It only adjusts the component position during drawing.<br>The default value varies by API version.<br>API version 9 and earlier:<br>{<br>x: 0,<br>y: 0<br>}<br>API version 10: none<br>Since API version 9, this API is supported in ArkTS widgets.|
| alignRules<sup>9+</sup> | {<br>left?: { anchor: string, align: [HorizontalAlign](ts-appendix-enums.md#horizontalalign) };<br>right?: { anchor: string, align: [HorizontalAlign](ts-appendix-enums.md#horizontalalign) };<br>middle?: { anchor: string, align: [HorizontalAlign](ts-appendix-enums.md#horizontalalign) };<br>top?: { anchor: string, align: [VerticalAlign](ts-appendix-enums.md#verticalalign) };<br>bottom?: { anchor: string, align: [VerticalAlign](ts-appendix-enums.md#verticalalign) };<br>center?: { anchor: string, align: [VerticalAlign](ts-appendix-enums.md#verticalalign) }<br>} | Alignment rules relative to the container. This attribute is valid only when the container is [\<RelativeContainer>](ts-container-relativecontainer.md).<br>- **left**: left-aligned.<br>- **right**: right-aligned.<br>- **middle**: center-aligned.<br>- **top**: top-aligned.<br>- **bottom**: bottom-aligned.<br>- **center**: center-aligned.<br>This API is supported in ArkTS widgets.<br>**NOTE**<br>- **anchor**: ID of the component that functions as the anchor point.<br>- **align**: alignment mode relative to the anchor component.|
......
......@@ -23,12 +23,17 @@ The size attributes set the width, height, and margin of a component.
| Size Arrangement | Result |
| ---------------------------------------- | ------------------ |
| minWidth/minHeight < width/height< maxWidth/maxHeight | width/height |
| minWidth/minHeight < width/height < maxWidth/maxHeight | width/height |
| minWidth/minHeight < maxWidth/maxHeight < width/height | maxWidth/maxHeight |
| maxWidth/maxHeight < minWidth/minHeight < width/height | minWidth/minHeight |
| maxWidth/maxHeight < width/height< minWidth/minHeight | minWidth/minHeight |
| maxWidth/maxHeight < width/height < minWidth/minHeight | minWidth/minHeight |
| width/height < maxWidth/maxHeight < minWidth/minHeight | minWidth/minHeight |
| width/height < minWidth/minHeight < maxWidth/maxHeight | minWidth/minHeight |
| minWidth/minHeight = maxWidth/maxHeight | minWidth/minHeight |
| minWidth/minHeight < maxWidth/maxHeight = width/height | maxWidth/maxHeight |
| maxWidth/maxHeight < minWidth/minHeight = width/height | minWidth/minHeight |
| width/height = minWidth/minHeight < maxWidth/maxHeight | minWidth/minHeight |
| width/height = maxWidth/maxHeight < minWidth/minHeight | minWidth/minHeight |
## Example
```ts
......@@ -71,6 +76,11 @@ struct SizeExample {
Text('no layoutWeight')
.size({ width: '30%', height: 110 }).backgroundColor(0xD2B48C).textAlign(TextAlign.Center)
}.size({ width: '90%', height: 140 }).backgroundColor(0xAFEEEE)
// calc calculation feature
Text('calc:').fontSize(12).fontColor(0xCCCCCC).width('90%')
Text('calc test').fontSize(50).fontWeight(FontWeight.Bold).backgroundColor(0xFFFAF0).textAlign(TextAlign.Center)
.margin('calc(25vp*2)')
.size({width:'calc(90%)', height:'calc(50vp + 10%)'})
}.width('100%').margin({ top: 5 })
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册