1 /* 2 * Copyright (C) 2022-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 #ifndef ACCESSIBILITY_ELEMENT_INFO_H 17 #define ACCESSIBILITY_ELEMENT_INFO_H 18 19 #include <map> 20 #include <set> 21 #include <vector> 22 #include "accessibility_def.h" 23 24 namespace OHOS { 25 namespace Accessibility { 26 static std::set<std::string> EXTRA_ELEMENTINFO_SET = { 27 "CheckboxGroupSelectedStatus", 28 "Row", 29 "Column", 30 "SideBarContainerStates", 31 "ListItemIndex", 32 "ToggleType", 33 "BindSheet", 34 "hasRegisteredHover" 35 }; 36 37 /* 38 * class define the action on Accessibility info 39 */ 40 class AccessibleAction { 41 public: 42 /** 43 * @brief Construct 44 */ AccessibleAction()45 AccessibleAction() {} 46 47 /** 48 * @brief Construct 49 * @param actionType The type of action, refer to [ActionType] 50 * @param description The description message of action. 51 */ 52 AccessibleAction(ActionType actionType, const std::string &description); 53 54 /** 55 * @brief Gets the action type. 56 * @return The type of action, refer to [ActionType] 57 */ 58 ActionType GetActionType() const; 59 60 /** 61 * @brief Gets the action description. 62 * @return The description message of action. 63 */ 64 const std::string &GetDescriptionInfo() const; 65 66 protected: 67 ActionType actionType_ = ACCESSIBILITY_ACTION_INVALID; 68 std::string description_ = ""; 69 }; 70 71 /** 72 * @brief Define the RangInfo for progress bar 73 * @note 74 * @retval None 75 */ 76 class RangeInfo { 77 public: 78 /** 79 * @brief Construct 80 */ RangeInfo()81 RangeInfo() {} 82 83 /** 84 * @brief Construct 85 * @param min The min value 86 * @param max The max value 87 * @param current current value 88 */ 89 RangeInfo(double min, double max, double current); 90 91 /** 92 * @brief Gets the min value. 93 * @return min value 94 */ 95 double GetMin() const; 96 97 /** 98 * @brief Gets the max value. 99 * @return max value. 100 */ 101 double GetMax() const; 102 103 /** 104 * @brief Gets the current value. 105 * @return current value. 106 */ 107 double GetCurrent() const; 108 109 /** 110 * @brief Sets the min value. 111 * @param min min value 112 */ 113 void SetMin(double min); 114 115 /** 116 * @brief Sets the max value. 117 * @param max max value. 118 */ 119 void SetMax(double max); 120 121 /** 122 * @brief Sets the current value. 123 * @param current current value 124 */ 125 void SetCurrent(double current); 126 127 protected: 128 double min_ = 0; 129 double max_ = 0; 130 double current_ = 0; 131 }; 132 133 /** 134 * @brief Define the list/grid component 135 * @note 136 * @retval None 137 */ 138 class GridInfo { 139 public: 140 /** 141 * @brief Construct 142 * @since 3 143 * @sysCap Accessibility 144 */ GridInfo()145 GridInfo() {} 146 147 /** 148 * @brief Construct 149 * @param rowCount The number of row 150 * @param columnCount The number of column 151 * @param mode 0: select one line only, otherwise select multilines. 152 * @since 3 153 * @sysCap Accessibility 154 */ 155 GridInfo(int32_t rowCount, int32_t columnCount, int32_t mode); 156 157 /** 158 * @brief Set the grid object 159 * @param rowCount The number of row 160 * @param columnCount The number of column 161 * @param mode 0: select one line only, otherwise select multilines. 162 * @since 3 163 * @sysCap Accessibility 164 */ 165 void SetGrid(int32_t rowCount, int32_t columnCount, int32_t mode); 166 167 /** 168 * @brief Copy grid object. 169 * @param other The copied grid 170 * @since 3 171 * @sysCap Accessibility 172 */ 173 void SetGrid(GridInfo other); 174 175 /** 176 * @brief Gets the number of rows. 177 * @return number of rows. 178 * @since 3 179 * @sysCap Accessibility 180 */ 181 int32_t GetRowCount() const; 182 183 /** 184 * @brief Gets the number of columns. 185 * @return number of columns. 186 * @since 3 187 * @sysCap Accessibility 188 */ 189 int32_t GetColumnCount() const; 190 191 /** 192 * @brief Get the mode of grid 193 * @return 0: Selected by one line, otherwise is multilines. 194 * @since 3 195 * @sysCap Accessibility 196 */ 197 int32_t GetSelectionMode() const; 198 199 protected: 200 int32_t rowCount_ = 0; 201 int32_t columnCount_ = 0; 202 int32_t selectionMode_ = 0; 203 }; 204 205 class GridItemInfo { 206 public: 207 /** 208 * @brief Construct 209 * @since 3 210 * @sysCap Accessibility 211 */ GridItemInfo()212 GridItemInfo() {} 213 214 /** 215 * @brief Construct 216 * @param rowIndex The index of row. 217 * @param rowSpan The row spanned. 218 * @param columnIndex The index of column 219 * @param columnSpan THe column spanned 220 * @param heading true:The item isHeading, otherwise is not 221 * @param selected true:The item is selected,otherwise is not 222 * @since 3 223 * @sysCap Accessibility 224 */ 225 GridItemInfo(int32_t rowIndex, int32_t rowSpan, int32_t columnIndex, int32_t columnSpan, 226 bool heading, bool selected); 227 228 /** 229 * @brief Copy the GridItemInfo 230 * @param other The object of GridItemInfo copied. 231 * @since 3 232 * @sysCap Accessibility 233 */ 234 void SetGridItemInfo(GridItemInfo other); 235 236 /** 237 * @brief Set grid object 238 * @param rowIndex The index of row. 239 * @param rowSpan The row spanned. 240 * @param columnIndex The index of column 241 * @param columnSpan THe column spanned 242 * @param heading true:The item isHeading, otherwise is not 243 * @param selected true:The item is selected,otherwise is not 244 * @since 3 245 * @sysCap Accessibility 246 */ 247 void SetGridItemInfo(int32_t rowIndex, int32_t rowSpan, int32_t columnIndex, int32_t columnSpan, 248 bool heading, bool selected); 249 250 /** 251 * @brief Gets the column index at which the item is located. 252 * @return The column index. 253 * @since 3 254 * @sysCap Accessibility 255 */ 256 int32_t GetColumnIndex() const; 257 258 /** 259 * @brief Gets the row index at which the item is located. 260 * @return The row index. 261 * @since 3 262 * @sysCap Accessibility 263 */ 264 int32_t GetRowIndex() const; 265 266 /** 267 * @brief Gets the number of columns the item spans. 268 * @return The column span. 269 * @since 3 270 * @sysCap Accessibility 271 */ 272 int32_t GetColumnSpan() const; 273 274 /** 275 * @brief Gets the number of rows the item spans. 276 * @return The row span. 277 * @since 3 278 * @sysCap Accessibility 279 */ 280 int32_t GetRowSpan() const; 281 282 /** 283 * @brief Checks if the grid item is a heading. 284 * @return true:If the item is a heading, otherwise is not. 285 * @since 3 286 * @sysCap Accessibility 287 */ 288 bool IsHeading() const; 289 290 /** 291 * @brief Checks if the grid item is a selected. 292 * @return true:If the item is a selected, otherwise is not. 293 * @since 3 294 * @sysCap Accessibility 295 */ 296 bool IsSelected() const; 297 298 protected: 299 bool heading_ = false; 300 int32_t columnIndex_ = 0; 301 int32_t rowIndex_ = 0; 302 int32_t columnSpan_ = 0; 303 int32_t rowSpan_ = 0; 304 bool selected_ = false; 305 }; 306 307 308 /* 309 * class define the extra elementinfo 310 */ 311 class ExtraElementInfo { 312 public: 313 /** 314 * @brief Construct 315 */ ExtraElementInfo()316 ExtraElementInfo() {} 317 318 /** 319 * @brief Construct 320 * @param extraElementValueStr The map of extraElement. 321 * @param extraElementValueInt The map of extraElement. 322 * @sysCap Accessibility 323 */ 324 ExtraElementInfo(const std::map<std::string, std::string> extraElementValueStr, 325 const std::map<std::string, int32_t> extraElementValueInt); 326 327 /** 328 * @brief Copy the ExtraElementInfo 329 * @param keyStr The key of extraElementValueStr. 330 * @param valueStr The val of extraElementValueStr. 331 * @sysCap Accessibility 332 */ 333 RetError SetExtraElementInfo(const std::string keyStr, const std::string valueStr); 334 335 /** 336 * @brief Copy the ExtraElementInfo 337 * @param keyStr The key of extraElementValueInt. 338 * @param valueInt The val of extraElementValueInt. 339 * @sysCap Accessibility 340 */ 341 RetError SetExtraElementInfo(const std::string keyStr, const int32_t valueInt); 342 343 /** 344 * @brief Gets the map of extraElementValueStr. 345 * @return The extraElementValueStr map. 346 * @sysCap Accessibility 347 */ 348 const std::map<std::string, std::string> &GetExtraElementInfoValueStr() const; 349 350 /** 351 * @brief Gets the map of extraElementValueInt. 352 * @return The extraElementValueInt map. 353 * @sysCap Accessibility 354 */ 355 const std::map<std::string, int32_t> &GetExtraElementInfoValueInt() const; 356 357 protected: 358 std::map<std::string, std::string> extraElementValueStr_ = {}; 359 std::map<std::string, int32_t> extraElementValueInt_ = {}; 360 }; 361 362 class Rect { 363 public: 364 /** 365 * @brief Construct 366 * @since 3 367 * @sysCap Accessibility 368 */ Rect()369 Rect() {} 370 371 /** 372 * @brief Destruct 373 * @since 3 374 * @sysCap Accessibility 375 */ 376 virtual ~Rect() = default; 377 378 /** 379 * @brief Construct 380 * @param leftTopX : The left top x pixel coordinates 381 * @param leftTopY : The left top y pixel coordinates 382 * @param rightBottomY : The right bottom y pixel coordinates 383 * @param rightBottomX : The right bottom x pixel coordinates 384 * @since 3 385 * @sysCap Accessibility 386 */ Rect(int32_t leftTopX,int32_t leftTopY,int32_t rightBottomX,int32_t rightBottomY)387 Rect(int32_t leftTopX, int32_t leftTopY, int32_t rightBottomX, int32_t rightBottomY) 388 { 389 leftTopX_ = leftTopX; 390 leftTopY_ = leftTopY; 391 rightBottomX_ = rightBottomX; 392 rightBottomY_ = rightBottomY; 393 } 394 395 /** 396 * @brief Get the left top point's pixel coordinates 397 * @return The left top x pixel coordinates 398 * @since 3 399 * @sysCap Accessibility 400 */ GetLeftTopXScreenPostion()401 int32_t GetLeftTopXScreenPostion() const 402 { 403 return leftTopX_; 404 } 405 406 /** 407 * @brief Get the left top point's pixel coordinates 408 * @return The left top y pixel coordinates 409 * @since 3 410 * @sysCap Accessibility 411 */ GetLeftTopYScreenPostion()412 int32_t GetLeftTopYScreenPostion() const 413 { 414 return leftTopY_; 415 } 416 417 /** 418 * @brief Get the right bottom point's pixel coordinates 419 * @return The bottom x pixel coordinates 420 * @since 3 421 * @sysCap Accessibility 422 */ GetRightBottomXScreenPostion()423 int32_t GetRightBottomXScreenPostion() const 424 { 425 return rightBottomX_; 426 } 427 428 /** 429 * @brief Get the right bottom point's pixel coordinates 430 * @return The bottom y pixel coordinates 431 * @since 3 432 * @sysCap Accessibility 433 */ GetRightBottomYScreenPostion()434 int32_t GetRightBottomYScreenPostion() const 435 { 436 return rightBottomY_; 437 } 438 /** 439 * @brief Set the left top point's pixel coordinates 440 * @param leftTopX The left top x pixel coordinates 441 * @param leftTopY The left top y pixel coordinates 442 * @since 3 443 * @sysCap Accessibility 444 */ SetLeftTopScreenPostion(int32_t leftTopX,int32_t leftTopY)445 void SetLeftTopScreenPostion(int32_t leftTopX, int32_t leftTopY) 446 { 447 leftTopY_ = leftTopY; 448 leftTopX_ = leftTopX; 449 } 450 451 /** 452 * @brief Set the right bottom point's pixel coordinates 453 * @param rightBottomX The right bottom x pixel coordinates 454 * @param rightBottomY The right bottom y pixel coordinates 455 * @since 3 456 * @sysCap Accessibility 457 */ SetRightBottomScreenPostion(int32_t rightBottomX,int32_t rightBottomY)458 void SetRightBottomScreenPostion(int32_t rightBottomX, int32_t rightBottomY) 459 { 460 rightBottomY_ = rightBottomY; 461 rightBottomX_ = rightBottomX; 462 } 463 464 protected: 465 int32_t leftTopX_ = 0; 466 int32_t leftTopY_ = 0; 467 int32_t rightBottomX_ = 0; 468 int32_t rightBottomY_ = 0; 469 }; 470 471 /* 472 * class define the span info 473 */ 474 class SpanInfo { 475 public: 476 /** 477 * @brief Construct 478 */ SpanInfo()479 SpanInfo() {} 480 481 /** 482 * @brief Construct 483 * @param spanId The span Id. 484 * @param spanText The text of span. 485 * @param accessibilityText The accessibility text of span. 486 * @param accessibilityDescription The accessibility description of span. 487 * @param accessibilityLevel The accessibility level of span. 488 */ 489 SpanInfo(const int32_t &spanId, const std::string &spanText, const std::string &accessibilityText, 490 const std::string &accessibilityDescription, const std::string &accessibilityLevel); 491 492 /** 493 * @brief Sets the span Id of spanInfo. 494 * @param spanId The span Id. 495 */ 496 void SetSpanId(const int32_t spanId); 497 498 /** 499 * @brief Sets the Text of spanInfo. 500 * @param spanText The span text. 501 */ 502 void SetSpanText(const std::string spanText); 503 504 /** 505 * @brief Sets the accessibility text of spanInfo. 506 * @param accessibilityText The accessibility text. 507 */ 508 void SetAccessibilityText(const std::string accessibilityText); 509 510 /** 511 * @brief Sets the accessibilityDescription of spanInfo. 512 * @param accessibilityDescription The accessibility description. 513 */ 514 void SetAccessibilityDescription(const std::string accessibilityDescription); 515 516 /** 517 * @brief Sets the accessibilityLevel of spanInfo. 518 * @param accessibilityLevel The accessibility level. 519 */ 520 void SetAccessibilityLevel(const std::string accessibilityLevel); 521 522 /** 523 * @brief Gets the span id. 524 * @return The id of span. 525 */ 526 int32_t GetSpanId() const; 527 528 /** 529 * @brief Gets the span Text. 530 * @return The Text of span. 531 */ 532 const std::string &GetSpanText() const; 533 534 /** 535 * @brief Gets the accessibility text. 536 * @return The accessibility text of span. 537 */ 538 const std::string &GetAccessibilityText() const; 539 540 /** 541 * @brief Gets the accessibility description. 542 * @return The accessibility description of span. 543 */ 544 const std::string &GetAccessibilityDescription() const; 545 546 /** 547 * @brief Gets the accessibility level. 548 * @return The accessibility level of span. 549 */ 550 const std::string &GetAccessibilityLevel() const; 551 552 protected: 553 int32_t spanId_; 554 std::string spanText_; 555 std::string accessibilityText_; 556 std::string accessibilityDescription_; 557 std::string accessibilityLevel_; 558 }; 559 560 /* 561 * The class supply the api to set/get ui component property 562 */ 563 class AccessibilityElementInfo { 564 public: 565 static constexpr int64_t UNDEFINED_ACCESSIBILITY_ID = -1; 566 static constexpr int32_t UNDEFINED_TREE_ID = -1; 567 static constexpr int32_t UNDEFINED_WINID_ID = -1; 568 static constexpr int32_t MAX_SIZE = 50; 569 static constexpr int64_t ROOT_PARENT_ID = -2100000; 570 571 /** 572 * @brief Construct 573 * @since 3 574 * @sysCap Accessibility 575 */ 576 AccessibilityElementInfo(); 577 578 /** 579 * @brief Set the id of AccessibilityElementInfo 580 * @param componentId The id of component. 581 * @since 3 582 * @sysCap Accessibility 583 */ 584 void SetComponentId(const int64_t componentId); 585 586 /** 587 * @brief Get the child's accessibility Id by index. 588 * @param index The index of child 589 * @return The child's accessibility Id 590 * @since 3 591 * @sysCap Accessibility 592 */ 593 int64_t GetChildId(const int32_t index) const; 594 595 /** 596 * @brief Gets the number of children 597 * @return The number of children 598 * @since 3 599 * @sysCap Accessibility 600 */ 601 int32_t GetChildCount() const; 602 603 /** 604 * @brief Gets the id of children 605 * @return The list of children id 606 * @since 3 607 * @sysCap Accessibility 608 */ 609 const std::vector<int64_t> &GetChildIds() const; 610 611 /** 612 * @brief Add child node information 613 * @param childId The id of child node 614 * @since 3 615 * @sysCap Accessibility 616 */ 617 void AddChild(const int64_t childId); 618 619 /** 620 * @brief Remove child specified. 621 * @param childId The child to removed. 622 * @return true:Removed succeed, otherwise is not. 623 * @since 3 624 * @sysCap Accessibility 625 */ 626 bool RemoveChild(const int64_t childId); 627 628 /** 629 * @brief Gets an action list. 630 * @return action list. Refer to AccessibleAction 631 * @since 3 632 * @sysCap Accessibility 633 */ 634 const std::vector<AccessibleAction> &GetActionList() const; 635 636 /** 637 * @brief Add action on the component 638 * @param action The action on the component. 639 * @since 3 640 * @sysCap Accessibility 641 */ 642 void AddAction(AccessibleAction &action); 643 644 /** 645 * @brief Remove action on the component 646 * @param action The action object. 647 * @since 3 648 * @sysCap Accessibility 649 */ 650 void DeleteAction(AccessibleAction &action); 651 652 /** 653 * @brief Remove the action on the component. 654 * @param actionType The action type. 655 * @return true:successfully deleted, otherwise is not. 656 * @since 3 657 * @sysCap Accessibility 658 */ 659 bool DeleteAction(ActionType &actionType); 660 661 /** 662 * @brief Remove all the action on the component. 663 * @since 3 664 * @sysCap Accessibility 665 */ 666 void DeleteAllActions(); 667 668 /** 669 * @brief Sets the maximum length of text allowed for this node. 670 * @param max The maximum length of text 671 * @since 3 672 * @sysCap Accessibility 673 */ 674 void SetTextLengthLimit(const int32_t max); 675 676 /** 677 * @brief Gets the maximum length of text allowed for this node. 678 * @return The maximum length of text 679 * @since 3 680 * @sysCap Accessibility 681 */ 682 int32_t GetTextLengthLimit() const; 683 684 /** 685 * @brief Get the window Id of the component that belongs to the window. 686 * @return window id 687 * @since 3 688 * @sysCap Accessibility 689 */ 690 int32_t GetWindowId() const; 691 692 /** 693 * @brief Set the window Id of the component that belongs to the window. 694 * @param windowId The window Id 695 * @since 3 696 * @sysCap Accessibility 697 */ 698 void SetWindowId(const int32_t windowId); 699 700 /** 701 * @brief Get parent accessibility Id. 702 * @return The accessibility Id of parent. 703 * @since 3 704 * @sysCap Accessibility 705 */ 706 int64_t GetParentNodeId() const; 707 708 /** 709 * @brief Set parent node information 710 * @param parentId Parent node id 711 * @since 3 712 * @sysCap Accessibility 713 */ 714 void SetParent(const int64_t parentId); 715 716 /** 717 * @brief Gets the rectangular area of this accessibility node control in the screen. 718 * @return The rectangular area of this accessibility node 719 * @since 3 720 * @sysCap Accessibility 721 */ 722 const Rect &GetRectInScreen() const; 723 724 /** 725 * @brief Set the rectangular area of this accessibility node control in the screen. 726 * @param bounds The rectangular area of this accessibility node 727 * @since 3 728 * @sysCap Accessibility 729 */ 730 void SetRectInScreen(Rect &bounds); 731 732 /** 733 * @brief Checks whether this node (a check box as an example) is checkable. 734 * @return true:the node is checkable, otherwise is not. 735 * @since 3 736 * @sysCap Accessibility 737 */ 738 bool IsCheckable() const; 739 740 /** 741 * @brief Set whether this node (a check box as an example) is checkable. 742 * @param checkable true:the node is checkable, otherwise is not. 743 * @since 3 744 * @sysCap Accessibility 745 */ 746 void SetCheckable(const bool checkable); 747 748 /** 749 * @brief Checks whether this node is checked. 750 * @return true : Is checked, otherwise is not. 751 * @since 3 752 * @sysCap Accessibility 753 */ 754 bool IsChecked() const; 755 756 /** 757 * @brief Set whether this node is checked. 758 * @param checked true:Is checked, otherwise is not. 759 * @since 3 760 * @sysCap Accessibility 761 */ 762 void SetChecked(const bool checked); 763 764 /** 765 * @brief Checks whether this node can be focused. 766 * @return true : Can be focused, otherwise is not. 767 * @since 3 768 * @sysCap Accessibility 769 */ 770 bool IsFocusable() const; 771 772 /** 773 * @brief Set whether this node can be focused. 774 * @param focusable true : Can be focused, otherwise is not. 775 * @since 3 776 * @sysCap Accessibility 777 */ 778 void SetFocusable(const bool focusable); 779 780 /** 781 * @brief Checks whether this node has gained focus. 782 * @return true:Focused, otherwise is not. 783 * @since 3 784 * @sysCap Accessibility 785 */ 786 bool IsFocused() const; 787 788 /** 789 * @brief Set whether this node has gained focus. 790 * @param focused true : Focused, otherwise is not. 791 * @since 3 792 * @sysCap Accessibility 793 */ 794 void SetFocused(const bool focused); 795 796 /** 797 * @brief Checks whether this node is visible to users. 798 * @return true : visible, otherwise is not. 799 * @since 3 800 * @sysCap Accessibility 801 */ 802 bool IsVisible() const; 803 804 /** 805 * @brief Set whether this node is visible to users. 806 * @param visible true:visible, otherwise is not. 807 * @since 3 808 * @sysCap Accessibility 809 */ 810 void SetVisible(const bool visible); 811 812 /** 813 * @brief Checks whether this node has gained accessibility focus. 814 * @return true:Gained accessibility focus, otherwise is not. 815 * @since 3 816 * @sysCap Accessibility 817 */ 818 bool HasAccessibilityFocus() const; 819 820 /** 821 * @brief Set whether this node has gained accessibility focus. 822 * @param focused true:Gained accessibility focus, otherwise is not. 823 * @since 3 824 * @sysCap Accessibility 825 */ 826 void SetAccessibilityFocus(const bool focused); 827 828 /** 829 * @brief Checks whether this node is selected. 830 * @return true:selected, otherwise is not. 831 * @since 3 832 * @sysCap Accessibility 833 */ 834 bool IsSelected() const; 835 836 /** 837 * @brief Set whether this node is selected. 838 * @param selected true: selected, otherwise is not. 839 * @since 3 840 * @sysCap Accessibility 841 */ 842 void SetSelected(const bool selected); 843 844 /** 845 * @brief Checks whether this node is clickable. 846 * @return true: clickable, otherwise is not. 847 * @since 3 848 * @sysCap Accessibility 849 */ 850 bool IsClickable() const; 851 852 /** 853 * @brief Set whether this node is clickable. 854 * @param clickable true:clickable, otherwise is not. 855 * @since 3 856 * @sysCap Accessibility 857 */ 858 void SetClickable(const bool clickable); 859 860 /** 861 * @brief Checks whether this node is long clickable. 862 * @return true: long clickable, otherwise is not. 863 * @since 3 864 * @sysCap Accessibility 865 */ 866 bool IsLongClickable() const; 867 868 /** 869 * @brief Set whether this node is long clickable. 870 * @param longClickable true: long clickable, otherwise is not. 871 * @since 3 872 * @sysCap Accessibility 873 */ 874 void SetLongClickable(const bool longClickable); 875 876 /** 877 * @brief Checks whether this node is enabled. 878 * @return true:enabled, otherwise is not. 879 * @since 3 880 * @sysCap Accessibility 881 */ 882 bool IsEnabled() const; 883 884 /** 885 * @brief Set whether this node is enabled. 886 * @param enabled true: enabled, otherwise is not. 887 * @since 3 888 * @sysCap Accessibility 889 */ 890 void SetEnabled(const bool enabled); 891 892 /** 893 * @brief Checks whether the content in this node is a password. 894 * @return true: password, otherwise is not. 895 * @since 3 896 * @sysCap Accessibility 897 */ 898 bool IsPassword() const; 899 900 /** 901 * @brief Set whether the content in this node is a password 902 * @param type true:password, otherwise is not. 903 * @since 3 904 * @sysCap Accessibility 905 */ 906 void SetPassword(const bool type); 907 908 /** 909 * @brief Checks whether this node is scrollable. 910 * @return true: scrollable, otherwise is not. 911 * @since 3 912 * @sysCap Accessibility 913 */ 914 bool IsScrollable() const; 915 916 /** 917 * @brief Set whether this node is scrollable. 918 * @param scrollable true: scrollable, otherwise is not. 919 * @since 3 920 * @sysCap Accessibility 921 */ 922 void SetScrollable(const bool scrollable); 923 924 /** 925 * @brief Checks whether this node is editable. 926 * @return true:editable, otherwise is not. 927 * @since 3 928 * @sysCap Accessibility 929 */ 930 bool IsEditable() const; 931 932 /** 933 * @brief Set whether this node is editable. 934 * @param editable true: editable, otherwise is not. 935 * @since 3 936 * @sysCap Accessibility 937 */ 938 void SetEditable(const bool editable); 939 940 /** 941 * @brief Checks whether this node can display text in multiple lines. 942 * @return true: multilines, otherwise is not. 943 * @since 3 944 * @sysCap Accessibility 945 */ 946 bool IsPluraLineSupported() const; 947 948 /** 949 * @brief Set whether this node can display text in multiple lines. 950 * @param multiLine true:multilines, otherwise is not. 951 * @since 3 952 * @sysCap Accessibility 953 */ 954 void SetPluraLineSupported(const bool multiLine); 955 956 /** 957 * @brief Checks whether pop-up windows are supported. 958 * @return true: Support popup, otherwise is not. 959 * @since 3 960 * @sysCap Accessibility 961 */ 962 bool IsPopupSupported() const; 963 964 /** 965 * @brief Set whether pop-up windows are supported. 966 * @param supportPopup true: Support popup, otherwise is not. 967 * @since 3 968 * @sysCap Accessibility 969 */ 970 void SetPopupSupported(const bool supportPopup); 971 972 /** 973 * @brief Checks whether this node is deletable. 974 * @return true:deletable, otherwise is not. 975 * @since 3 976 * @sysCap Accessibility 977 */ 978 bool IsDeletable() const; 979 980 /** 981 * @brief Set whether this node is deletable. 982 * @param deletable true:deletable, otherwise is not. 983 * @since 3 984 * @sysCap Accessibility 985 */ 986 void SetDeletable(const bool deletable); 987 988 /** 989 * @brief Checks whether this node is essential to users. 990 * @return true: essential to user, otherwise is not. 991 * @since 3 992 * @sysCap Accessibility 993 */ 994 bool IsEssential() const; 995 996 /** 997 * @brief Set whether this node is essential to users. 998 * @param essential true:essential to user, otherwise is not. 999 * @since 3 1000 * @sysCap Accessibility 1001 */ 1002 void SetEssential(const bool essential); 1003 1004 /** 1005 * @brief Checks whether this node is displaying a hint. 1006 * @return true:displaying a hint, otherwise is not. 1007 * @since 3 1008 * @sysCap Accessibility 1009 */ 1010 bool IsGivingHint() const; 1011 1012 /** 1013 * @brief Set whether this node is displaying a hint. 1014 * @param hinting true:displaying a hint, otherwise is not. 1015 * @since 3 1016 * @sysCap Accessibility 1017 */ 1018 void SetHinting(const bool hinting); 1019 1020 /** 1021 * @brief Gets the bundle name of application target. 1022 * @return bundle name 1023 * @since 3 1024 * @sysCap Accessibility 1025 */ 1026 const std::string &GetBundleName() const; 1027 1028 /** 1029 * @brief Set the bundle name of application target. 1030 * @param bundleName The bundle name of application target. 1031 * @since 3 1032 * @sysCap Accessibility 1033 */ 1034 void SetBundleName(const std::string &bundleName); 1035 1036 /** 1037 * @brief Get component type. 1038 * @return The component type. 1039 * @since 3 1040 * @sysCap Accessibility 1041 */ 1042 const std::string &GetComponentType() const; 1043 1044 /** 1045 * @brief Set component type. 1046 * @param className The component type. 1047 * @since 3 1048 * @sysCap Accessibility 1049 */ 1050 void SetComponentType(const std::string &className); 1051 1052 /** 1053 * @brief Gets the text of node. 1054 * @return The text of node 1055 * @since 3 1056 * @sysCap Accessibility 1057 */ 1058 const std::string &GetContent() const; 1059 1060 /** 1061 * @brief Set the text of node. 1062 * @param text The text of node 1063 * @since 3 1064 * @sysCap Accessibility 1065 */ 1066 void SetContent(const std::string &text); 1067 1068 /** 1069 * @brief Gets the hint information. 1070 * @return the hint information. 1071 * @since 3 1072 * @sysCap Accessibility 1073 */ 1074 const std::string &GetHint() const; 1075 1076 /** 1077 * @brief Sets the hint information. 1078 * @param hintText the hint information. 1079 * @since 3 1080 * @sysCap Accessibility 1081 */ 1082 void SetHint(const std::string &hintText); 1083 1084 /** 1085 * @brief Gets the description of the accessibility node. 1086 * @return the description of the accessibility node. 1087 * @since 3 1088 * @sysCap Accessibility 1089 */ 1090 const std::string &GetDescriptionInfo() const; 1091 1092 /** 1093 * @brief Set the description of the accessibility node. 1094 * @param contentDescription the description of the accessibility node. 1095 * @since 3 1096 * @sysCap Accessibility 1097 */ 1098 void SetDescriptionInfo(const std::string &contentDescription); 1099 1100 /** 1101 * @brief Set the resource name of the component. 1102 * @param viewIdResName The resource name. 1103 * @since 3 1104 * @sysCap Accessibility 1105 */ 1106 void SetComponentResourceId(const std::string &viewIdResName); 1107 1108 /** 1109 * @brief Gets the resource name. 1110 * @return the resource name. 1111 * @since 3 1112 * @sysCap Accessibility 1113 */ 1114 const std::string &GetComponentResourceId() const; 1115 1116 /** 1117 * @brief Set whether this node has live region 1118 * @param liveRegion live region: 0: not live region; 1: interrupt current talk back; 2: talk back by order 1119 * @since 3 1120 * @sysCap Accessibility 1121 */ 1122 void SetLiveRegion(const int32_t liveRegion); 1123 1124 /** 1125 * @brief Get the live region of the node 1126 * @return The live region of the node 1127 * @since 3 1128 * @sysCap Accessibility 1129 */ 1130 int32_t GetLiveRegion() const; 1131 1132 /** 1133 * @brief Set whether this node has content Invalid. 1134 * @note If the node has content Invalid,when input invalid information, it will be talkbacked. such as: 1135 * The editbox permit number only, you input character("a"), The invalid information will be talkbacked. 1136 * @param contentInvalid true:the content is invalid; false:the content is valid 1137 * @since 3 1138 * @sysCap Accessibility 1139 */ 1140 void SetContentInvalid(const bool contentInvalid); 1141 1142 /** 1143 * @brief Get whether this node has content Invalid. 1144 * @return true:the content is invalid; false:the content is valid 1145 * @since 3 1146 * @sysCap Accessibility 1147 */ 1148 bool GetContentInvalid() const; 1149 1150 /** 1151 * @brief Set error information, it used with contentInvalid is setted true. 1152 * @param error error information 1153 * @since 3 1154 * @sysCap Accessibility 1155 */ 1156 void SetError(const std::string &error); 1157 1158 /** 1159 * @brief Get error information,it used with contentInvalid is setted true. 1160 * @return error information 1161 * @since 3 1162 * @sysCap Accessibility 1163 */ 1164 const std::string &GetError() const; 1165 1166 /** 1167 * @brief Set the id of component labeled 1168 * @param componentId the id of component 1169 * @since 3 1170 * @sysCap Accessibility 1171 */ 1172 void SetLabeled(const int64_t componentId); 1173 1174 /** 1175 * @brief Get labeled accessibility Id 1176 * @return accessibility Id 1177 * @since 3 1178 * @sysCap Accessibility 1179 */ 1180 int64_t GetLabeledAccessibilityId() const; 1181 1182 /** 1183 * @brief Set accessibility Id 1184 * @param componentId The id of component 1185 * @since 3 1186 * @sysCap Accessibility 1187 */ 1188 void SetAccessibilityId(const int64_t componentId); 1189 1190 /** 1191 * @brief Get accessibility Id 1192 * @return accessibility Id 1193 * @since 3 1194 * @sysCap Accessibility 1195 */ 1196 int64_t GetAccessibilityId() const; 1197 1198 /** 1199 * @brief Get the object of RangeInfo 1200 * @return the object of RangeInfo 1201 * @since 3 1202 * @sysCap Accessibility 1203 */ 1204 const RangeInfo &GetRange() const; 1205 1206 /** 1207 * @brief Set the object of RangeInfo 1208 * @param rangeInfo the object of RangeInfo 1209 * @since 3 1210 * @sysCap Accessibility 1211 */ 1212 void SetRange(RangeInfo &rangeInfo); 1213 1214 /** 1215 * @brief Set the start location of text selected. 1216 * @param start the start location of text selected. 1217 * @since 3 1218 * @sysCap Accessibility 1219 */ 1220 void SetSelectedBegin(const int32_t start); 1221 1222 /** 1223 * @brief Get the start location of text selected. 1224 * @return the start location of text selected. 1225 * @since 3 1226 * @sysCap Accessibility 1227 */ 1228 int32_t GetSelectedBegin() const; 1229 1230 /** 1231 * @brief Set the end location of text selected. 1232 * @param end the end location of text selected. 1233 * @since 3 1234 * @sysCap Accessibility 1235 */ 1236 void SetSelectedEnd(const int32_t end); 1237 1238 /** 1239 * @brief Get the end location of text selected. 1240 * @return the end location of text selected. 1241 * @since 3 1242 * @sysCap Accessibility 1243 */ 1244 int32_t GetSelectedEnd() const; 1245 1246 /** 1247 * @brief Get the object of GridInfo 1248 * @return the object of GridInfo 1249 * @since 3 1250 * @sysCap Accessibility 1251 */ 1252 const GridInfo &GetGrid() const; 1253 1254 /** 1255 * @brief Set the object of GridInfo 1256 * @param grid the object of GridInfo 1257 * @since 3 1258 * @sysCap Accessibility 1259 */ 1260 void SetGrid(const GridInfo &grid); 1261 1262 /** 1263 * @brief Get the object of GridItemInfo 1264 * @return the object of GridItemInfo 1265 * @since 3 1266 * @sysCap Accessibility 1267 */ 1268 const GridItemInfo &GetGridItem() const; 1269 1270 /** 1271 * @brief Set the object of GridItemInfo 1272 * @param gridItem the object of GridItemInfo 1273 * @since 3 1274 * @sysCap Accessibility 1275 */ 1276 void SetGridItem(const GridItemInfo &gridItem); 1277 1278 /** 1279 * @brief Get the current index of list or location text 1280 * @return the current index of list or location text 1281 * @since 3 1282 * @sysCap Accessibility 1283 */ 1284 int32_t GetCurrentIndex() const; 1285 1286 /** 1287 * @brief Set the current index of list or location text 1288 * @param index the current index of list or location text 1289 * @since 3 1290 * @sysCap Accessibility 1291 */ 1292 void SetCurrentIndex(const int32_t index); 1293 1294 /** 1295 * @brief Get the start index of list or location text 1296 * @return the start index of list or location text 1297 * @since 3 1298 * @sysCap Accessibility 1299 */ 1300 int32_t GetBeginIndex() const; 1301 1302 /** 1303 * @brief Set the start index of list or location text 1304 * @param index the start index of list or location text 1305 * @since 3 1306 * @sysCap Accessibility 1307 */ 1308 void SetBeginIndex(const int32_t index); 1309 1310 /** 1311 * @brief Get the end index of list or location text 1312 * @return the end index of list or location text 1313 * @since 3 1314 * @sysCap Accessibility 1315 */ 1316 int32_t GetEndIndex() const; 1317 1318 /** 1319 * @brief Set the end index of list or location text 1320 * @param index the end index of list or location text 1321 * @since 3 1322 * @sysCap Accessibility 1323 */ 1324 void SetEndIndex(const int32_t index); 1325 1326 /** 1327 * @brief Get the input type of text 1328 * @return The input type of text 1329 * @since 3 1330 * @sysCap Accessibility 1331 */ 1332 int32_t GetInputType() const; 1333 1334 /** 1335 * @brief Set the input type of text 1336 * @param inputType The input type of text 1337 * @since 3 1338 * @sysCap Accessibility 1339 */ 1340 void SetInputType(const int32_t inputType); 1341 1342 /** 1343 * @brief Check whether this node is valid 1344 * @return true:valid, otherwise is not. 1345 * @since 3 1346 * @sysCap Accessibility 1347 */ 1348 bool IsValidElement() const; 1349 1350 /** 1351 * @brief Set whether this node is valid 1352 * @param valid true:valid, otherwise is not. 1353 * @since 3 1354 * @sysCap Accessibility 1355 */ 1356 void SetValidElement(const bool valid); 1357 1358 /** 1359 * @brief Set inspector key 1360 * @param inspector The inspector key. 1361 * @since 3 1362 * @sysCap Accessibility 1363 */ 1364 void SetInspectorKey(const std::string &key); 1365 1366 /** 1367 * @brief Get inspector key 1368 * @return The inspector key 1369 * @since 3 1370 * @sysCap Accessibility 1371 */ 1372 const std::string &GetInspectorKey() const; 1373 1374 /** 1375 * @brief Set the path of page. 1376 * @param path The unique identification of one page. 1377 * @sysCap Accessibility 1378 */ 1379 void SetPagePath(const std::string &path); 1380 1381 /** 1382 * @brief Get the path of page 1383 * @return Page path 1384 * @sysCap Accessibility 1385 */ 1386 const std::string &GetPagePath() const; 1387 1388 /** 1389 * @brief Set page id 1390 * @param pageId page id. 1391 * @sysCap Accessibility 1392 */ 1393 void SetPageId(const int32_t pageId); 1394 1395 /** 1396 * @brief Get page id 1397 * @return page id 1398 * @sysCap Accessibility 1399 */ 1400 int32_t GetPageId() const; 1401 1402 /** 1403 * @brief Set the text movement step 1404 * @param granularity text moving unit 1405 * @sysCap Accessibility 1406 */ 1407 void SetTextMovementStep(const TextMoveUnit granularity); 1408 1409 /** 1410 * @brief Get the text movement step 1411 * @return Text moving unit 1412 * @sysCap Accessibility 1413 */ 1414 TextMoveUnit GetTextMovementStep() const; 1415 1416 /** 1417 * @brief Set item count 1418 * @param itemCounts The count of item 1419 * @sysCap Accessibility 1420 */ 1421 void SetItemCounts(const int32_t itemCounts); 1422 1423 /** 1424 * @brief Get item count 1425 * @return The count of item 1426 * @sysCap Accessibility 1427 */ 1428 int32_t GetItemCounts() const; 1429 1430 // The following methods are only used when the target application uses 1431 // the sendEvent interface to send event data. 1432 /** 1433 * @brief Set trigger action 1434 * @param action The trigger action 1435 * @sysCap Accessibility 1436 */ 1437 void SetTriggerAction(const ActionType action); 1438 1439 /** 1440 * @brief Get trigger action 1441 * @return The trigger action 1442 * @sysCap Accessibility 1443 */ 1444 ActionType GetTriggerAction() const; 1445 1446 /** 1447 * @brief Set content list 1448 * @param contentList The list of content 1449 * @sysCap Accessibility 1450 */ 1451 void SetContentList(const std::vector<std::string> &contentList); 1452 1453 /** 1454 * @brief Get content list 1455 * @param contentList(out) The list of content 1456 * @sysCap Accessibility 1457 */ 1458 void GetContentList(std::vector<std::string> &contentList) const; 1459 1460 /** 1461 * @brief Set latest content 1462 * @param content The latest content 1463 * @sysCap Accessibility 1464 */ 1465 void SetLatestContent(const std::string &content); 1466 1467 /** 1468 * @brief Get latest content 1469 * @return The latest content 1470 * @sysCap Accessibility 1471 */ 1472 const std::string &GetLatestContent() const; 1473 1474 /** 1475 * @brief Set accessibility text 1476 * @param accessibilityText The accessibility text of node 1477 * @sysCap Accessibility 1478 */ 1479 void SetAccessibilityText(const std::string &accessibilityText); 1480 1481 /** 1482 * @brief Get accessibility text 1483 * @return The accessibility text of node 1484 * @sysCap Accessibility 1485 */ 1486 const std::string &GetAccessibilityText() const; 1487 1488 /** 1489 * @brief Set text type 1490 * @param textType The text type of node 1491 * @sysCap Accessibility 1492 */ 1493 void SetTextType(const std::string &textType); 1494 1495 /** 1496 * @brief Get text type 1497 * @return The text type of node 1498 * @sysCap Accessibility 1499 */ 1500 const std::string &GetTextType() const; 1501 1502 /** 1503 * @brief Set offset 1504 * @param offset The offset of scroll 1505 * @sysCap Accessibility 1506 */ 1507 void SetOffset(const float offset); 1508 1509 /** 1510 * @brief Get offset 1511 * @return The offset of scroll 1512 * @sysCap Accessibility 1513 */ 1514 float GetOffset() const; 1515 1516 /** 1517 * @brief Set the child tree Id and the child window Id of the component that belongs to the window. 1518 * @param iChildTreeId The child tree Id 1519 * @param iChildWindowId The child window Id 1520 * @sysCap Accessibility 1521 */ 1522 void SetChildTreeIdAndWinId(const int32_t iChildTreeId, const int32_t iChildWindowId); 1523 1524 /** 1525 * @brief Get the child tree Id of the component that belongs to the window. 1526 * @return The child tree Id 1527 * @sysCap Accessibility 1528 */ 1529 int32_t GetChildTreeId() const; 1530 1531 /** 1532 * @brief Get the child window Id of the component that belongs to the window. 1533 * @return The child window Id 1534 * @sysCap Accessibility 1535 */ 1536 int32_t GetChildWindowId() const; 1537 1538 /** 1539 * @brief Set the child tree Id of the component that belongs to the window. 1540 * @param iChildTreeId The child tree Id 1541 * @sysCap Accessibility 1542 */ 1543 void SetBelongTreeId(const int32_t iBelongTreeId); 1544 1545 /** 1546 * @brief Get the child tree Id of the component that belongs to the window. 1547 * @return The child tree Id 1548 * @sysCap Accessibility 1549 */ 1550 int32_t GetBelongTreeId() const; 1551 1552 /** 1553 * @brief Get the parent WindowId. 1554 * @return The parent windowId Id 1555 * @sysCap Accessibility 1556 */ 1557 int32_t GetParentWindowId() const; 1558 1559 /** 1560 * @brief Set the parent window Id to the element info. 1561 * @param iParentWindowId The parent window Id 1562 * @sysCap Accessibility 1563 */ 1564 void SetParentWindowId(const int32_t iParentWindowId); 1565 1566 void SetExtraElement(const ExtraElementInfo &extraElementInfo); 1567 1568 const ExtraElementInfo &GetExtraElement() const; 1569 /** 1570 * @brief Get the accessibilityGroup to the element info. 1571 * @return the accessibilityGroup 1572 * @sysCap Accessibility 1573 */ 1574 bool GetAccessibilityGroup() const; 1575 1576 /** 1577 * @brief Set the accessibilityGroup to the element info. 1578 * @param accessibilityGroup The accessibilityGroup of node 1579 * @sysCap Accessibility 1580 */ 1581 void SetAccessibilityGroup(const bool accessibilityGroup); 1582 1583 /** 1584 * @brief Set the accessibilityLevel to the element info. 1585 * @param accessibilityLevel The accessibilityLevel of node. 1586 * @sysCap Accessibility 1587 */ 1588 void SetAccessibilityLevel(const std::string accessibilityLevel); 1589 1590 /** 1591 * @brief Get the accessibilityLevel to the element info. 1592 * @return the accessibilityLevel 1593 * @sysCap Accessibility 1594 */ 1595 const std::string &GetAccessibilityLevel() const; 1596 1597 /** 1598 * @brief Set zIndex 1599 * @param textType The value of zIndex 1600 * @sysCap Accessibility 1601 */ 1602 void SetZIndex(const int32_t zIndex); 1603 1604 /** 1605 * @brief Get zindex 1606 * @return The zindex of node 1607 * @sysCap Accessibility 1608 */ 1609 int32_t GetZIndex() const; 1610 1611 /** 1612 * @brief Set opacity 1613 * @param textType The value of opacity 1614 * @sysCap Accessibility 1615 */ 1616 void SetOpacity(const float opacity); 1617 1618 /** 1619 * @brief Get opacity 1620 * @return The opacity of node 1621 * @sysCap Accessibility 1622 */ 1623 float GetOpacity() const; 1624 1625 /** 1626 * @brief Set backgroundColor 1627 * @param textType The value of backgroundColor 1628 * @sysCap Accessibility 1629 */ 1630 void SetBackgroundColor(const std::string &backgroundColor); 1631 1632 /** 1633 * @brief Get backgroundColor 1634 * @return The backgroundColor of node 1635 * @sysCap Accessibility 1636 */ 1637 const std::string &GetBackgroundColor() const; 1638 1639 /** 1640 * @brief Set backgroundImage 1641 * @param textType The value of backgroundImage 1642 * @sysCap Accessibility 1643 */ 1644 void SetBackgroundImage(const std::string &backgroundImage); 1645 1646 /** 1647 * @brief Get backgroundImage 1648 * @return The backgroundImage of node 1649 * @sysCap Accessibility 1650 */ 1651 const std::string &GetBackgroundImage() const; 1652 1653 /** 1654 * @brief Set blur 1655 * @param textType The value of blur 1656 * @sysCap Accessibility 1657 */ 1658 void SetBlur(const std::string &blur); 1659 1660 /** 1661 * @brief Get blur 1662 * @return The blur of node 1663 * @sysCap Accessibility 1664 */ 1665 const std::string &GetBlur() const; 1666 1667 /** 1668 * @brief Set hitTestBehavior 1669 * @param textType The value of hitTestBehavior 1670 * @sysCap Accessibility 1671 */ 1672 void SetHitTestBehavior(const std::string &hitTestBehavior); 1673 1674 /** 1675 * @brief Get hitTestBehavior 1676 * @return The hitTestBehavior of node 1677 * @sysCap Accessibility 1678 */ 1679 const std::string &GetHitTestBehavior() const; 1680 1681 /** 1682 * @brief Set the navDestinationId to the element info. 1683 * @param navDestinationId The navDestinationId of node. 1684 * @sysCap Accessibility 1685 */ 1686 void SetNavDestinationId(const int64_t navDestinationId); 1687 1688 /** 1689 * @brief Get the navDestinationId to the element info. 1690 * @return the navDestinationId 1691 * @sysCap Accessibility 1692 */ 1693 int64_t GetNavDestinationId() const; 1694 1695 /** 1696 * @brief Set the span to the spanlist. 1697 * @param span The span. 1698 * @sysCap Accessibility 1699 */ 1700 void AddSpan(const SpanInfo &span); 1701 1702 /** 1703 * @brief Set the spanlist to the element info. 1704 * @param spanList The list of span. 1705 * @sysCap Accessibility 1706 */ 1707 void SetSpanList(const std::vector<SpanInfo> &spanList); 1708 1709 /** 1710 * @brief Gets an span list. 1711 * @return span list. 1712 * @sysCap Accessibility 1713 */ 1714 const std::vector<SpanInfo> &GetSpanList() const; 1715 1716 /** 1717 * @brief Get the isActive to the element info. 1718 * @return isActive status. 1719 * @sysCap Accessibility 1720 */ 1721 bool GetIsActive() const; 1722 1723 /** 1724 * @brief Set the isActive to the element info. 1725 * @param isActive The isActive of node. 1726 * @sysCap Accessibility 1727 */ 1728 void SetIsActive(const bool isActive); 1729 1730 /** 1731 * @brief Get the accessibilityVisible to the element info. 1732 * @return accessibilityVisible status. 1733 * @sysCap Accessibility 1734 */ 1735 bool GetAccessibilityVisible() const; 1736 1737 /** 1738 * @brief Set the accessibilityVisible to the element info. 1739 * @param isActive The accessibilityVisible of node. 1740 * @sysCap Accessibility 1741 */ 1742 void SetAccessibilityVisible(const bool accessibilityVisible); 1743 1744 /** 1745 * @brief Get the clip to the element info. 1746 * @return clip status. 1747 * @sysCap Accessibility 1748 */ 1749 bool GetClip() const; 1750 1751 /** 1752 * @brief Set the clip to the element info. 1753 * @param clip The clip of node. 1754 * @sysCap Accessibility 1755 */ 1756 void SetClip(const bool clip); 1757 1758 /** 1759 * @brief Get the windowId to the element info. 1760 * @return mainWindowId. 1761 * @sysCap Accessibility 1762 */ 1763 int32_t GetMainWindowId() const; 1764 1765 /** 1766 * @brief Set the windowId to the element info. 1767 * @param windowId The mainWindowId of node. 1768 * @sysCap Accessibility 1769 */ 1770 void SetMainWindowId(const int32_t windowId); 1771 1772 /** 1773 * @brief Get the customComponentType to the element info. 1774 * @return customComponentType status. 1775 * @sysCap Accessibility 1776 */ 1777 const std::string &GetCustomComponentType() const; 1778 1779 /** 1780 * @brief Set the customComponentType to the element info. 1781 * @param customComponentType The customComponentType of node. 1782 * @sysCap Accessibility 1783 */ 1784 void SetCustomComponentType(const std::string &customComponentType); 1785 1786 /** 1787 * @brief Get the accessibilityNextFocusId to the element info. 1788 * @return accessibilityNextFocusId. 1789 * @sysCap Accessibility 1790 */ 1791 int64_t GetAccessibilityNextFocusId() const; 1792 1793 /** 1794 * @brief Set the accessibilityNextFocusId to the element info. 1795 * @param accessibilityNextFocusId The accessibilityNextFocusId of node. 1796 * @sysCap Accessibility 1797 */ 1798 void SetAccessibilityNextFocusId(const int64_t accessibilityNextFocusId); 1799 1800 /** 1801 * @brief Get the accessibilityPreviousFocusId to the element info. 1802 * @return accessibilityPreviousFocusId. 1803 * @sysCap Accessibility 1804 */ 1805 int64_t GetAccessibilityPreviousFocusId() const; 1806 1807 /** 1808 * @brief Set the accessibilityPreviousFocusId to the element info. 1809 * @param accessibilityPreviousFocusId The accessibilityPreviousFocusId of node. 1810 * @sysCap Accessibility 1811 */ 1812 void SetAccessibilityPreviousFocusId(const int64_t accessibilityPreviousFocusId); 1813 1814 /** 1815 * @brief Get the accessibilityNextFocusInspectorKey to the element info. 1816 * @return accessibilityNextFocusInspectorKey. 1817 * @sysCap Accessibility 1818 */ 1819 const std::string &GetAccessibilityNextFocusInspectorKey() const; 1820 1821 /** 1822 * @brief Set the accessibilityNextFocusInspectorKey to the element info. 1823 * @param accessibilityNextFocusInspectorKey The accessibilityNextFocusInspectorKey of node. 1824 * @sysCap Accessibility 1825 */ 1826 void SetAccessibilityNextFocusInspectorKey(const std::string &accessibilityNextFocusInspectorKey); 1827 1828 /** 1829 * @brief Get the windowId to the element info. 1830 * @return innerWindowId. 1831 * @sysCap Accessibility 1832 */ 1833 int32_t GetInnerWindowId() const; 1834 1835 /** 1836 * @brief Set the windowId to the element info. 1837 * @param windowId The innerWindowId of node. 1838 * @sysCap Accessibility 1839 */ 1840 void SetInnerWindowId(const int32_t windowId); 1841 1842 /** 1843 * @brief Get the accessibilityScrollable to the element info. 1844 * @return accessibilityScrollable status. 1845 * @sysCap Accessibility 1846 */ 1847 bool GetAccessibilityScrollable() const; 1848 1849 /** 1850 * @brief Set the accessibilityScrollable to the element info. 1851 * @param accessibilityScrollable The accessibilityScrollable of node. 1852 * @sysCap Accessibility 1853 */ 1854 void SetAccessibilityScrollable(const bool accessibilityScrollable); 1855 1856 protected: 1857 int32_t pageId_ = -1; 1858 int32_t windowId_ = -1; 1859 int64_t elementId_ = UNDEFINED_ACCESSIBILITY_ID; 1860 int64_t parentId_ = UNDEFINED_ACCESSIBILITY_ID; 1861 1862 int32_t belongTreeId_ = UNDEFINED_TREE_ID; 1863 int32_t childTreeId_ = UNDEFINED_TREE_ID; 1864 int32_t childWindowId_ = UNDEFINED_WINID_ID; 1865 int32_t parentWindowId_ = UNDEFINED_WINID_ID; 1866 1867 std::string bundleName_ = ""; 1868 std::string componentType_ = ""; 1869 std::string text_ = ""; 1870 std::string hintText_ = ""; 1871 std::string accessibilityText_ = ""; 1872 std::string contentDescription_ = ""; 1873 std::string resourceName_ = ""; 1874 std::string inspectorKey_ = ""; 1875 std::string pagePath_ = ""; 1876 std::vector<int64_t> childNodeIds_; 1877 int32_t childCount_ = 0; 1878 std::vector<AccessibleAction> operations_; 1879 int32_t textLengthLimit_ = -1; 1880 Rect bounds_ {}; 1881 bool checkable_ = false; 1882 bool checked_ = false; 1883 bool focusable_ = false; 1884 bool focused_ = false; 1885 bool visible_ = false; 1886 bool accessibilityFocused_ = false; 1887 bool selected_ = false; 1888 bool clickable_ = false; 1889 bool longClickable_ = false; 1890 bool enable_ = false; 1891 bool isPassword_ = false; 1892 bool scrollable_ = false; 1893 bool editable_ = false; 1894 bool popupSupported_ = false; 1895 bool multiLine_ = false; 1896 bool deletable_ = false; 1897 bool hint_ = false; 1898 bool isEssential_ = false; 1899 int32_t currentIndex_ = 0; 1900 int32_t beginIndex_ = 0; 1901 int32_t endIndex_ = 0; 1902 RangeInfo rangeInfo_ {}; 1903 GridInfo grid_ {}; 1904 GridItemInfo gridItem_ {}; 1905 int32_t liveRegion_ = 0; 1906 bool contentInvalid_ = true; 1907 std::string error_ = ""; 1908 int64_t labeled_ = 0; 1909 int32_t beginSelected_ = 0; 1910 int32_t endSelected_ = 0; 1911 int32_t inputType_ = 0; // text input type added 1912 bool validElement_ = true; 1913 TextMoveUnit textMoveStep_ = STEP_CHARACTER; 1914 int32_t itemCounts_ = 0; 1915 ActionType triggerAction_ = ACCESSIBILITY_ACTION_INVALID; 1916 std::vector<std::string> contentList_ {}; 1917 std::string latestContent_ = ""; 1918 std::string textType_ = ""; 1919 float offset_ = 0.0f; 1920 ExtraElementInfo extraElementInfo_ {}; 1921 bool accessibilityGroup_ = true; 1922 std::string accessibilityLevel_ = "auto"; 1923 int32_t zIndex_ = 0; 1924 float opacity_ = 0.0f; 1925 std::string backgroundColor_ = ""; 1926 std::string backgroundImage_ = ""; 1927 std::string blur_ = ""; 1928 std::string hitTestBehavior_ = ""; 1929 int64_t navDestinationId_ = -1; 1930 std::vector<SpanInfo> spanList_ {}; 1931 bool isActive_ = true; 1932 bool accessibilityVisible_ = true; 1933 bool clip_ = false; 1934 static const int backgroundImageMaxLength = 20; 1935 int32_t mainWindowId_ = -1; // same widowId in uiview 1936 std::string customComponentType_ = ""; 1937 int32_t innerWindowId_ = -1; 1938 int64_t accessibilityNextFocusId_ = -1; 1939 int64_t accessibilityPreviousFocusId_ = -1; 1940 std::string accessibilityNextFocusInspectorKey_ = ""; 1941 bool accessibilityScrollable_ = true; 1942 }; 1943 } // namespace Accessibility 1944 } // namespace OHOS 1945 #endif // ACCESSIBILITY_ELEMENT_INFO_H