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

Name typedef Keyword Description
ArkUI_AccessibleAction ArkUI_AccessibleAction Defines a struct for accessibility actions.
ArkUI_AccessibleRect ArkUI_AccessibleRect Provides the bounding rectangle coordinates of the node.
ArkUI_AccessibleRangeInfo ArkUI_AccessibleRangeInfo Configures the current value, minimum value, and maximum value for specific components including Slider, Rating, and Progress.
ArkUI_AccessibleGridInfo ArkUI_AccessibleGridInfo Configures the number of rows, number of columns, and selection mode for specific components including List, Flex, Select, and Swiper.
ArkUI_AccessibleGridItemInfo ArkUI_AccessibleGridItemInfo Configures attributes for specific components including List, Flex, Select, and Swiper.
ArkUI_AccessibilityProviderCallbacks ArkUI_AccessibilityProviderCallbacks 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.
ArkUI_AccessibilityProviderCallbacksWithInstance ArkUI_AccessibilityProviderCallbacksWithInstance Defines 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_AccessibilityElementInfo ArkUI_AccessibilityElementInfo Provides accessibility node information for accessibility services and assistive applications (such as screen readers).
ArkUI_AccessibilityEventInfo ArkUI_AccessibilityEventInfo Describes 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_AccessibilityProvider ArkUI_AccessibilityProvider Defines a third-party accessibility provider to implement callback functions.
ArkUI_AccessibilityActionArguments ArkUI_AccessibilityActionArguments Sets the parameters of accessibility actions.
ArkUI_AccessibilityElementInfoList ArkUI_AccessibilityElementInfoList Provides a list instance of the encapsulated ArkUI_AccessibilityElementInfo.
ArkUI_Node* ArkUI_NodeHandle Defines the pointer to an ArkUI native component object.
Since: 23

Enums

Name typedef Keyword Description
ArkUI_Accessibility_ActionType ArkUI_Accessibility_ActionType Enumerates accessibility action types.
ArkUI_AccessibilityEventType ArkUI_AccessibilityEventType Enumerates accessibility event types.
ArkUI_AcessbilityErrorCode ArkUI_AcessbilityErrorCode Enumerates accessibility error codes.
ArkUI_AccessibilitySearchMode ArkUI_AccessibilitySearchMode Enumerates accessibility search modes.
ArkUI_AccessibilityFocusType ArkUI_AccessibilityFocusType Enumerates accessibility focus types.
ArkUI_AccessibilityFocusMoveDirection ArkUI_AccessibilityFocusMoveDirection Enumerates accessibility focus movement directions.

Functions

Name Description
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

Value Description
ARKUI_ACCESSIBILITY_NATIVE_ACTION_TYPE_INVALID = 0 Invalid value.
ARKUI_ACCESSIBILITY_NATIVE_ACTION_TYPE_CLICK = 0x00000010 Triggers the component's click event handling.
ARKUI_ACCESSIBILITY_NATIVE_ACTION_TYPE_LONG_CLICK = 0x00000020 Triggers the component's long-click event handling.
ARKUI_ACCESSIBILITY_NATIVE_ACTION_TYPE_GAIN_ACCESSIBILITY_FOCUS = 0x00000040 Requests accessibility focus for the component.
ARKUI_ACCESSIBILITY_NATIVE_ACTION_TYPE_CLEAR_ACCESSIBILITY_FOCUS = 0x00000080 Clears accessibility focus from the component.
ARKUI_ACCESSIBILITY_NATIVE_ACTION_TYPE_SCROLL_FORWARD = 0x00000100 Initiates forward scrolling in scrollable containers.
ARKUI_ACCESSIBILITY_NATIVE_ACTION_TYPE_SCROLL_BACKWARD = 0x00000200 Initiates backward scrolling in scrollable containers.
ARKUI_ACCESSIBILITY_NATIVE_ACTION_TYPE_COPY = 0x00000400 Copies the current text selection.
ARKUI_ACCESSIBILITY_NATIVE_ACTION_TYPE_PASTE = 0x00000800 Pastes content to the text component.
ARKUI_ACCESSIBILITY_NATIVE_ACTION_TYPE_CUT = 0x00001000 Cuts the current text selection to the pasteboard.
ARKUI_ACCESSIBILITY_NATIVE_ACTION_TYPE_SELECT_TEXT = 0x00002000 Selects 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 = 0x00004000 Sets the text content of the text component.
ARKUI_ACCESSIBILITY_NATIVE_ACTION_TYPE_SET_CURSOR_POSITION = 0x00100000 Sets 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 = 0x02000000 Moves 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 = 0x04000000 Moves 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

