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