1 /* 2 * Copyright (c) 2024 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 /** 17 * @addtogroup ArkUI_Accessibility 18 * @{ 19 * 20 * @brief Describes the native capabilities supported by ArkUI Accessibility, such as querying accessibility nodes and 21 * reporting accessibility events. 22 * 23 * @since 13 24 */ 25 26 /** 27 * @file native_interface_accessibility.h 28 * 29 * @brief Declares the APIs used to access the native Accessibility. 30 * @syscap SystemCapability.ArkUI.ArkUI.Full 31 * @kit ArkUI 32 * @since 13 33 */ 34 #ifndef _NATIVE_INTERFACE_ACCESSIBILITY_H 35 #define _NATIVE_INTERFACE_ACCESSIBILITY_H 36 37 #include <cstdint> 38 39 #ifdef __cplusplus 40 extern "C"{ 41 #endif 42 43 /** 44 * @brief Defines a struct for accessibility element information. 45 * 46 * @since 13 47 */ 48 typedef struct ArkUI_AccessibilityElementInfo ArkUI_AccessibilityElementInfo; 49 50 /** 51 * @brief Defines a struct for accessibility event information. 52 * 53 * @since 13 54 */ 55 typedef struct ArkUI_AccessibilityEventInfo ArkUI_AccessibilityEventInfo; 56 57 /** 58 * @brief Defines a struct for the local provider of accessibility. 59 * 60 * @since 13 61 */ 62 typedef struct ArkUI_AccessibilityProvider ArkUI_AccessibilityProvider; 63 64 /** 65 * @brief Defines a struct for accessibility action arguments. 66 * 67 * @since 13 68 */ 69 typedef struct ArkUI_AccessibilityActionArguments ArkUI_AccessibilityActionArguments; 70 71 /** 72 * @brief Defines an enum for accessibility action types. 73 * 74 * @since 13 75 */ 76 typedef enum { 77 /** Invalid action. */ 78 ARKUI_ACCESSIBILITY_NATIVE_ACTION_TYPE_INVALID = 0, 79 /** Response to a click. */ 80 ARKUI_ACCESSIBILITY_NATIVE_ACTION_TYPE_CLICK = 0x00000010, 81 /** Response to a long click. */ 82 ARKUI_ACCESSIBILITY_NATIVE_ACTION_TYPE_LONG_CLICK = 0x00000020, 83 /** Accessibility focus acquisition. */ 84 ARKUI_ACCESSIBILITY_NATIVE_ACTION_TYPE_GAIN_ACCESSIBILITY_FOCUS = 0x00000040, 85 /** Accessibility focus clearance. */ 86 ARKUI_ACCESSIBILITY_NATIVE_ACTION_TYPE_CLEAR_ACCESSIBILITY_FOCUS = 0x00000080, 87 /** Forward scroll action. */ 88 ARKUI_ACCESSIBILITY_NATIVE_ACTION_TYPE_SCROLL_FORWARD = 0x00000100, 89 /** Backward scroll action. */ 90 ARKUI_ACCESSIBILITY_NATIVE_ACTION_TYPE_SCROLL_BACKWARD = 0x00000200, 91 /** Copy action for text content. */ 92 ARKUI_ACCESSIBILITY_NATIVE_ACTION_TYPE_COPY = 0x00000400, 93 /** Paste action for text content. */ 94 ARKUI_ACCESSIBILITY_NATIVE_ACTION_TYPE_PASTE = 0x00000800, 95 /** Cut action for text content. */ 96 ARKUI_ACCESSIBILITY_NATIVE_ACTION_TYPE_CUT = 0x00001000, 97 /** Text selection action, requiring the setting of <b>selectTextBegin</b>, <b>TextEnd</b>, and <b>TextInForward</b> 98 * parameters to select a text segment in the text box. */ 99 ARKUI_ACCESSIBILITY_NATIVE_ACTION_TYPE_SELECT_TEXT = 0x00002000, 100 /** Text content setting action. */ 101 ARKUI_ACCESSIBILITY_NATIVE_ACTION_TYPE_SET_TEXT = 0x00004000, 102 /** Cursor position setting action. */ 103 ARKUI_ACCESSIBILITY_NATIVE_ACTION_TYPE_SET_CURSOR_POSITION = 0x00100000, 104 } ArkUI_Accessibility_ActionType; 105 106 /** 107 * @brief Defines an enum for accessibility event types. 108 * 109 * @since 13 110 */ 111 typedef enum { 112 /** Invalid event. */ 113 ARKUI_ACCESSIBILITY_NATIVE_EVENT_TYPE_INVALID = 0, 114 /** Click event, sent after the UI component responds. */ 115 ARKUI_ACCESSIBILITY_NATIVE_EVENT_TYPE_CLICKED = 0x00000001, 116 /** Long click event, sent after the UI component responds. */ 117 ARKUI_ACCESSIBILITY_NATIVE_EVENT_TYPE_LONG_CLICKED = 0x00000002, 118 /** Selection event, sent after the UI component responds. */ 119 ARKUI_ACCESSIBILITY_NATIVE_EVENT_TYPE_SELECTED = 0x00000004, 120 /** Text update event, sent when text is updated. */ 121 ARKUI_ACCESSIBILITY_NATIVE_EVENT_TYPE_TEXT_UPDATE = 0x00000010, 122 /** Page state update event, sent when the page transitions, switches, resizes, or moves. */ 123 ARKUI_ACCESSIBILITY_NATIVE_EVENT_TYPE_PAGE_STATE_UPDATE = 0x00000020, 124 /** Page content update event, sent when the page content changes. */ 125 ARKUI_ACCESSIBILITY_NATIVE_EVENT_TYPE_PAGE_CONTENT_UPDATE = 0x00000800, 126 /** Scrolled event, sent when a scrollable component experiences a scroll event. */ 127 ARKUI_ACCESSIBILITY_NATIVE_EVENT_TYPE_SCROLLED = 0x000001000, 128 /** Accessibility focus event, sent after the UI component responds. */ 129 ARKUI_ACCESSIBILITY_NATIVE_EVENT_TYPE_ACCESSIBILITY_FOCUSED = 0x00008000, 130 /** Accessibility focus cleared event, sent after the UI component responds. */ 131 ARKUI_ACCESSIBILITY_NATIVE_EVENT_TYPE_ACCESSIBILITY_FOCUS_CLEARED = 0x00010000, 132 /** FOcus request for a specific node. */ 133 ARKUI_ACCESSIBILITY_NATIVE_EVENT_TYPE_REQUEST_ACCESSIBILITY_FOCUS = 0x02000000, 134 /** Page open event reported by the UI component. */ 135 ARKUI_ACCESSIBILITY_NATIVE_EVENT_TYPE_PAGE_OPEN = 0x20000000, 136 /** Page close event reported by the UI component. */ 137 ARKUI_ACCESSIBILITY_NATIVE_EVENT_TYPE_PAGE_CLOSE = 0x08000000, 138 /** Announcement event, indicating a request to proactively announce specified content. */ 139 ARKUI_ACCESSIBILITY_NATIVE_EVENT_TYPE_ANNOUNCE_FOR_ACCESSIBILITY = 0x10000000, 140 /** Focus update event, used for focus update scenarios. */ 141 ARKUI_ACCESSIBILITY_NATIVE_EVENT_TYPE_FOCUS_NODE_UPDATE = 0x10000001, 142 } ArkUI_AccessibilityEventType; 143 144 /** 145 * @brief Defines a struct for the accessible action. 146 * 147 * @since 13 148 */ 149 typedef struct { 150 /** Action type. */ 151 ArkUI_Accessibility_ActionType actionType; 152 /** Action description. */ 153 const char* description; 154 } ArkUI_AccessibleAction; 155 156 /** 157 * @brief Defines a struct for the accessible rectangle. 158 * 159 * @since 13 160 */ 161 typedef struct { 162 /** X coordinate of the upper left corner. */ 163 int32_t leftTopX; 164 /** Y coordinate of the upper left corner. */ 165 int32_t leftTopY; 166 /** X coordinate of the lower right corner. */ 167 int32_t rightBottomX; 168 /** Y coordinate of the lower right corner. */ 169 int32_t rightBottomY; 170 } ArkUI_AccessibleRect; 171 172 /** 173 * @brief Define a struct for the accessible range information. 174 * 175 * @since 13 176 */ 177 typedef struct { 178 /** Minimum value. */ 179 double min; 180 /** Maximum value. */ 181 double max; 182 /** Current value. */ 183 double current; 184 } ArkUI_AccessibleRangeInfo; 185 186 /** 187 * @brief Defines a struct for the accessible grid information. 188 * 189 * @since 13 190 */ 191 typedef struct { 192 /** Number of rows. */ 193 int32_t rowCount; 194 /** Number of columns. */ 195 int32_t columnCount; 196 /** Selection mode. The value <b>0</b> indicates that only one row can be selected. */ 197 int32_t selectionMode; 198 } ArkUI_AccessibleGridInfo; 199 200 /** 201 * @brief Defines a struct for the accessible grid item information. 202 * 203 * @since 13 204 */ 205 typedef struct { 206 /** Whether it is a header. */ 207 bool heading; 208 /** Whether it is selected. */ 209 bool selected; 210 /** Column index. */ 211 int32_t columnIndex; 212 /** Row index. */ 213 int32_t rowIndex; 214 /** Column span. */ 215 int32_t columnSpan; 216 /** Row span. */ 217 int32_t rowSpan; 218 } ArkUI_AccessibleGridItemInfo; 219 220 /** 221 * @brief Enumerates the accessibility error codes. 222 * 223 * @since 13 224 */ 225 typedef enum { 226 /** 227 * @error Success. 228 */ 229 ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL = 0, 230 /** 231 * @error Failure. 232 */ 233 ARKUI_ACCESSIBILITY_NATIVE_RESULT_FAILED = -1, 234 /** 235 * @error Invalid parameter. 236 */ 237 ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER = -2, 238 /** 239 * @error Out of memory. 240 */ 241 ARKUI_ACCESSIBILITY_NATIVE_RESULT_OUT_OF_MEMORY = -3, 242 } ArkUI_AcessbilityErrorCode; 243 244 /** 245 * @brief Defines an enum for the accessibility search modes. 246 * 247 * @since 13 248 */ 249 typedef enum { 250 /** Search for current nodes. */ 251 ARKUI_ACCESSIBILITY_NATIVE_SEARCH_MODE_PREFETCH_CURRENT = 0, 252 /** Search for parent nodes. */ 253 ARKUI_ACCESSIBILITY_NATIVE_SEARCH_MODE_PREFETCH_PREDECESSORS = 1 << 0, 254 /** Search for sibling nodes. */ 255 ARKUI_ACCESSIBILITY_NATIVE_SEARCH_MODE_PREFETCH_SIBLINGS = 1 << 1, 256 /** Search for child nodes at the next level. */ 257 ARKUI_ACCESSIBILITY_NATIVE_SEARCH_MODE_PREFETCH_CHILDREN = 1 << 2, 258 /** Search for all child nodes. */ 259 ARKUI_ACCESSIBILITY_NATIVE_SEARCH_MODE_PREFETCH_RECURSIVE_CHILDREN = 1 << 3, 260 } ArkUI_AccessibilitySearchMode; 261 262 /** 263 * @brief Defines an enum for the accessibility focus types. 264 * 265 * @since 13 266 */ 267 typedef enum { 268 /** Invalid type. */ 269 ARKUI_ACCESSIBILITY_NATIVE_FOCUS_TYPE_INVALID = -1, 270 /** Input focus type. */ 271 ARKUI_ACCESSIBILITY_NATIVE_FOCUS_TYPE_INPUT = 1 << 0, 272 /** Accessibility focus type. */ 273 ARKUI_ACCESSIBILITY_NATIVE_FOCUS_TYPE_ACCESSIBILITY = 1 << 1, 274 } ArkUI_AccessibilityFocusType; 275 276 /** 277 * @brief Enumerates the directions for moving the accessibility focus. 278 * 279 * @since 13 280 */ 281 typedef enum { 282 /** Invalid direction. */ 283 ARKUI_ACCESSIBILITY_NATIVE_DIRECTION_INVALID = 0, 284 /** Up. */ 285 ARKUI_ACCESSIBILITY_NATIVE_DIRECTION_UP = 0x00000001, 286 /** Down. */ 287 ARKUI_ACCESSIBILITY_NATIVE_DIRECTION_DOWN = 0x00000002, 288 /** Left. */ 289 ARKUI_ACCESSIBILITY_NATIVE_DIRECTION_LEFT = 0x00000004, 290 /** Right. */ 291 ARKUI_ACCESSIBILITY_NATIVE_DIRECTION_RIGHT = 0x00000008, 292 /** Forward. */ 293 ARKUI_ACCESSIBILITY_NATIVE_DIRECTION_FORWARD = 0x00000010, 294 /** Backward. */ 295 ARKUI_ACCESSIBILITY_NATIVE_DIRECTION_BACKWARD = 0x00000020, 296 } ArkUI_AccessibilityFocusMoveDirection; 297 298 /** 299 * @brief Defines a struct for the accessibility element information list. 300 * 301 * @since 13 302 */ 303 typedef struct ArkUI_AccessibilityElementInfoList ArkUI_AccessibilityElementInfoList; 304 305 /** 306 * @brief Registers callbacks for the accessibility provider. 307 * 308 * @since 13 309 */ 310 typedef struct ArkUI_AccessibilityProviderCallbacks { 311 /** 312 * @brief Called to obtain element information based on a specified node. 313 * 314 * @param elementId Indicates the element ID. 315 * @param mode Indicates accessibility search mode. 316 * @param requestId Indicates the request ID. 317 * @param elementList Indicates accessibility elementInfo list. 318 * @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. 319 * Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. 320 */ 321 int32_t (*findAccessibilityNodeInfosById)(int64_t elementId, ArkUI_AccessibilitySearchMode mode, 322 int32_t requestId, ArkUI_AccessibilityElementInfoList* elementList); 323 /** 324 * @brief Called to obtain element information based on a specified node and text content. 325 * 326 * @param elementId Indicates the element ID. 327 * @param text Indicates accessibility text. 328 * @param requestId Indicates the request ID. 329 * @param elementList Indicates accessibility elementInfo list. 330 * @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. 331 * Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. 332 */ 333 int32_t (*findAccessibilityNodeInfosByText)(int64_t elementId, const char* text, int32_t requestId, 334 ArkUI_AccessibilityElementInfoList* elementList); 335 /** 336 * @brief Called to obtain focused element information based on a specified node. 337 * 338 * @param elementId Indicates the element ID. 339 * @param focusType Indicates focus type. 340 * @param requestId Indicates the request ID. 341 * @param elementInfo Indicates accessibility elementInfo. 342 * @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. 343 * Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. 344 */ 345 int32_t (*findFocusedAccessibilityNode)(int64_t elementId, ArkUI_AccessibilityFocusType focusType, 346 int32_t requestId, ArkUI_AccessibilityElementInfo* elementInfo); 347 /** 348 * @brief Called to find the next focusable node based on the reference node. 349 * 350 * @param elementId Indicates the element ID. 351 * @param direction Indicates direction. 352 * @param requestId Indicates the request ID. 353 * @param elementInfo Indicates accessibility elementInfo. 354 * @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. 355 * Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. 356 */ 357 int32_t (*findNextFocusAccessibilityNode)( 358 int64_t elementId, ArkUI_AccessibilityFocusMoveDirection direction, 359 int32_t requestId, ArkUI_AccessibilityElementInfo* elementInfo); 360 /** 361 * @brief Called to execute a specified action on a specified node. 362 * 363 * @param elementId Indicates the element ID. 364 * @param action Indicates action. 365 * @param actionArguments Indicates action arguments. 366 * @param requestId Indicates the request ID. 367 * @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. 368 * Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. 369 */ 370 int32_t (*executeAccessibilityAction)(int64_t elementId, ArkUI_Accessibility_ActionType action, 371 ArkUI_AccessibilityActionArguments *actionArguments, int32_t requestId); 372 /** 373 * @brief Called to clear the focus state of the current focused node. 374 * 375 * @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. 376 * Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_FAILED} if the operation is failed. 377 */ 378 int32_t (*clearFocusedFocusAccessibilityNode)(); 379 /** 380 * @brief Called to query the current cursor position of the specified node. 381 * 382 * @param elementId Indicates the element ID. 383 * @param requestId Indicates the request ID. 384 * @param index Indicates index. 385 * @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. 386 * Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. 387 */ 388 int32_t (*getAccessibilityNodeCursorPosition)(int64_t elementId, int32_t requestId, int32_t* index); 389 } ArkUI_AccessibilityProviderCallbacks; 390 391 /** 392 * @brief Registers a callback for this <b>ArkUI_AccessibilityProvider</b> instance. 393 * 394 * @param provider Indicates the pointer to the <b>ArkUI_AccessibilityProvider</b> instance. 395 * @param callbacks Indicates the pointer to the <b>GetAccessibilityNodeCursorPosition</b> callback. 396 * @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. 397 * Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. 398 * @since 13 399 */ 400 int32_t OH_ArkUI_AccessibilityProviderRegisterCallback( 401 ArkUI_AccessibilityProvider* provider, ArkUI_AccessibilityProviderCallbacks* callbacks); 402 403 /** 404 * @brief Sends accessibility event information. 405 * 406 * @param provider Indicates the pointer to the <b>ArkUI_AccessibilityProvider</b> instance. 407 * @param eventInfo Indicates the pointer to the accessibility event information. 408 * @param callback Indicates the pointer to the callback that is called after the event is sent. 409 * @since 13 410 */ 411 void OH_ArkUI_SendAccessibilityAsyncEvent( 412 ArkUI_AccessibilityProvider* provider, ArkUI_AccessibilityEventInfo* eventInfo, 413 void (*callback)(int32_t errorCode)); 414 415 /** 416 * @brief Adds and obtains the pointer to an <b>ArkUI_AccessibilityElementInfo</b> object. 417 * 418 * @param list Indicates the pointer to an <b>ArkUI_AccessibilityElementInfoList</b> object. 419 * @return Returns the pointer to the <b>ArkUI_AccessibilityElementInfo</b> object. 420 * @since 13 421 */ 422 ArkUI_AccessibilityElementInfo* OH_ArkUI_AddAndGetAccessibilityElementInfo( 423 ArkUI_AccessibilityElementInfoList* list); 424 425 /** 426 * @brief Sets the element ID for an <b>ArkUI_AccessibilityElementInfo</b> object. 427 * 428 * @param elementInfo Indicates the pointer to an <b>ArkUI_AccessibilityElementInfo</b> object. 429 * @param elementId Indicates the element ID. 430 * @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. 431 * Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. 432 * @since 13 433 */ 434 int32_t OH_ArkUI_AccessibilityElementInfoSetElementId( 435 ArkUI_AccessibilityElementInfo* elementInfo, int32_t elementId); 436 437 /** 438 * @brief Sets the parent ID for an <b>ArkUI_AccessibilityElementInfo</b> object. 439 * 440 * @param elementInfo Indicates the pointer to an <b>ArkUI_AccessibilityElementInfo</b> object. 441 * @param parentId Indicates the parent ID. 442 * @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. 443 * Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. 444 * @since 13 445 */ 446 int32_t OH_ArkUI_AccessibilityElementInfoSetParentId( 447 ArkUI_AccessibilityElementInfo* elementInfo, int32_t parentId); 448 449 /** 450 * @brief Sets the component type for an <b>ArkUI_AccessibilityElementInfo</b> object. 451 * 452 * @param elementInfo Indicates the pointer to an <b>ArkUI_AccessibilityElementInfo</b> object. 453 * @param componentType Indicates the component type. 454 * @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. 455 * Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. 456 * @since 13 457 */ 458 int32_t OH_ArkUI_AccessibilityElementInfoSetComponentType( 459 ArkUI_AccessibilityElementInfo* elementInfo, const char* componentType); 460 461 /** 462 * @brief Sets the component content for an <b>ArkUI_AccessibilityElementInfo</b> object. 463 * 464 * @param elementInfo Indicates the pointer to an <b>ArkUI_AccessibilityElementInfo</b> object. 465 * @param contents Indicates the component content. 466 * @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. 467 * Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. 468 * @since 13 469 */ 470 int32_t OH_ArkUI_AccessibilityElementInfoSetContents( 471 ArkUI_AccessibilityElementInfo* elementInfo, const char* contents); 472 473 /** 474 * @brief Sets the hint text for an <b>ArkUI_AccessibilityElementInfo</b> object. 475 * 476 * @param elementInfo Indicates the pointer to an <b>ArkUI_AccessibilityElementInfo</b> object. 477 * @param hintText Indicates the hint text. 478 * @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. 479 * Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. 480 * @since 13 481 */ 482 int32_t OH_ArkUI_AccessibilityElementInfoSetHintText( 483 ArkUI_AccessibilityElementInfo* elementInfo, const char* hintText); 484 485 /** 486 * @brief Sets the accessibility text for an <b>ArkUI_AccessibilityElementInfo</b> object. 487 * 488 * @param elementInfo Indicates the pointer to an <b>ArkUI_AccessibilityElementInfo</b> object. 489 * @param accessibilityText Indicates the accessibility text. 490 * @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. 491 * Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. 492 * @since 13 493 */ 494 int32_t OH_ArkUI_AccessibilityElementInfoSetAccessibilityText( 495 ArkUI_AccessibilityElementInfo* elementInfo, const char* accessibilityText); 496 497 /** 498 * @brief Sets the accessibility description for an <b>ArkUI_AccessibilityElementInfo</b> object. 499 * 500 * @param elementInfo Indicates the pointer to an <b>ArkUI_AccessibilityElementInfo</b> object. 501 * @param accessibilityDescription Indicates the accessibility description. 502 * @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. 503 * Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. 504 * @since 13 505 */ 506 int32_t OH_ArkUI_AccessibilityElementInfoSetAccessibilityDescription( 507 ArkUI_AccessibilityElementInfo* elementInfo, const char* accessibilityDescription); 508 509 /** 510 * @brief Set the number of child nodes and child node IDs for an <b>ArkUI_AccessibilityElementInfo</b> object. 511 * 512 * @param elementInfo Indicates the pointer to an <b>ArkUI_AccessibilityElementInfo</b> object. 513 * @param childCount Indicates the number of child nodes. 514 * @param childNodeIds Indicates an array of child node IDs. 515 * @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. 516 * Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. 517 * @since 13 518 */ 519 int32_t OH_ArkUI_AccessibilityElementInfoSetChildNodeIds( 520 ArkUI_AccessibilityElementInfo* elementInfo, int32_t childCount, int64_t* childNodeIds); 521 522 /** 523 * @brief Sets the operation actions for an <b>ArkUI_AccessibilityElementInfo</b> object. 524 * 525 * @param elementInfo Indicates the pointer to an <b>ArkUI_AccessibilityElementInfo</b> object. 526 * @param operationCount Indicates the operation count. 527 * @param operationActions Indicates the operation actions. 528 * @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. 529 * Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. 530 * @since 13 531 */ 532 int32_t OH_ArkUI_AccessibilityElementInfoSetOperationActions(ArkUI_AccessibilityElementInfo* elementInfo, 533 int32_t operationCount, ArkUI_AccessibleAction* operationActions); 534 535 /** 536 * @brief Sets the screen area for an <b>ArkUI_AccessibilityElementInfo</b> object. 537 * 538 * @param elementInfo Indicates the pointer to an <b>ArkUI_AccessibilityElementInfo</b> object. 539 * @param screenRect Indicates the screen area. 540 * @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. 541 * Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. 542 * @since 13 543 */ 544 int32_t OH_ArkUI_AccessibilityElementInfoSetScreenRect( 545 ArkUI_AccessibilityElementInfo* elementInfo, ArkUI_AccessibleRect* screenRect); 546 547 /** 548 * @brief Sets whether the element is checkable for an <b>ArkUI_AccessibilityElementInfo</b> object. 549 * 550 * @param elementInfo Indicates the pointer to an <b>ArkUI_AccessibilityElementInfo</b> object. 551 * @param checkable Indicates whether the element is checkable. 552 * @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. 553 * Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. 554 * @since 13 555 */ 556 int32_t OH_ArkUI_AccessibilityElementInfoSetCheckable( 557 ArkUI_AccessibilityElementInfo* elementInfo, bool checkable); 558 559 /** 560 * @brief Sets whether the element is checked for an <b>ArkUI_AccessibilityElementInfo</b> object. 561 * 562 * @param elementInfo Indicates the pointer to an <b>ArkUI_AccessibilityElementInfo</b> object. 563 * @param checked Indicates whether the element is checked. 564 * @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. 565 * Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. 566 * @since 13 567 */ 568 int32_t OH_ArkUI_AccessibilityElementInfoSetChecked( 569 ArkUI_AccessibilityElementInfo* elementInfo, bool checked); 570 571 /** 572 * @brief Sets whether the element is focusable for an <b>ArkUI_AccessibilityElementInfo</b> object. 573 * @param elementInfo Indicates the pointer to an <b>ArkUI_AccessibilityElementInfo</b> object. 574 * @param focusable Indicates whether the element is focusable. 575 * @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. 576 * Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. 577 * @since 13 578 */ 579 int32_t OH_ArkUI_AccessibilityElementInfoSetFocusable( 580 ArkUI_AccessibilityElementInfo* elementInfo, bool focusable); 581 582 /** 583 * @brief Sets whether the element is focused for an <b>ArkUI_AccessibilityElementInfo</b> object. 584 * 585 * @param elementInfo Indicates the pointer to an <b>ArkUI_AccessibilityElementInfo</b> object. 586 * @param isFocused Indicates whether the element is focused. 587 * @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. 588 * Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. 589 * @since 13 590 */ 591 int32_t OH_ArkUI_AccessibilityElementInfoSetFocused( 592 ArkUI_AccessibilityElementInfo* elementInfo, bool isFocused); 593 594 /** 595 * @brief Sets whether the element is visible for an <b>ArkUI_AccessibilityElementInfo</b> object. 596 * 597 * @param elementInfo Indicates the pointer to an <b>ArkUI_AccessibilityElementInfo</b> object. 598 * @param isVisible Indicates whether the element is visible. 599 * @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. 600 * Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. 601 * @since 13 602 */ 603 int32_t OH_ArkUI_AccessibilityElementInfoSetVisible( 604 ArkUI_AccessibilityElementInfo* elementInfo, bool isVisible); 605 606 /** 607 * @brief Sets the accessibility focus state for an <b>ArkUI_AccessibilityElementInfo</b> object. 608 * 609 * @param elementInfo Indicates the pointer to an <b>ArkUI_AccessibilityElementInfo</b> object. 610 * @param accessibilityFocused Indicates whether the element has accessibility focus. 611 * @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. 612 * Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. 613 * @since 13 614 */ 615 int32_t OH_ArkUI_AccessibilityElementInfoSetAccessibilityFocused( 616 ArkUI_AccessibilityElementInfo* elementInfo, bool accessibilityFocused); 617 618 /** 619 * @brief Sets whether the element is selected for an <b>ArkUI_AccessibilityElementInfo</b> object. 620 * 621 * @param elementInfo Indicates the pointer to an <b>ArkUI_AccessibilityElementInfo</b> object. 622 * @param selected Indicates whether the element is selected. 623 * @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. 624 * Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. 625 * @since 13 626 */ 627 int32_t OH_ArkUI_AccessibilityElementInfoSetSelected( 628 ArkUI_AccessibilityElementInfo* elementInfo, bool selected); 629 630 /** 631 * @brief Sets whether the element is clickable for an <b>ArkUI_AccessibilityElementInfo</b> object. 632 * 633 * @param elementInfo Indicates the pointer to an <b>ArkUI_AccessibilityElementInfo</b> object. 634 * @param clickable Indicates whether the element is clickable. 635 * @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. 636 * Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. 637 * @since 13 638 */ 639 int32_t OH_ArkUI_AccessibilityElementInfoSetClickable( 640 ArkUI_AccessibilityElementInfo* elementInfo, bool clickable); 641 642 /** 643 * @brief Sets whether the element is long clickable for an <b>ArkUI_AccessibilityElementInfo</b> object. 644 * 645 * @param elementInfo Indicates the pointer to an <b>ArkUI_AccessibilityElementInfo</b> object. 646 * @param longClickable Indicates whether the element is long clickable. 647 * @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. 648 * Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. 649 * @since 13 650 */ 651 int32_t OH_ArkUI_AccessibilityElementInfoSetLongClickable( 652 ArkUI_AccessibilityElementInfo* elementInfo, bool longClickable); 653 654 /** 655 * @brief Sets whether the element is enabled for an <b>ArkUI_AccessibilityElementInfo</b> object. 656 * 657 * @param elementInfo Indicates the pointer to an <b>ArkUI_AccessibilityElementInfo</b> object. 658 * @param isEnabled Indicates whether the element is enabled. 659 * @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. 660 * Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. 661 * @since 13 662 */ 663 int32_t OH_ArkUI_AccessibilityElementInfoSetEnabled( 664 ArkUI_AccessibilityElementInfo* elementInfo, bool isEnabled); 665 666 /** 667 * @brief Sets whether the element is a password for an <b>ArkUI_AccessibilityElementInfo</b> object. 668 * 669 * @param elementInfo Indicates the pointer to an <b>ArkUI_AccessibilityElementInfo</b> object. 670 * @param isPassword Indicates whether the element is a password. 671 * @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. 672 * Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. 673 * @since 13 674 */ 675 int32_t OH_ArkUI_AccessibilityElementInfoSetIsPassword( 676 ArkUI_AccessibilityElementInfo* elementInfo, bool isPassword); 677 678 /** 679 * @brief Sets whether the element is scrollable for an <b>ArkUI_AccessibilityElementInfo</b> object. 680 * 681 * @param elementInfo Indicates the pointer to an <b>ArkUI_AccessibilityElementInfo</b> object. 682 * @param scrollable Indicates whether the element is scrollable. 683 * @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. 684 * Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. 685 * @since 13 686 */ 687 int32_t OH_ArkUI_AccessibilityElementInfoSetScrollable( 688 ArkUI_AccessibilityElementInfo* elementInfo, bool scrollable); 689 690 /** 691 * @brief Sets whether the element is editable for an <b>ArkUI_AccessibilityElementInfo</b> object. 692 * 693 * @param elementInfo Indicates the pointer to an <b>ArkUI_AccessibilityElementInfo</b> object. 694 * @param editable Indicates whether the element is editable. 695 * @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. 696 * Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. 697 * @since 13 698 */ 699 int32_t OH_ArkUI_AccessibilityElementInfoSetEditable( 700 ArkUI_AccessibilityElementInfo* elementInfo, bool editable); 701 702 /** 703 * @brief Sets whether the element is a hint for an <b>ArkUI_AccessibilityElementInfo</b> object. 704 * 705 * @param elementInfo Indicates the pointer to an <b>ArkUI_AccessibilityElementInfo</b> object. 706 * @param isHint Indicates whether the element is a hint. 707 * @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. 708 * Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. 709 * @since 13 710 */ 711 int32_t OH_ArkUI_AccessibilityElementInfoSetIsHint( 712 ArkUI_AccessibilityElementInfo* elementInfo, bool isHint); 713 714 /** 715 * @brief Sets the range information for an <b>ArkUI_AccessibilityElementInfo</b> object. 716 * 717 * @param elementInfo Indicates the pointer to an <b>ArkUI_AccessibilityElementInfo</b> object. 718 * @param rangeInfo Indicates the range information. 719 * @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. 720 * Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. 721 * @since 13 722 */ 723 int32_t OH_ArkUI_AccessibilityElementInfoSetRangeInfo( 724 ArkUI_AccessibilityElementInfo* elementInfo, ArkUI_AccessibleRangeInfo* rangeInfo); 725 726 /** 727 * @brief Sets the grid information for an <b>ArkUI_AccessibilityElementInfo</b> object. 728 * 729 * @param elementInfo Indicates the pointer to an <b>ArkUI_AccessibilityElementInfo</b> object. 730 * @param gridInfo Indicates the grid information. 731 * @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. 732 * Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. 733 * @since 13 734 */ 735 int32_t OH_ArkUI_AccessibilityElementInfoSetGridInfo( 736 ArkUI_AccessibilityElementInfo* elementInfo, ArkUI_AccessibleGridInfo* gridInfo); 737 738 /** 739 * @brief Sets the grid item for an <b>ArkUI_AccessibilityElementInfo</b> object. 740 * 741 * @param elementInfo Indicates the pointer to an <b>ArkUI_AccessibilityElementInfo</b> object. 742 * @param gridItem Indicates the grid item. 743 * @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. 744 * Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. 745 * @since 13 746 */ 747 int32_t OH_ArkUI_AccessibilityElementInfoSetGridItemInfo( 748 ArkUI_AccessibilityElementInfo* elementInfo, ArkUI_AccessibleGridItemInfo* gridItem); 749 750 /** 751 * @brief Sets the starting index of the selected text for an <b>ArkUI_AccessibilityElementInfo</b> object. 752 * 753 * @param elementInfo Indicates the pointer to an <b>ArkUI_AccessibilityElementInfo</b> object. 754 * @param selectedTextStart Indicates the starting index of the selected text 755 * @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. 756 * Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. 757 * @since 13 758 */ 759 int32_t OH_ArkUI_AccessibilityElementInfoSetSelectedTextStart( 760 ArkUI_AccessibilityElementInfo* elementInfo, int32_t selectedTextStart); 761 762 /** 763 * @brief Sets the end index of the selected text for an <b>ArkUI_AccessibilityElementInfo</b> object. 764 * 765 * @param elementInfo Indicates the pointer to an <b>ArkUI_AccessibilityElementInfo</b> object. 766 * @param selectedTextEnd Indicates the end index of the selected text 767 * @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. 768 * Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. 769 * @since 13 770 */ 771 int32_t OH_ArkUI_AccessibilityElementInfoSetSelectedTextEnd( 772 ArkUI_AccessibilityElementInfo* elementInfo, int32_t selectedTextEnd); 773 774 /** 775 * @brief Sets the index of the currently selected item for an <b>ArkUI_AccessibilityElementInfo</b> object. 776 * 777 * @param elementInfo Indicates the pointer to an <b>ArkUI_AccessibilityElementInfo</b> object. 778 * @param currentItemIndex Indicates the index of the currently selected item. 779 * @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. 780 * Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. 781 * @since 13 782 */ 783 int32_t OH_ArkUI_AccessibilityElementInfoSetCurrentItemIndex( 784 ArkUI_AccessibilityElementInfo* elementInfo, int32_t currentItemIndex); 785 786 /** 787 * @brief Sets the index of the first item for an <b>ArkUI_AccessibilityElementInfo</b> object. 788 * 789 * @param elementInfo Indicates the pointer to an <b>ArkUI_AccessibilityElementInfo</b> object. 790 * @param startItemIndex Indicates the index of the first item. 791 * @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. 792 * Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. 793 * @since 13 794 */ 795 int32_t OH_ArkUI_AccessibilityElementInfoSetStartItemIndex( 796 ArkUI_AccessibilityElementInfo* elementInfo, int32_t startItemIndex); 797 798 /** 799 * @brief Sets the index of the last item for an <b>ArkUI_AccessibilityElementInfo</b> object. 800 * 801 * @param elementInfo Indicates the pointer to an <b>ArkUI_AccessibilityElementInfo</b> object. 802 * @param endItemIndex Indicates the index of the last item. 803 * @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. 804 * Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. 805 * @since 13 806 */ 807 int32_t OH_ArkUI_AccessibilityElementInfoSetEndItemIndex( 808 ArkUI_AccessibilityElementInfo* elementInfo, int32_t endItemIndex); 809 810 /** 811 * @brief Sets the number of items for an <b>ArkUI_AccessibilityElementInfo</b> object. 812 * 813 * @param elementInfo Indicates the pointer to an <b>ArkUI_AccessibilityElementInfo</b> object. 814 * @param itemCount Indicates the number of items. 815 * @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. 816 * Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. 817 * @since 13 818 */ 819 int32_t OH_ArkUI_AccessibilityElementInfoSetItemCount( 820 ArkUI_AccessibilityElementInfo* elementInfo, int32_t itemCount); 821 822 /** 823 * @brief Sets the offset for an <b>ArkUI_AccessibilityElementInfo</b> object. 824 * 825 * @param elementInfo Indicates the pointer to an <b>ArkUI_AccessibilityElementInfo</b> object. 826 * @param offset Indicates the scroll pixel offset relative to the top of the element. 827 * @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. 828 * Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. 829 * @since 13 830 */ 831 int32_t OH_ArkUI_AccessibilityElementInfoSetAccessibilityOffset( 832 ArkUI_AccessibilityElementInfo* elementInfo, int32_t offset); 833 834 /** 835 * @brief Sets the accessibility group for an <b>ArkUI_AccessibilityElementInfo</b> object. 836 * 837 * @param elementInfo Indicates the pointer to an <b>ArkUI_AccessibilityElementInfo</b> object. 838 * @param accessibilityGroup Indicates the accessibility group. 839 * @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. 840 * Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. 841 * @since 13 842 */ 843 int32_t OH_ArkUI_AccessibilityElementInfoSetAccessibilityGroup( 844 ArkUI_AccessibilityElementInfo* elementInfo, bool accessibilityGroup); 845 846 /** 847 * @brief Sets the accessibility level for an <b>ArkUI_AccessibilityElementInfo</b> object. 848 * 849 * @param elementInfo Indicates the pointer to an <b>ArkUI_AccessibilityElementInfo</b> object. 850 * @param accessibilityLevel Indicates the accessibility level. 851 * @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. 852 * Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. 853 * @since 13 854 */ 855 int32_t OH_ArkUI_AccessibilityElementInfoSetAccessibilityLevel( 856 ArkUI_AccessibilityElementInfo* elementInfo, const char* accessibilityLevel); 857 858 /** 859 * @brief Sets the z-index for an <b>ArkUI_AccessibilityElementInfo</b> object. 860 * 861 * @param elementInfo Indicates the pointer to an <b>ArkUI_AccessibilityElementInfo</b> object. 862 * @param zIndex Indicates the z-index value. 863 * @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. 864 * Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. 865 * @since 13 866 */ 867 int32_t OH_ArkUI_AccessibilityElementInfoSetZIndex( 868 ArkUI_AccessibilityElementInfo* elementInfo, int32_t zIndex); 869 870 /** 871 * @brief Sets the opacity for an <b>ArkUI_AccessibilityElementInfo</b> object. 872 * 873 * @param elementInfo Indicates the pointer to an <b>ArkUI_AccessibilityElementInfo</b> object. 874 * @param opacity Indicates the opacity. 875 * @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. 876 * Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. 877 * @since 13 878 */ 879 int32_t OH_ArkUI_AccessibilityElementInfoSetAccessibilityOpacity( 880 ArkUI_AccessibilityElementInfo* elementInfo, float opacity); 881 882 /** 883 * @brief Sets the background color for an <b>ArkUI_AccessibilityElementInfo</b> object. 884 * 885 * @param elementInfo Indicates the pointer to an <b>ArkUI_AccessibilityElementInfo</b> object. 886 * @param backgroundColor Indicates the background color. 887 * @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. 888 * Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. 889 * @since 13 890 */ 891 int32_t OH_ArkUI_AccessibilityElementInfoSetBackgroundColor( 892 ArkUI_AccessibilityElementInfo* elementInfo, const char* backgroundColor); 893 894 /** 895 * @brief Sets the background image for an <b>ArkUI_AccessibilityElementInfo</b> object. 896 * 897 * @param elementInfo Indicates the pointer to an <b>ArkUI_AccessibilityElementInfo</b> object. 898 * @param backgroundImage Indicates the backgroundImage. 899 * @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. 900 * Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. 901 * @since 13 902 */ 903 int32_t OH_ArkUI_AccessibilityElementInfoSetBackgroundImage( 904 ArkUI_AccessibilityElementInfo* elementInfo, const char* backgroundImage); 905 906 /** 907 * @brief Sets the blur effect for an <b>ArkUI_AccessibilityElementInfo</b> object. 908 * 909 * @param elementInfo Indicates the pointer to an <b>ArkUI_AccessibilityElementInfo</b> object. 910 * @param blur Indicates the blur effect. 911 * @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. 912 * Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. 913 * @since 13 914 */ 915 int32_t OH_ArkUI_AccessibilityElementInfoSetBlur( 916 ArkUI_AccessibilityElementInfo* elementInfo, const char* blur); 917 918 /** 919 * @brief Sets the hit test behavior for an <b>ArkUI_AccessibilityElementInfo</b> object. 920 * 921 * @param elementInfo Indicates the pointer to an <b>ArkUI_AccessibilityElementInfo</b> object. 922 * @param hitTestBehavior Indicates the hit test behavior. 923 * @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. 924 * Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. 925 * @since 13 926 */ 927 int32_t OH_ArkUI_AccessibilityElementInfoSetHitTestBehavior( 928 ArkUI_AccessibilityElementInfo* elementInfo, const char* hitTestBehavior); 929 930 /** 931 * @brief Creates an <b>ArkUI_AccessibilityElementInfo</b> object. 932 * 933 * @return Returns the <b>ArkUI_AccessibilityElementInfo</b> object, or NULL if it fails to create. 934 * The possible reason for failure is that the memory error occurred during object creation. 935 * @since 13 936 * @version 1.0 937 */ 938 ArkUI_AccessibilityElementInfo* OH_ArkUI_CreateAccessibilityElementInfo(void); 939 940 /** 941 * @brief Destroys an <b>ArkUI_AccessibilityElementInfo</b> object. 942 * 943 * @param elementInfo Indicates the pointer to the <b>ArkUI_AccessibilityElementInfo</b> object to destroy. 944 * @since 13 945 * @version 1.0 946 */ 947 void OH_ArkUI_DestoryAccessibilityElementInfo(ArkUI_AccessibilityElementInfo* elementInfo); 948 949 /** 950 * @brief Creates an <b>ArkUI_AccessibilityEventInfo</b> object. 951 * 952 * @return Returns the <b>ArkUI_AccessibilityEventInfo</b> object, or NULL if it fails to create. 953 * The possible reason for failure is that the memory error occurred during object creation. 954 * @since 13 955 */ 956 ArkUI_AccessibilityEventInfo* OH_ArkUI_CreateAccessibilityEventInfo(void); 957 958 /** 959 * @brief Destroys an <b>ArkUI_AccessibilityEventInfo</b> object. 960 * 961 * @param eventInfo Indicates the pointer to the <b>ArkUI_AccessibilityEventInfo</b> object to destroy. 962 * @since 13 963 */ 964 void OH_ArkUI_DestoryAccessibilityEventInfo(ArkUI_AccessibilityEventInfo* eventInfo); 965 966 /** 967 * @brief Sets the event type for an <b>ArkUI_AccessibilityEventInfo</b> object. 968 * 969 * @param eventInfo Indicates the pointer to an <b>ArkUI_AccessibilityEventInfo</b> object. 970 * @param eventType Indicates the event type. 971 * @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. 972 * Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. 973 * @since 13 974 */ 975 int32_t OH_ArkUI_AccessibilityEventSetEventType( 976 ArkUI_AccessibilityEventInfo* eventInfo, ArkUI_AccessibilityEventType eventType); 977 978 /** 979 * @brief Sets the text announced for accessibility for an <b>ArkUI_AccessibilityEventInfo</b> object. 980 * 981 * @param eventInfo Indicates the pointer to an <b>ArkUI_AccessibilityEventInfo</b> object. 982 * @param textAnnouncedForAccessibility Indicates the text announced for accessibility. 983 * @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. 984 * Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. 985 * @since 13 986 */ 987 int32_t OH_ArkUI_AccessibilityEventSetTextAnnouncedForAccessibility( 988 ArkUI_AccessibilityEventInfo* eventInfo, const char* textAnnouncedForAccessibility); 989 990 /** 991 * @brief Sets the request focus ID for an <b>ArkUI_AccessibilityEventInfo</b> object. 992 * 993 * @param eventInfo Indicates the pointer to an <b>ArkUI_AccessibilityEventInfo</b> object. 994 * @param requestFocusId Indicates the request focus ID. 995 * @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. 996 * Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. 997 * @since 13 998 */ 999 int32_t OH_ArkUI_AccessibilityEventSetRequestFocusId( 1000 ArkUI_AccessibilityEventInfo* eventInfo, int32_t requestFocusId); 1001 1002 /** 1003 * @brief Sets the element information for an <b>ArkUI_AccessibilityEventInfo</b> object. 1004 * 1005 * @param eventInfo Indicates the pointer to an <b>ArkUI_AccessibilityEventInfo</b> object. 1006 * @param elementInfo Indicates the pointer to an <b>ArkUI_AccessibilityElementInfo</b> object. 1007 * @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. 1008 * Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. 1009 * @since 13 1010 */ 1011 int32_t OH_ArkUI_AccessibilityEventSetElementInfo( 1012 ArkUI_AccessibilityEventInfo* eventInfo, ArkUI_AccessibilityElementInfo* elementInfo); 1013 1014 /** 1015 * @brief Obtains the value of a key from an <b>ArkUI_AccessibilityActionArguments</b> object. 1016 * 1017 * @param arguments Indicates the pointer to an <b>ArkUI_AccessibilityActionArguments</b> object. 1018 * @param key Indicates the key. 1019 * @param value Indicates the value. 1020 * @return Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_SUCCESSFUL} if the operation is successful. 1021 * Returns {@link ARKUI_ACCESSIBILITY_NATIVE_RESULT_BAD_PARAMETER} if a parameter is incorrect. 1022 * @since 13 1023 */ 1024 int32_t OH_ArkUI_FindAccessibilityActionArgumentByKey( 1025 ArkUI_AccessibilityActionArguments* arguments, const char* key, char** value); 1026 #ifdef __cplusplus 1027 }; 1028 #endif 1029 #endif // _NATIVE_INTERFACE_ACCESSIBILITY_H 1030