openharmony 鸿蒙 capi-native-interface-accessibility-h

2026-08-25 浏览 (1)

native_interface_accessibility.h

Overview

Declares the APIs for accessing Native Accessibility features.

File to include: <arkui/native_interface_accessibility.h>

Library: libace_ndk.z.so

System capability: SystemCapability.ArkUI.ArkUI.Full

Since: 13

Related module: ArkUI_Accessibility

Sample: AccessibilityCapi

Summary

Structs

Nametypedef KeywordDescription
ArkUI_AccessibleActionArkUI_AccessibleActionDefines a struct for accessibility actions.
ArkUI_AccessibleRectArkUI_AccessibleRectProvides the bounding rectangle coordinates of the node.
ArkUI_AccessibleRangeInfoArkUI_AccessibleRangeInfoConfigures the current value, minimum value, and maximum value for specific components including Slider, Rating, and Progress.
ArkUI_AccessibleGridInfoArkUI_AccessibleGridInfoConfigures the number of rows, number of columns, and selection mode for specific components including List, Flex, Select, and Swiper.
ArkUI_AccessibleGridItemInfoArkUI_AccessibleGridItemInfoConfigures attributes for specific components including List, Flex, Select, and Swiper.
ArkUI_AccessibilityProviderCallbacksArkUI_AccessibilityProviderCallbacksDefines a struct for third-party accessibility provider callback functions, which third-party platforms need to implement. These functions are registered with the system side through OH_ArkUI_AccessibilityProviderRegisterCallback.
ArkUI_AccessibilityProviderCallbacksWithInstanceArkUI_AccessibilityProviderCallbacksWithInstanceDefines the callback function struct for third-party accessibility providers in multi-instance scenarios. These functions should be implemented by third-party platforms and registered with the system using OH_ArkUI_AccessibilityProviderRegisterCallbackWithInstance.
ArkUI_AccessibilityElementInfoArkUI_AccessibilityElementInfoProvides accessibility node information for accessibility services and assistive applications (such as screen readers).
ArkUI_AccessibilityEventInfoArkUI_AccessibilityEventInfoDescribes the accessibility event information. After a component completes an action requested by an accessibility service or application, it needs to send a success event to confirm the operation.
ArkUI_AccessibilityProviderArkUI_AccessibilityProviderDefines a third-party accessibility provider to implement callback functions.
ArkUI_AccessibilityActionArgumentsArkUI_AccessibilityActionArgumentsSets the parameters of accessibility actions.
ArkUI_AccessibilityElementInfoListArkUI_AccessibilityElementInfoListProvides a list instance of the encapsulated ArkUI_AccessibilityElementInfo.
ArkUI_Node*ArkUI_NodeHandleDefines the pointer to an ArkUI native component object.
Since: 23

Enums

Nametypedef KeywordDescription
ArkUI_Accessibility_ActionTypeArkUI_Accessibility_ActionTypeEnumerates accessibility action types.
ArkUI_AccessibilityEventTypeArkUI_AccessibilityEventTypeEnumerates accessibility event types.
ArkUI_AcessbilityErrorCodeArkUI_AcessbilityErrorCodeEnumerates accessibility error codes.
ArkUI_AccessibilitySearchModeArkUI_AccessibilitySearchModeEnumerates accessibility search modes.
ArkUI_AccessibilityFocusTypeArkUI_AccessibilityFocusTypeEnumerates accessibility focus types.
ArkUI_AccessibilityFocusMoveDirectionArkUI_AccessibilityFocusMoveDirectionEnumerates accessibility focus movement directions.

Functions

