diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json new file mode 100644 index 0000000000000000000000000000000000000000..cea4d3f4e0eea515bf71ca8cef4037d5fd8282ba --- /dev/null +++ b/.vscode/c_cpp_properties.json @@ -0,0 +1,18 @@ +{ + "configurations": [ + { + "name": "windows-gcc-x64", + "includePath": [ + "${workspaceFolder}/**" + ], + "compilerPath": "gcc", + "cStandard": "${default}", + "cppStandard": "${default}", + "intelliSenseMode": "windows-gcc-x64", + "compilerArgs": [ + "" + ] + } + ], + "version": 4 +} \ No newline at end of file diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000000000000000000000000000000000000..1641ae183fd8565da4ead2d5ff5bd60a165f000a --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,24 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "name": "C/C++ Runner: Debug Session", + "type": "cppdbg", + "request": "launch", + "args": [], + "stopAtEntry": false, + "externalConsole": true, + "cwd": "c:/Users/lisitao/AppData/Roaming/WeLink/appdata/IM/08y0dmif4azg@d5cb51187d2/ReceiveFiles", + "program": "c:/Users/lisitao/AppData/Roaming/WeLink/appdata/IM/08y0dmif4azg@d5cb51187d2/ReceiveFiles/build/Debug/outDebug", + "MIMode": "gdb", + "miDebuggerPath": "gdb", + "setupCommands": [ + { + "description": "Enable pretty-printing for gdb", + "text": "-enable-pretty-printing", + "ignoreFailures": true + } + ] + } + ] +} \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000000000000000000000000000000000000..3e5eb956e1aac2b053a4d09e761fcc26bb2b106e --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,59 @@ +{ + "C_Cpp_Runner.cCompilerPath": "gcc", + "C_Cpp_Runner.cppCompilerPath": "g++", + "C_Cpp_Runner.debuggerPath": "gdb", + "C_Cpp_Runner.cStandard": "", + "C_Cpp_Runner.cppStandard": "", + "C_Cpp_Runner.msvcBatchPath": "", + "C_Cpp_Runner.useMsvc": false, + "C_Cpp_Runner.warnings": [ + "-Wall", + "-Wextra", + "-Wpedantic", + "-Wshadow", + "-Wformat=2", + "-Wcast-align", + "-Wconversion", + "-Wsign-conversion", + "-Wnull-dereference" + ], + "C_Cpp_Runner.msvcWarnings": [ + "/W4", + "/permissive-", + "/w14242", + "/w14287", + "/w14296", + "/w14311", + "/w14826", + "/w44062", + "/w44242", + "/w14905", + "/w14906", + "/w14263", + "/w44265", + "/w14928" + ], + "C_Cpp_Runner.enableWarnings": true, + "C_Cpp_Runner.warningsAsError": false, + "C_Cpp_Runner.compilerArgs": [], + "C_Cpp_Runner.linkerArgs": [], + "C_Cpp_Runner.includePaths": [], + "C_Cpp_Runner.includeSearch": [ + "*", + "**/*" + ], + "C_Cpp_Runner.excludeSearch": [ + "**/build", + "**/build/**", + "**/.*", + "**/.*/**", + "**/.vscode", + "**/.vscode/**" + ], + "C_Cpp_Runner.useAddressSanitizer": false, + "C_Cpp_Runner.useUndefinedSanitizer": false, + "C_Cpp_Runner.useLeakSanitizer": false, + "C_Cpp_Runner.showCompilationTime": false, + "C_Cpp_Runner.useLinkTimeOptimization": false, + "C_Cpp_Runner.msvcSecureNoWarnings": false +} \ No newline at end of file diff --git a/arkui/ace_engine/native/libace.ndk.json b/arkui/ace_engine/native/libace.ndk.json index a7c27f13b9d0c1241e7597d91c558172bc803c64..ee8243bf5b82008883c9b63bd797bcb28c424d20 100644 --- a/arkui/ace_engine/native/libace.ndk.json +++ b/arkui/ace_engine/native/libace.ndk.json @@ -714,5 +714,177 @@ { "first_introduced": "12", "name": "OH_NativeXComponent_GetNativeXComponent" - } + }, + { + "first_introduced": "12", + "name": "OH_ArkUI_GuidelineOption_Create" + }, + { + "first_introduced": "12", + "name": "OH_ArkUI_GuidelineOption_Dispose" + }, + { + "first_introduced": "12", + "name": "OH_ArkUI_GuidelineOption_SetId" + }, + { + "first_introduced": "12", + "name": "OH_ArkUI_GuidelineOption_SetDirection" + }, + { + "first_introduced": "12", + "name": "OH_ArkUI_GuidelineOption_SetPositionStart" + }, + { + "first_introduced": "12", + "name": "OH_ArkUI_GuidelineOption_SetPositionEnd" + }, + { + "first_introduced": "12", + "name": "OH_ArkUI_GuidelineOption_GetId" + }, + { + "first_introduced": "12", + "name": "OH_ArkUI_GuidelineOption_GetDirection" + }, + { + "first_introduced": "12", + "name": "OH_ArkUI_GuidelineOption_GetPositionStart" + }, + { + "first_introduced": "12", + "name": "OH_ArkUI_GuidelineOption_GetPositionEnd" + }, + { + "first_introduced": "12", + "name": "OH_ArkUI_BarrierOption_Create" + }, + { + "first_introduced": "12", + "name": "OH_ArkUI_BarrierOption_Dispose" + }, + { + "first_introduced": "12", + "name": "OH_ArkUI_BarrierOption_SetId" + }, + { + "first_introduced": "12", + "name": "OH_ArkUI_BarrierOption_SetDirection" + }, + { + "first_introduced": "12", + "name": "OH_ArkUI_BarrierOption_SetReferencedId" + }, + { + "first_introduced": "12", + "name": "OH_ArkUI_BarrierOption_GetId" + }, + { + "first_introduced": "12", + "name": "OH_ArkUI_BarrierOption_GetDirection" + }, + { + "first_introduced": "12", + "name": "OH_ArkUI_BarrierOption_GetReferencedId" + }, + { + "first_introduced": "12", + "name": "OH_ArkUI_BarrierOption_GetReferencedIdSize" + }, + { + "first_introduced": "12", + "name": "OH_ArkUI_AlignRuleOption_Create" + }, + { + "first_introduced": "12", + "name": "OH_ArkUI_AlignRuleOption_Dispose" + }, + { + "first_introduced": "12", + "name": "OH_ArkUI_AlignRuleOption_SetLeft" + }, + { + "first_introduced": "12", + "name": "OH_ArkUI_AlignRuleOption_SetRight" + }, + { + "first_introduced": "12", + "name": "OH_ArkUI_AlignRuleOption_SetMiddle" + }, + { + "first_introduced": "12", + "name": "OH_ArkUI_AlignRuleOption_SetTop" + }, + { + "first_introduced": "12", + "name": "OH_ArkUI_AlignRuleOption_SetBottom" + }, + { + "first_introduced": "12", + "name": "OH_ArkUI_AlignRuleOption_SetCenter" + }, + { + "first_introduced": "12", + "name": "OH_ArkUI_AlignRuleOption_SetBiasHorizontal" + }, + { + "first_introduced": "12", + "name": "OH_ArkUI_AlignRuleOption_SetBiasVertical" + }, + { + "first_introduced": "12", + "name": "OH_ArkUI_AlignRuleOption_GetLeftId" + }, + { + "first_introduced": "12", + "name": "OH_ArkUI_AlignRuleOption_GetLeftAlign" + }, + { + "first_introduced": "12", + "name": "OH_ArkUI_AlignRuleOption_GetRightId" + }, + { + "first_introduced": "12", + "name": "OH_ArkUI_AlignRuleOption_GetRightAlign" + }, + { + "first_introduced": "12", + "name": "OH_ArkUI_AlignRuleOption_GetMiddleId" + }, + { + "first_introduced": "12", + "name": "OH_ArkUI_AlignRuleOption_GetMiddleAlign" + }, + { + "first_introduced": "12", + "name": "OH_ArkUI_AlignRuleOption_GetTopId" + }, + { + "first_introduced": "12", + "name": "OH_ArkUI_AlignRuleOption_GetTopAlign" + }, + { + "first_introduced": "12", + "name": "OH_ArkUI_AlignRuleOption_GetBottomId" + }, + { + "first_introduced": "12", + "name": "OH_ArkUI_AlignRuleOption_GetBottomAlign" + }, + { + "first_introduced": "12", + "name": "OH_ArkUI_AlignRuleOption_GetCenterId" + }, + { + "first_introduced": "12", + "name": "OH_ArkUI_AlignRuleOption_GetCenterAlign" + }, + { + "first_introduced": "12", + "name": "OH_ArkUI_AlignRuleOption_GetBiasHorizontal" + }, + { + "first_introduced": "12", + "name": "OH_ArkUI_AlignRuleOption_GetBiasVertical" + } ] \ 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 c1fc53bc0d8c21572799d1f3fa1c97b1c3033203..b4a745498cf08a98aa458b3e4c13c04337368552 100644 --- a/arkui/ace_engine/native/native_node.h +++ b/arkui/ace_engine/native/native_node.h @@ -111,6 +111,8 @@ typedef enum { ARKUI_NODE_WATER_FLOW, /** Water flow item. */ ARKUI_NODE_FLOW_ITEM, + /** Relative layout component. */ + ARKUI_NODE_RELATIVE_CONTAINER, } ArkUI_NodeType; /** @@ -1195,50 +1197,10 @@ typedef enum { * 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: ID of the component that functions as the anchor point for left alignment. \n - * .value[1]?.i32: alignment mode relative to the anchor component for left alignment. - * The value is an enum of {@link ArkUI_HorizontalAlignment}. \n - * .value[2]?.i32: ID of the component that functions as the anchor point for center alignment. \n - * .value[3]?.i32: alignment mode relative to the anchor component for center alignment. - * The value is an enum of {@link ArkUI_HorizontalAlignment}. \n - * .value[4]?.i32: ID of the component that functions as the anchor point for right alignment. \n - * .value[5]?.i32: alignment mode relative to the anchor component for right alignment. - * The value is an enum of {@link ArkUI_HorizontalAlignment}. \n - * .value[6]?.i32: ID of the component that functions as the anchor point for top alignment. \n - * .value[7]?.i32: alignment mode relative to the anchor component for top alignment. - * The value is an enum of {@link ArkUI_VerticalAlignment}. \n - * .value[8]?.i32: ID of the component that functions as the anchor point for center alignment in the - * vertical direction. \n - * .value[9]?.i32: alignment mode relative to the anchor component forcenter alignment in the vertical direction. - * The value is an enum of {@link ArkUI_VerticalAlignment}. \n - * .value[10]?.i32: ID of the component that functions as the anchor point for bottom alignment. \n - * .value[11]?.i32: alignment mode relative to the anchor component for bottom alignment. - * The value is an enum of {@link ArkUI_VerticalAlignment}. \n - * .value[12]?.f32: bias value in the horizontal direction. \n - * .value[13]?.f32: bias value in the vertical direction. \n - * \n - * Format of the return value {@link ArkUI_AttributeItem}:\n - * .value[0].i32: ID of the component that functions as the anchor point for left alignment. \n - * .value[1].i32: alignment mode relative to the anchor component for left alignment. - * The value is an enum of {@link ArkUI_HorizontalAlignment}. \n - * .value[2].i32: ID of the component that functions as the anchor point for center alignment. \n - * .value[3].i32: alignment mode relative to the anchor component for center alignment. - * The value is an enum of {@link ArkUI_HorizontalAlignment}. \n - * .value[4].i32: ID of the component that functions as the anchor point for right alignment. \n - * .value[5].i32: alignment mode relative to the anchor component for right alignment. - * The value is an enum of {@link ArkUI_HorizontalAlignment}. \n - * .value[6].i32: ID of the component that functions as the anchor point for top alignment. \n - * .value[7].i32: alignment mode relative to the anchor component for top alignment. - * The value is an enum of {@link ArkUI_VerticalAlignment}. \n - * .value[8].i32: ID of the component that functions as the anchor point for center alignment in the - * vertical direction. \n - * .value[9].i32: alignment mode relative to the anchor component forcenter alignment in the vertical direction. - * The value is an enum of {@link ArkUI_VerticalAlignment}. \n - * .value[10].i32: ID of the component that functions as the anchor point for bottom alignment. \n - * .value[11].i32: alignment mode relative to the anchor component for bottom alignment. - * The value is an enum of {@link ArkUI_VerticalAlignment}. \n - * .value[12].f32: bias value in the horizontal direction. \n - * .value[13].f32: bias value in the vertical direction. \n + * .object: Use the {@link ArkUI_AlignRuleOption} object as the component’s alignment rule. \n + * \n + * Format of the return value {@link ArkUI_AttributeItem}:\n + * .object: Use the {@link ArkUI_AlignRuleOption} object as the component’s alignment rule. \n * */ NODE_ALIGN_RULES, @@ -1370,6 +1332,44 @@ typedef enum { */ NODE_ASPECT_RATIO, + /** + * @brief The implicit shared element transition within the component supports attribute setting, + * attribute reset, and attribute acquisition interfaces. + * + * Attribute setting method parameter {@link ArkUI_AttributeItem} format: \n + * .value[0].i32: The parameter type is 1 or 0. 2 components that share element bindings, + * Whether to continue to participate in the shared element animation when the appearance element is not deleted, + * the default is false, and the original position will remain unchanged if not involved. \n + * .string is used to set the binding relationship. Set the id to "" to clear the binding relationship to avoid participating in sharing behavior. + * The id can be changed and the binding relationship re-established. + * The same ID can only be bound to two components and they are in/out roles of different types. + * Multiple components cannot be bound to the same id. \n + *\n + * Attribute acquisition method return value {@link ArkUI_AttributeItem} format: \n + * .value[0].i32: The parameter type is 1 or 0. 2 components that share element bindings, + * Whether to continue to participate in the shared element animation when the appearance element is not deleted, + * the default is not false, if not involved, the original position will remain unchanged. \n + * .string is used to set the binding relationship. Set the id to "" to clear the binding relationship to avoid participating in sharing behavior. + * The id can be changed and the binding relationship re-established. + * The same ID can only be bound to two components and they are in/out roles of different types. + * Multiple components cannot be bound to the same id. \n + */ + NODE_GEOMETRY_TRANSITION, + + /** + * @brief specifies the parameters of the chain formed by this component as the chain head, and supports attribute setting, attribute reset and attribute acquisition interfaces. + * + * Only takes effect when the parent container is RelativeContainer + * + * Attribute setting method parameter {@link ArkUI_AttributeItem} format: \n + * .value[0].i32: The direction of the chain. Enum {@link ArkUI_Axis}. \n + * .value[1].i32: Chain style. Enum {@link ArkUI_RelativeLayoutChainStyle}. \n + *\n + * .value[0].i32: The direction of the chain. Enum {@link ArkUI_Axis}. \n + * .value[1].i32: Chain style. Enum {@link ArkUI_RelativeLayoutChainStyle}. \n + */ + NODE_RELATIVE_LAYOUT_CHAIN_MODE, + /** * @brief Defines the text content attribute, which can be set, reset, and obtained as required through APIs. * @@ -2113,6 +2113,21 @@ typedef enum { */ NODE_TEXT_INPUT_TEXT_SELECTION, + /** + * @brief Sets whether to hide the text selection menu when the text box is long-pressed, double-click, or + * right-clicked. 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 hide the text selection menu when the text box is long-pressed, double-click, or + * right-clicked. The default value is false. \n + * \n + * Format of the return value {@link ArkUI_AttributeItem}:\n + * .value[0].i32: whether to hide the text selection menu when the text box is long-pressed, double-click, or + * right-clicked. \n + * + */ + NODE_TEXT_INPUT_SELECTION_MENU_HIDDEN, + /** * @brief Defines the default placeholder text for the multi-line text box. * This attribute can be set, reset, and obtained as required through APIs. @@ -2238,6 +2253,21 @@ typedef enum { */ NODE_TEXT_AREA_SHOW_COUNTER, + /** + * @brief Sets whether to hide the text selection menu when the text box is long-pressed, double-click, + * or right-clicked. 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 hide the text selection menu when the text box is long-pressed, double-click, + * or right-clicked. The default value is false. \n + * \n + * Format of the return value {@link ArkUI_AttributeItem}:\n + * .value[0].i32: whether to hide the text selection menu when the text box is long-pressed, double-click, + * or right-clicked. \n + * + */ + NODE_TEXT_AREA_SELECTION_MENU_HIDDEN, + /** * @brief Defines the button text content. This attribute can be set, reset, and obtained as required through APIs. * @@ -3329,6 +3359,21 @@ typedef enum { */ NODE_LIST_CACHED_COUNT, + /** + * @brief Sets the alignment mode of list items along the cross axis when the cross-axis width of the list is + * greater than the cross-axis width of list items multiplied by the value of lanes. + * 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: alignment mode of list items along the cross axis. + * The parameter type is {@link ArkUI_ListItemAlignment}. \n + * \n + * Format of the return value {@link ArkUI_AttributeItem}:\n + * .value[0].i32: alignment mode of list items along the cross axis. + * The parameter type is {@link ArkUI_ListItemAlignment}. \n + */ + NODE_LIST_ALIGN_LIST_ITEM, + /** * @brief Defines whether to enable loop playback for the swiper. * This attribute can be set, reset, and obtained as required through APIs. @@ -3786,6 +3831,32 @@ typedef enum { * .value[0].i32: number of cached items in the water flowadapter. \n */ NODE_WATER_FLOW_CACHED_COUNT, + + /** + * @brief Set the auxiliary line in the RelativeContaine container, supporting property setting, + * property reset and property acquisition interfaces. + * + * Attribute setting method parameter {@link ArkUI_AttributeItem} format: \n + * .object: Auxiliary lines within the RelativeContaine container: \n + *\n + * Attribute acquisition method return value {@link ArkUI_AttributeItem} format: \n + * .object: Auxiliary lines within the RelativeContaine container: \n + * + */ + NODE_RELATIVE_CONTAINER_GUIDE_LINE = MAX_NODE_SCOPE_NUM * ARKUI_NODE_RELATIVE_CONTAINER, + + /** + * @brief Sets the barrier within the RelativeContaine container and supports property setting, + * property reset and property acquisition interfaces. + * + * Attribute setting method parameter {@link ArkUI_AttributeItem} format: \n + * .object: Auxiliary lines within the RelativeContaine container: \n + *\n + * Attribute acquisition method return value {@link ArkUI_AttributeItem} format: \n + * .object: Barrier within the RelativeContaine container: \n + * + */ + NODE_RELATIVE_CONTAINER_BARRIER, } ArkUI_NodeAttributeType; #define MAX_COMPONENT_EVENT_ARG_NUM 12 @@ -4035,6 +4106,32 @@ typedef enum { * */ NODE_TEXT_INPUT_ON_TEXT_SELECTION_CHANGE, + + /** + * @brief Defines the event triggered when the input status 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 one parameter:\n + * ArkUI_NodeComponentEvent.data[0].i32: true indicates that text input is in progress. \n + * + */ + NODE_TEXT_INPUT_ON_EDIT_CHANGE, + + /** + * @brief textInput This event is triggered when the input content changes. + * + * Conditions for triggering this event: When the input content changes. \n + * When the event callback occurs, the union type in the event parameter + * {@link ArkUI_NodeEvent} object is {@link ArkUI_NodeComponentEvent}. \n + * {@link ArkUI_NodeComponentEvent} contains 2 parameters:\n + * ArkUI_NodeComponentEvent.data[0].f32: Indicates the width of the text. \n + * ArkUI_NodeComponentEvent.data[1].f32: Indicates the height of the text. \n + * + */ + NODE_TEXT_INPUT_ON_CONTENT_SIZE_CHANGE, + /** * @brief Defines the event triggered when the input in the text box changes. * @@ -4071,6 +4168,40 @@ typedef enum { */ NODE_TEXT_AREA_ON_TEXT_SELECTION_CHANGE, + /** + * @brief Defines the event triggered when the input status 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 one parameter:\n + * ArkUI_NodeComponentEvent.data[0].i32: true indicates that text input is in progress. \n + * + */ + NODE_TEXT_AREA_ON_EDIT_CHANGE, + + /** + * @brief Defines the event triggered when the Enter key on the keyboard is pressed for the multi-line text box. + * + * This event is not triggered when keyType is ARKUI_ENTER_KEY_TYPE_NEW_LINE. \n + * 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: type of the Enter key. + * + */ + NODE_TEXT_AREA_ON_SUBMIT, + + /** + * @brief textArea This event is triggered when the input content changes. + * + * Conditions for triggering this event: When the input content changes. \n + * When the event callback occurs, the union type in the event parameter {@link ArkUI_NodeEvent} object is {@link ArkUI_NodeComponentEvent}. \n + * {@link ArkUI_NodeComponentEvent} contains 2 parameters:\n + * ArkUI_NodeComponentEvent.data[0].f32: Indicates the width of the text. \n + * ArkUI_NodeComponentEvent.data[1].f32: Indicates the height of the text. \n + * + */ + NODE_TEXT_AREA_ON_CONTENT_SIZE_CHANGE, + /** * @brief Defines the event triggered when the selected status of the ARKUI_NODE_CHECKBOX component changes. * @@ -5079,6 +5210,14 @@ typedef struct { * @return Returns 0 if the operation is successful; returns 401 if a parameter error occurs. */ int32_t (*setLengthMetricUnit)(ArkUI_NodeHandle node, ArkUI_LengthMetricUnit unit); + + /** + * @brief Get the parent node. + * + * @param node target node object. + * @return Returns the pointer of the component, if not return NULL + */ + ArkUI_NodeHandle (*getParent)(ArkUI_NodeHandle node); } ArkUI_NativeNodeAPI_1; diff --git a/arkui/ace_engine/native/native_type.h b/arkui/ace_engine/native/native_type.h index f9038b369ee7f11944078096fa65b4cd2fb75d06..637c7640ced286b76568eef6d81d0f7c8e784b48 100644 --- a/arkui/ace_engine/native/native_type.h +++ b/arkui/ace_engine/native/native_type.h @@ -112,6 +112,28 @@ struct ArkUI_Context; */ typedef struct ArkUI_Context* ArkUI_ContextHandle; +/** + * @brief specifies the alignment rules for subcomponents set in relative containers. + * + * @since 12 + */ +typedef struct ArkUI_AlignRuleOption ArkUI_AlignRuleOption; + +/** + * @brief guideLine parameters, used to define the id, direction and position of the guideline. + * + * @since 12 + */ +typedef struct ArkUI_GuidelineOption ArkUI_GuidelineOption; + +/** + * @brief barrier parameter, used to define the id, + * direction and components of the barrier that it depends on when generating it. + * + * @since 12 + */ +typedef struct ArkUI_BarrierOption ArkUI_BarrierOption; + /** * @brief Defines the event callback type. * @@ -1414,6 +1436,52 @@ typedef enum { ARKUI_FINISH_CALLBACK_LOGICALLY, } ArkUI_FinishCallbackType; +/** + * @brief Enumerates the alignment modes of items along the cross axis. + * + * @since 12 + */ +typedef enum { + /** The list items are packed toward the start edge of the list container along the cross axis. */ + ARKUI_LIST_ITEM_ALIGNMENT_START = 0, + /** The list items are centered in the list container along the cross axis. */ + ARKUI_LIST_ITEM_ALIGNMENT_CENTER, + /** The list items are packed toward the end edge of the list container along the cross axis. */ + ARKUI_LIST_ITEM_ALIGNMENT_END, +} ArkUI_ListItemAlignment; + + +/** + * @brief defines the direction of the barrier line. + * + * @since 12 + */ +typedef enum { + /** The barrier is the leftmost of all its referencedIds. */ + ARKUI_BARRIER_DIRECTION_LEFT = 0, + /** The barrier is on the rightmost side of all its referencedIds. */ + ARKUI_BARRIER_DIRECTION_RIGHT, + /** The barrier is at the top of all its referencedIds. */ + ARKUI_BARRIER_DIRECTION_TOP, + /** The barrier is at the bottom of all its referencedIds. */ + ARKUI_BARRIER_DIRECTION_BOTTOM +} ArkUI_BarrierDirection; + + +/** + * @brief defines the style of the chain. + * + * @since 12 + */ +typedef enum { + /** Components are evenly distributed among constraint anchor points. */ + ARKUI_RELATIVE_LAYOUT_CHAIN_STYLE_SPREAD = 0, + /**Except for the first and last two sub-components, other components are evenly distributed between the constraint anchor points. */ + ARKUI_RELATIVE_LAYOUT_CHAIN_STYLE_SPREAD_INSIDE, + /**No gaps in subcomponents within the chain. */ + ARKUI_RELATIVE_LAYOUT_CHAIN_STYLE_PACKED, +} ArkUI_RelativeLayoutChainStyle; + /** * @brief Describes the margins of a component. * @@ -1731,6 +1799,411 @@ ArkUI_Margin OH_ArkUI_WaterFlowSectionOption_GetMargin(ArkUI_WaterFlowSectionOpt * @since 12 */ int32_t OH_ArkUI_WaterFlowSectionOption_GetItemCount(ArkUI_WaterFlowSectionOption* option, int32_t index); + +/** +* @brief Create auxiliary line information in the RelativeContaine container. +* +* @param size The number of auxiliary lines. +* @return auxiliary line information. +* @since 12 +*/ +ArkUI_GuidelineOption* OH_ArkUI_GuidelineOption_Create(int32_t size); + +/** +* @brief Destroy auxiliary line information. +* +* @param guideline auxiliary line information. +* @since 12 +*/ +void OH_ArkUI_GuidelineOption_Dispose(ArkUI_GuidelineOption* guideline); + +/** +* @brief Set the Id of the auxiliary line. +* +* @param guideline auxiliary line information. +* @param value id, must be unique and cannot have the same name as the component in the container. +* @param index auxiliary line index value. +* @since 12 +*/ +void OH_ArkUI_GuidelineOption_SetId(ArkUI_GuidelineOption* guideline, const char* value, int32_t index); + +/** +* @brief Set the direction of the auxiliary line. +* +* @param guideline auxiliary line information. +* @param value direction. +* @param index auxiliary line index value. +* @since 12 +*/ +void OH_ArkUI_GuidelineOption_SetDirection(ArkUI_GuidelineOption* guideline, ArkUI_Axis value, int32_t index); + +/** +* @brief Set the distance from the left or top of the container. +* +* @param guideline auxiliary line information. +* @param value The distance from the left or top of the container. +* @param index auxiliary line index value. +* @since 12 +*/ +void OH_ArkUI_GuidelineOption_SetPositionStart(ArkUI_GuidelineOption* guideline, float value, int32_t index); + +/** +* @brief Set the distance from the right or bottom of the container. +* +* @param guideline auxiliary line information. +* @param value The distance from the right side or bottom of the container. +* @param index auxiliary line index value. +* @since 12 +*/ +void OH_ArkUI_GuidelineOption_SetPositionEnd(ArkUI_GuidelineOption* guideline, float value, int32_t index); + +/** +* @brief Get the Id of the auxiliary line. +* +* @param guideline auxiliary line information. +* @param index auxiliary line index value. +* @returnId. +* @since 12 +*/ +const char* OH_ArkUI_GuidelineOption_GetId(ArkUI_GuidelineOption* guideline, int32_t index); + +/** +* @brief Get the direction of the auxiliary line. +* +* @param guideline auxiliary line information. +* @param index auxiliary line index value. +* @return direction. +* @since 12 +*/ +ArkUI_Axis OH_ArkUI_GuidelineOption_GetDirection(ArkUI_GuidelineOption* guideline, int32_t index); + +/** +* @brief Get the distance from the left or top of the container. +* +* @param guideline auxiliary line information. +* @param index auxiliary line index value. +* @return The distance from the left or top of the container. +* @since 12 +*/ +float OH_ArkUI_GuidelineOption_GetPositionStart(ArkUI_GuidelineOption* guideline, int32_t index); + +/** +* @brief Get the distance from the right side or bottom of the container. +* +* @param guideline auxiliary line information. +* @param index auxiliary line index value. +* @return The distance from the right side or bottom of the container. +* @since 12 +*/ +float OH_ArkUI_GuidelineOption_GetPositionEnd(ArkUI_GuidelineOption* guideline, int32_t index); + +/** +* @brief creates barrier information within the RelativeContaine container. +* +* @param size Number of barriers. +* @return barrier information. +* @since 12 +*/ +ArkUI_BarrierOption* OH_ArkUI_BarrierOption_Create(int32_t size); + +/** +* @brief Destroy barrier information. +* +* @param barrierStyle barrier information. +* @since 12 +*/ +void OH_ArkUI_BarrierOption_Dispose(ArkUI_BarrierOption* barrierStyle); + +/** +* @brief Set the Id of the barrier. +* +* @param barrierStyle barrier information. +* @param value id, must be unique and cannot have the same name as the component in the container. +* @param index Barrier index value. +* @since 12 +*/ +void OH_ArkUI_BarrierOption_SetId(ArkUI_BarrierOption* barrierStyle, const char* value, int32_t index); + +/** +* @brief Set the direction of the barrier. +* +* @param barrierStyle barrier information. +* @param value direction. +* @param index Barrier index value. +* @since 12 +*/ +void OH_ArkUI_BarrierOption_SetDirection(ArkUI_BarrierOption* barrierStyle, ArkUI_BarrierDirection value, int32_t index); + +/** +* @brief Sets the dependent component of the barrier. +* +* @param barrierStyle barrier information. +* @param value The ID of the dependent component. +* @param index Barrier index value. +* @since 12 +*/ +void OH_ArkUI_BarrierOption_SetReferencedId(ArkUI_BarrierOption* barrierStyle, const char* value, int32_t index); + +/** +* @brief Get the Id of the barrier. +* +* @param barrierStyle auxiliary line information. +* @param index auxiliary line index value. +* @return The Id of the barrier. +* @since 12 +*/ +const char* OH_ArkUI_BarrierOption_GetId(ArkUI_BarrierOption* barrierStyle, int32_t index); + +/** +* @brief Gets the direction of the barrier. +* +* @param barrierStyle auxiliary line information. +* @param index auxiliary line index value. +* @return The direction of the barrier. +* @since 12 +*/ +ArkUI_BarrierDirection OH_ArkUI_BarrierOption_GetDirection(ArkUI_BarrierOption* barrierStyle, int32_t index); + +/** +* @brief Get the dependent components of the barrier. +* +* @param barrierStyle auxiliary line information. +* @param index auxiliary line index value. +* @param referencedIndex dependent component Id index value. +* @return The barrier's dependent components. +* @since 12 +*/ +const char* OH_ArkUI_BarrierOption_GetReferencedId(ArkUI_BarrierOption* barrierStyle, int32_t index, int32_t referencedIndex); + +/** +* @brief Gets the number of dependent components of the barrier. +* +* @param barrierStyle auxiliary line information. +* @param index auxiliary line index value. +* @return The number of dependent components of the barrier. +* @since 12 +*/ +int32_t OH_ArkUI_BarrierOption_GetReferencedIdSize(ArkUI_BarrierOption* barrierStyle, int32_t index); + +/** +* @brief creates alignment rule information for subcomponents in relative containers. +* +* @return Alignment rule information. +* @since 12 +*/ +ArkUI_AlignRuleOption* OH_ArkUI_AlignRuleOption_Create(); + +/** +* @brief Destroys the alignment rule information of subcomponents in relative containers. +* +* @param option Alignment rule information of subcomponents in the relative container. +* @since 12 +*/ +void OH_ArkUI_AlignRuleOption_Dispose(ArkUI_AlignRuleOption* option); + +/** +* @brief Set the left alignment parameter. +* +* @param option Alignment rule information of subcomponents in the relative container. +* @param id The id value of the anchor component. +* @param value Alignment relative to the anchor component. +* @since 12 +*/ +void OH_ArkUI_AlignRuleOption_SetLeft(ArkUI_AlignRuleOption* option, const char* id, ArkUI_HorizontalAlignment alignment); + +/** +* @brief Set the right alignment parameter. +* +* @param option Alignment rule information of subcomponents in the relative container. +* @param id The id value of the anchor component. +* @param value Alignment relative to the anchor component. +* @since 12 +*/ +void OH_ArkUI_AlignRuleOption_SetRight(ArkUI_AlignRuleOption* option, const char* id, ArkUI_HorizontalAlignment alignment); + +/** +* @brief Set the parameters for horizontal center alignment. +* +* @param option Alignment rule information of subcomponents in the relative container. +* @param id The id value of the anchor component. +* @param value Alignment relative to anchor component +* @since 12 +*/ +void OH_ArkUI_AlignRuleOption_SetMiddle(ArkUI_AlignRuleOption* option, const char* id, ArkUI_HorizontalAlignment alignment); + +/** +* @brief Set the parameters for top alignment. +* +* @param option Alignment rule information of subcomponents in the relative container. +* @param id The id value of the anchor component. +* @param value Alignment relative to anchor component +* @since 12 +*/ +void OH_ArkUI_AlignRuleOption_SetTop(ArkUI_AlignRuleOption* option, const char* id, ArkUI_VerticalAlignment alignment); + +/** +* @brief Set the bottom alignment parameters. +* +* @param option Alignment rule information of subcomponents in the relative container. +* @param id The id value of the anchor component. +* @param value Alignment relative to anchor component +* @since 12 +*/ +void OH_ArkUI_AlignRuleOption_SetBottom(ArkUI_AlignRuleOption* option, const char* id, ArkUI_VerticalAlignment alignment); + +/** +* @brief Set the parameters for vertical center alignment. +* +* @param option Alignment rule information of subcomponents in the relative container. +* @param id The id value of the anchor component. +* @param value Alignment relative to the anchor component. +* @since 12 +*/ +void OH_ArkUI_AlignRuleOption_SetCenter(ArkUI_AlignRuleOption* option, const char* id, ArkUI_VerticalAlignment alignment); + +/** +* @brief Sets the horizontal offset parameter of the component under the anchor point constraint. +* +* @param option Alignment rule information of subcomponents in the relative container. +* @param horizontal bias value in the horizontal direction. +* @since 12 +*/ +void OH_ArkUI_AlignRuleOption_SetBiasHorizontal(ArkUI_AlignRuleOption* option, float horizontal); + +/** +* @brief Set the vertical offset parameter of the component under the anchor point constraint. +* +* @param option Alignment rule information of subcomponents in the relative container. +* @param horizontal bias value in the vertical direction. +* @since 12 +*/ +void OH_ArkUI_AlignRuleOption_SetBiasVertical(ArkUI_AlignRuleOption* option, float vertical); + +/** +* @brief Get the Id of the left-aligned parameter. +* +* @param option Alignment rule information of subcomponents in the relative container. +* @return The id value of the anchor component. +* @since 12 +*/ +const char* OH_ArkUI_AlignRuleOption_GetLeftId(ArkUI_AlignRuleOption* option); + +/** +* @brief Gets the alignment of the left-aligned parameter. +* +* @param option Alignment rule information of subcomponents in the relative container. +* @return The alignment of the parameters. +* @since 12 +*/ +ArkUI_HorizontalAlignment OH_ArkUI_AlignRuleOption_GetLeftAlign(ArkUI_AlignRuleOption* option); + +/** +* @brief Get the right alignment parameter. +* +* @param option Alignment rule information of subcomponents in the relative container. +* @return Right-aligned parameter id. +* @since 12 +*/ +const char* OH_ArkUI_AlignRuleOption_GetRightId(ArkUI_AlignRuleOption* option); + +/** +* @brief Get the right alignment parameter. +* +* @param option Alignment rule information of subcomponents in the relative container. +* @return The alignment of the right-aligned parameter. +* @since 12 +*/ +ArkUI_HorizontalAlignment OH_ArkUI_AlignRuleOption_GetRightAlign(ArkUI_AlignRuleOption* option); + +/** +* @brief Gets the parameters of horizontal center alignment. +* +* @param option Alignment rule information of subcomponents in the relative container. +* @return The id of the parameter of horizontal center alignment. +* @since 12 +*/ +const char* OH_ArkUI_AlignRuleOption_GetMiddleId(ArkUI_AlignRuleOption* option); + +/** +* @brief Gets the parameters of horizontal center alignment. +* +* @param option Alignment rule information of subcomponents in the relative container. +* @return The alignment of the horizontally centered alignment parameter. +* @since 12 +*/ +ArkUI_HorizontalAlignment OH_ArkUI_AlignRuleOption_GetMiddleAlign(ArkUI_AlignRuleOption* option); + +/** +* @brief Get the top-aligned parameters. +* +* @param option Alignment rule information of subcomponents in the relative container. +* @return Top aligned parameter id. +* @since 12 +*/ +const char* OH_ArkUI_AlignRuleOption_GetTopId(ArkUI_AlignRuleOption* option); + +/** +* @brief Get the top-aligned parameters. +* +* @param option Alignment rule information of subcomponents in the relative container. +* @return The alignment of the top-aligned parameter. +* @since 12 +*/ +ArkUI_VerticalAlignment OH_ArkUI_AlignRuleOption_GetTopAlign(ArkUI_AlignRuleOption* option); + +/** +* @brief Get the bottom alignment parameters. +* +* @param option Alignment rule information of subcomponents in the relative container. +* @return The id of the bottom-aligned parameter. +* @since 12 +*/ +const char* OH_ArkUI_AlignRuleOption_GetBottomId(ArkUI_AlignRuleOption* option); + +/** +* @brief Get the bottom alignment parameters. +* +* @param option Alignment rule information of subcomponents in the relative container. +* @return The alignment of the bottom-aligned parameter. +* @since 12 +*/ +ArkUI_VerticalAlignment OH_ArkUI_AlignRuleOption_GetBottomAlign(ArkUI_AlignRuleOption* option); + +/** +* @brief Gets the parameters of vertical center alignment. +* +* @param option Alignment rule information of subcomponents in the relative container. +* @return The id of the vertical center alignment parameter. +* @since 12 +*/ +const char* OH_ArkUI_AlignRuleOption_GetCenterId(ArkUI_AlignRuleOption* option); + +/** +* @brief Gets the parameters of vertical center alignment. +* +* @param option Alignment rule information of subcomponents in the relative container. +* @return The alignment of the vertical center alignment parameter. +* @since 12 +*/ +ArkUI_VerticalAlignment OH_ArkUI_AlignRuleOption_GetCenterAlign(ArkUI_AlignRuleOption* option); + +/** +* @brief Get the bias value in the horizontal direction. +* +* @param option Alignment rule information of subcomponents in the relative container. +* @return The bias value in the horizontal direction. +* @since 12 +*/ +float OH_ArkUI_AlignRuleOption_GetBiasHorizontal(ArkUI_AlignRuleOption* option); + +/** +* @brief Get the bias value in the vertical direction. +* +* @param option Alignment rule information of subcomponents in the relative container. +* @return bias value in vertical direction. +* @since 12 +*/ +float OH_ArkUI_AlignRuleOption_GetBiasVertical(ArkUI_AlignRuleOption* option); #ifdef __cplusplus }; #endif