1use serde::{Deserialize, Serialize};
2#[doc = "Disables the accessibility domain.\n[disable](https://chromedevtools.github.io/devtools-protocol/tot/Accessibility/#method-disable)"]
3#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4pub struct DisableParams {}
5#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
6pub enum DisableMethod {
7 #[serde(rename = "Accessibility.disable")]
8 Disable,
9}
10#[doc = "Disables the accessibility domain.\n[disable](https://chromedevtools.github.io/devtools-protocol/tot/Accessibility/#method-disable)"]
11#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
12pub struct Disable {
13 pub method: DisableMethod,
14 pub params: DisableParams,
15}
16impl Disable {
17 pub const IDENTIFIER: &'static str = "Accessibility.disable";
18 pub fn identifier(&self) -> &'static str {
19 Self::IDENTIFIER
20 }
21}
22impl crate::CommandResult for Disable {
23 type Result = super::results::DisableResult;
24}
25#[doc = "Enables the accessibility domain which causes `AXNodeId`s to remain consistent between method calls.\nThis turns on accessibility for the page, which can impact performance until accessibility is disabled.\n[enable](https://chromedevtools.github.io/devtools-protocol/tot/Accessibility/#method-enable)"]
26#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
27pub struct EnableParams {}
28#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
29pub enum EnableMethod {
30 #[serde(rename = "Accessibility.enable")]
31 Enable,
32}
33#[doc = "Enables the accessibility domain which causes `AXNodeId`s to remain consistent between method calls.\nThis turns on accessibility for the page, which can impact performance until accessibility is disabled.\n[enable](https://chromedevtools.github.io/devtools-protocol/tot/Accessibility/#method-enable)"]
34#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
35pub struct Enable {
36 pub method: EnableMethod,
37 pub params: EnableParams,
38}
39impl Enable {
40 pub const IDENTIFIER: &'static str = "Accessibility.enable";
41 pub fn identifier(&self) -> &'static str {
42 Self::IDENTIFIER
43 }
44}
45impl crate::CommandResult for Enable {
46 type Result = super::results::EnableResult;
47}
48#[doc = "Fetches the accessibility node and partial accessibility tree for this DOM node, if it exists.\n[getPartialAXTree](https://chromedevtools.github.io/devtools-protocol/tot/Accessibility/#method-getPartialAXTree)"]
49#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
50pub struct GetPartialAxTreeParams {
51 #[doc = "Identifier of the node to get the partial accessibility tree for."]
52 #[serde(rename = "nodeId")]
53 #[serde(skip_serializing_if = "Option::is_none")]
54 #[serde(default)]
55 pub node_id: Option<crate::browser_protocol::dom::types::NodeId>,
56 #[doc = "Identifier of the backend node to get the partial accessibility tree for."]
57 #[serde(rename = "backendNodeId")]
58 #[serde(skip_serializing_if = "Option::is_none")]
59 #[serde(default)]
60 pub backend_node_id: Option<crate::browser_protocol::dom::types::BackendNodeId>,
61 #[doc = "JavaScript object id of the node wrapper to get the partial accessibility tree for."]
62 #[serde(rename = "objectId")]
63 #[serde(skip_serializing_if = "Option::is_none")]
64 #[serde(default)]
65 pub object_id: Option<crate::js_protocol::runtime::types::RemoteObjectId>,
66 #[doc = "Whether to fetch this node's ancestors, siblings and children. Defaults to true."]
67 #[serde(rename = "fetchRelatives")]
68 #[serde(skip_serializing_if = "Option::is_none")]
69 #[serde(default)]
70 pub fetch_relatives: Option<bool>,
71}
72#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
73pub enum GetPartialAxTreeMethod {
74 #[serde(rename = "Accessibility.getPartialAXTree")]
75 GetPartialAxTree,
76}
77#[doc = "Fetches the accessibility node and partial accessibility tree for this DOM node, if it exists.\n[getPartialAXTree](https://chromedevtools.github.io/devtools-protocol/tot/Accessibility/#method-getPartialAXTree)"]
78#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
79pub struct GetPartialAxTree {
80 pub method: GetPartialAxTreeMethod,
81 pub params: GetPartialAxTreeParams,
82}
83impl GetPartialAxTree {
84 pub const IDENTIFIER: &'static str = "Accessibility.getPartialAXTree";
85 pub fn identifier(&self) -> &'static str {
86 Self::IDENTIFIER
87 }
88}
89impl crate::CommandResult for GetPartialAxTree {
90 type Result = super::results::GetPartialAxTreeResult;
91}
92#[doc = "Fetches the entire accessibility tree for the root Document\n[getFullAXTree](https://chromedevtools.github.io/devtools-protocol/tot/Accessibility/#method-getFullAXTree)"]
93#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
94pub struct GetFullAxTreeParams {
95 #[doc = "The maximum depth at which descendants of the root node should be retrieved.\nIf omitted, the full tree is returned."]
96 #[serde(rename = "depth")]
97 #[serde(skip_serializing_if = "Option::is_none")]
98 #[serde(default)]
99 pub depth: Option<i64>,
100 #[doc = "The frame for whose document the AX tree should be retrieved.\nIf omitted, the root frame is used."]
101 #[serde(rename = "frameId")]
102 #[serde(skip_serializing_if = "Option::is_none")]
103 #[serde(default)]
104 pub frame_id: Option<crate::browser_protocol::page::types::FrameId>,
105}
106#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
107pub enum GetFullAxTreeMethod {
108 #[serde(rename = "Accessibility.getFullAXTree")]
109 GetFullAxTree,
110}
111#[doc = "Fetches the entire accessibility tree for the root Document\n[getFullAXTree](https://chromedevtools.github.io/devtools-protocol/tot/Accessibility/#method-getFullAXTree)"]
112#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
113pub struct GetFullAxTree {
114 pub method: GetFullAxTreeMethod,
115 pub params: GetFullAxTreeParams,
116}
117impl GetFullAxTree {
118 pub const IDENTIFIER: &'static str = "Accessibility.getFullAXTree";
119 pub fn identifier(&self) -> &'static str {
120 Self::IDENTIFIER
121 }
122}
123impl crate::CommandResult for GetFullAxTree {
124 type Result = super::results::GetFullAxTreeResult;
125}
126#[doc = "Fetches the root node.\nRequires `enable()` to have been called previously.\n[getRootAXNode](https://chromedevtools.github.io/devtools-protocol/tot/Accessibility/#method-getRootAXNode)"]
127#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
128pub struct GetRootAxNodeParams {
129 #[doc = "The frame in whose document the node resides.\nIf omitted, the root frame is used."]
130 #[serde(rename = "frameId")]
131 #[serde(skip_serializing_if = "Option::is_none")]
132 #[serde(default)]
133 pub frame_id: Option<crate::browser_protocol::page::types::FrameId>,
134}
135#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
136pub enum GetRootAxNodeMethod {
137 #[serde(rename = "Accessibility.getRootAXNode")]
138 GetRootAxNode,
139}
140#[doc = "Fetches the root node.\nRequires `enable()` to have been called previously.\n[getRootAXNode](https://chromedevtools.github.io/devtools-protocol/tot/Accessibility/#method-getRootAXNode)"]
141#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
142pub struct GetRootAxNode {
143 pub method: GetRootAxNodeMethod,
144 pub params: GetRootAxNodeParams,
145}
146impl GetRootAxNode {
147 pub const IDENTIFIER: &'static str = "Accessibility.getRootAXNode";
148 pub fn identifier(&self) -> &'static str {
149 Self::IDENTIFIER
150 }
151}
152impl crate::CommandResult for GetRootAxNode {
153 type Result = super::results::GetRootAxNodeResult;
154}
155#[doc = "Fetches a node and all ancestors up to and including the root.\nRequires `enable()` to have been called previously.\n[getAXNodeAndAncestors](https://chromedevtools.github.io/devtools-protocol/tot/Accessibility/#method-getAXNodeAndAncestors)"]
156#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
157pub struct GetAxNodeAndAncestorsParams {
158 #[doc = "Identifier of the node to get."]
159 #[serde(rename = "nodeId")]
160 #[serde(skip_serializing_if = "Option::is_none")]
161 #[serde(default)]
162 pub node_id: Option<crate::browser_protocol::dom::types::NodeId>,
163 #[doc = "Identifier of the backend node to get."]
164 #[serde(rename = "backendNodeId")]
165 #[serde(skip_serializing_if = "Option::is_none")]
166 #[serde(default)]
167 pub backend_node_id: Option<crate::browser_protocol::dom::types::BackendNodeId>,
168 #[doc = "JavaScript object id of the node wrapper to get."]
169 #[serde(rename = "objectId")]
170 #[serde(skip_serializing_if = "Option::is_none")]
171 #[serde(default)]
172 pub object_id: Option<crate::js_protocol::runtime::types::RemoteObjectId>,
173}
174#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
175pub enum GetAxNodeAndAncestorsMethod {
176 #[serde(rename = "Accessibility.getAXNodeAndAncestors")]
177 GetAxNodeAndAncestors,
178}
179#[doc = "Fetches a node and all ancestors up to and including the root.\nRequires `enable()` to have been called previously.\n[getAXNodeAndAncestors](https://chromedevtools.github.io/devtools-protocol/tot/Accessibility/#method-getAXNodeAndAncestors)"]
180#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
181pub struct GetAxNodeAndAncestors {
182 pub method: GetAxNodeAndAncestorsMethod,
183 pub params: GetAxNodeAndAncestorsParams,
184}
185impl GetAxNodeAndAncestors {
186 pub const IDENTIFIER: &'static str = "Accessibility.getAXNodeAndAncestors";
187 pub fn identifier(&self) -> &'static str {
188 Self::IDENTIFIER
189 }
190}
191impl crate::CommandResult for GetAxNodeAndAncestors {
192 type Result = super::results::GetAxNodeAndAncestorsResult;
193}
194#[doc = "Fetches a particular accessibility node by AXNodeId.\nRequires `enable()` to have been called previously.\n[getChildAXNodes](https://chromedevtools.github.io/devtools-protocol/tot/Accessibility/#method-getChildAXNodes)"]
195#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
196pub struct GetChildAxNodesParams {
197 #[serde(rename = "id")]
198 pub id: super::types::AxNodeId,
199 #[doc = "The frame in whose document the node resides.\nIf omitted, the root frame is used."]
200 #[serde(rename = "frameId")]
201 #[serde(skip_serializing_if = "Option::is_none")]
202 #[serde(default)]
203 pub frame_id: Option<crate::browser_protocol::page::types::FrameId>,
204}
205impl GetChildAxNodesParams {
206 pub fn new(id: impl Into<super::types::AxNodeId>) -> Self {
207 Self {
208 id: id.into(),
209 frame_id: None,
210 }
211 }
212}
213#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
214pub enum GetChildAxNodesMethod {
215 #[serde(rename = "Accessibility.getChildAXNodes")]
216 GetChildAxNodes,
217}
218#[doc = "Fetches a particular accessibility node by AXNodeId.\nRequires `enable()` to have been called previously.\n[getChildAXNodes](https://chromedevtools.github.io/devtools-protocol/tot/Accessibility/#method-getChildAXNodes)"]
219#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
220pub struct GetChildAxNodes {
221 pub method: GetChildAxNodesMethod,
222 pub params: GetChildAxNodesParams,
223}
224impl GetChildAxNodes {
225 pub const IDENTIFIER: &'static str = "Accessibility.getChildAXNodes";
226 pub fn identifier(&self) -> &'static str {
227 Self::IDENTIFIER
228 }
229}
230impl crate::CommandResult for GetChildAxNodes {
231 type Result = super::results::GetChildAxNodesResult;
232}
233#[doc = "Query a DOM node's accessibility subtree for accessible name and role.\nThis command computes the name and role for all nodes in the subtree, including those that are\nignored for accessibility, and returns those that match the specified name and role. If no DOM\nnode is specified, or the DOM node does not exist, the command returns an error. If neither\n`accessibleName` or `role` is specified, it returns all the accessibility nodes in the subtree.\n[queryAXTree](https://chromedevtools.github.io/devtools-protocol/tot/Accessibility/#method-queryAXTree)"]
234#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
235pub struct QueryAxTreeParams {
236 #[doc = "Identifier of the node for the root to query."]
237 #[serde(rename = "nodeId")]
238 #[serde(skip_serializing_if = "Option::is_none")]
239 #[serde(default)]
240 pub node_id: Option<crate::browser_protocol::dom::types::NodeId>,
241 #[doc = "Identifier of the backend node for the root to query."]
242 #[serde(rename = "backendNodeId")]
243 #[serde(skip_serializing_if = "Option::is_none")]
244 #[serde(default)]
245 pub backend_node_id: Option<crate::browser_protocol::dom::types::BackendNodeId>,
246 #[doc = "JavaScript object id of the node wrapper for the root to query."]
247 #[serde(rename = "objectId")]
248 #[serde(skip_serializing_if = "Option::is_none")]
249 #[serde(default)]
250 pub object_id: Option<crate::js_protocol::runtime::types::RemoteObjectId>,
251 #[doc = "Find nodes with this computed name."]
252 #[serde(rename = "accessibleName")]
253 #[serde(skip_serializing_if = "Option::is_none")]
254 #[serde(default)]
255 pub accessible_name: Option<String>,
256 #[doc = "Find nodes with this computed role."]
257 #[serde(rename = "role")]
258 #[serde(skip_serializing_if = "Option::is_none")]
259 #[serde(default)]
260 pub role: Option<String>,
261}
262#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
263pub enum QueryAxTreeMethod {
264 #[serde(rename = "Accessibility.queryAXTree")]
265 QueryAxTree,
266}
267#[doc = "Query a DOM node's accessibility subtree for accessible name and role.\nThis command computes the name and role for all nodes in the subtree, including those that are\nignored for accessibility, and returns those that match the specified name and role. If no DOM\nnode is specified, or the DOM node does not exist, the command returns an error. If neither\n`accessibleName` or `role` is specified, it returns all the accessibility nodes in the subtree.\n[queryAXTree](https://chromedevtools.github.io/devtools-protocol/tot/Accessibility/#method-queryAXTree)"]
268#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
269pub struct QueryAxTree {
270 pub method: QueryAxTreeMethod,
271 pub params: QueryAxTreeParams,
272}
273impl QueryAxTree {
274 pub const IDENTIFIER: &'static str = "Accessibility.queryAXTree";
275 pub fn identifier(&self) -> &'static str {
276 Self::IDENTIFIER
277 }
278}
279impl crate::CommandResult for QueryAxTree {
280 type Result = super::results::QueryAxTreeResult;
281}
282group_enum ! (AccessibilityCommands { Disable (Disable) , Enable (Enable) , GetPartialAxTree (GetPartialAxTree) , GetFullAxTree (GetFullAxTree) , GetRootAxNode (GetRootAxNode) , GetAxNodeAndAncestors (GetAxNodeAndAncestors) , GetChildAxNodes (GetChildAxNodes) , QueryAxTree (QueryAxTree) } + identifiable);