NameDescription
int32_t OH_ArkUI_AccessibilityProviderRegisterCallback(ArkUI_AccessibilityProvider* provider, ArkUI_AccessibilityProviderCallbacks* callbacks)Defines a struct for third-party accessibility provider callback functions, which third-party platforms need to implement. These functions are registered with the system side through OH_ArkUI_AccessibilityProviderRegisterCallback.
int32_t OH_ArkUI_AccessibilityProviderRegisterCallbackWithInstance(const char* instanceId,ArkUI_AccessibilityProvider* provider, ArkUI_AccessibilityProviderCallbacksWithInstance* callbacks)Registers accessibility provider callback functions for third-party platforms in multi-instance scenarios.
void OH_ArkUI_SendAccessibilityAsyncEvent(ArkUI_AccessibilityProvider* provider, ArkUI_AccessibilityEventInfo* eventInfo,void (*callback)(int32_t errorCode))Proactively sends an event to notify the accessibility service.
ArkUI_AccessibilityElementInfo* OH_ArkUI_AddAndGetAccessibilityElementInfo(ArkUI_AccessibilityElementInfoList* list)Adds an ArkUI_AccessibilityElementInfo member to the specified list and returns the ArkUI_AccessibilityElementInfo struct.
int32_t OH_ArkUI_AccessibilityElementInfoSetElementId(ArkUI_AccessibilityElementInfo* elementInfo, int32_t elementId)Sets the component ID for an ArkUI_AccessibilityElementInfo object.
int32_t OH_ArkUI_AccessibilityElementInfoSetParentId(ArkUI_AccessibilityElementInfo* elementInfo, int32_t parentId)Sets the parent ID for an ArkUI_AccessibilityElementInfo object.
int32_t OH_ArkUI_AccessibilityElementInfoSetComponentType(ArkUI_AccessibilityElementInfo* elementInfo, const char* componentType)Sets the component type for the ArkUI_AccessibilityElementInfo object.
int32_t OH_ArkUI_AccessibilityElementInfoSetContents(ArkUI_AccessibilityElementInfo* elementInfo, const char* contents)Sets the component text content for the ArkUI_AccessibilityElementInfo object.
int32_t OH_ArkUI_AccessibilityElementInfoSetHintText(ArkUI_AccessibilityElementInfo* elementInfo, const char* hintText)Sets the hint text for an ArkUI_AccessibilityElementInfo object.
int32_t OH_ArkUI_AccessibilityElementInfoSetAccessibilityText(ArkUI_AccessibilityElementInfo* elementInfo, const char* accessibilityText)Sets the accessibility text for an ArkUI_AccessibilityElementInfo object.
int32_t OH_ArkUI_AccessibilityElementInfoSetAccessibilityDescription(ArkUI_AccessibilityElementInfo* elementInfo, const char* accessibilityDescription)Sets the accessibility description for an ArkUI_AccessibilityElementInfo object.
int32_t OH_ArkUI_AccessibilityElementInfoSetChildNodeIds(ArkUI_AccessibilityElementInfo* elementInfo, int32_t childCount, int64_t* childNodeIds)Sets the child node count and IDs for an ArkUI_AccessibilityElementInfo object.
int32_t OH_ArkUI_AccessibilityElementInfoSetOperationActions(ArkUI_AccessibilityElementInfo* elementInfo,int32_t operationCount, ArkUI_AccessibleAction* operationActions)Sets the supported operations for an ArkUI_AccessibilityElementInfo object.
int32_t OH_ArkUI_AccessibilityElementInfoSetScreenRect(ArkUI_AccessibilityElementInfo* elementInfo, ArkUI_AccessibleRect* screenRect)Sets the screen coordinates for an ArkUI_AccessibilityElementInfo object.
int32_t OH_ArkUI_AccessibilityElementInfoSetCheckable(ArkUI_AccessibilityElementInfo* elementInfo, bool checkable)Sets whether the ArkUI_AccessibilityElementInfo object is checkable.
int32_t OH_ArkUI_AccessibilityElementInfoSetChecked(ArkUI_AccessibilityElementInfo* elementInfo, bool checked)Sets whether the ArkUI_AccessibilityElementInfo object is checked.
int32_t OH_ArkUI_AccessibilityElementInfoSetFocusable(ArkUI_AccessibilityElementInfo* elementInfo, bool focusable)Sets whether the ArkUI_AccessibilityElementInfo object is focusable.
int32_t OH_ArkUI_AccessibilityElementInfoSetFocused(ArkUI_AccessibilityElementInfo* elementInfo, bool isFocused)Sets whether the ArkUI_AccessibilityElementInfo object is focused.
int32_t OH_ArkUI_AccessibilityElementInfoSetVisible(ArkUI_AccessibilityElementInfo* elementInfo, bool isVisible)Sets whether an ArkUI_AccessibilityElementInfo object is visible.
int32_t OH_ArkUI_AccessibilityElementInfoSetAccessibilityFocused(ArkUI_AccessibilityElementInfo* elementInfo, bool accessibilityFocused)Sets whether the element is focused for accessibility purposes for an ArkUI_AccessibilityElementInfo object.
int32_t OH_ArkUI_AccessibilityElementInfoSetSelected(ArkUI_AccessibilityElementInfo* elementInfo, bool selected)Sets whether the ArkUI_AccessibilityElementInfo object is selected.
int32_t OH_ArkUI_AccessibilityElementInfoSetClickable(ArkUI_AccessibilityElementInfo* elementInfo, bool clickable)Sets whether the ArkUI_AccessibilityElementInfo object is clickable.
int32_t OH_ArkUI_AccessibilityElementInfoSetLongClickable(ArkUI_AccessibilityElementInfo* elementInfo, bool longClickable)Sets whether the ArkUI_AccessibilityElementInfo object supports long-press gestures.
int32_t OH_ArkUI_AccessibilityElementInfoSetEnabled(ArkUI_AccessibilityElementInfo* elementInfo, bool isEnabled)Sets whether the ArkUI_AccessibilityElementInfo object is enabled.
int32_t OH_ArkUI_AccessibilityElementInfoSetIsPassword(ArkUI_AccessibilityElementInfo* elementInfo, bool isPassword)Sets whether the ArkUI_AccessibilityElementInfo object is a password.
int32_t OH_ArkUI_AccessibilityElementInfoSetScrollable(ArkUI_AccessibilityElementInfo* elementInfo, bool scrollable)Sets whether the ArkUI_AccessibilityElementInfo object is scrollable.
int32_t OH_ArkUI_AccessibilityElementInfoSetEditable(ArkUI_AccessibilityElementInfo* elementInfo, bool editable)Sets whether the ArkUI_AccessibilityElementInfo object is editable.
int32_t OH_ArkUI_AccessibilityElementInfoSetIsHint(ArkUI_AccessibilityElementInfo* elementInfo, bool isHint)Sets the hint status for an ArkUI_AccessibilityElementInfo object.
int32_t OH_ArkUI_AccessibilityElementInfoSetRangeInfo(ArkUI_AccessibilityElementInfo* elementInfo, ArkUI_AccessibleRangeInfo* rangeInfo)Sets the range information for an ArkUI_AccessibilityElementInfo object.
int32_t OH_ArkUI_AccessibilityElementInfoSetGridInfo(ArkUI_AccessibilityElementInfo* elementInfo, ArkUI_AccessibleGridInfo* gridInfo)Sets the grid information for an ArkUI_AccessibilityElementInfo object.
int32_t OH_ArkUI_AccessibilityElementInfoSetGridItemInfo(ArkUI_AccessibilityElementInfo* elementInfo, ArkUI_AccessibleGridItemInfo* gridItem)Sets a single-item container within a grid container for an ArkUI_AccessibilityElementInfo object.
int32_t OH_ArkUI_AccessibilityElementInfoSetSelectedTextStart(ArkUI_AccessibilityElementInfo* elementInfo, int32_t selectedTextStart)Sets the start position of the selected text for an ArkUI_AccessibilityElementInfo object.
int32_t OH_ArkUI_AccessibilityElementInfoSetSelectedTextEnd(ArkUI_AccessibilityElementInfo* elementInfo, int32_t selectedTextEnd)Sets the end position of the selected text for an ArkUI_AccessibilityElementInfo object.
int32_t OH_ArkUI_AccessibilityElementInfoSetCurrentItemIndex(ArkUI_AccessibilityElementInfo* elementInfo, int32_t currentItemIndex)Sets the position information of the currently focused component for an ArkUI_AccessibilityElementInfo object.
int32_t OH_ArkUI_AccessibilityElementInfoSetStartItemIndex(ArkUI_AccessibilityElementInfo* elementInfo, int32_t startItemIndex)Sets the position information of the first element displayed on the current screen for an ArkUI_AccessibilityElementInfo object.
int32_t OH_ArkUI_AccessibilityElementInfoSetEndItemIndex(ArkUI_AccessibilityElementInfo* elementInfo, int32_t endItemIndex)Sets the position information of the last element displayed on the current screen for an ArkUI_AccessibilityElementInfo object.
int32_t OH_ArkUI_AccessibilityElementInfoSetItemCount(ArkUI_AccessibilityElementInfo* elementInfo, int32_t itemCount)Sets the total number of elements of a specific component for an ArkUI_AccessibilityElementInfo object.
int32_t OH_ArkUI_AccessibilityElementInfoSetAccessibilityOffset(ArkUI_AccessibilityElementInfo* elementInfo, int32_t offset)Sets the scrolling pixel offset of the content area relative to the top coordinate of the element for an ArkUI_AccessibilityElementInfo object.
int32_t OH_ArkUI_AccessibilityElementInfoSetAccessibilityGroup(ArkUI_AccessibilityElementInfo* elementInfo, bool accessibilityGroup)Sets whether the ArkUI_AccessibilityElementInfo object should be treated as an accessibility group.
int32_t OH_ArkUI_AccessibilityElementInfoSetAccessibilityLevel(ArkUI_AccessibilityElementInfo* elementInfo, const char* accessibilityLevel)Sets the accessibility level for the ArkUI_AccessibilityElementInfo object.
int32_t OH_ArkUI_AccessibilityElementInfoSetZIndex(ArkUI_AccessibilityElementInfo* elementInfo, int32_t zIndex)Sets the z-order of the component for the ArkUI_AccessibilityElementInfo object.
int32_t OH_ArkUI_AccessibilityElementInfoSetAccessibilityOpacity(ArkUI_AccessibilityElementInfo* elementInfo, float opacity)Sets the opacity for the ArkUI_AccessibilityElementInfo object.
int32_t OH_ArkUI_AccessibilityElementInfoSetBackgroundColor(ArkUI_AccessibilityElementInfo* elementInfo, const char* backgroundColor)Sets the background color for the ArkUI_AccessibilityElementInfo object.
int32_t OH_ArkUI_AccessibilityElementInfoSetBackgroundImage(ArkUI_AccessibilityElementInfo* elementInfo, const char* backgroundImage)Sets the background image for the ArkUI_AccessibilityElementInfo object.
int32_t OH_ArkUI_AccessibilityElementInfoSetBlur(ArkUI_AccessibilityElementInfo* elementInfo, const char* blur)Sets the blur value for the ArkUI_AccessibilityElementInfo object.
int32_t OH_ArkUI_AccessibilityElementInfoSetHitTestBehavior(ArkUI_AccessibilityElementInfo* elementInfo, const char* hitTestBehavior)Sets the response logic and node blocking rules for the hit test for an ArkUI_AccessibilityElementInfo object.
int32_t OH_ArkUI_AccessibilityElementInfoSetComponentIdentifier(ArkUI_AccessibilityElementInfo* elementInfo, const char* identifier)Sets the component identifier for the accessibility node information of the ArkUI_AccessibilityElementInfo object, which can be used to identify specific components in automated tests.
ArkUI_AccessibilityElementInfo* OH_ArkUI_CreateAccessibilityElementInfo(void)Creates an ArkUI_AccessibilityElementInfo object, which must be destroyed with OH_ArkUI_DestoryAccessibilityElementInfo.
void OH_ArkUI_DestoryAccessibilityElementInfo(ArkUI_AccessibilityElementInfo* elementInfo)Destroys an ArkUI_AccessibilityElementInfo object.
ArkUI_AccessibilityEventInfo* OH_ArkUI_CreateAccessibilityEventInfo(void)Creates an ArkUI_AccessibilityEventInfo object, which must be destroyed with OH_ArkUI_DestoryAccessibilityEventInfo.
void OH_ArkUI_DestoryAccessibilityEventInfo(ArkUI_AccessibilityEventInfo* eventInfo)Destroys an ArkUI_AccessibilityEventInfo object.
int32_t OH_ArkUI_AccessibilityEventSetEventType(ArkUI_AccessibilityEventInfo* eventInfo, ArkUI_AccessibilityEventType eventType)Sets the event type for an ArkUI_AccessibilityEventInfo object.
int32_t OH_ArkUI_AccessibilityEventSetTextAnnouncedForAccessibility(ArkUI_AccessibilityEventInfo* eventInfo, const char* textAnnouncedForAccessibility)Sets the content for auto-broadcasting for the ArkUI_AccessibilityEventInfo object.
int32_t OH_ArkUI_AccessibilityEventSetRequestFocusId(ArkUI_AccessibilityEventInfo* eventInfo, int32_t requestFocusId)Sets the focus request ID for an ArkUI_AccessibilityEventInfo object.
int32_t OH_ArkUI_AccessibilityEventSetElementInfo(ArkUI_AccessibilityEventInfo* eventInfo, ArkUI_AccessibilityElementInfo* elementInfo)Sets the element information for an ArkUI_AccessibilityEventInfo object.
int32_t OH_ArkUI_FindAccessibilityActionArgumentByKey(ArkUI_AccessibilityActionArguments* arguments, const char* key, char** value)Obtains the value associated with the specified key in ArkUI_AccessibilityActionArguments.
int32_t OH_ArkUI_NativeModule_GetNativeAccessibilityProvider(ArkUI_NodeHandle* node, ArkUI_AccessibilityProvider** provider)Obtains the level-2 pointer variable of the pointer to the ArkUI_AccessibilityProvider object.
The ArkUI_AccessibilityProvider object corresponds to the ArkUI_NodeHandle instance passed.
A third-party framework maps its UI components as RenderNode of the ARKUI_NODE_CUSTOM type to obtain ArkUI_NodeHandle.
Then, it calls OH_ArkUI_NativeModule_GetNativeAccessibilityProvider to obtain the ArkUI_AccessibilityProvider pointer and register an accessibility callback.
Finally, the ArkUI accessibility service can identify the UI of the third-party framework and trigger events.
This API takes effect only when the third-party framework maps its UI components as RenderNode of the ARKUI_NODE_CUSTOM type. Otherwise, an error code will be reported.
This API uses RenderNode to implement the access of the third-party framework. Only ARKUI_NODE_CUSTOM can access the accessibility service to obtain the accessibility control tree.
Multi-thread concurrency is not supported. The third-party framework ensures thread security during the API calling.