Value Description
ARKUI_ACCESSIBILITY_NATIVE_EVENT_TYPE_INVALID = 0 Invalid value.
ARKUI_ACCESSIBILITY_NATIVE_EVENT_TYPE_CLICKED = 0x00000001 Click event, sent after the UI component responds.
ARKUI_ACCESSIBILITY_NATIVE_EVENT_TYPE_LONG_CLICKED = 0x00000002 Long-click event, sent after the UI component responds.
ARKUI_ACCESSIBILITY_NATIVE_EVENT_TYPE_SELECTED = 0x00000004 Selection event, sent after the UI component responds.
ARKUI_ACCESSIBILITY_NATIVE_EVENT_TYPE_TEXT_UPDATE = 0x00000010 Text update event, sent when text is updated.
ARKUI_ACCESSIBILITY_NATIVE_EVENT_TYPE_PAGE_STATE_UPDATE = 0x00000020 Page state update event, sent on page navigation, switching, resizing, or movement.
ARKUI_ACCESSIBILITY_NATIVE_EVENT_TYPE_PAGE_CONTENT_UPDATE = 0x00000800 Page content update event, sent when the page content changes.
ARKUI_ACCESSIBILITY_NATIVE_EVENT_TYPE_SCROLLED = 0x000001000 Scroll event, sent when scrolling occurs on scrollable components.
ARKUI_ACCESSIBILITY_NATIVE_EVENT_TYPE_ACCESSIBILITY_FOCUSED = 0x00008000 Accessibility focus event, sent after the UI component receives focus.
ARKUI_ACCESSIBILITY_NATIVE_EVENT_TYPE_ACCESSIBILITY_FOCUS_CLEARED = 0x00010000 Accessibility focus cleared event, sent after the UI component loses focus.
ARKUI_ACCESSIBILITY_NATIVE_EVENT_TYPE_REQUEST_ACCESSIBILITY_FOCUS = 0x02000000 Event to actively requests focus for the specified node.
ARKUI_ACCESSIBILITY_NATIVE_EVENT_TYPE_PAGE_OPEN = 0x20000000 Page open event reported by the UI component.
ARKUI_ACCESSIBILITY_NATIVE_EVENT_TYPE_PAGE_CLOSE = 0x08000000 Page close event reported by the UI component.
ARKUI_ACCESSIBILITY_NATIVE_EVENT_TYPE_ANNOUNCE_FOR_ACCESSIBILITY = 0x10000000 Announcement event, indicating a request to proactively announce specified content.
ARKUI_ACCESSIBILITY_NATIVE_EVENT_TYPE_FOCUS_NODE_UPDATE = 0x10000001 Focus update event, used in the focus update scenarios.

ArkUI_AcessbilityErrorCode

enum ArkUI_AcessbilityErrorCode

Description

Enumerates accessibility error codes.

Since: 13

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

ArkUI_AccessibilitySearchMode

enum ArkUI_AccessibilitySearchMode

Description

Enumerates accessibility search modes.

Since: 13

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

ArkUI_AccessibilityFocusType

enum ArkUI_AccessibilityFocusType

Description

Enumerates accessibility focus types.

Since: 13

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

ArkUI_AccessibilityFocusMoveDirection

