openharmony 鸿蒙 capi-arkui-accessibility-arkui-accessibilityprovidercallbackswithinstance

2026-08-25 浏览 (1)

ArkUI_AccessibilityProviderCallbacksWithInstance

typedef struct {...} ArkUI_AccessibilityProviderCallbacksWithInstance

Overview

Defines a callback function struct of a third-party operation provider in the multi-instance scenario. The functions that need to be implemented by the third-party platform are registered with the system through OH_ArkUI_AccessibilityProviderRegisterCallbackWithInstance.

Since: 15

Related module: ArkUI_Accessibility

Header file: native_interface_accessibility.h

Summary

Member Functions

NameDescription
int32_t (*findAccessibilityNodeInfosById)(const char* instanceId, int64_t elementId,ArkUI_AccessibilitySearchMode mode, int32_t requestId, ArkUI_AccessibilityElementInfoList* elementList)Finds the information about an accessibility node based on the specified node ID. Multi-instance scenarios are supported. Callback function implemented by the third-party platform and registered with the system.
int32_t (*findAccessibilityNodeInfosByText)(const char* instanceId, int64_t elementId, const char* text,int32_t requestId, ArkUI_AccessibilityElementInfoList* elementList)Finds the node information matching the specified text content. Multi-instance scenarios are supported. Callback function implemented by the third-party platform and registered with the system.
int32_t (*findFocusedAccessibilityNode)(const char* instanceId, int64_t elementId,ArkUI_AccessibilityFocusType focusType, int32_t requestId, ArkUI_AccessibilityElementInfo* elementInfo)Finds the node that currently has focus within a given node. Callback function implemented by the third-party platform and registered with the system. Multi-instance scenarios are supported.
int32_t (*findNextFocusAccessibilityNode)(const char* instanceId, int64_t elementId, ArkUI_AccessibilityFocusMoveDirection direction,int32_t requestId, ArkUI_AccessibilityElementInfo* elementInfo)Finds the next node in a specified direction from a given node. Callback function implemented by the third-party platform and registered with the system. Multi-instance scenarios are supported.
int32_t (*executeAccessibilityAction)(const char* instanceId, int64_t elementId,ArkUI_Accessibility_ActionType action, ArkUI_AccessibilityActionArguments *actionArguments, int32_t requestId)Performs a specified action on a specified node. Callback function implemented by the third-party platform and registered with the system. Multi-instance scenarios are supported.
int32_t (*clearFocusedFocusAccessibilityNode)(const char* instanceId)Removes focus from the current node. Callback function implemented by the third-party platform and registered with the system. Multi-instance scenarios are supported.
int32_t (*getAccessibilityNodeCursorPosition)(const char* instanceId, int64_t elementId,int32_t requestId, int32_t* index)Obtains the cursor position within a text component of the current accessibility node. Callback function implemented by the third-party platform and registered with the system. Multi-instance scenarios are supported.

Member Function Description

findAccessibilityNodeInfosById()

int32_t (*findAccessibilityNodeInfosById)(const char* instanceId, int64_t elementId,ArkUI_AccessibilitySearchMode mode, int32_t requestId, ArkUI_AccessibilityElementInfoList* elementList)

Description

Finds the information about an accessibility node based on the specified node ID. Callback function implemented by the third-party platform and registered with the system. Multi-instance scenarios are supported.

Since: 15

Parameters

NameDescription
const char* instanceIdInstance ID of the third-party framework.
int64_t elementIdUnique ID of the accessibility element.
ArkUI_AccessibilitySearchMode modeSearch mode for accessibility services.
int32_t requestIdRequest ID, which is used to associate the request process. It is recommended that this ID be logged to facilitate fault locating.
ArkUI_AccessibilityElementInfoList* elementListList of all accessibility elements found.

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.

findAccessibilityNodeInfosByText()

int32_t (*findAccessibilityNodeInfosByText)(const char* instanceId, int64_t elementId, const char* text,int32_t requestId, ArkUI_AccessibilityElementInfoList* elementList)

Description