Enum Description

ArkUI_Accessibility_ActionType

enum ArkUI_Accessibility_ActionType

Description

Enumerates accessibility action types.

Since: 13

ValueDescription
ARKUI_ACCESSIBILITY_NATIVE_ACTION_TYPE_INVALID = 0Invalid value.
ARKUI_ACCESSIBILITY_NATIVE_ACTION_TYPE_CLICK = 0x00000010Triggers the component's click event handling.
ARKUI_ACCESSIBILITY_NATIVE_ACTION_TYPE_LONG_CLICK = 0x00000020Triggers the component's long-click event handling.
ARKUI_ACCESSIBILITY_NATIVE_ACTION_TYPE_GAIN_ACCESSIBILITY_FOCUS = 0x00000040Requests accessibility focus for the component.
ARKUI_ACCESSIBILITY_NATIVE_ACTION_TYPE_CLEAR_ACCESSIBILITY_FOCUS = 0x00000080Clears accessibility focus from the component.
ARKUI_ACCESSIBILITY_NATIVE_ACTION_TYPE_SCROLL_FORWARD = 0x00000100Initiates forward scrolling in scrollable containers.
ARKUI_ACCESSIBILITY_NATIVE_ACTION_TYPE_SCROLL_BACKWARD = 0x00000200Initiates backward scrolling in scrollable containers.
ARKUI_ACCESSIBILITY_NATIVE_ACTION_TYPE_COPY = 0x00000400Copies the current text selection.
ARKUI_ACCESSIBILITY_NATIVE_ACTION_TYPE_PASTE = 0x00000800Pastes content to the text component.
ARKUI_ACCESSIBILITY_NATIVE_ACTION_TYPE_CUT = 0x00001000Cuts the current text selection to the pasteboard.
ARKUI_ACCESSIBILITY_NATIVE_ACTION_TYPE_SELECT_TEXT = 0x00002000Selects a range of text within an editable area in a text component. Selects a range of text within an editable area by using ArkUI_AccessibilityActionArguments and setting selectTextBegin (indicates the start position of the selection), selectTextEnd (indicates the end position of the selection), and selectTextInForWard (true indicates to select text forward, and false indicates to select text backward).
ARKUI_ACCESSIBILITY_NATIVE_ACTION_TYPE_SET_TEXT = 0x00004000Sets the text content of the text component.
ARKUI_ACCESSIBILITY_NATIVE_ACTION_TYPE_SET_CURSOR_POSITION = 0x00100000Sets the cursor position where the text can be entered for the text component. This API is used together with ArkUI_AccessibilityActionArguments.
ARKUI_ACCESSIBILITY_NATIVE_ACTION_TYPE_NEXT_HTML_ITEM = 0x02000000Moves focus to the next focusable component. Note: "HTML" indicates the web-like navigation capability, not actual web elements. This attribute is available only when the findNextFocusAccessibilityNode capability is implemented.
Since: 15
ARKUI_ACCESSIBILITY_NATIVE_ACTION_TYPE_PREVIOUS_HTML_ITEM = 0x04000000Moves focus to the previous focusable component. Note: "HTML" indicates the web-like navigation capability, not actual web elements. This API requires implementation of findNextFocusAccessibilityNode.
Since: 15

ArkUI_AccessibilityEventType

enum ArkUI_AccessibilityEventType

Description

Enumerates accessibility event types.

Since: 13

ValueDescription
ARKUI_ACCESSIBILITY_NATIVE_EVENT_TYPE_INVALID = 0Invalid value.
ARKUI_ACCESSIBILITY_NATIVE_EVENT_TYPE_CLICKED = 0x00000001Click event, sent after the UI component responds.
ARKUI_ACCESSIBILITY_NATIVE_EVENT_TYPE_LONG_CLICKED = 0x00000002Long-click event, sent after the UI component responds.
ARKUI_ACCESSIBILITY_NATIVE_EVENT_TYPE_SELECTED = 0x00000004Selection event, sent after the UI component responds.
ARKUI_ACCESSIBILITY_NATIVE_EVENT_TYPE_TEXT_UPDATE = 0x00000010Text update event, sent when text is updated.
ARKUI_ACCESSIBILITY_NATIVE_EVENT_TYPE_PAGE_STATE_UPDATE = 0x00000020Page state update event, sent on page navigation, switching, resizing, or movement.
ARKUI_ACCESSIBILITY_NATIVE_EVENT_TYPE_PAGE_CONTENT_UPDATE = 0x00000800Page content update event, sent when the page content changes.
ARKUI_ACCESSIBILITY_NATIVE_EVENT_TYPE_SCROLLED = 0x000001000Scroll event, sent when scrolling occurs on scrollable components.
ARKUI_ACCESSIBILITY_NATIVE_EVENT_TYPE_ACCESSIBILITY_FOCUSED = 0x00008000Accessibility focus event, sent after the UI component receives focus.
ARKUI_ACCESSIBILITY_NATIVE_EVENT_TYPE_ACCESSIBILITY_FOCUS_CLEARED = 0x00010000Accessibility focus cleared event, sent after the UI component loses focus.
ARKUI_ACCESSIBILITY_NATIVE_EVENT_TYPE_REQUEST_ACCESSIBILITY_FOCUS = 0x02000000Event to actively requests focus for the specified node.
ARKUI_ACCESSIBILITY_NATIVE_EVENT_TYPE_PAGE_OPEN = 0x20000000Page open event reported by the UI component.
ARKUI_ACCESSIBILITY_NATIVE_EVENT_TYPE_PAGE_CLOSE = 0x08000000Page close event reported by the UI component.
ARKUI_ACCESSIBILITY_NATIVE_EVENT_TYPE_ANNOUNCE_FOR_ACCESSIBILITY = 0x10000000Announcement event, indicating a request to proactively announce specified content.
ARKUI_ACCESSIBILITY_NATIVE_EVENT_TYPE_FOCUS_NODE_UPDATE = 0x10000001Focus update event, used in the focus update scenarios.

ArkUI_AcessbilityErrorCode

enum ArkUI_AcessbilityErrorCode

Description

Enumerates accessibility error codes.

Since: 13

ValueDescription
ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL = 0The operation is successful.
ARKUI_ACCESSIBILITY_NATIVE_RESULT_FAILED = -1The operation failed.
ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER = -2Invalid parameter.
ARKUI_ACCESSIBILITY_NATIVE_RESULT_OUT_OF_MEMORY = -3Insufficient memory.

ArkUI_AccessibilitySearchMode

enum ArkUI_AccessibilitySearchMode

Description

Enumerates accessibility search modes.

Since: 13

ValueDescription
ARKUI_ACCESSIBILITY_NATIVE_SEARCH_MODE_PREFETCH_CURRENT = 0Searches the current node.
ARKUI_ACCESSIBILITY_NATIVE_SEARCH_MODE_PREFETCH_PREDECESSORS = 1 << 0Searches parent nodes.
ARKUI_ACCESSIBILITY_NATIVE_SEARCH_MODE_PREFETCH_SIBLINGS = 1 << 1Searches sibling nodes.
ARKUI_ACCESSIBILITY_NATIVE_SEARCH_MODE_PREFETCH_CHILDREN = 1 << 2Searches immediate child nodes.
ARKUI_ACCESSIBILITY_NATIVE_SEARCH_MODE_PREFETCH_RECURSIVE_CHILDREN = 1 << 3Searches all child nodes.

ArkUI_AccessibilityFocusType

enum ArkUI_AccessibilityFocusType

Description

Enumerates accessibility focus types.

Since: 13