enum ArkUI_AccessibilityFocusMoveDirection

Description

Enumerates accessibility focus movement directions.

Since: 13

Value Description
ARKUI_ACCESSIBILITY_NATIVE_DIRECTION_INVALID = 0 Invalid value.
ARKUI_ACCESSIBILITY_NATIVE_DIRECTION_UP = 0x00000001 Moves focus up.
ARKUI_ACCESSIBILITY_NATIVE_DIRECTION_DOWN = 0x00000002 Moves focus down.
ARKUI_ACCESSIBILITY_NATIVE_DIRECTION_LEFT = 0x00000004 Moves focus left.
ARKUI_ACCESSIBILITY_NATIVE_DIRECTION_RIGHT = 0x00000008 Moves focus right.
ARKUI_ACCESSIBILITY_NATIVE_DIRECTION_FORWARD = 0x00000010 Moves focus to the next focusable node (relative to the reference node in query).
ARKUI_ACCESSIBILITY_NATIVE_DIRECTION_BACKWARD = 0x00000020 Moves 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

Name Description
ArkUI_AccessibilityProvider* provider Pointer to an ArkUI_AccessibilityProvider instance.
ArkUI_AccessibilityProviderCallbacks* callbacks Pointer to an ArkUI_AccessibilityProviderCallbacks struct that contains the set of callback functions implemented by the third-party platform.

Returns

Type Description
int32_t Returns 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

Name Description
const char* instanceId Pointer 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* provider Handle to the third-party platform provider.
ArkUI_AccessibilityProviderCallbacksWithInstance* callbacks Pointer to an ArkUI_AccessibilityProviderCallbacksWithInstance instance.

Returns

Type Description
int32_t Returns 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

Name Description
ArkUI_AccessibilityProvider* provider Handle to the third-party platform provider.
ArkUI_AccessibilityEventInfo* eventInfo Pointer 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

Name Description
ArkUI_AccessibilityElementInfoList* list ArkUI_AccessibilityElementInfoList struct to which the newly created ArkUI_AccessibilityElementInfo member is added and then returned to the function caller.

Returns

Type Description
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

Name Description
ArkUI_AccessibilityElementInfo* elementInfo Pointer to an ArkUI_AccessibilityElementInfo object.
int32_t elementId Unique ID of the accessibility element.

Returns

Type Description
int32_t Returns 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

Name Description
ArkUI_AccessibilityElementInfo* elementInfo Pointer to the target ArkUI_AccessibilityElementInfo object.
int32_t parentId Accessibility ID of the element's parent component.

Returns

Type Description
int32_t Returns 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

Name Description
ArkUI_AccessibilityElementInfo* elementInfo Pointer to the target ArkUI_AccessibilityElementInfo object.
const char* componentType Pointer to the component type of the element.

Returns

Type Description
int32_t Returns 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

Name Description
ArkUI_AccessibilityElementInfo* elementInfo Pointer to the target ArkUI_AccessibilityElementInfo object.
const char* contents Pointer to the text content recognized by accessibility services for the element.

Returns

Type Description
int32_t Returns 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

Name Description
ArkUI_AccessibilityElementInfo* elementInfo Pointer to the target ArkUI_AccessibilityElementInfo object.
const char* hintText Pointer to the hint text. The default value is "".

Returns

Type Description
int32_t Returns 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

Name Description
ArkUI_AccessibilityElementInfo* elementInfo Pointer to the target ArkUI_AccessibilityElementInfo object.
const char* accessibilityText Pointer to the accessibility text. The default value is "".

Returns

Type Description
int32_t Returns 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

Name Description
ArkUI_AccessibilityElementInfo* elementInfo Pointer to the target ArkUI_AccessibilityElementInfo object.
const char* accessibilityDescription Pointer to the accessibility description. The default value is "".

Returns

Type Description
int32_t Returns 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

