diff --git a/arkui/ace_engine/native/libace.ndk.json b/arkui/ace_engine/native/libace.ndk.json index b5f15e435f2c5b382402e1300d178d30e5db48c8..9716d21898b5ca219a049d97150e54a5e2a591af 100644 --- a/arkui/ace_engine/native/libace.ndk.json +++ b/arkui/ace_engine/native/libace.ndk.json @@ -1158,5 +1158,77 @@ { "first_introduced": "12", "name": "OH_ArkUI_ListItemSwipeActionOption_SetOnOffsetChange" + }, + { + "first_introduced": "12", + "name": "OH_ArkUI_AccessibilityState_Create" + }, + { + "first_introduced": "12", + "name": "OH_ArkUI_AccessibilityState_Dispose" + }, + { + "first_introduced": "12", + "name": "OH_ArkUI_AccessibilityState_SetDisabled" + }, + { + "first_introduced": "12", + "name": "OH_ArkUI_AccessibilityState_IsDisabled" + }, + { + "first_introduced": "12", + "name": "OH_ArkUI_AccessibilityState_SetSelected" + }, + { + "first_introduced": "12", + "name": "OH_ArkUI_AccessibilityState_IsSelected" + }, + { + "first_introduced": "12", + "name": "OH_ArkUI_AccessibilityState_SetCheckedType" + }, + { + "first_introduced": "12", + "name": "OH_ArkUI_AccessibilityState_GetCheckedType" + }, + { + "first_introduced": "12", + "name": "OH_ArkUI_AccessibilityValue_Create" + }, + { + "first_introduced": "12", + "name": "OH_ArkUI_AccessibilityValue_Dispose" + }, + { + "first_introduced": "12", + "name": "OH_ArkUI_AccessibilityValue_SetMin" + }, + { + "first_introduced": "12", + "name": "OH_ArkUI_AccessibilityValue_GetMin" + }, + { + "first_introduced": "12", + "name": "OH_ArkUI_AccessibilityValue_SetMax" + }, + { + "first_introduced": "12", + "name": "OH_ArkUI_AccessibilityValue_GetMax" + }, + { + "first_introduced": "12", + "name": "OH_ArkUI_AccessibilityValue_SetCurrent" + }, + { + "first_introduced": "12", + "name": "OH_ArkUI_AccessibilityValue_GetCurrent" + }, + { + "first_introduced": "12", + "name": "OH_ArkUI_AccessibilityValue_SetText" + }, + { + "first_introduced": "12", + "name": "OH_ArkUI_AccessibilityValue_GetText" } ] \ 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 5df060447dde9ad420dfaa8f59decc40c7007b0f..b566a3b188e1a3350b514f6204cd0bba956a44a1 100644 --- a/arkui/ace_engine/native/native_node.h +++ b/arkui/ace_engine/native/native_node.h @@ -1617,6 +1617,63 @@ typedef enum { */ NODE_FOCUS_ON_TOUCH, + /** + * @brief Accessible ID, which can be obtained as required through APIs. + * + * Format of the return value {@link ArkUI_AttributeItem}:\n + * .value[0].i32:Accessible ID。\n + * + */ + NODE_ACCESSIBILITY_ID = 85, + + /** + * @brief Define accessible actions, 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].u32:accessible action types,and uses the {@link ArkUI_AccessibilityActionType} enumeration value.\n + * \n + * Format of the return value {@link ArkUI_AttributeItem}:\n + * .value[0].u32:accessible action types,and uses the {@link ArkUI_AccessibilityActionType} enumeration value.\n + * + */ + NODE_ACCESSIBILITY_ACTIONS = 86, + + /** + * @brief Define accessible role, 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].u32:accessible role type,and uses the {@link ArkUI_NodeType} enumeration value.\n + * \n + * Format of the return value {@link ArkUI_AttributeItem}:\n + * .value[0].u32:accessible role type,and uses the {@link ArkUI_NodeType} enumeration value.\n + * + */ + NODE_ACCESSIBILITY_ROLE = 87, + + /** + * @brief Define accessible state, which 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_AccessibilityState}.\n + * \n + * Format of the {@link ArkUI_AttributeItem} parameter for setting the attribute:\n + * .object:the parameter type is {@link ArkUI_AccessibilityState}.\n + * + */ + NODE_ACCESSIBILITY_STATE = 88, + + /** + * @brief Define accessible value, which 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_AccessibilityValue}.\n + * \n + * Format of the return value {@link ArkUI_AttributeItem}:\n + * .object:the parameter type is {@link ArkUI_AccessibilityValue}.\n + * + */ + NODE_ACCESSIBILITY_VALUE = 89, + /** * @brief Defines the text content attribute, which can be set, reset, and obtained as required through APIs. * @@ -5112,6 +5169,19 @@ typedef enum { */ NODE_EVENT_ON_DETACH, + /** + * @brief Defines the accessibility action event. + * + * This event is triggered when The accessibility operation type has been set and + * corresponding operations have been carried out. \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 parameters:\n + * ArkUI_NodeComponentEvent.data[0].u32: accessibility action type,the union type is + * {@link ArkUI_AccessibilityActionType} \n + * + */ + NODE_ON_ACCESSIBILITY_ACTIONS = 13, /** * @brief Triggers onDetectResultUpdate callback * when the text is set to TextDataDetectorConfig and recognized successfully. diff --git a/arkui/ace_engine/native/native_type.h b/arkui/ace_engine/native/native_type.h index 381ea6d4280211c954d86ef6c83858becfcce258..65106133e02678cdb499d0043ce9972b026e434d 100644 --- a/arkui/ace_engine/native/native_type.h +++ b/arkui/ace_engine/native/native_type.h @@ -518,6 +518,52 @@ typedef struct { int32_t size; } ARKUI_TextPickerCascadeRangeContent; +/** + * @brief 定义无障碍复选框状态类型枚举值。 + * + * @since 12 + */ +typedef enum { + /** 复选框未被选中。*/ + ARKUI_ACCESSIBILITY_UNCHECKED = 0, + /** 复选框被选中。*/ + ARKUI_ACCESSIBILITY_CHECKED, +} ArkUI_AccessibilityCheckedState; + + +/** + * @brief Define accessible action types. + * + * @since 12 + */ +typedef enum { + /** click action. */ + ARKUI_ACCESSIBILITY_ACTION_CLICK = 1 << 0, + /** long click action. */ + ARKUI_ACCESSIBILITY_ACTION_LONG_CLICK = 1 << 1, + /** cut action. */ + ARKUI_ACCESSIBILITY_ACTION_CUT = 1 << 2, + /** copy action. */ + ARKUI_ACCESSIBILITY_ACTION_COPY = 1 << 3, + /** paste action. */ + ARKUI_ACCESSIBILITY_ACTION_PASTE = 1 << 4, +} ArkUI_AccessibilityActionType; + +/** + * @brief 定义组件无障碍状态。 + * + * @since 12 + */ +typedef struct ArkUI_AccessibilityState ArkUI_AccessibilityState; + +/** + * @brief 定义组件无障碍信息值。 + * + * @since 12 + */ +typedef struct ArkUI_AccessibilityValue ArkUI_AccessibilityValue; + + /** * @brief Enumerates the effects used at the edges of the component when the boundary of the scrollable content is * reached. @@ -2912,6 +2958,176 @@ int32_t OH_ArkUI_ListItemSwipeActionOption_GetEdgeEffect(ArkUI_ListItemSwipeActi void OH_ArkUI_ListItemSwipeActionOption_SetOnOffsetChange(ArkUI_ListItemSwipeActionOption* option, void (*callback)(float offset)); +/** + * @brief Create accessibility state. + * + * @return accessibility state object. If the object returns a null pointer, + * it indicates a creation failure, and the reason for the failure may be that the address space is full. + * @since 12 +*/ +ArkUI_AccessibilityState* OH_ArkUI_AccessibilityState_Create(void); + +/** +* @brief Dispose accessibility state. +* +* @param state accessibility state object. +* @since 12 +*/ +void OH_ArkUI_AccessibilityState_Dispose(ArkUI_AccessibilityState* state); + +/** + * @brief Set accessibility state disabled. + * + * @param state accessibility state object. + * @param isDisabled accessibility state disabled, Value 1 indicates disabled and 0 indicates enbled. + * @since 12 +*/ +void OH_ArkUI_AccessibilityState_SetDisabled(ArkUI_AccessibilityState* state, int32_t isDisabled); + +/** + * @brief Get accessibility state disabled. + * + * @param state accessibility state object. + * @return accessibility state disabled, Value 1 indicates disabled and 0 indicates enbled. The default value is 0. + * If the function parameter is abnormal, return the default value. + * @since 12 +*/ +int32_t OH_ArkUI_AccessibilityState_IsDisabled(ArkUI_AccessibilityState* state); + +/** + * @brief Set accessibility state selected. + * + * @param state accessibility state object. + * @param isSelected accessibility state selected, Value 1 indicates selected, and 0 indicates not selected. + * The default value is 0. + * @since 12 +*/ +void OH_ArkUI_AccessibilityState_SetSelected(ArkUI_AccessibilityState* state, int32_t isSelected); + +/** + * @brief Get accessibility state selected. + * + * @param state accessibility state object. + * @return accessibility state selected, Value 1 indicates selected, and 0 indicates not selected. + * The default value is 0. + * If the function parameter is abnormal, return the default value. + * @since 12 +*/ +int32_t OH_ArkUI_AccessibilityState_IsSelected(ArkUI_AccessibilityState* state); + +/** + * @brief Set accessibility checked state. + * + * @param state accessibility state object. + * @param checkState checked state,and uses the {@link ArkUI_AccessibilityCheckedState} enumeration value, + * The default value is ARKUI_ACCESSIBILITY_UNCHECKED. + * @since 12 +*/ +void OH_ArkUI_AccessibilityState_SetCheckedState(ArkUI_AccessibilityState* state, int32_t checkState); + +/** + * @brief Get accessibility checked state. + * + * @param state accessibility state object. + * @return checked state,and uses the {@link ArkUI_AccessibilityCheckedState} enumeration value, + * The default value is ARKUI_ACCESSIBILITY_UNCHECKED. + * If the function parameter is abnormal, return the default value. + * @since 12 +*/ +int32_t OH_ArkUI_AccessibilityState_GetCheckedState(ArkUI_AccessibilityState* state); + +/** + * @brief Create accessibility value. + * + * @return accessibility value object. If the object returns a null pointer, + * it indicates a creation failure, and the reason for the failure may be that the address space is full. + * @since 12 +*/ +ArkUI_AccessibilityValue* OH_ArkUI_AccessibilityValue_Create(void); + +/** +* @brief Dispose accessibility value. +* +* @param state accessibility value object. +* @since 12 +*/ +void OH_ArkUI_AccessibilityValue_Dispose(ArkUI_AccessibilityValue* value); + +/** + * @brief Set accessibility minimum value. + * + * @param value accessibility value object. + * @param min minimum value based on range components, The default value is -1。 + * @since 12 +*/ +void OH_ArkUI_AccessibilityValue_SetMin(ArkUI_AccessibilityValue* value, int32_t min); + +/** + * @brief Get accessibility minimum value. + * + * @param value accessibility value object. + * @return minimum value based on range components, The default value is -1。 + * If the function parameter is abnormal, return -1. + * @since 12 +*/ +int32_t OH_ArkUI_AccessibilityValue_GetMin(ArkUI_AccessibilityValue* value); + +/** + * @brief Set accessibility minimum value. + * + * @param value accessibility value object. + * @param max maximum value based on range components, The default value is -1。 + * @since 12 +*/ +void OH_ArkUI_AccessibilityValue_SetMax(ArkUI_AccessibilityValue* value, int32_t max); + +/** + * @brief Get accessibility minimum value. + * + * @param value accessibility value object. + * @return maximum value based on range components, The default value is -1。 + * If the function parameter is abnormal, return -1. + * @since 12 +*/ +int32_t OH_ArkUI_AccessibilityValue_GetMax(ArkUI_AccessibilityValue* value); + +/** + * @brief Set accessibility current value. + * + * @param value accessibility value object. + * @param current value based on range components, The default value is -1。 + * @since 12 +*/ +void OH_ArkUI_AccessibilityValue_SetCurrent(ArkUI_AccessibilityValue* value, int32_t current); + +/** + * @brief Get accessibility current value. + * + * @param value accessibility value object. + * @return current value based on range components, The default value is -1。 + * If the function parameter is abnormal, return -1. + * @since 12 +*/ +int32_t OH_ArkUI_AccessibilityValue_GetCurrent(ArkUI_AccessibilityValue* value); + +/** + * @brief Set accessibility text value. + * + * @param value accessibility value object. + * @param text The textual description information of the component, which defaults to an empty string。 + * @since 12 +*/ +void OH_ArkUI_AccessibilityValue_SetText(ArkUI_AccessibilityValue* value, const char* text); + +/** + * @brief Get accessibility text value。 + * + * @param value accessibility value object. + * @return The textual description information of the component, which defaults to an empty string; + * If the function parameter is abnormal, return null. + * @since 12 +*/ +const char* OH_ArkUI_AccessibilityValue_GetText(ArkUI_AccessibilityValue* value); #ifdef __cplusplus }; #endif