ValueDescription
ARKUI_ACCESSIBILITY_NATIVE_FOCUS_TYPE_INVALID = -1Invalid value.
ARKUI_ACCESSIBILITY_NATIVE_FOCUS_TYPE_INPUT = 1 << 0Input focus type.
ARKUI_ACCESSIBILITY_NATIVE_FOCUS_TYPE_ACCESSIBILITY = 1 << 1Accessibility focus type.

ArkUI_AccessibilityFocusMoveDirection

enum ArkUI_AccessibilityFocusMoveDirection

Description

Enumerates accessibility focus movement directions.

Since: 13

ValueDescription
ARKUI_ACCESSIBILITY_NATIVE_DIRECTION_INVALID = 0Invalid value.
ARKUI_ACCESSIBILITY_NATIVE_DIRECTION_UP = 0x00000001Moves focus up.
ARKUI_ACCESSIBILITY_NATIVE_DIRECTION_DOWN = 0x00000002Moves focus down.
ARKUI_ACCESSIBILITY_NATIVE_DIRECTION_LEFT = 0x00000004Moves focus left.
ARKUI_ACCESSIBILITY_NATIVE_DIRECTION_RIGHT = 0x00000008Moves focus right.
ARKUI_ACCESSIBILITY_NATIVE_DIRECTION_FORWARD = 0x00000010Moves focus to the next focusable node (relative to the reference node in query).
ARKUI_ACCESSIBILITY_NATIVE_DIRECTION_BACKWARD = 0x00000020Moves focus to the previous focusable node (relative to the reference node in query).

Function Description

OH_ArkUI_AccessibilityProviderRegisterCallback()

int32_t OH_ArkUI_AccessibilityProviderRegisterCallback(ArkUI_AccessibilityProvider* provider, ArkUI_AccessibilityProviderCallbacks* callbacks)

Description

Defines a struct for third-party accessibility provider callback functions, which third-party platforms need to implement. These functions are registered with the system side through OH_ArkUI_AccessibilityProviderRegisterCallback.

Since: 13

Parameters

NameDescription
ArkUI_AccessibilityProvider* providerPointer to an ArkUI_AccessibilityProvider instance.
ArkUI_AccessibilityProviderCallbacks* callbacksPointer to an ArkUI_AccessibilityProviderCallbacks struct that contains the set of callback functions implemented by the third-party platform.

Returns

TypeDescription
int32_tReturns ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL if the operation is successful.
Returns ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER if a parameter error occurs.

OH_ArkUI_AccessibilityProviderRegisterCallbackWithInstance()

int32_t OH_ArkUI_AccessibilityProviderRegisterCallbackWithInstance(const char* instanceId, ArkUI_AccessibilityProvider* provider, ArkUI_AccessibilityProviderCallbacksWithInstance* callbacks)

Description

Registers accessibility provider callback functions for third-party platforms in multi-instance scenarios.

Since: 15

Parameters

NameDescription
const char* instanceIdPointer to the instance ID for third-party platform integration, used to distinguish between different instances in multi-instance scenarios. The ID is assigned and maintained by the third-party platform.
ArkUI_AccessibilityProvider* providerHandle to the third-party platform provider.
ArkUI_AccessibilityProviderCallbacksWithInstance* callbacksPointer to an ArkUI_AccessibilityProviderCallbacksWithInstance instance.

Returns

TypeDescription
int32_tReturns ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL if the operation is successful.
Returns ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER if a parameter error occurs.

OH_ArkUI_SendAccessibilityAsyncEvent()

void OH_ArkUI_SendAccessibilityAsyncEvent(ArkUI_AccessibilityProvider* provider, ArkUI_AccessibilityEventInfo* eventInfo, void (*callback)(int32_t errorCode))

Description

Proactively sends an event to notify the accessibility service.

Since: 13

Parameters

NameDescription
ArkUI_AccessibilityProvider* providerHandle to the third-party platform provider.
ArkUI_AccessibilityEventInfo* eventInfoPointer to the accessibility event information.
void (*callback)(int32_t errorCode)Callback that receives the asynchronous operation result.

OH_ArkUI_AddAndGetAccessibilityElementInfo()

ArkUI_AccessibilityElementInfo* OH_ArkUI_AddAndGetAccessibilityElementInfo(ArkUI_AccessibilityElementInfoList* list)

Description

Adds an ArkUI_AccessibilityElementInfo member to the specified list and returns the ArkUI_AccessibilityElementInfo struct.

Since: 13

Parameters

NameDescription
ArkUI_AccessibilityElementInfoList* listArkUI_AccessibilityElementInfoList struct to which the newly created ArkUI_AccessibilityElementInfo member is added and then returned to the function caller.

Returns

TypeDescription
ArkUI_AccessibilityElementInfo*Pointer to the created ArkUI_AccessibilityElementInfo struct; returns NULL if creation fails.

OH_ArkUI_AccessibilityElementInfoSetElementId()

int32_t OH_ArkUI_AccessibilityElementInfoSetElementId(ArkUI_AccessibilityElementInfo* elementInfo, int32_t elementId)

Description

Sets the component ID for an ArkUI_AccessibilityElementInfo object.

Since: 13

Parameters

NameDescription
ArkUI_AccessibilityElementInfo* elementInfoPointer to an ArkUI_AccessibilityElementInfo object.
int32_t elementIdUnique ID of the accessibility element.

Returns

TypeDescription
int32_tReturns ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL if the operation is successful.
Returns ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER if a parameter error occurs.

OH_ArkUI_AccessibilityElementInfoSetParentId()

int32_t OH_ArkUI_AccessibilityElementInfoSetParentId(ArkUI_AccessibilityElementInfo* elementInfo, int32_t parentId)

Description

Sets the parent ID for an ArkUI_AccessibilityElementInfo object.

Since: 13

Parameters

NameDescription
ArkUI_AccessibilityElementInfo* elementInfoPointer to the target ArkUI_AccessibilityElementInfo object.
int32_t parentIdAccessibility ID of the element's parent component.

Returns

TypeDescription
int32_tReturns ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL if the operation is successful.
Returns ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER if a parameter error occurs.

OH_ArkUI_AccessibilityElementInfoSetComponentType()

int32_t OH_ArkUI_AccessibilityElementInfoSetComponentType(ArkUI_AccessibilityElementInfo* elementInfo, const char* componentType)

Description

Sets the component type for the ArkUI_AccessibilityElementInfo object.

Since: 13

Parameters

NameDescription
ArkUI_AccessibilityElementInfo* elementInfoPointer to the target ArkUI_AccessibilityElementInfo object.
const char* componentTypePointer to the component type of the element.

Returns

TypeDescription
int32_tReturns ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL if the operation is successful.
Returns ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER if a parameter error occurs.

OH_ArkUI_AccessibilityElementInfoSetContents()

int32_t OH_ArkUI_AccessibilityElementInfoSetContents(ArkUI_AccessibilityElementInfo* elementInfo, const char* contents)

Description

Sets the component text content for the ArkUI_AccessibilityElementInfo object.

Since: 13

Parameters

NameDescription
ArkUI_AccessibilityElementInfo* elementInfoPointer to the target ArkUI_AccessibilityElementInfo object.
const char* contentsPointer to the text content recognized by accessibility services for the element.

Returns

TypeDescription
int32_tReturns ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL if the operation is successful.
Returns ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER if a parameter error occurs.

OH_ArkUI_AccessibilityElementInfoSetHintText()

int32_t OH_ArkUI_AccessibilityElementInfoSetHintText(ArkUI_AccessibilityElementInfo* elementInfo, const char* hintText)

Description

Sets the hint text for an ArkUI_AccessibilityElementInfo object.

Since: 13

Parameters

NameDescription
ArkUI_AccessibilityElementInfo* elementInfoPointer to the target ArkUI_AccessibilityElementInfo object.
const char* hintTextPointer to the hint text. The default value is "".

Returns

TypeDescription
int32_tReturns ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL if the operation is successful.
Returns ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER if a parameter error occurs.

OH_ArkUI_AccessibilityElementInfoSetAccessibilityText()

int32_t OH_ArkUI_AccessibilityElementInfoSetAccessibilityText(ArkUI_AccessibilityElementInfo* elementInfo, const char* accessibilityText)

Description

Sets the accessibility text for an ArkUI_AccessibilityElementInfo object.

Since: 13

Parameters

NameDescription
ArkUI_AccessibilityElementInfo* elementInfoPointer to the target ArkUI_AccessibilityElementInfo object.
const char* accessibilityTextPointer to the accessibility text. The default value is "".

Returns

TypeDescription
int32_tReturns ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL if the operation is successful.
Returns ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER if a parameter error occurs.

OH_ArkUI_AccessibilityElementInfoSetAccessibilityDescription()