Name Description
ArkUI_AccessibilityElementInfo* elementInfo Pointer to the target ArkUI_AccessibilityElementInfo object.
int32_t childCount Child node count. The default value is 0.
int64_t* childNodeIds Pointer to the array of child node IDs.

Returns

Type Description
int32_t Returns 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

Name Description
ArkUI_AccessibilityElementInfo* elementInfo Pointer to the target ArkUI_AccessibilityElementInfo object.
int32_t* operationCount Pointer to the number of actions supported by the component.
ArkUI_AccessibleAction* operationActions Pointer to the array of actions supported by the component.

Returns

Type Description
int32_t Returns 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

Name Description
ArkUI_AccessibilityElementInfo* elementInfo Pointer to the target ArkUI_AccessibilityElementInfo object.
ArkUI_AccessibleRect* screenRect Pointer to the screen coordinates.

Returns

Type Description
int32_t Returns 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

Name Description
ArkUI_AccessibilityElementInfo* elementInfo Pointer to the target ArkUI_AccessibilityElementInfo object.
bool checkable Whether the object is checkable. true: checkable; false: not checkable. The default value is false.

Returns

Type Description
int32_t Returns 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.

NOTE

This API only sets whether the object is checked, but does not set whether the object is checkable. To set whether the object is checkable, call OH_ArkUI_AccessibilityElementInfoSetCheckable.

Since: 13

Parameters

Name Description
ArkUI_AccessibilityElementInfo* elementInfo Pointer to the target ArkUI_AccessibilityElementInfo object.
bool checked Whether the object is checked. true: checked; false: unchecked. The default value is false.

Returns

Type Description
int32_t Returns 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

Name Description
ArkUI_AccessibilityElementInfo* elementInfo Pointer to the target ArkUI_AccessibilityElementInfo object.
bool focusable Whether the object is focusable. true: focusable; false: not focusable. The default value is false.

Returns

Type Description
int32_t Returns 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

Name Description
ArkUI_AccessibilityElementInfo* elementInfo Pointer to the target ArkUI_AccessibilityElementInfo object.
bool isFocused Whether the object is focused. true: focused; false: not focused. The default value is false.

Returns

Type Description
int32_t Returns 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

Name Description
ArkUI_AccessibilityElementInfo* elementInfo Pointer to the target ArkUI_AccessibilityElementInfo object.
bool isVisible Whether the element is visible. true: visible; false: not visible. The default value is false.

Returns

Type Description
int32_t Returns 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

Name Description
ArkUI_AccessibilityElementInfo* elementInfo Pointer to the target ArkUI_AccessibilityElementInfo object.
bool accessibilityFocused Accessibility focus state. true: Accessibility focus is set. false: Accessibility focus is not set. The default value is false.

Returns

Type Description
int32_t Returns 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

Name Description
ArkUI_AccessibilityElementInfo* elementInfo Pointer to the target ArkUI_AccessibilityElementInfo object.
bool selected Whether the object is selected. true: selected; false: not selected. The default value is false.

Returns

Type Description
int32_t Returns 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

Name Description
ArkUI_AccessibilityElementInfo* elementInfo Pointer to the target ArkUI_AccessibilityElementInfo object.
bool clickable Whether the object is clickable. true: supported; false: not supported. The default value is false.

Returns

Type Description
int32_t Returns 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

Name Description
ArkUI_AccessibilityElementInfo* elementInfo Pointer to the target ArkUI_AccessibilityElementInfo object.
bool longClickable Whether long-press gestures are supported. true: supported; false: not supported. The default value is false.

Returns

Type Description
int32_t Returns 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

Name Description
ArkUI_AccessibilityElementInfo* elementInfo Pointer to the target ArkUI_AccessibilityElementInfo object.
bool isEnabled Whether the object is enabled. true: enabled; false: not enabled. The default value is false.

Returns

Type Description
int32_t Returns 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

Name Description
ArkUI_AccessibilityElementInfo* elementInfo Pointer to the target ArkUI_AccessibilityElementInfo object.
bool isPassword Whether the object is a password. true: The object is a password. false: The object is not a password. The default value is false.

