1 /* 2 * Copyright (c) 2023 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 NWEB_ACCESSIBILITY_NODE_INFO_H 17 #define NWEB_ACCESSIBILITY_NODE_INFO_H 18 19 #include <string> 20 21 #include "nweb_export.h" 22 23 namespace OHOS::NWeb { 24 25 class OHOS_NWEB_EXPORT NWebAccessibilityNodeInfo { 26 public: 27 virtual ~NWebAccessibilityNodeInfo() = default; 28 29 virtual std::string GetHint() = 0; 30 31 virtual std::string GetError() = 0; 32 33 virtual int32_t GetRectX() = 0; 34 35 virtual int32_t GetRectY() = 0; 36 37 virtual void SetPageId(int32_t pageId) = 0; 38 39 virtual int32_t GetPageId() = 0; 40 41 virtual std::vector<uint32_t> GetActions() = 0; 42 43 virtual std::string GetContent() = 0; 44 45 virtual std::vector<int64_t> GetChildIds() = 0; 46 47 virtual void SetParentId(int64_t parentId) = 0; 48 49 virtual int64_t GetParentId() = 0; 50 51 virtual bool GetIsHeading() = 0; 52 53 virtual bool GetIsChecked() = 0; 54 55 virtual bool GetIsEnabled() = 0; 56 57 virtual bool GetIsFocused() = 0; 58 59 virtual int32_t GetRectWidth() = 0; 60 61 virtual int32_t GetRectHeight() = 0; 62 63 virtual bool GetIsVisible() = 0; 64 65 virtual bool GetIsHinting() = 0; 66 67 virtual bool GetIsEditable() = 0; 68 69 virtual bool GetIsSelected() = 0; 70 71 virtual size_t GetItemCounts() = 0; 72 73 virtual int32_t GetLiveRegion() = 0; 74 75 virtual bool GetIsPassword() = 0; 76 77 virtual bool GetIsCheckable() = 0; 78 79 virtual bool GetIsClickable() = 0; 80 81 virtual bool GetIsFocusable() = 0; 82 83 virtual bool GetIsScrollable() = 0; 84 85 virtual bool GetIsDeletable() = 0; 86 87 virtual int64_t GetAccessibilityId() = 0; 88 89 virtual bool GetIsPopupSupported() = 0; 90 91 virtual bool GetIsContentInvalid() = 0; 92 93 virtual int32_t GetSelectionEnd() = 0; 94 95 virtual int32_t GetSelectionStart() = 0; 96 97 virtual float GetRangeInfoMin() = 0; 98 99 virtual float GetRangeInfoMax() = 0; 100 101 virtual float GetRangeInfoCurrent() = 0; 102 103 virtual int32_t GetInputType() = 0; 104 105 virtual std::string GetComponentType() = 0; 106 107 virtual std::string GetDescriptionInfo() = 0; 108 109 virtual int32_t GetGridRows() = 0; 110 111 virtual int32_t GetGridItemRow() = 0; 112 113 virtual int32_t GetGridColumns() = 0; 114 115 virtual int32_t GetGridItemColumn() = 0; 116 117 virtual int32_t GetGridItemRowSpan() = 0; 118 119 virtual int32_t GetGridSelectedMode() = 0; 120 121 virtual int32_t GetGridItemColumnSpan() = 0; 122 123 virtual bool GetIsAccessibilityFocus() = 0; 124 125 virtual bool GetIsPluralLineSupported() = 0; 126 GetIsAccessibilityGroup()127 virtual bool GetIsAccessibilityGroup() 128 { 129 return false; 130 } 131 GetAccessibilityLevel()132 virtual std::string GetAccessibilityLevel() 133 { 134 return std::string(); 135 } 136 GetAccessibilityDescription()137 virtual std::string GetAccessibilityDescription() 138 { 139 return std::string(); 140 } 141 GetAccessibilityText()142 virtual std::string GetAccessibilityText() 143 { 144 return std::string(); 145 } 146 }; 147 148 } // namespace OHOS::NWeb 149 150 #endif // NWEB_ACCESSIBILITY_NODE_INFO_H