int32_t OH_ArkUI_AccessibilityElementInfoSetAccessibilityDescription(ArkUI_AccessibilityElementInfo* elementInfo, const char* accessibilityDescription)

Description

Sets the accessibility description for an ArkUI_AccessibilityElementInfo object.

Since: 13

Parameters

NameDescription
ArkUI_AccessibilityElementInfo* elementInfoPointer to the target ArkUI_AccessibilityElementInfo object.
const char* accessibilityDescriptionPointer to the accessibility description. The default value is "".

Returns

TypeDescription
int32_tReturns ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL if the operation is successful.
Returns ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER if a parameter error occurs.

OH_ArkUI_AccessibilityElementInfoSetChildNodeIds()

int32_t OH_ArkUI_AccessibilityElementInfoSetChildNodeIds(ArkUI_AccessibilityElementInfo* elementInfo, int32_t childCount, int64_t* childNodeIds)

Description

Sets the child node count and IDs for an ArkUI_AccessibilityElementInfo object.

Since: 13

Parameters

NameDescription
ArkUI_AccessibilityElementInfo* elementInfoPointer to the target ArkUI_AccessibilityElementInfo object.
int32_t childCountChild node count. The default value is 0.
int64_t* childNodeIdsPointer to the array of child node IDs.

Returns

TypeDescription
int32_tReturns ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL if the operation is successful.
Returns ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER if a parameter error occurs.

OH_ArkUI_AccessibilityElementInfoSetOperationActions()

int32_t OH_ArkUI_AccessibilityElementInfoSetOperationActions(ArkUI_AccessibilityElementInfo* elementInfo,int32_t operationCount, ArkUI_AccessibleAction* operationActions)

Description

Sets the supported operations for an ArkUI_AccessibilityElementInfo object.

Since: 13

Parameters

NameDescription
ArkUI_AccessibilityElementInfo* elementInfoPointer to the target ArkUI_AccessibilityElementInfo object.
int32_t* operationCountPointer to the number of actions supported by the component.
ArkUI_AccessibleAction* operationActionsPointer to the array of actions supported by the component.

Returns

TypeDescription
int32_tReturns ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL if the operation is successful.
Returns ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER if a parameter error occurs.

OH_ArkUI_AccessibilityElementInfoSetScreenRect()

int32_t OH_ArkUI_AccessibilityElementInfoSetScreenRect(ArkUI_AccessibilityElementInfo* elementInfo, ArkUI_AccessibleRect* screenRect)

Description

Sets the screen coordinates for an ArkUI_AccessibilityElementInfo object.

Since: 13

Parameters

NameDescription
ArkUI_AccessibilityElementInfo* elementInfoPointer to the target ArkUI_AccessibilityElementInfo object.
ArkUI_AccessibleRect* screenRectPointer to the screen coordinates.

Returns

TypeDescription
int32_tReturns ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL if the operation is successful.
Returns ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER if a parameter error occurs.

OH_ArkUI_AccessibilityElementInfoSetCheckable()

int32_t OH_ArkUI_AccessibilityElementInfoSetCheckable(ArkUI_AccessibilityElementInfo* elementInfo, bool checkable)

Description

Sets whether the ArkUI_AccessibilityElementInfo object is checkable.

Since: 13

Parameters

NameDescription
ArkUI_AccessibilityElementInfo* elementInfoPointer to the target ArkUI_AccessibilityElementInfo object.
bool checkableWhether the object is checkable. true: checkable; false: not checkable. The default value is false.

Returns

TypeDescription
int32_tReturns ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL if the operation is successful.
Returns ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER if a parameter error occurs.

OH_ArkUI_AccessibilityElementInfoSetChecked()

int32_t OH_ArkUI_AccessibilityElementInfoSetChecked(ArkUI_AccessibilityElementInfo* elementInfo, bool checked)

Description

Sets whether the ArkUI_AccessibilityElementInfo object is checked.

Since: 13

Parameters

NameDescription
ArkUI_AccessibilityElementInfo* elementInfoPointer to the target ArkUI_AccessibilityElementInfo object.
bool checkedWhether the object is checked. true: checked; false: unchecked. The default value is false.

Returns

TypeDescription
int32_tReturns ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL if the operation is successful.
Returns ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER if a parameter error occurs.

OH_ArkUI_AccessibilityElementInfoSetFocusable()

int32_t OH_ArkUI_AccessibilityElementInfoSetFocusable(ArkUI_AccessibilityElementInfo* elementInfo, bool focusable)

Description

Sets whether the ArkUI_AccessibilityElementInfo object is focusable.

Since: 13

Parameters

NameDescription
ArkUI_AccessibilityElementInfo* elementInfoPointer to the target ArkUI_AccessibilityElementInfo object.
bool focusableWhether the object is focusable. true: focusable; false: not focusable. The default value is false.

Returns

TypeDescription
int32_tReturns ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL if the operation is successful.
Returns ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER if a parameter error occurs.

OH_ArkUI_AccessibilityElementInfoSetFocused()

int32_t OH_ArkUI_AccessibilityElementInfoSetFocused(ArkUI_AccessibilityElementInfo* elementInfo, bool isFocused)

Description

Sets whether the ArkUI_AccessibilityElementInfo object is focused.

Since: 13

Parameters

NameDescription
ArkUI_AccessibilityElementInfo* elementInfoPointer to the target ArkUI_AccessibilityElementInfo object.
bool isFocusedWhether the object is focused. true: focused; false: not focused. The default value is false.

Returns

TypeDescription
int32_tReturns ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL if the operation is successful.
Returns ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER if a parameter error occurs.

OH_ArkUI_AccessibilityElementInfoSetVisible()

int32_t OH_ArkUI_AccessibilityElementInfoSetVisible(ArkUI_AccessibilityElementInfo* elementInfo, bool isVisible)

Description

Sets whether an ArkUI_AccessibilityElementInfo object is visible.

Since: 13

Parameters

NameDescription
ArkUI_AccessibilityElementInfo* elementInfoPointer to the target ArkUI_AccessibilityElementInfo object.
bool isVisibleWhether the element is visible. true: visible; false: not visible. The default value is false.

Returns

TypeDescription
int32_tReturns ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL if the operation is successful.
Returns ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER if a parameter error occurs.

OH_ArkUI_AccessibilityElementInfoSetAccessibilityFocused()

int32_t OH_ArkUI_AccessibilityElementInfoSetAccessibilityFocused(ArkUI_AccessibilityElementInfo* elementInfo, bool accessibilityFocused)

Description

Sets whether the element is focused for accessibility purposes for an ArkUI_AccessibilityElementInfo object.

Since: 13

Parameters

NameDescription
ArkUI_AccessibilityElementInfo* elementInfoPointer to the target ArkUI_AccessibilityElementInfo object.
bool accessibilityFocusedAccessibility focus state. true: Accessibility focus is set. false: Accessibility focus is not set. The default value is false.

Returns

TypeDescription
int32_tReturns ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL if the operation is successful.
Returns ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER if a parameter error occurs.

OH_ArkUI_AccessibilityElementInfoSetSelected()

int32_t OH_ArkUI_AccessibilityElementInfoSetSelected(ArkUI_AccessibilityElementInfo* elementInfo, bool selected)

Description

Sets whether the ArkUI_AccessibilityElementInfo object is selected.

Since: 13

Parameters

NameDescription
ArkUI_AccessibilityElementInfo* elementInfoPointer to the target ArkUI_AccessibilityElementInfo object.
bool selectedWhether the object is selected. true: selected; false: not selected. The default value is false.

Returns

TypeDescription
int32_tReturns ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL if the operation is successful.
Returns ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER if a parameter error occurs.

OH_ArkUI_AccessibilityElementInfoSetClickable()

int32_t OH_ArkUI_AccessibilityElementInfoSetClickable(ArkUI_AccessibilityElementInfo* elementInfo, bool clickable)

Description

Sets whether the ArkUI_AccessibilityElementInfo object is clickable.

Since: 13

Parameters

NameDescription
ArkUI_AccessibilityElementInfo* elementInfoPointer to the target ArkUI_AccessibilityElementInfo object.
bool clickableWhether the object is clickable. true: supported; false: not supported. The default value is false.

Returns

TypeDescription
int32_tReturns ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL if the operation is successful.
Returns ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER if a parameter error occurs.

OH_ArkUI_AccessibilityElementInfoSetLongClickable()

int32_t OH_ArkUI_AccessibilityElementInfoSetLongClickable(ArkUI_AccessibilityElementInfo* elementInfo, bool longClickable)

Description

Sets whether the ArkUI_AccessibilityElementInfo object supports long-press gestures.

Since: 13

Parameters