Returns

Type Description
int32_t Returns 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

Name Description
ArkUI_AccessibilityElementInfo* elementInfo Pointer to the target ArkUI_AccessibilityElementInfo object.
bool scrollable Whether scrolling is supported. true: supported; false: not supported. The default value is false.

Returns

Type Description
int32_t Returns 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

Name Description
ArkUI_AccessibilityElementInfo* elementInfo Pointer to the target ArkUI_AccessibilityElementInfo object.
bool editable Whether editing is supported. true: supported; false: not supported. The default value is false.

Returns

Type Description
int32_t Returns 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

Name Description
ArkUI_AccessibilityElementInfo* elementInfo Pointer to the target ArkUI_AccessibilityElementInfo object.
bool isHint Whether 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

Type Description
int32_t Returns 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

Name Description
ArkUI_AccessibilityElementInfo* elementInfo Pointer to the target ArkUI_AccessibilityElementInfo object.
ArkUI_AccessibleRangeInfo* rangeInfo Pointer to the current value, maximum value, and minimum value of the specific component.

Returns

Type Description
int32_t Returns 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

Name Description
ArkUI_AccessibilityElementInfo* elementInfo Pointer to the target ArkUI_AccessibilityElementInfo object.
ArkUI_AccessibleGridInfo* gridInfo Pointer to the number of rows, number of columns, and selection mode of the specific component.

Returns

Type Description
int32_t Returns 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

Name Description
ArkUI_AccessibilityElementInfo* elementInfo Pointer to the target ArkUI_AccessibilityElementInfo object.
ArkUI_AccessibleGridItemInfo* gridItem Pointer to the attribute values for the specific component.

Returns

Type Description
int32_t Returns 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

Name Description
ArkUI_AccessibilityElementInfo* elementInfo Pointer to the target ArkUI_AccessibilityElementInfo object.
int32_t selectedTextStart Start position of the selected text. Applicable to text components.

Returns

Type Description
int32_t Returns 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

Name Description
ArkUI_AccessibilityElementInfo* elementInfo Pointer to the target ArkUI_AccessibilityElementInfo object.
int32_t selectedTextEnd End position of the selected text. Applicable to text components.

Returns

Type Description
int32_t Returns 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

Name Description
ArkUI_AccessibilityElementInfo* elementInfo Pointer to the target ArkUI_AccessibilityElementInfo object.
int32_t currentItemIndex Position information of the currently focused component.

Returns

Type Description
int32_t Returns 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

Name Description
ArkUI_AccessibilityElementInfo* elementInfo Pointer to the target ArkUI_AccessibilityElementInfo object.
int32_t startItemIndex Index of the first item displayed on the current screen. Applicable to components such as List, Select, Swiper, and Tab_Bar.

Returns

Type Description
int32_t Returns 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

Name Description
ArkUI_AccessibilityElementInfo* elementInfo Pointer to the target ArkUI_AccessibilityElementInfo object.
int32_t endItemIndex Index of the last item displayed on the current screen. Applicable to components such as List, Select, Swiper, and Tab_Bar.

Returns

Type Description
int32_t Returns 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

Name Description
ArkUI_AccessibilityElementInfo* elementInfo Pointer to the target ArkUI_AccessibilityElementInfo object.
int32_t itemCount Total count of items of the specific component. Applicable to components such as List, Select, Swiper, and Tab_Bar.

Returns

Type Description
int32_t Returns 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

Name Description
ArkUI_AccessibilityElementInfo* elementInfo Pointer to the target ArkUI_AccessibilityElementInfo object.
int32_t offset Scrolling pixel offset of the content area relative to the top coordinate of the element for scrollable controls, such as List and Grid.

Returns

Type Description
int32_t Returns 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

Name Description
ArkUI_AccessibilityElementInfo* elementInfo Pointer to the target ArkUI_AccessibilityElementInfo object.
bool accessibilityGroup Whether to enable accessibility group behavior for the object. true: enable; false: disable.

