diff --git a/arkui/ace_engine/native/libace.ndk.json b/arkui/ace_engine/native/libace.ndk.json index 6566446ad58bee09322067fcdef660a6c0826acd..e650b12573a3821ca81e82374086b5cf1700bb52 100644 --- a/arkui/ace_engine/native/libace.ndk.json +++ b/arkui/ace_engine/native/libace.ndk.json @@ -170,5 +170,9 @@ { "first_introduced": "12", "name": "OH_NativeXComponent_RegisterOnTouchInterceptCallback" + }, + { + "first_introduced": "12", + "name": "OH_ArkUI_QueryModuleInterface" } ] \ No newline at end of file diff --git a/arkui/ace_engine/native/native_node.h b/arkui/ace_engine/native/native_node.h index 0c3c6eb2cd30f514c35593cf7f440c6e59cd1472..cc2f06428b6fd76102550a03d39b1f29cbf3dc80 100644 --- a/arkui/ace_engine/native/native_node.h +++ b/arkui/ace_engine/native/native_node.h @@ -107,6 +107,8 @@ typedef enum { ARKUI_NODE_FLEX, /** Refresh component. */ ARKUI_NODE_REFRESH, + /** Waterfall container. */ + ARKUI_NODE_WATER_FLOW, } ArkUI_NodeType; /** @@ -800,6 +802,18 @@ typedef enum { * */ NODE_TRANSLATE_TRANSITION, + /** + * @brief Defines the slide-in and slide-out of the component from the screen edge during transition. + * This attribute can be set, reset, and obtained as required through APIs. + * + * Format of the {@link ArkUI_AttributeItem} parameter for setting the attribute:\n + * value[0].i32: The parameter type is {@link ArkUI_TransitionEdge}. \n + * \n + * Format of the return value {@link ArkUI_AttributeItem}:\n + * value[0].i32: The parameter type is {@link ArkUI_TransitionEdge}. \n + * + */ + NODE_MOVE_TRANSITION, /** * @brief Defines the focus attribute, which can be set, reset, and obtained as required through APIs. @@ -1341,6 +1355,17 @@ typedef enum { * */ NODE_FOCUS_STATUS, + /** + * @brief Defines the aspect ratio attribute, which can be set, reset, and obtained as required through APIs. + * + * Format of the {@link ArkUI_AttributeItem} parameter for setting the attribute:\n + * .value[0].f32: aspect ratio of the component, in width/height format. \n + * \n + * Format of the return value {@link ArkUI_AttributeItem}:\n + * .value[0].f32: aspect ratio of the component, in width/height format. \n + * + */ + NODE_ASPECT_RATIO, /** * @brief Defines the text content attribute, which can be set, reset, and obtained as required through APIs. @@ -1605,6 +1630,28 @@ typedef enum { * */ NODE_TEXT_INDENT, + /** + * @brief Defines the line break rule. This attribute can be set, reset, and obtained as required through APIs. + * + * Format of the {@link ArkUI_AttributeItem} parameter for setting the attribute:\n + * .value[0].i32: The parameter type is {@link ArkUI_WordBreak}. \n + * \n + * Format of the return value {@link ArkUI_AttributeItem}:\n + * .value[0].i32: The parameter type is {@link ArkUI_WordBreak}. \n + * + */ + NODE_TEXT_WORD_BREAK, + /** + * @brief Defines the ellipsis position. This attribute can be set, reset, and obtained as required through APIs. + * + * Format of the {@link ArkUI_AttributeItem} parameter for setting the attribute:\n + * .value[0].i32: The parameter type is {@link ArkUI_EllipsisMode}. \n + * \n + * Format of the return value {@link ArkUI_AttributeItem}:\n + * .value[0].i32: The parameter type is {@link ArkUI_EllipsisMode}. \n + * + */ + NODE_TEXT_ELLIPSIS_MODE, /** * @brief Defines the text content attribute, which can be set, reset, and obtained as required through APIs. * @@ -1616,6 +1663,28 @@ typedef enum { * */ NODE_SPAN_CONTENT = MAX_NODE_SCOPE_NUM * ARKUI_NODE_SPAN, + /** + * @brief Defines the text background style. + * This attribute can be set, reset, and obtained as required through APIs. + * + * Format of the {@link ArkUI_AttributeItem} parameter for setting the attribute:\n + * .value[0].u32: color of the text background, in 0xARGB format, for example, 0xFFFF0000 indicating red. \n + * The second parameter indicates the rounded corners of the text background. Two setting modes are available: \n + * 1: .value[1].f32: radius of the four corners, in vp. \n + * 2: .value[1].f32: radius of the upper left corner, in vp. \n + * .value[2].f32: radius of the upper right corner, in vp. \n + * .value[3].f32: radius of the lower left corner, in vp. \n + * .value[4].f32: radius of the lower right corner, in vp. \n + * \n + * Format of the return value {@link ArkUI_AttributeItem}:\n + * .value[0].u32: color of the text background, in 0xARGB format. \n + * .value[1].f32: radius of the upper left corner, in vp. \n + * .value[2].f32: radius of the upper right corner, in vp. \n + * .value[3].f32: radius of the lower left corner, in vp. \n + * .value[4].f32: radius of the lower right corner, in vp. \n + * + */ + NODE_SPAN_TEXT_BACKGROUND_STYLE, /** * @brief Defines the image source of the image span. * This attribute can be set, reset, and obtained as required through APIs. @@ -1727,6 +1796,29 @@ typedef enum { * */ NODE_IMAGE_ALT, + /** + * @brief Defines whether the image is draggable. + * This attribute can be set, reset, and obtained as required through APIs. + * + * Format of the {@link ArkUI_AttributeItem} parameter for setting the attribute:\n + * .value[0].i32: whether the image is draggable. The value true means that the image is draggable. \n + * \n + * Format of the return value {@link ArkUI_AttributeItem}:\n + * .value[0].i32: whether the image is draggable. \n + * + */ + NODE_IMAGE_DRAGGABLE, + /** + * @brief Defines the image rendering mode. This attribute can be set, reset, and obtained as required through APIs. + * + * Format of the {@link ArkUI_AttributeItem} parameter for setting the attribute:\n + * .value[0].i32: The parameter type is {@link ArkUI_RenderMode}. \n + * \n + * Format of the return value {@link ArkUI_AttributeItem}:\n + * .value[0].i32: The parameter type is {@link ArkUI_RenderMode}. \n + * + */ + NODE_IMAGE_RENDER_MODE, /** * @brief Defines the color of the component when it is selected. * This attribute can be set, reset, and obtained as required through APIs. @@ -1751,6 +1843,17 @@ typedef enum { * */ NODE_TOGGLE_SWITCH_POINT_COLOR, + /** + * @brief Defines the toggle switch value. This attribute can be set, reset, and obtained as required through APIs. + * + * Format of the {@link ArkUI_AttributeItem} parameter for setting the attribute:\n + * .value[0].i32: whether to enable the toggle. The value true means to enable the toggle. \n + * \n + * Format of the return value {@link ArkUI_AttributeItem}:\n + * .value[0].i32: whether to enable the toggle. \n + * + */ + NODE_TOGGLE_VALUE, /** * @brief Defines the foreground color of the loading progress bar. @@ -1981,6 +2084,20 @@ typedef enum { * */ NODE_TEXT_INPUT_CANCEL_BUTTON, + /** + * @brief Sets the text selection area, which will be highlighted. + * This attribute can be set, reset, and obtained as required through APIs. + * + * Format of the {@link ArkUI_AttributeItem} parameter for setting the attribute:\n + * .value[0].i32: start position of the text selection. \n + * .value[1].i32: end position of the text selection. \n + * \n + * Format of the return value {@link ArkUI_AttributeItem}:\n + * .value[0].i32: start position of the text selection. \n + * .value[1].i32: end position of the text selection. \n + * + */ + NODE_TEXT_INPUT_TEXT_SELECTION, /** * @brief Defines the default placeholder text for the multi-line text box. @@ -2074,6 +2191,38 @@ typedef enum { * */ NODE_TEXT_AREA_EDITING, + /** + * @brief Defines the text box type. This attribute can be set, reset, and obtained as required through APIs. + * + * Format of the {@link ArkUI_AttributeItem} parameter for setting the attribute:\n + * .value[0].i32: text box type {@link ArkUI_TextAreaType}. + * The default value is ARKUI_TEXTAREA_TYPE_NORMAL. \n + * \n + * Format of the return value {@link ArkUI_AttributeItem}:\n + * .value[0].i32: text box type {@link ArkUI_TextAreaType}. \n + * + */ + NODE_TEXT_AREA_TYPE, + /** + * @brief Defines the counter settings. This attribute can be set, reset, and obtained as required through APIs. + * + * Format of the {@link ArkUI_AttributeItem} parameter for setting the attribute:\n + * .value[0].i32: whether to show a character counter. The value true means to show a character counter. \n + * .value[1]?.f32: threshold percentage for displaying the character counter. The character counter is displayed + * when the number of characters that have been entered is greater than the maximum number of characters multiplied + * by the threshold percentage value. The value range is 1 to 100. If the value is a decimal, it is rounded down. \n + * .value[2]?.i32: whether to highlight the border when the number of entered characters reaches the maximum. \n + * \n + * Format of the return value {@link ArkUI_AttributeItem}:\n + * .value[0].i32: whether to show a character counter. \n + * .value[1].f32: threshold percentage for displaying the character counter. The character counter is displayed + * when the number of characters that have been entered is greater than the maximum number of characters multiplied + * by the threshold percentage value. The value range is 1 to 100. \n + * .value[2].i32: whether to highlight the border when the number of entered characters reaches the maximum. + * The default value is true. \n + * + */ + NODE_TEXT_AREA_SHOW_COUNTER, /** * @brief Defines the button text content. This attribute can be set, reset, and obtained as required through APIs. @@ -3320,6 +3469,22 @@ typedef enum { */ NODE_SWIPER_SHOW_DISPLAY_ARROW, + /** + * @brief Defines the effect used at the edges of the swiper when the boundary of the scrollable content is reached. + * This attribute can be set, reset, and obtained as required through APIs. + * + * Format of the {@link ArkUI_AttributeItem} parameter for setting the attribute:\n + * .value[0].i32: effect used at the edges of the swiper when the boundary of the scrollable content is reached. + * The parameter type is {@link ArkUI_EdgeEffect}.\n + * The default value is ARKUI_EDGE_EFFECT_SPRING. \n + * \n + * Format of the return value {@link ArkUI_AttributeItem}:\n + * .value[0].i32: effect used at the edges of the swiper when the boundary of the scrollable content is reached. + * The parameter type is {@link ArkUI_EdgeEffect}. \n + * + */ + NODE_SWIPER_EDGE_EFFECT_MODE, + /** * @brief Defines the header of the list item group. * This attribute can be set, reset, and obtained as required through APIs. @@ -3460,6 +3625,28 @@ typedef enum { * */ NODE_REFRESH_REFRESHING = MAX_NODE_SCOPE_NUM * ARKUI_NODE_REFRESH, + /** + * @brief Sets the custom content in the pull-down area. + * This attribute can be set, reset, and obtained as required through APIs. + * + * Format of the {@link ArkUI_AttributeItem} parameter for setting the attribute:\n + * .object: The parameter type is {@Link ArkUI_NodeHandle}. + * + */ + NODE_REFRESH_CONTENT, + + /** + * @brief Defines the main axis direction of the component layout. + * This attribute can be set, reset, and obtained as required through APIs. + * + * Format of the {@link ArkUI_AttributeItem} parameter for setting the attribute:\n + * .value[0].i32: main axis direction. The parameter type is {@Link ArkUI_FlexDirection}. + * \n + * Format of the return value {@link ArkUI_AttributeItem}:\n + * .value[0].i32: main axis direction. The parameter type is {@Link ArkUI_FlexDirection}. + * + */ + NODE_WATER_FLOW_LAYOUT_DIRECTION = MAX_NODE_SCOPE_NUM * ARKUI_NODE_WATER_FLOW, } ArkUI_NodeAttributeType; #define MAX_COMPONENT_EVENT_ARG_NUM 12 @@ -3505,6 +3692,15 @@ typedef enum { * {@link ArkUI_NodeComponentEvent} does not contain parameters. */ NODE_EVENT_ON_APPEAR, + /** + * @brief Defines the unmount event. + * + * This event is triggered when the component is unmounted and hidden. \n + * When the event callback occurs, the union type in the {@link ArkUI_NodeEvent} object is + * {@link ArkUI_NodeComponentEvent}. \n + * {@link ArkUI_NodeComponentEvent} does not contain parameters. + */ + NODE_EVENT_ON_DISAPPEAR, /** * @brief Defines the area change event. @@ -3680,6 +3876,18 @@ typedef enum { * */ NODE_TEXT_INPUT_ON_PASTE, + /** + * @brief Defines the event triggered when the text selection position changes. + * + \n + * When the event callback occurs, the union type in the {@link ArkUI_NodeEvent} object is + * {@link ArkUI_NodeComponentEvent}. \n + * {@link ArkUI_NodeComponentEvent} contains two parameters:\n + * ArkUI_NodeComponentEvent.data[0].i32: start position of the text selection area. \n + * ArkUI_NodeComponentEvent.data[1].i32: end position of the text selection area. \n + * + */ + NODE_TEXT_INPUT_ON_TEXT_SELECTION_CHANGE, /** * @brief Defines the event triggered when the input in the text box changes. * @@ -3691,6 +3899,30 @@ typedef enum { * */ NODE_TEXT_AREA_ON_CHANGE = MAX_NODE_SCOPE_NUM * ARKUI_NODE_TEXT_AREA, + /** + * @brief Defines the event triggered when the paste button on the pasteboard, which displays when the text box is + * long pressed, is clicked. + * + \n + * When the event callback occurs, the union type in the {@link ArkUI_NodeEvent} object is + * {@link ArkUI_StringAsyncEvent}. \n + * {@link ArkUI_StringAsyncEvent} contains one parameter:\n + * ArkUI_StringAsyncEvent.pStr: text that is pasted + * + */ + NODE_TEXT_AREA_ON_PASTE, + /** + * @brief Defines the event triggered when the text selection position changes. + * + \n + * When the event callback occurs, the union type in the {@link ArkUI_NodeEvent} object is + * {@link ArkUI_NodeComponentEvent}. \n + * {@link ArkUI_NodeComponentEvent} contains two parameters:\n + * ArkUI_NodeComponentEvent.data[0].i32: start position of the text selection area. \n + * ArkUI_NodeComponentEvent.data[1].i32: end position of the text selection area. \n + * + */ + NODE_TEXT_AREA_ON_TEXT_SELECTION_CHANGE, /** * @brief Defines the event triggered when the selected status of the ARKUI_NODE_CHECKBOX component changes. @@ -3759,6 +3991,58 @@ typedef enum { */ NODE_SLIDER_EVENT_ON_CHANGE = MAX_NODE_SCOPE_NUM * ARKUI_NODE_SLIDER, + /** + * @brief Defines the event triggered when the index of the currently displayed element of this + * ARKUI_NODE_SWIPER instance changes. + * + * When the event callback occurs, the union type in the {@link ArkUI_NodeEvent} object is + * {@link ArkUI_NodeComponentEvent}. \n + * {@link ArkUI_NodeComponentEvent} contains one parameter:\n + * ArkUI_NodeComponentEvent.data[0].i32: index of the currently displayed element. \n + */ + NODE_SWIPER_EVENT_ON_CHANGE = MAX_NODE_SCOPE_NUM * ARKUI_NODE_SWIPER, + + /** + * @brief Defines the event triggered when the switching animation of this ARKUI_NODE_SWIPER instance starts. + * + * When the event callback occurs, the union type in the {@link ArkUI_NodeEvent} object is + * {@link ArkUI_NodeComponentEvent}. \n + * {@link ArkUI_NodeComponentEvent} contains five parameters: \n + * ArkUI_NodeComponentEvent.data[0].i32: index of the currently displayed element. \n + * ArkUI_NodeComponentEvent.data[1].i32: index of the target element to switch to. \n + * ArkUI_NodeComponentEvent.data[2].f32: offset of the currently displayed element relative to the + * start position of the swiper along the main axis. \n + * ArkUI_NodeComponentEvent.data[3].f32: offset of the target element relative to the start position + * of the swiper along the main axis. \n + * ArkUI_NodeComponentEvent.data[4].f32: hands-off velocity. \n + */ + NODE_SWIPER_EVENT_ON_ANIMATION_START, + + /** + * @brief Defines the event triggered when the switching animation of this ARKUI_NODE_SWIPER instance ends. + * + * When the event callback occurs, the union type in the {@link ArkUI_NodeEvent} object is + * {@link ArkUI_NodeComponentEvent}. \n + * {@link ArkUI_NodeComponentEvent} contains two parameters:\n + * ArkUI_NodeComponentEvent.data[0].i32: index of the currently displayed element. \n + * ArkUI_NodeComponentEvent.data[1].f32: offset of the currently displayed element relative to the + * start position of the swiper along the main axis. \n + */ + NODE_SWIPER_EVENT_ON_ANIMATION_END, + + /** + * @brief Defines the event triggered on a frame-by-frame basis when the page is turned by a swipe in this + * ARKUI_NODE_SWIPER instance. + * + * When the event callback occurs, the union type in the {@link ArkUI_NodeEvent} object is + * {@link ArkUI_NodeComponentEvent}. \n + * {@link ArkUI_NodeComponentEvent} contains two parameters:\n + * ArkUI_NodeComponentEvent.data[0].i32: index of the currently displayed element. \n + * ArkUI_NodeComponentEvent.data[1].f32: offset of the currently displayed element relative to the + * start position of the swiper along the main axis. \n + */ + NODE_SWIPER_EVENT_ON_GESTURE_SWIPE, + /** * @brief Defines the event triggered when the ARKUI_NODE_SCROLL component scrolls. * diff --git a/arkui/ace_engine/native/native_type.h b/arkui/ace_engine/native/native_type.h index 3cdd51892d77a368512bef878877983ff09a4488..62ef4072fcda7052c6479f2163b56b63faa02d1e 100644 --- a/arkui/ace_engine/native/native_type.h +++ b/arkui/ace_engine/native/native_type.h @@ -228,6 +228,22 @@ typedef enum { ARKUI_TEXTINPUT_TYPE_NUMBER_DECIMAL = 12, } ArkUI_TextInputType; +/** + * @brief Enumerates the text box types. + * + * @since 12 + */ +typedef enum { + /** Normal input mode. */ + ARKUI_TEXTAREA_TYPE_NORMAL = 0, + /** Number input mode. */ + ARKUI_TEXTAREA_TYPE_NUMBER = 2, + /** Phone number input mode. */ + ARKUI_TEXTAREA_TYPE_PHONE_NUMBER = 3, + /** Email address input mode. */ + ARKUI_TEXTAREA_TYPE_EMAIL = 5, +} ArkUI_TextAreaType; + /** * @brief Enumerates the styles of the Cancel button. * @@ -1203,6 +1219,66 @@ typedef enum { ARKUI_LINEAR_GRADIENT_DIRECTION_NONE, } ArkUI_LinearGradientDirection; +/** + * @brief Enumerates the word break rules. + * + * @since 12 + */ +typedef enum { + /** Word breaks can occur between any two characters for Chinese, Japanese, and Korean (CJK) text, but can occur + * only at a space character for non-CJK text (such as English). */ + ARKUI_WORD_BREAK_NORMAL = 0, + /** Word breaks can occur between any two characters for non-CJK text. CJK text behavior is the same as for + * NORMAL. */ + ARKUI_WORD_BREAK_BREAK_ALL, + /** This option has the same effect as BREAK_ALL for non-CJK text, except that if it preferentially wraps + * lines at appropriate characters (for example, spaces) whenever possible. + CJK text behavior is the same as for NORMAL. */ + ARKUI_WORD_BREAK_BREAK_WORD, +} ArkUI_WordBreak; + +/** + * @brief Enumerates the ellipsis positions. + * + * @since 12 + */ +typedef enum { + /** An ellipsis is used at the start of the line of text. */ + ARKUI_ELLIPSIS_MODE_START = 0, + /** An ellipsis is used at the center of the line of text. */ + ARKUI_ELLIPSIS_MODE_CENTER, + /** An ellipsis is used at the end of the line of text. */ + ARKUI_ELLIPSIS_MODE_END, +} ArkUI_EllipsisMode; + +/** + * @brief Enumerates the image rendering modes. + * + * @since 12 + */ +typedef enum { + /** Render image pixels as they are in the original source image. */ + ARKUI_IMAGE_RENDER_MODE_ORIGINAL = 0, + /** Render image pixels to create a monochrome template image. */ + ARKUI_IMAGE_RENDER_MODE_TEMPLATE, +} ArkUI_ImageRenderMode; + +/** + * @brief Enumerates the slide-in and slide-out positions of the component from the screen edge during transition. + * + * @since 12 + */ +typedef enum { + /** Top edge of the window. */ + ARKUI_TRANSITION_EDGE_TOP = 0, + /** Bottom edge of the window. */ + ARKUI_TRANSITION_EDGE_BOTTOM, + /** Left edge of the window. */ + ARKUI_TRANSITION_EDGE_START, + /** Right edge of the window. */ + ARKUI_TRANSITION_EDGE_END, +} ArkUI_TransitionEdge; + #ifdef __cplusplus }; #endif