NameDescription
ArkUI_AccessibilityElementInfo* elementInfoPointer to the target ArkUI_AccessibilityElementInfo object.
bool longClickableWhether long-press gestures are supported. true: supported; false: not supported. The default value is false.

Returns

TypeDescription
int32_tReturns ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL if the operation is successful.
Returns ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER if a parameter error occurs.

OH_ArkUI_AccessibilityElementInfoSetEnabled()

int32_t OH_ArkUI_AccessibilityElementInfoSetEnabled(ArkUI_AccessibilityElementInfo* elementInfo, bool isEnabled)

Description

Sets whether the ArkUI_AccessibilityElementInfo object is enabled.

Since: 13

Parameters

NameDescription
ArkUI_AccessibilityElementInfo* elementInfoPointer to the target ArkUI_AccessibilityElementInfo object.
bool isEnabledWhether the object is enabled. true: enabled; false: not enabled. The default value is false.

Returns

TypeDescription
int32_tReturns ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL if the operation is successful.
Returns ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER if a parameter error occurs.

OH_ArkUI_AccessibilityElementInfoSetIsPassword()

int32_t OH_ArkUI_AccessibilityElementInfoSetIsPassword(ArkUI_AccessibilityElementInfo* elementInfo, bool isPassword)

Description

Sets whether the ArkUI_AccessibilityElementInfo object is a password.

Since: 13

Parameters

NameDescription
ArkUI_AccessibilityElementInfo* elementInfoPointer to the target ArkUI_AccessibilityElementInfo object.
bool isPasswordWhether the object is a password. true: The object is a password. false: The object is not a password. The default value is false.

Returns

TypeDescription
int32_tReturns ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL if the operation is successful.
Returns ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER if a parameter error occurs.

OH_ArkUI_AccessibilityElementInfoSetScrollable()

int32_t OH_ArkUI_AccessibilityElementInfoSetScrollable(ArkUI_AccessibilityElementInfo* elementInfo, bool scrollable)

Description

Sets whether the ArkUI_AccessibilityElementInfo object is scrollable.

Since: 13

Parameters

NameDescription
ArkUI_AccessibilityElementInfo* elementInfoPointer to the target ArkUI_AccessibilityElementInfo object.
bool scrollableWhether scrolling is supported. true: supported; false: not supported. The default value is false.

Returns

TypeDescription
int32_tReturns ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL if the operation is successful.
Returns ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER if a parameter error occurs.

OH_ArkUI_AccessibilityElementInfoSetEditable()

int32_t OH_ArkUI_AccessibilityElementInfoSetEditable(ArkUI_AccessibilityElementInfo* elementInfo, bool editable)

Description

Sets whether the ArkUI_AccessibilityElementInfo object is editable.

Since: 13

Parameters

NameDescription
ArkUI_AccessibilityElementInfo* elementInfoPointer to the target ArkUI_AccessibilityElementInfo object.
bool editableWhether editing is supported. true: supported; false: not supported. The default value is false.

Returns

TypeDescription
int32_tReturns ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL if the operation is successful.
Returns ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER if a parameter error occurs.

OH_ArkUI_AccessibilityElementInfoSetIsHint()

int32_t OH_ArkUI_AccessibilityElementInfoSetIsHint(ArkUI_AccessibilityElementInfo* elementInfo, bool isHint)

Description

Sets the hint status for an ArkUI_AccessibilityElementInfo object.

Since: 13

Parameters

NameDescription
ArkUI_AccessibilityElementInfo* elementInfoPointer to the target ArkUI_AccessibilityElementInfo object.
bool isHintWhether the object represents a hint. true if the object represents a hint, false otherwise. The hintText information is obtained only when the object is in the hint state.

Returns

TypeDescription
int32_tReturns ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL if the operation is successful.
Returns ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER if a parameter error occurs.

OH_ArkUI_AccessibilityElementInfoSetRangeInfo()

int32_t OH_ArkUI_AccessibilityElementInfoSetRangeInfo(ArkUI_AccessibilityElementInfo* elementInfo, ArkUI_AccessibleRangeInfo* rangeInfo)

Description

Sets the range information for an ArkUI_AccessibilityElementInfo object.

Since: 13

Parameters

NameDescription
ArkUI_AccessibilityElementInfo* elementInfoPointer to the target ArkUI_AccessibilityElementInfo object.
ArkUI_AccessibleRangeInfo* rangeInfoPointer to the current value, maximum value, and minimum value of the specific component.

Returns

TypeDescription
int32_tReturns ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL if the operation is successful.
Returns ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER if a parameter error occurs.

OH_ArkUI_AccessibilityElementInfoSetGridInfo()

int32_t OH_ArkUI_AccessibilityElementInfoSetGridInfo(ArkUI_AccessibilityElementInfo* elementInfo, ArkUI_AccessibleGridInfo* gridInfo)

Description

Sets the grid information for an ArkUI_AccessibilityElementInfo object.

Since: 13

Parameters

NameDescription
ArkUI_AccessibilityElementInfo* elementInfoPointer to the target ArkUI_AccessibilityElementInfo object.
ArkUI_AccessibleGridInfo* gridInfoPointer to the number of rows, number of columns, and selection mode of the specific component.

Returns

TypeDescription
int32_tReturns ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL if the operation is successful.
Returns ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER if a parameter error occurs.

OH_ArkUI_AccessibilityElementInfoSetGridItemInfo()

int32_t OH_ArkUI_AccessibilityElementInfoSetGridItemInfo(ArkUI_AccessibilityElementInfo* elementInfo, ArkUI_AccessibleGridItemInfo* gridItem)

Description

Sets a single-item container within a grid container for an ArkUI_AccessibilityElementInfo object.

Since: 13

Parameters

NameDescription
ArkUI_AccessibilityElementInfo* elementInfoPointer to the target ArkUI_AccessibilityElementInfo object.
ArkUI_AccessibleGridItemInfo* gridItemPointer to the attribute values for the specific component.

Returns

TypeDescription
int32_tReturns ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL if the operation is successful.
Returns ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER if a parameter error occurs.

OH_ArkUI_AccessibilityElementInfoSetSelectedTextStart()

int32_t OH_ArkUI_AccessibilityElementInfoSetSelectedTextStart(ArkUI_AccessibilityElementInfo* elementInfo, int32_t selectedTextStart)

Description

Sets the start position of the selected text for an ArkUI_AccessibilityElementInfo object.

Since: 13

Parameters

NameDescription
ArkUI_AccessibilityElementInfo* elementInfoPointer to the target ArkUI_AccessibilityElementInfo object.
int32_t selectedTextStartStart position of the selected text. Applicable to text components.

Returns

TypeDescription
int32_tReturns ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL if the operation is successful.
Returns ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER if a parameter error occurs.

OH_ArkUI_AccessibilityElementInfoSetSelectedTextEnd()

int32_t OH_ArkUI_AccessibilityElementInfoSetSelectedTextEnd(ArkUI_AccessibilityElementInfo* elementInfo, int32_t selectedTextEnd)

Description

Sets the end position of the selected text for an ArkUI_AccessibilityElementInfo object.

Since: 13

Parameters

NameDescription
ArkUI_AccessibilityElementInfo* elementInfoPointer to the target ArkUI_AccessibilityElementInfo object.
int32_t selectedTextEndEnd position of the selected text. Applicable to text components.

Returns

TypeDescription
int32_tReturns ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL if the operation is successful.
Returns ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER if a parameter error occurs.

OH_ArkUI_AccessibilityElementInfoSetCurrentItemIndex()

int32_t OH_ArkUI_AccessibilityElementInfoSetCurrentItemIndex(ArkUI_AccessibilityElementInfo* elementInfo, int32_t currentItemIndex)

Description

Sets the position information of the currently focused component for an ArkUI_AccessibilityElementInfo object.

Since: 13

Parameters

NameDescription
ArkUI_AccessibilityElementInfo* elementInfoPointer to the target ArkUI_AccessibilityElementInfo object.
int32_t currentItemIndexPosition information of the currently focused component.

Returns

TypeDescription
int32_tReturns ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL if the operation is successful.
Returns ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER if a parameter error occurs.

OH_ArkUI_AccessibilityElementInfoSetStartItemIndex()

int32_t OH_ArkUI_AccessibilityElementInfoSetStartItemIndex(ArkUI_AccessibilityElementInfo* elementInfo, int32_t startItemIndex)

Description

Sets the position information of the first element displayed on the current screen for an ArkUI_AccessibilityElementInfo object.

Since: 13

Parameters

NameDescription
ArkUI_AccessibilityElementInfo* elementInfoPointer to the target ArkUI_AccessibilityElementInfo object.
int32_t startItemIndexIndex of the first item displayed on the current screen. Applicable to components such as List, Select, Swiper, and Tab_Bar.