Finds the node information matching the specified text content. Callback function implemented by the third-party platform and registered with the system. Multi-instance scenarios are supported.

Since: 15

Parameters

NameDescription
const char* instanceIdInstance ID of the third-party framework.
int64_t elementIdUnique ID of the accessibility element.
const char* textText content to match in the component.
int32_t requestIdRequest ID for identifying the request process. It is recommended for logging to aid troubleshooting.
ArkUI_AccessibilityElementInfoList* elementListList of all accessibility elements found.

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.

findFocusedAccessibilityNode()

int32_t (*findFocusedAccessibilityNode)(const char* instanceId, int64_t elementId,ArkUI_AccessibilityFocusType focusType, int32_t requestId, ArkUI_AccessibilityElementInfo* elementInfo)

Description

Finds the node that currently has focus within a given node. Callback function implemented by the third-party platform and registered with the system. Multi-instance scenarios are supported.

Since: 15

Parameters

NameDescription
const char* instanceIdInstance ID of the third-party framework.
int64_t elementIdUnique ID of the accessibility element.
ArkUI_AccessibilityFocusType focusTypeFocus type.
int32_t requestIdRequest ID, which is used to associate the request process. It is recommended that this ID be logged to facilitate fault locating.
ArkUI_AccessibilityElementInfo* elementInfoList of all accessibility elements found.

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.

findNextFocusAccessibilityNode()

int32_t (*findNextFocusAccessibilityNode)(const char* instanceId, int64_t elementId, ArkUI_AccessibilityFocusMoveDirection direction,int32_t requestId, ArkUI_AccessibilityElementInfo* elementInfo)

Description

Finds the next node in a specified direction from a given node. Callback function implemented by the third-party platform and registered with the system. Multi-instance scenarios are supported.

Since: 15

Parameters

NameDescription
const char* instanceIdInstance ID of the third-party framework.
int64_t elementIdUnique ID of the accessibility element.
ArkUI_AccessibilityFocusMoveDirection directionSearch direction.
int32_t requestIdRequest ID for identifying the request process. It is recommended for logging to aid troubleshooting.
ArkUI_AccessibilityElementInfo* elementInfoList of all accessibility elements found.

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.

executeAccessibilityAction()

int32_t (*executeAccessibilityAction)(const char* instanceId, int64_t elementId,ArkUI_Accessibility_ActionType action, ArkUI_AccessibilityActionArguments *actionArguments, int32_t requestId)

Description

Performs a specified action on a specified node. Callback function implemented by the third-party platform and registered with the system. Multi-instance scenarios are supported.

Since: 15

Parameters

NameDescription
const char* instanceIdInstance ID of the third-party framework.
int64_t elementIdUnique ID of the accessibility element.
ArkUI_Accessibility_ActionType actionAction to perform, such as focus, click, or long press.
ArkUI_AccessibilityActionArguments *actionArgumentsParameters controlling the action.
int32_t requestIdRequest ID for identifying the request process. It is recommended for logging to aid troubleshooting.

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.

clearFocusedFocusAccessibilityNode()

int32_t (*clearFocusedFocusAccessibilityNode)(const char* instanceId)

Description

Removes focus from the current node. Callback function implemented by the third-party platform and registered with the system. Multi-instance scenarios are supported.

Since: 15

Parameters

NameDescription
const char* instanceIdInstance ID of the third-party framework.

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.

getAccessibilityNodeCursorPosition()

int32_t (*getAccessibilityNodeCursorPosition)(const char* instanceId, int64_t elementId,int32_t requestId, int32_t* index)

Description

Obtains the cursor position within a text component of the current accessibility node. Callback function implemented by the third-party platform and registered with the system. Multi-instance scenarios are supported.

Since: 15

Parameters

NameDescription
const char* instanceIdInstance ID of the third-party framework.
int64_t elementIdUnique ID of the accessibility element.
int32_t requestIdRequest ID for identifying the request process. It is recommended for logging to aid troubleshooting.
int32_t* indexCursor position result.

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.

你可能感兴趣的鸿蒙文章

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/RHTQfEqQ