Returns

Type Description
int32_t Returns 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

Name Description
ArkUI_AccessibilityElementInfo* elementInfo Pointer to the target ArkUI_AccessibilityElementInfo object.
const char* accessibilityLevel Pointer 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

Type Description
int32_t Returns 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

Name Description
ArkUI_AccessibilityElementInfo* elementInfo Pointer to the target ArkUI_AccessibilityElementInfo object.
int32_t zIndex Z-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

Type Description
int32_t Returns 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

Name Description
ArkUI_AccessibilityElementInfo* elementInfo Pointer to the target ArkUI_AccessibilityElementInfo object.
float opacity Opacity. The value ranges from 0 to 1, where 1 indicates opaque and 0 indicates completely transparent. This parameter is required for UiTest.

Returns

Type Description
int32_t Returns 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

Name Description
ArkUI_AccessibilityElementInfo* elementInfo Pointer to the target ArkUI_AccessibilityElementInfo object.
const char* backgroundColor Pointer 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

Type Description
int32_t Returns 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

Name Description
ArkUI_AccessibilityElementInfo* elementInfo Pointer to the target ArkUI_AccessibilityElementInfo object.
const char* backgroundImage Pointer to the background image. This parameter is required for UiTest.

Returns

Type Description
int32_t Returns 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

Name Description
ArkUI_AccessibilityElementInfo* elementInfo Pointer to the target ArkUI_AccessibilityElementInfo object.
const char* blur Pointer to the blur value. This parameter is required for UiTest.

Returns

Type Description
int32_t Returns 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

Name Description
ArkUI_AccessibilityElementInfo* elementInfo Pointer to the target ArkUI_AccessibilityElementInfo object.
const char* hitTestBehavior Pointer to the hit test mode. For details about the value range, see HitTestMode.

Returns

Type Description
int32_t Returns 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

Name Description
ArkUI_AccessibilityElementInfo* elementInfo Pointer to the element information of an accessibility node.
const char* identifier Pointer 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

Type Description
int32_t Returns 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

Type Description
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

Name Description
ArkUI_AccessibilityElementInfo* elementInfo Pointer 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

Type Description
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

Name Description
ArkUI_AccessibilityEventInfo* eventInfo Pointer 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

Name Description
ArkUI_AccessibilityEventInfo* eventInfo Pointer to an ArkUI_AccessibilityEventInfo object.
ArkUI_AccessibilityEventType eventType Event type.

Returns

Type Description
int32_t Returns 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

Name Description
ArkUI_AccessibilityEventInfo* eventInfo Pointer to an ArkUI_AccessibilityEventInfo object.
const char* textAnnouncedForAccessibility Pointer to the content for auto-broadcasting.

Returns

Type Description
int32_t Returns 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

Name Description
ArkUI_AccessibilityEventInfo* eventInfo Pointer to an ArkUI_AccessibilityEventInfo object.
int32_t requestFocusId Focus request ID.

Returns

Type Description
int32_t Returns 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

Name Description
ArkUI_AccessibilityEventInfo* eventInfo Pointer to an ArkUI_AccessibilityEventInfo object.
ArkUI_AccessibilityElementInfo* elementInfo Pointer to an ArkUI_AccessibilityElementInfo object.

Returns

Type Description
int32_t Returns 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

Name Description
ArkUI_AccessibilityActionArguments* arguments Pointer to an ArkUI_AccessibilityActionArguments object.
const char* key Pointer to the key.
char** value Pointer to the value.

Returns

Type Description
int32_t Returns 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

Name Description
ArkUI_NodeHandle* node Pointer to an ArkUI_NodeHandle object.
ArkUI_AccessibilityProvider** provider Double pointer to an object of the ArkUI_AccessibilityProvider type. provider is used to register an accessibility callback function.

Returns

Type Description
int32_t Status 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.