Returns

TypeDescription
int32_tReturns ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL if the operation is successful.
Returns ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER if a parameter error occurs.

OH_ArkUI_AccessibilityElementInfoSetEndItemIndex()

int32_t OH_ArkUI_AccessibilityElementInfoSetEndItemIndex(ArkUI_AccessibilityElementInfo* elementInfo, int32_t endItemIndex)

Description

Sets the position information of the last element displayed on the current screen for an ArkUI_AccessibilityElementInfo object.

Since: 13

Parameters

NameDescription
ArkUI_AccessibilityElementInfo* elementInfoPointer to the target ArkUI_AccessibilityElementInfo object.
int32_t endItemIndexIndex of the last item displayed on the current screen. Applicable to components such as List, Select, Swiper, and Tab_Bar.

Returns

TypeDescription
int32_tReturns ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL if the operation is successful.
Returns ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER if a parameter error occurs.

OH_ArkUI_AccessibilityElementInfoSetItemCount()

int32_t OH_ArkUI_AccessibilityElementInfoSetItemCount(ArkUI_AccessibilityElementInfo* elementInfo, int32_t itemCount)

Description

Sets the total number of elements of a specific component for an ArkUI_AccessibilityElementInfo object.

Since: 13

Parameters

NameDescription
ArkUI_AccessibilityElementInfo* elementInfoPointer to the target ArkUI_AccessibilityElementInfo object.
int32_t itemCountTotal count of items of the specific component. Applicable to components such as List, Select, Swiper, and Tab_Bar.

Returns

TypeDescription
int32_tReturns ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL if the operation is successful.
Returns ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER if a parameter error occurs.

OH_ArkUI_AccessibilityElementInfoSetAccessibilityOffset()

int32_t OH_ArkUI_AccessibilityElementInfoSetAccessibilityOffset(ArkUI_AccessibilityElementInfo* elementInfo, int32_t offset)

Description

Sets the scrolling pixel offset of the content area relative to the top coordinate of the element for an ArkUI_AccessibilityElementInfo object.

Since: 13

Parameters

NameDescription
ArkUI_AccessibilityElementInfo* elementInfoPointer to the target ArkUI_AccessibilityElementInfo object.
int32_t offsetScrolling pixel offset of the content area relative to the top coordinate of the element for scrollable controls, such as List and Grid.

Returns

TypeDescription
int32_tReturns ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL if the operation is successful.
Returns ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER if a parameter error occurs.

OH_ArkUI_AccessibilityElementInfoSetAccessibilityGroup()

int32_t OH_ArkUI_AccessibilityElementInfoSetAccessibilityGroup(ArkUI_AccessibilityElementInfo* elementInfo, bool accessibilityGroup)

Description

Sets whether the ArkUI_AccessibilityElementInfo object should be treated as an accessibility group.

Since: 13

Parameters

NameDescription
ArkUI_AccessibilityElementInfo* elementInfoPointer to the target ArkUI_AccessibilityElementInfo object.
bool accessibilityGroupWhether to enable accessibility group behavior for the object. true: enable; false: disable.

Returns

TypeDescription
int32_tReturns ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL if the operation is successful.
Returns ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER if a parameter error occurs.

OH_ArkUI_AccessibilityElementInfoSetAccessibilityLevel()

int32_t OH_ArkUI_AccessibilityElementInfoSetAccessibilityLevel(ArkUI_AccessibilityElementInfo* elementInfo, const char* accessibilityLevel)

Description

Sets the accessibility level for the ArkUI_AccessibilityElementInfo object.

Since: 13

Parameters

NameDescription
ArkUI_AccessibilityElementInfo* elementInfoPointer to the target ArkUI_AccessibilityElementInfo object.
const char* accessibilityLevelPointer to the accessibility level of the component, which is used to decide whether the component is recognized by accessibility services.
- auto: The system automatically determines the component's importance based on its attributes and decides whether to allow accessibility services to recognize it.
- yes: The component is important and allows recognition by accessibility services.
- no: The component is not important and prohibits recognition by accessibility services.
- no-hide-descendants: The component and its descendant nodes are not important, and prohibits recognition of the component and its descendants by accessibility services.

Returns

TypeDescription
int32_tReturns ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL if the operation is successful.
Returns ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER if a parameter error occurs.

OH_ArkUI_AccessibilityElementInfoSetZIndex()

int32_t OH_ArkUI_AccessibilityElementInfoSetZIndex(ArkUI_AccessibilityElementInfo* elementInfo, int32_t zIndex)

Description

Sets the z-order of the component for the ArkUI_AccessibilityElementInfo object.

Since: 13

Parameters

NameDescription
ArkUI_AccessibilityElementInfo* elementInfoPointer to the target ArkUI_AccessibilityElementInfo object.
int32_t zIndexZ-order of the component, used to control the position of the component along the z-axis perpendicular to the screen. This parameter is required for UiTest.

Returns

TypeDescription
int32_tReturns ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL if the operation is successful.
Returns ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER if a parameter error occurs.

OH_ArkUI_AccessibilityElementInfoSetAccessibilityOpacity()

int32_t OH_ArkUI_AccessibilityElementInfoSetAccessibilityOpacity(ArkUI_AccessibilityElementInfo* elementInfo, float opacity)

Description

Sets the opacity for the ArkUI_AccessibilityElementInfo object.

Since: 13

Parameters

NameDescription
ArkUI_AccessibilityElementInfo* elementInfoPointer to the target ArkUI_AccessibilityElementInfo object.
float opacityOpacity. The value ranges from 0 to 1, where 1 indicates opaque and 0 indicates completely transparent. This parameter is required for UiTest.

Returns

TypeDescription
int32_tReturns ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL if the operation is successful.
Returns ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER if a parameter error occurs.

OH_ArkUI_AccessibilityElementInfoSetBackgroundColor()

int32_t OH_ArkUI_AccessibilityElementInfoSetBackgroundColor(ArkUI_AccessibilityElementInfo* elementInfo, const char* backgroundColor)

Description

Sets the background color for the ArkUI_AccessibilityElementInfo object.

Since: 13

Parameters

NameDescription
ArkUI_AccessibilityElementInfo* elementInfoPointer to the target ArkUI_AccessibilityElementInfo object.
const char* backgroundColorPointer to the background color. The value is in the #ARGB format. For example, the value for non-transparent white is "#FFFFFFFF". This parameter is required for UiTest.

Returns

TypeDescription
int32_tReturns ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL if the operation is successful.
Returns ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER if a parameter error occurs.

OH_ArkUI_AccessibilityElementInfoSetBackgroundImage()

int32_t OH_ArkUI_AccessibilityElementInfoSetBackgroundImage(ArkUI_AccessibilityElementInfo* elementInfo, const char* backgroundImage)

Description

Sets the background image for the ArkUI_AccessibilityElementInfo object.

Since: 13

Parameters

NameDescription
ArkUI_AccessibilityElementInfo* elementInfoPointer to the target ArkUI_AccessibilityElementInfo object.
const char* backgroundImagePointer to the background image. This parameter is required for UiTest.

Returns

TypeDescription
int32_tReturns ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL if the operation is successful.
Returns ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER if a parameter error occurs.

OH_ArkUI_AccessibilityElementInfoSetBlur()

int32_t OH_ArkUI_AccessibilityElementInfoSetBlur(ArkUI_AccessibilityElementInfo* elementInfo, const char* blur)

Description

Sets the blur value for the ArkUI_AccessibilityElementInfo object.

Since: 13

Parameters

NameDescription
ArkUI_AccessibilityElementInfo* elementInfoPointer to the target ArkUI_AccessibilityElementInfo object.
const char* blurPointer to the blur value. This parameter is required for UiTest.

Returns

TypeDescription
int32_tReturns ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL if the operation is successful.
Returns ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER if a parameter error occurs.

OH_ArkUI_AccessibilityElementInfoSetHitTestBehavior()

int32_t OH_ArkUI_AccessibilityElementInfoSetHitTestBehavior(ArkUI_AccessibilityElementInfo* elementInfo, const char* hitTestBehavior)

Description

Sets the response logic and node blocking rules for the hit test for an ArkUI_AccessibilityElementInfo object.

Since: 13

Parameters

NameDescription
ArkUI_AccessibilityElementInfo* elementInfoPointer to the target ArkUI_AccessibilityElementInfo object.
const char* hitTestBehaviorPointer to the hit test mode. For details about the value range, see HitTestMode.

Returns

TypeDescription
int32_tReturns ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL if the operation is successful.
Returns ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER if a parameter error occurs.

OH_ArkUI_AccessibilityElementInfoSetComponentIdentifier()

