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