int32_t OH_ArkUI_AccessibilityElementInfoSetComponentIdentifier(ArkUI_AccessibilityElementInfo* elementInfo, const char* identifier)

Description

Sets the component identifier for the accessibility node information of the ArkUI_AccessibilityElementInfo object, which can be used to identify specific components in automated tests.

Since: 24

Parameters

NameDescription
ArkUI_AccessibilityElementInfo* elementInfoPointer to the element information of an accessibility node.
const char* identifierPointer to the unique identifier of a component.
Ensure that the component identifier in the reported component tree is unique and the character string contains a maximum of 1024 characters. If the character string exceeds 1024 characters, it will be truncated.

Returns

TypeDescription
int32_tReturns ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL if the operation is successful.
Returns ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER if a parameter error occurs.

OH_ArkUI_CreateAccessibilityElementInfo()

ArkUI_AccessibilityElementInfo* OH_ArkUI_CreateAccessibilityElementInfo(void)

Description

Creates an ArkUI_AccessibilityElementInfo object, which must be destroyed with OH_ArkUI_DestoryAccessibilityElementInfo.

Since: 13

Returns

TypeDescription
ArkUI_AccessibilityElementInfo*Pointer to the ArkUI_AccessibilityElementInfo object.

OH_ArkUI_DestoryAccessibilityElementInfo()

void OH_ArkUI_DestoryAccessibilityElementInfo(ArkUI_AccessibilityElementInfo* elementInfo)

Description

Destroys an ArkUI_AccessibilityElementInfo object.

Since: 13

Parameters

NameDescription
ArkUI_AccessibilityElementInfo* elementInfoPointer to the target ArkUI_AccessibilityElementInfo object.

OH_ArkUI_CreateAccessibilityEventInfo()

ArkUI_AccessibilityEventInfo* OH_ArkUI_CreateAccessibilityEventInfo(void)

Description

Creates an ArkUI_AccessibilityEventInfo object, which must be destroyed with OH_ArkUI_DestoryAccessibilityEventInfo.

Since: 13

Returns

TypeDescription
ArkUI_AccessibilityEventInfo*Pointer to the ArkUI_AccessibilityEventInfo object.

OH_ArkUI_DestoryAccessibilityEventInfo()

void OH_ArkUI_DestoryAccessibilityEventInfo(ArkUI_AccessibilityEventInfo* eventInfo)

Description

Destroys an ArkUI_AccessibilityEventInfo object.

Since: 13

Parameters

NameDescription
ArkUI_AccessibilityEventInfo* eventInfoPointer to the ArkUI_AccessibilityEventInfo object to destroy.

OH_ArkUI_AccessibilityEventSetEventType()

int32_t OH_ArkUI_AccessibilityEventSetEventType(ArkUI_AccessibilityEventInfo* eventInfo,  ArkUI_AccessibilityEventType eventType)

Description

Sets the event type for an ArkUI_AccessibilityEventInfo object.

Since: 13

Parameters

NameDescription
ArkUI_AccessibilityEventInfo* eventInfoPointer to an ArkUI_AccessibilityEventInfo object.
ArkUI_AccessibilityEventType eventTypeEvent type.

Returns

TypeDescription
int32_tReturns ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL if the operation is successful.
Returns ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER if a parameter error occurs.

OH_ArkUI_AccessibilityEventSetTextAnnouncedForAccessibility()

int32_t OH_ArkUI_AccessibilityEventSetTextAnnouncedForAccessibility(ArkUI_AccessibilityEventInfo* eventInfo,  const char* textAnnouncedForAccessibility)

Description

Sets the content for auto-broadcasting for the ArkUI_AccessibilityEventInfo object.

Since: 13

Parameters

NameDescription
ArkUI_AccessibilityEventInfo* eventInfoPointer to an ArkUI_AccessibilityEventInfo object.
const char* textAnnouncedForAccessibilityPointer to the content for auto-broadcasting.

Returns

TypeDescription
int32_tReturns ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL if the operation is successful.
Returns ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER if a parameter error occurs.

OH_ArkUI_AccessibilityEventSetRequestFocusId()

int32_t OH_ArkUI_AccessibilityEventSetRequestFocusId(ArkUI_AccessibilityEventInfo* eventInfo,  int32_t requestFocusId)

Description

Sets the focus request ID for an ArkUI_AccessibilityEventInfo object.

Since: 13

Parameters

NameDescription
ArkUI_AccessibilityEventInfo* eventInfoPointer to an ArkUI_AccessibilityEventInfo object.
int32_t requestFocusIdFocus request ID.

Returns

TypeDescription
int32_tReturns ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL if the operation is successful.
Returns ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER if a parameter error occurs.

OH_ArkUI_AccessibilityEventSetElementInfo()

int32_t OH_ArkUI_AccessibilityEventSetElementInfo(ArkUI_AccessibilityEventInfo* eventInfo,  ArkUI_AccessibilityElementInfo* elementInfo)

Description

Sets the element information for an ArkUI_AccessibilityEventInfo object.

Since: 13

Parameters

NameDescription
ArkUI_AccessibilityEventInfo* eventInfoPointer to an ArkUI_AccessibilityEventInfo object.
ArkUI_AccessibilityElementInfo* elementInfoPointer to an ArkUI_AccessibilityElementInfo object.

Returns

TypeDescription
int32_tReturns ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL if the operation is successful.
Returns ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER if a parameter error occurs.

OH_ArkUI_FindAccessibilityActionArgumentByKey()

int32_t OH_ArkUI_FindAccessibilityActionArgumentByKey(ArkUI_AccessibilityActionArguments* arguments, const char* key, char** value)

Description

Obtains the value associated with a specified key in an ArkUI_AccessibilityActionArguments struct.

Since: 13

Parameters

NameDescription
ArkUI_AccessibilityActionArguments* argumentsPointer to an ArkUI_AccessibilityActionArguments object.
const char* keyPointer to the key.
char** valuePointer to the value.

Returns

TypeDescription
int32_tReturns ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL if the operation is successful.
Returns ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER if a parameter error occurs.

OH_ArkUI_NativeModule_GetNativeAccessibilityProvider()

int32_t OH_ArkUI_NativeModule_GetNativeAccessibilityProvider(ArkUI_NodeHandle* node, ArkUI_AccessibilityProvider** provider)

Description

Obtains the level-2 pointer variable of the pointer to the ArkUI_AccessibilityProvider object.

The ArkUI_AccessibilityProvider object corresponds to the ArkUI_NodeHandle instance passed.

A third-party framework maps its UI components as RenderNode of the ARKUI_NODE_CUSTOM type to obtain ArkUI_NodeHandle.

Then, it calls OH_ArkUI_NativeModule_GetNativeAccessibilityProvider to obtain the ArkUI_AccessibilityProvider pointer and register an accessibility callback.

Finally, the ArkUI accessibility service can identify the UI of the third-party framework and trigger events.

This API takes effect only when the third-party framework maps its UI components as RenderNode of the ARKUI_NODE_CUSTOM type. Otherwise, an error code will be reported.

This API uses RenderNode to implement the access of the third-party framework. Only ARKUI_NODE_CUSTOM can access the accessibility service to obtain the accessibility control tree.

Multi-thread concurrency is not supported. The third-party framework ensures thread security during the API calling.

Since: 23

Parameters

NameDescription
ArkUI_NodeHandle* nodePointer to an ArkUI_NodeHandle object.
ArkUI_AccessibilityProvider** providerDouble pointer to an object of the ArkUI_AccessibilityProvider type. provider is used to register an accessibility callback function.

Returns

TypeDescription
int32_tStatus code.
Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful.
Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs.
Parameter error: 1. The input parameter node or provider is a null pointer.
2. The ArkUI_NodeHandle type corresponding to node is not ARKUI_NODE_CUSTOM.

你可能感兴趣的鸿蒙文章

openharmony 鸿蒙 arkts-apis-uicontext-contextmenucontroller

openharmony 鸿蒙 errorcode-canvas

openharmony 鸿蒙 capi-oh-nativexcomponent-native-xcomponent-oh-nativexcomponent

openharmony 鸿蒙 errorcode-bindSheet

openharmony 鸿蒙 js-apis-arkui-uiExtension-sys

openharmony 鸿蒙 capi-arkui-accessibility-arkui-accessibilityeventinfo

openharmony 鸿蒙 capi-arkui-rendernodeutils

openharmony 鸿蒙 js-apis-arkui-node

openharmony 鸿蒙 capi-native-node-h

openharmony 鸿蒙 capi-arkui-nativemodule-arkui-listitemswipeactionitem

  • 所属分类: 后端技术
  • 本文标签: 鸿蒙 软件
  • 版权声明: 本文链接 https://seaxiang.com/blog/ddH9tlgO