001package Torello.Browser.BrowserAPI; 002 003// *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** 004// Java-HTML Imports 005// *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** 006 007import Torello.Browser.*; 008import Torello.Browser.helper.*; 009import Torello.Browser.JavaScriptAPI.*; 010import Torello.JSON.*; 011 012import Torello.Java.ReadOnly.ReadOnlyList; 013import Torello.Java.ReadOnly.ReadOnlyArrayList; 014 015import Torello.JavaDoc.Annotations.StaticFunctional; 016import Torello.JavaDoc.Annotations.JDHeaderBackgroundImg; 017 018import Torello.Browser.BrowserAPI.NestedHelpers.Commands.Accessibility$$Commands; 019 020 021// *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** 022// JDK Imports 023// *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** 024 025import javax.json.JsonObject; 026import javax.json.JsonValue; 027 028/** 029 * <SPAN CLASS=COPIEDJDK><B><CODE>[No Description Provided by Google]</CODE></B></SPAN> 030 * <EMBED CLASS='external-html' DATA-FILE-ID=CDP.CODE_GEN_NOTE> 031 */ 032@StaticFunctional@JDHeaderBackgroundImg(EmbedTagFileID="CDP.WOOD_PLANK_NOTE") 033public class Accessibility 034{ 035 // No Pubic Constructors 036 private Accessibility() { } 037 038 039 // ******************************************************************************************** 040 // ******************************************************************************************** 041 // Eliminated Types 042 // ******************************************************************************************** 043 // ******************************************************************************************** 044 045 046 /** 047 * Unique accessibility node identifier. 048 049 * <EMBED CLASS='external-html' DATA-CTAS='String' DATA-FILE-ID=CDP.EliminatedType 050 * DATA-NAME=AXNodeId> 051 */ 052 public static final String AXNodeId = 053 "AXNodeId has been eliminated.\n" + 054 "It was replaced with the standard Java-Type: String"; 055 056 057 // ******************************************************************************************** 058 // ******************************************************************************************** 059 // Enumerated String Constants Lists 060 // ******************************************************************************************** 061 // ******************************************************************************************** 062 063 064 /** 065 * Values of AXProperty name: 066 * - from 'busy' to 'roledescription': states which apply to every AX node 067 * - from 'live' to 'root': attributes which apply to nodes in live regions 068 * - from 'autocomplete' to 'valuetext': attributes which apply to widgets 069 * - from 'checked' to 'selected': states which apply to widgets 070 * - from 'activedescendant' to 'owns' - relationships between elements other than parent/child/sibling. 071 * <BR /><BR /><B CLASS=StrEnumType>String-Enumeration Type</B> 072 */ 073 public static final ReadOnlyList<String> AXPropertyName = new ReadOnlyArrayList<>( 074 String.class, 075 "actions", "activedescendant", "atomic", "autocomplete", "busy", "checked", "controls", 076 "describedby", "details", "disabled", "editable", "errormessage", "expanded", "flowto", 077 "focusable", "focused", "hasPopup", "hidden", "hiddenRoot", "invalid", "keyshortcuts", 078 "labelledby", "level", "live", "modal", "multiline", "multiselectable", "orientation", 079 "owns", "pressed", "readonly", "relevant", "required", "roledescription", "root", 080 "selected", "settable", "url", "valuemax", "valuemin", "valuetext" 081 ); 082 083 /** 084 * Enum of possible native property sources (as a subtype of a particular AXValueSourceType). 085 * <BR /><BR /><B CLASS=StrEnumType>String-Enumeration Type</B> 086 */ 087 public static final ReadOnlyList<String> AXValueNativeSourceType = new ReadOnlyArrayList<>( 088 String.class, 089 "description", "figcaption", "label", "labelfor", "labelwrapped", "legend", "other", 090 "rubyannotation", "tablecaption", "title" 091 ); 092 093 /** 094 * Enum of possible property sources. 095 * <BR /><BR /><B CLASS=StrEnumType>String-Enumeration Type</B> 096 */ 097 public static final ReadOnlyList<String> AXValueSourceType = new ReadOnlyArrayList<>( 098 String.class, 099 "attribute", "contents", "implicit", "placeholder", "relatedElement", "style" 100 ); 101 102 /** 103 * Enum of possible property types. 104 * <BR /><BR /><B CLASS=StrEnumType>String-Enumeration Type</B> 105 */ 106 public static final ReadOnlyList<String> AXValueType = new ReadOnlyArrayList<>( 107 String.class, 108 "boolean", "booleanOrUndefined", "computedString", "domRelation", "idref", "idrefList", 109 "integer", "internalRole", "node", "nodeList", "number", "role", "string", "token", 110 "tokenList", "tristate", "valueUndefined" 111 ); 112 113 114 115 // ******************************************************************************************** 116 // ******************************************************************************************** 117 // Basic Types 118 // ******************************************************************************************** 119 // ******************************************************************************************** 120 121 122 /** 123 * A node in the accessibility tree. 124 * 125 * <EMBED CLASS=globalDefs DATA-DOMAIN=Accessibility DATA-API=BrowserAPI> 126 */ 127 @JDHeaderBackgroundImg(EmbedTagFileID="CDP.NESTED_TYPE_JDHBI") 128 public static class AXNode 129 extends BaseType<AXNode> 130 implements java.io.Serializable 131 { 132 /** <EMBED CLASS='external-html' DATA-FILE-ID=SVUID> */ 133 protected static final long serialVersionUID = 1; 134 135 private static final NestedHelper<Accessibility.AXNode> singleton = 136 Torello.Browser.BrowserAPI.NestedHelpers.Types. 137 Accessibility$$AXNode$$.singleton; 138 139 /** Unique identifier for this node. */ 140 public final String nodeId; 141 142 /** Whether this node is ignored for accessibility */ 143 public final boolean ignored; 144 145 /** 146 * Collection of reasons why this node is hidden. 147 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 148 */ 149 public final Accessibility.AXProperty[] ignoredReasons; 150 151 /** 152 * This <CODE>Node</CODE>'s role, whether explicit or implicit. 153 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 154 */ 155 public final Accessibility.AXValue role; 156 157 /** 158 * This <CODE>Node</CODE>'s Chrome raw role. 159 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 160 */ 161 public final Accessibility.AXValue chromeRole; 162 163 /** 164 * The accessible name for this <CODE>Node</CODE>. 165 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 166 */ 167 public final Accessibility.AXValue name; 168 169 /** 170 * The accessible description for this <CODE>Node</CODE>. 171 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 172 */ 173 public final Accessibility.AXValue description; 174 175 /** 176 * The value for this <CODE>Node</CODE>. 177 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 178 */ 179 public final Accessibility.AXValue value; 180 181 /** 182 * All other properties 183 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 184 */ 185 public final Accessibility.AXProperty[] properties; 186 187 /** 188 * ID for this node's parent. 189 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 190 */ 191 public final String parentId; 192 193 /** 194 * IDs for each of this node's child nodes. 195 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 196 */ 197 public final String[] childIds; 198 199 /** 200 * The backend ID for the associated DOM node, if any. 201 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 202 */ 203 public final Integer backendDOMNodeId; 204 205 /** 206 * The frame ID for the frame associated with this nodes document. 207 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 208 */ 209 public final String frameId; 210 211 /** Constructor. Please review this class' fields for documentation. */ 212 public AXNode( 213 ReadOnlyList<Boolean> isPresent, String nodeId, boolean ignored, 214 AXProperty[] ignoredReasons, AXValue role, AXValue chromeRole, AXValue name, 215 AXValue description, AXValue value, AXProperty[] properties, String parentId, 216 String[] childIds, Integer backendDOMNodeId, String frameId 217 ) 218 { 219 super(singleton, Domains.Accessibility, "AXNode", 13); 220 221 this.nodeId = nodeId; 222 this.ignored = ignored; 223 this.ignoredReasons = ignoredReasons; 224 this.role = role; 225 this.chromeRole = chromeRole; 226 this.name = name; 227 this.description = description; 228 this.value = value; 229 this.properties = properties; 230 this.parentId = parentId; 231 this.childIds = childIds; 232 this.backendDOMNodeId = backendDOMNodeId; 233 this.frameId = frameId; 234 235 this.isPresent = (isPresent == null) 236 ? singleton.generateIsPresentList(this) 237 : THROWS.check(isPresent, 13, "Accessibility.AXNode"); 238 } 239 240 /** Creates an instance of this class from a {@link JsonObject}.*/ 241 public static AXNode fromJSON(JsonObject jo) 242 { return singleton.fromJSON(jo); } 243 244 /** Returns this class's {@link NestedDescriptor} singleton-instance. class / type.*/ 245 public static NestedDescriptor<AXNode> descriptor() 246 { return singleton.descriptor(); } 247 } 248 249 /** 250 * <CODE>[No Description Provided by Google]</CODE> 251 * 252 * <EMBED CLASS=globalDefs DATA-DOMAIN=Accessibility DATA-API=BrowserAPI> 253 */ 254 @JDHeaderBackgroundImg(EmbedTagFileID="CDP.NESTED_TYPE_JDHBI") 255 public static class AXProperty 256 extends BaseType<AXProperty> 257 implements java.io.Serializable 258 { 259 /** <EMBED CLASS='external-html' DATA-FILE-ID=SVUID> */ 260 protected static final long serialVersionUID = 1; 261 262 private static final NestedHelper<Accessibility.AXProperty> singleton = 263 Torello.Browser.BrowserAPI.NestedHelpers.Types. 264 Accessibility$$AXProperty$$.singleton; 265 266 /** 267 * The name of this property. 268 * <EMBED CLASS='external-html' DATA-D=Accessibility DATA-C=AXPropertyName DATA-F=name DATA-FILE-ID=CDP.EL2> 269 * @see BaseType#enumStrList(String) 270 */ 271 public final String name; 272 273 /** The value of this property. */ 274 public final Accessibility.AXValue value; 275 276 /** Constructor. Please review this class' fields for documentation. */ 277 public AXProperty(ReadOnlyList<Boolean> isPresent, String name, AXValue value) 278 { 279 super(singleton, Domains.Accessibility, "AXProperty", 2); 280 281 this.name = name; 282 this.value = value; 283 284 this.isPresent = (isPresent == null) 285 ? singleton.generateIsPresentList(this) 286 : THROWS.check(isPresent, 2, "Accessibility.AXProperty"); 287 } 288 289 /** Creates an instance of this class from a {@link JsonObject}.*/ 290 public static AXProperty fromJSON(JsonObject jo) 291 { return singleton.fromJSON(jo); } 292 293 /** Returns this class's {@link NestedDescriptor} singleton-instance. class / type.*/ 294 public static NestedDescriptor<AXProperty> descriptor() 295 { return singleton.descriptor(); } 296 } 297 298 /** 299 * <CODE>[No Description Provided by Google]</CODE> 300 * 301 * <EMBED CLASS=globalDefs DATA-DOMAIN=Accessibility DATA-API=BrowserAPI> 302 */ 303 @JDHeaderBackgroundImg(EmbedTagFileID="CDP.NESTED_TYPE_JDHBI") 304 public static class AXRelatedNode 305 extends BaseType<AXRelatedNode> 306 implements java.io.Serializable 307 { 308 /** <EMBED CLASS='external-html' DATA-FILE-ID=SVUID> */ 309 protected static final long serialVersionUID = 1; 310 311 private static final NestedHelper<Accessibility.AXRelatedNode> singleton = 312 Torello.Browser.BrowserAPI.NestedHelpers.Types. 313 Accessibility$$AXRelatedNode$$.singleton; 314 315 /** The BackendNodeId of the related DOM node. */ 316 public final int backendDOMNodeId; 317 318 /** 319 * The IDRef value provided, if any. 320 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 321 */ 322 public final String idref; 323 324 /** 325 * The text alternative of this node in the current context. 326 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 327 */ 328 public final String text; 329 330 /** Constructor. Please review this class' fields for documentation. */ 331 public AXRelatedNode 332 (ReadOnlyList<Boolean> isPresent, int backendDOMNodeId, String idref, String text) 333 { 334 super(singleton, Domains.Accessibility, "AXRelatedNode", 3); 335 336 this.backendDOMNodeId = backendDOMNodeId; 337 this.idref = idref; 338 this.text = text; 339 340 this.isPresent = (isPresent == null) 341 ? singleton.generateIsPresentList(this) 342 : THROWS.check(isPresent, 3, "Accessibility.AXRelatedNode"); 343 } 344 345 /** Creates an instance of this class from a {@link JsonObject}.*/ 346 public static AXRelatedNode fromJSON(JsonObject jo) 347 { return singleton.fromJSON(jo); } 348 349 /** Returns this class's {@link NestedDescriptor} singleton-instance. class / type.*/ 350 public static NestedDescriptor<AXRelatedNode> descriptor() 351 { return singleton.descriptor(); } 352 } 353 354 /** 355 * A single computed AX property. 356 * 357 * <EMBED CLASS=globalDefs DATA-DOMAIN=Accessibility DATA-API=BrowserAPI> 358 */ 359 @JDHeaderBackgroundImg(EmbedTagFileID="CDP.NESTED_TYPE_JDHBI") 360 public static class AXValue 361 extends BaseType<AXValue> 362 implements java.io.Serializable 363 { 364 /** <EMBED CLASS='external-html' DATA-FILE-ID=SVUID> */ 365 protected static final long serialVersionUID = 1; 366 367 private static final NestedHelper<Accessibility.AXValue> singleton = 368 Torello.Browser.BrowserAPI.NestedHelpers.Types. 369 Accessibility$$AXValue$$.singleton; 370 371 /** 372 * The type of this value. 373 * <EMBED CLASS='external-html' DATA-D=Accessibility DATA-C=AXValueType DATA-F=type DATA-FILE-ID=CDP.EL2> 374 * @see BaseType#enumStrList(String) 375 */ 376 public final String type; 377 378 /** 379 * The computed value of this property. 380 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 381 */ 382 public final JsonValue value; 383 384 /** 385 * One or more related nodes, if applicable. 386 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 387 */ 388 public final Accessibility.AXRelatedNode[] relatedNodes; 389 390 /** 391 * The sources which contributed to the computation of this property. 392 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 393 */ 394 public final Accessibility.AXValueSource[] sources; 395 396 /** Constructor. Please review this class' fields for documentation. */ 397 public AXValue( 398 ReadOnlyList<Boolean> isPresent, String type, JsonValue value, 399 AXRelatedNode[] relatedNodes, AXValueSource[] sources 400 ) 401 { 402 super(singleton, Domains.Accessibility, "AXValue", 4); 403 404 this.type = type; 405 this.value = value; 406 this.relatedNodes = relatedNodes; 407 this.sources = sources; 408 409 this.isPresent = (isPresent == null) 410 ? singleton.generateIsPresentList(this) 411 : THROWS.check(isPresent, 4, "Accessibility.AXValue"); 412 } 413 414 /** Creates an instance of this class from a {@link JsonObject}.*/ 415 public static AXValue fromJSON(JsonObject jo) 416 { return singleton.fromJSON(jo); } 417 418 /** Returns this class's {@link NestedDescriptor} singleton-instance. class / type.*/ 419 public static NestedDescriptor<AXValue> descriptor() 420 { return singleton.descriptor(); } 421 } 422 423 /** 424 * A single source for a computed AX property. 425 * 426 * <EMBED CLASS=globalDefs DATA-DOMAIN=Accessibility DATA-API=BrowserAPI> 427 */ 428 @JDHeaderBackgroundImg(EmbedTagFileID="CDP.NESTED_TYPE_JDHBI") 429 public static class AXValueSource 430 extends BaseType<AXValueSource> 431 implements java.io.Serializable 432 { 433 /** <EMBED CLASS='external-html' DATA-FILE-ID=SVUID> */ 434 protected static final long serialVersionUID = 1; 435 436 private static final NestedHelper<Accessibility.AXValueSource> singleton = 437 Torello.Browser.BrowserAPI.NestedHelpers.Types. 438 Accessibility$$AXValueSource$$.singleton; 439 440 /** 441 * What type of source this is. 442 * <EMBED CLASS='external-html' DATA-D=Accessibility DATA-C=AXValueSourceType DATA-F=type DATA-FILE-ID=CDP.EL2> 443 * @see BaseType#enumStrList(String) 444 */ 445 public final String type; 446 447 /** 448 * The value of this property source. 449 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 450 */ 451 public final Accessibility.AXValue value; 452 453 /** 454 * The name of the relevant attribute, if any. 455 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 456 */ 457 public final String attribute; 458 459 /** 460 * The value of the relevant attribute, if any. 461 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 462 */ 463 public final Accessibility.AXValue attributeValue; 464 465 /** 466 * Whether this source is superseded by a higher priority source. 467 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 468 */ 469 public final Boolean superseded; 470 471 /** 472 * The native markup source for this value, e.g. a <CODE>{@code <label>}</CODE> element. 473 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 474 * <EMBED CLASS='external-html' DATA-D=Accessibility DATA-C=AXValueNativeSourceType DATA-F=nativeSource DATA-FILE-ID=CDP.EL2> 475 * @see BaseType#enumStrList(String) 476 */ 477 public final String nativeSource; 478 479 /** 480 * The value, such as a node or node list, of the native source. 481 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 482 */ 483 public final Accessibility.AXValue nativeSourceValue; 484 485 /** 486 * Whether the value for this property is invalid. 487 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 488 */ 489 public final Boolean invalid; 490 491 /** 492 * Reason for the value being invalid, if it is. 493 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 494 */ 495 public final String invalidReason; 496 497 /** Constructor. Please review this class' fields for documentation. */ 498 public AXValueSource( 499 ReadOnlyList<Boolean> isPresent, String type, AXValue value, String attribute, 500 AXValue attributeValue, Boolean superseded, String nativeSource, 501 AXValue nativeSourceValue, Boolean invalid, String invalidReason 502 ) 503 { 504 super(singleton, Domains.Accessibility, "AXValueSource", 9); 505 506 this.type = type; 507 this.value = value; 508 this.attribute = attribute; 509 this.attributeValue = attributeValue; 510 this.superseded = superseded; 511 this.nativeSource = nativeSource; 512 this.nativeSourceValue = nativeSourceValue; 513 this.invalid = invalid; 514 this.invalidReason = invalidReason; 515 516 this.isPresent = (isPresent == null) 517 ? singleton.generateIsPresentList(this) 518 : THROWS.check(isPresent, 9, "Accessibility.AXValueSource"); 519 } 520 521 /** Creates an instance of this class from a {@link JsonObject}.*/ 522 public static AXValueSource fromJSON(JsonObject jo) 523 { return singleton.fromJSON(jo); } 524 525 /** Returns this class's {@link NestedDescriptor} singleton-instance. class / type.*/ 526 public static NestedDescriptor<AXValueSource> descriptor() 527 { return singleton.descriptor(); } 528 } 529 530 531 // ******************************************************************************************** 532 // ******************************************************************************************** 533 // Event Types 534 // ******************************************************************************************** 535 // ******************************************************************************************** 536 537 538 /** 539 * The loadComplete event mirrors the load complete event sent by the browser to assistive 540 * technology when the web page has finished loading. 541 * 542 * <BR /><B CLASS=Exp-Top>EXPERIMENTAL</B> 543 * <EMBED CLASS=globalDefs DATA-DOMAIN=Accessibility DATA-API=BrowserAPI> 544 */ 545 @JDHeaderBackgroundImg(EmbedTagFileID="CDP.NESTED_EVENT_JDHBI") 546 public static class loadComplete 547 extends BrowserEvent<loadComplete> 548 implements java.io.Serializable 549 { 550 /** <EMBED CLASS='external-html' DATA-FILE-ID=SVUID> */ 551 protected static final long serialVersionUID = 1; 552 553 private static final NestedHelper<Accessibility.loadComplete> singleton = 554 Torello.Browser.BrowserAPI.NestedHelpers.Events. 555 Accessibility$$loadComplete$$.singleton; 556 557 /** New document root node. */ 558 public final Accessibility.AXNode root; 559 560 /** Constructor. Please review this class' fields for documentation. */ 561 public loadComplete(ReadOnlyList<Boolean> isPresent, AXNode root) 562 { 563 super(singleton, Domains.Accessibility, "loadComplete", 1); 564 565 this.root = root; 566 567 this.isPresent = (isPresent == null) 568 ? singleton.generateIsPresentList(this) 569 : THROWS.check(isPresent, 1, "Accessibility.loadComplete"); 570 } 571 572 /** Creates an instance of this class from a {@link JsonObject}.*/ 573 public static loadComplete fromJSON(JsonObject jo) 574 { return singleton.fromJSON(jo); } 575 576 /** Returns this class's {@link NestedDescriptor} singleton-instance. class / type.*/ 577 public static NestedDescriptor<loadComplete> descriptor() 578 { return singleton.descriptor(); } 579 } 580 581 /** 582 * The nodesUpdated event is sent every time a previously requested node has changed the in tree. 583 * 584 * <BR /><B CLASS=Exp-Top>EXPERIMENTAL</B> 585 * <EMBED CLASS=globalDefs DATA-DOMAIN=Accessibility DATA-API=BrowserAPI> 586 */ 587 @JDHeaderBackgroundImg(EmbedTagFileID="CDP.NESTED_EVENT_JDHBI") 588 public static class nodesUpdated 589 extends BrowserEvent<nodesUpdated> 590 implements java.io.Serializable 591 { 592 /** <EMBED CLASS='external-html' DATA-FILE-ID=SVUID> */ 593 protected static final long serialVersionUID = 1; 594 595 private static final NestedHelper<Accessibility.nodesUpdated> singleton = 596 Torello.Browser.BrowserAPI.NestedHelpers.Events. 597 Accessibility$$nodesUpdated$$.singleton; 598 599 /** Updated node data. */ 600 public final Accessibility.AXNode[] nodes; 601 602 /** Constructor. Please review this class' fields for documentation. */ 603 public nodesUpdated(ReadOnlyList<Boolean> isPresent, AXNode[] nodes) 604 { 605 super(singleton, Domains.Accessibility, "nodesUpdated", 1); 606 607 this.nodes = nodes; 608 609 this.isPresent = (isPresent == null) 610 ? singleton.generateIsPresentList(this) 611 : THROWS.check(isPresent, 1, "Accessibility.nodesUpdated"); 612 } 613 614 /** Creates an instance of this class from a {@link JsonObject}.*/ 615 public static nodesUpdated fromJSON(JsonObject jo) 616 { return singleton.fromJSON(jo); } 617 618 /** Returns this class's {@link NestedDescriptor} singleton-instance. class / type.*/ 619 public static NestedDescriptor<nodesUpdated> descriptor() 620 { return singleton.descriptor(); } 621 } 622 623 624 625 626 // ******************************************************************************************** 627 // ******************************************************************************************** 628 // Commands 629 // ******************************************************************************************** 630 // ******************************************************************************************** 631 632 633 /** 634 * Disables the accessibility domain. 635 * 636 * @return An instance of <CODE>{@link Script}<Void></CODE> 637 * 638 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 639 * browser receives the invocation-request. 640 * 641 * <BR /><BR /><DIV CLASS=JDHint> 642 * This Browser-Function <I>does not have</I> a return-value. You may choose to 643 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <Void>} to ensure that 644 * the Browser Function has run to completion. 645 * </DIV> 646 */ 647 public static Script<Void> disable() 648 { 649 // Ultra-Simple Request JSON - Because this method has no parameters 650 final String requestJSON = "{\"method\":\"Accessibility.disable\"}"; 651 652 return Script.NO_RET(Domains.Accessibility, "disable", requestJSON); 653 } 654 655 /** 656 * Enables the accessibility domain which causes <CODE>AXNodeId</CODE>s to remain consistent between method calls. 657 * This turns on accessibility for the page, which can impact performance until accessibility is disabled. 658 * 659 * @return An instance of <CODE>{@link Script}<Void></CODE> 660 * 661 * <BR /><BR />This {@code Script} instance must be <B STYLE='color:red'>executed</B> before the 662 * browser receives the invocation-request. 663 * 664 * <BR /><BR /><DIV CLASS=JDHint> 665 * This Browser-Function <I>does not have</I> a return-value. You may choose to 666 * <B STYLE='color: red'>await</B> the {@link Promise}{@code <Void>} to ensure that 667 * the Browser Function has run to completion. 668 * </DIV> 669 */ 670 public static Script<Void> enable() 671 { 672 // Ultra-Simple Request JSON - Because this method has no parameters 673 final String requestJSON = "{\"method\":\"Accessibility.enable\"}"; 674 675 return Script.NO_RET(Domains.Accessibility, "enable", requestJSON); 676 } 677 678 /** 679 * Fetches a node and all ancestors up to and including the root. 680 * Requires <CODE>enable()</CODE> to have been called previously. 681 * 682 * <BR /><B CLASS=Exp-Top>EXPERIMENTAL</B> 683 * 684 * @param nodeId Identifier of the node to get. 685 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 686 * 687 * @param backendNodeId Identifier of the backend node to get. 688 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 689 * 690 * @param objectId JavaScript object id of the node wrapper to get. 691 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 692 * 693 * @return An instance of <CODE>{@link Script}<{@link Accessibility.AXNode}[]></CODE> 694 * 695 * <BR /><BR />This <B>script</B> may be <B STYLE='color: red'>executed</B>, using 696 * {@link Script#exec(WebSocketSender) Script.exec}, and afterwards, a {@link Promise} 697 * <CODE><{@link Accessibility.AXNode}[]></CODE> will be returned 698 * 699 * <BR /><BR />Finally, the <B>{@code Promise}</B> may be <B STYLE='color: red'>awaited</B>, 700 * using {@link Promise#await()}, <I>and the returned result of this Browser Function may 701 * be retrieved.</I> 702 * 703 * <BR /><BR /><DIV CLASS=JDHint> 704 * This Browser Function's {@code Promise} returns: 705 * <CODE>{@link Accessibility.AXNode}[] (<B>nodes</B>)</CODE> 706 * </DIV> 707 */ 708 public static Script<Accessibility.AXNode[]> getAXNodeAndAncestors 709 (Integer nodeId, Integer backendNodeId, String objectId) 710 { 711 // Convert all Method Parameters into a JSON Request-Object (as a String) 712 final String requestJSON = WriteJSON.get( 713 Accessibility$$Commands.getAXNodeAndAncestors$$, "Accessibility.getAXNodeAndAncestors", 714 nodeId, backendNodeId, objectId 715 ); 716 717 return new Script<>( 718 Domains.Accessibility, "getAXNodeAndAncestors", requestJSON, 719 Accessibility$$Commands::getAXNodeAndAncestors, 720 Accessibility.AXNode[].class 721 ); 722 } 723 724 /** 725 * Fetches a particular accessibility node by AXNodeId. 726 * Requires <CODE>enable()</CODE> to have been called previously. 727 * 728 * <BR /><B CLASS=Exp-Top>EXPERIMENTAL</B> 729 * 730 * @param id - 731 * 732 * @param frameId 733 * The frame in whose document the node resides. 734 * If omitted, the root frame is used. 735 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 736 * 737 * @return An instance of <CODE>{@link Script}<{@link Accessibility.AXNode}[]></CODE> 738 * 739 * <BR /><BR />This <B>script</B> may be <B STYLE='color: red'>executed</B>, using 740 * {@link Script#exec(WebSocketSender) Script.exec}, and afterwards, a {@link Promise} 741 * <CODE><{@link Accessibility.AXNode}[]></CODE> will be returned 742 * 743 * <BR /><BR />Finally, the <B>{@code Promise}</B> may be <B STYLE='color: red'>awaited</B>, 744 * using {@link Promise#await()}, <I>and the returned result of this Browser Function may 745 * be retrieved.</I> 746 * 747 * <BR /><BR /><DIV CLASS=JDHint> 748 * This Browser Function's {@code Promise} returns: 749 * <CODE>{@link Accessibility.AXNode}[] (<B>nodes</B>)</CODE> 750 * </DIV> 751 */ 752 public static Script<Accessibility.AXNode[]> getChildAXNodes(String id, String frameId) 753 { 754 // Convert all Method Parameters into a JSON Request-Object (as a String) 755 final String requestJSON = WriteJSON.get( 756 Accessibility$$Commands.getChildAXNodes$$, "Accessibility.getChildAXNodes", 757 id, frameId 758 ); 759 760 return new Script<>( 761 Domains.Accessibility, "getChildAXNodes", requestJSON, 762 Accessibility$$Commands::getChildAXNodes, 763 Accessibility.AXNode[].class 764 ); 765 } 766 767 /** 768 * Fetches the entire accessibility tree for the root Document 769 * 770 * <BR /><B CLASS=Exp-Top>EXPERIMENTAL</B> 771 * 772 * @param depth 773 * The maximum depth at which descendants of the root node should be retrieved. 774 * If omitted, the full tree is returned. 775 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 776 * 777 * @param frameId 778 * The frame for whose document the AX tree should be retrieved. 779 * If omitted, the root frame is used. 780 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 781 * 782 * @return An instance of <CODE>{@link Script}<{@link Accessibility.AXNode}[]></CODE> 783 * 784 * <BR /><BR />This <B>script</B> may be <B STYLE='color: red'>executed</B>, using 785 * {@link Script#exec(WebSocketSender) Script.exec}, and afterwards, a {@link Promise} 786 * <CODE><{@link Accessibility.AXNode}[]></CODE> will be returned 787 * 788 * <BR /><BR />Finally, the <B>{@code Promise}</B> may be <B STYLE='color: red'>awaited</B>, 789 * using {@link Promise#await()}, <I>and the returned result of this Browser Function may 790 * be retrieved.</I> 791 * 792 * <BR /><BR /><DIV CLASS=JDHint> 793 * This Browser Function's {@code Promise} returns: 794 * <CODE>{@link Accessibility.AXNode}[] (<B>nodes</B>)</CODE> 795 * </DIV> 796 */ 797 public static Script<Accessibility.AXNode[]> getFullAXTree(Integer depth, String frameId) 798 { 799 // Convert all Method Parameters into a JSON Request-Object (as a String) 800 final String requestJSON = WriteJSON.get( 801 Accessibility$$Commands.getFullAXTree$$, "Accessibility.getFullAXTree", 802 depth, frameId 803 ); 804 805 return new Script<>( 806 Domains.Accessibility, "getFullAXTree", requestJSON, 807 Accessibility$$Commands::getFullAXTree, 808 Accessibility.AXNode[].class 809 ); 810 } 811 812 /** 813 * Fetches the accessibility node and partial accessibility tree for this DOM node, if it exists. 814 * 815 * <BR /><B CLASS=Exp-Top>EXPERIMENTAL</B> 816 * 817 * @param nodeId Identifier of the node to get the partial accessibility tree for. 818 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 819 * 820 * @param backendNodeId Identifier of the backend node to get the partial accessibility tree for. 821 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 822 * 823 * @param objectId JavaScript object id of the node wrapper to get the partial accessibility tree for. 824 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 825 * 826 * @param fetchRelatives Whether to fetch this node's ancestors, siblings and children. Defaults to true. 827 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 828 * 829 * @return An instance of <CODE>{@link Script}<{@link Accessibility.AXNode}[]></CODE> 830 * 831 * <BR /><BR />This <B>script</B> may be <B STYLE='color: red'>executed</B>, using 832 * {@link Script#exec(WebSocketSender) Script.exec}, and afterwards, a {@link Promise} 833 * <CODE><{@link Accessibility.AXNode}[]></CODE> will be returned 834 * 835 * <BR /><BR />Finally, the <B>{@code Promise}</B> may be <B STYLE='color: red'>awaited</B>, 836 * using {@link Promise#await()}, <I>and the returned result of this Browser Function may 837 * be retrieved.</I> 838 * 839 * <BR /><BR /><DIV CLASS=JDHint> 840 * This Browser Function's {@code Promise} returns: 841 * <CODE>{@link Accessibility.AXNode}[] (<B>nodes</B>)</CODE> 842 * <BR /> 843 * The <CODE>Accessibility.AXNode</CODE> for this DOM node, if it exists, plus its ancestors, siblings and 844 * children, if requested. 845 * </DIV> 846 */ 847 public static Script<Accessibility.AXNode[]> getPartialAXTree 848 (Integer nodeId, Integer backendNodeId, String objectId, Boolean fetchRelatives) 849 { 850 // Convert all Method Parameters into a JSON Request-Object (as a String) 851 final String requestJSON = WriteJSON.get( 852 Accessibility$$Commands.getPartialAXTree$$, "Accessibility.getPartialAXTree", 853 nodeId, backendNodeId, objectId, fetchRelatives 854 ); 855 856 return new Script<>( 857 Domains.Accessibility, "getPartialAXTree", requestJSON, 858 Accessibility$$Commands::getPartialAXTree, 859 Accessibility.AXNode[].class 860 ); 861 } 862 863 /** 864 * Fetches the root node. 865 * Requires <CODE>enable()</CODE> to have been called previously. 866 * 867 * <BR /><B CLASS=Exp-Top>EXPERIMENTAL</B> 868 * 869 * @param frameId 870 * The frame in whose document the node resides. 871 * If omitted, the root frame is used. 872 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 873 * 874 * @return An instance of <CODE>{@link Script}<{@link Accessibility.AXNode}></CODE> 875 * 876 * <BR /><BR />This <B>script</B> may be <B STYLE='color: red'>executed</B>, using 877 * {@link Script#exec(WebSocketSender) Script.exec}, and afterwards, a {@link Promise} 878 * <CODE><{@link Accessibility.AXNode}></CODE> will be returned 879 * 880 * <BR /><BR />Finally, the <B>{@code Promise}</B> may be <B STYLE='color: red'>awaited</B>, 881 * using {@link Promise#await()}, <I>and the returned result of this Browser Function may 882 * be retrieved.</I> 883 * 884 * <BR /><BR /><DIV CLASS=JDHint> 885 * This Browser Function's {@code Promise} returns: 886 * <CODE>{@link Accessibility.AXNode} (<B>node</B>)</CODE> 887 * </DIV> 888 */ 889 public static Script<Accessibility.AXNode> getRootAXNode(String frameId) 890 { 891 // Build the JSON Request-Object (as a String); only 1 Parameter is passed 892 final String requestJSON = WriteJSON.get 893 (CDPTypes.STRING, "frameId", true, "Accessibility.getRootAXNode", frameId); 894 895 return new Script<>( 896 Domains.Accessibility, "getRootAXNode", requestJSON, 897 Accessibility$$Commands::getRootAXNode, 898 Accessibility.AXNode.class 899 ); 900 } 901 902 /** 903 * Query a DOM node's accessibility subtree for accessible name and role. 904 * This command computes the name and role for all nodes in the subtree, including those that are 905 * ignored for accessibility, and returns those that match the specified name and role. If no DOM 906 * node is specified, or the DOM node does not exist, the command returns an error. If neither 907 * <CODE>accessibleName</CODE> or <CODE>role</CODE> is specified, it returns all the accessibility nodes in the subtree. 908 * 909 * <BR /><B CLASS=Exp-Top>EXPERIMENTAL</B> 910 * 911 * <BR /><BR /><DIV CLASS=JDHint> 912 * 👍 Because of the sheer number of input parameters to this method, there is a 913 * a {@link CommandBuilder} variant to this method which may be invoked instead. 914 * 915 * <BR /><BR /> 916 * Please View: {@link #queryAXTree()} 917 * </DIV> 918 * 919 * @param nodeId Identifier of the node for the root to query. 920 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 921 * 922 * @param backendNodeId Identifier of the backend node for the root to query. 923 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 924 * 925 * @param objectId JavaScript object id of the node wrapper for the root to query. 926 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 927 * 928 * @param accessibleName Find nodes with this computed name. 929 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 930 * 931 * @param role Find nodes with this computed role. 932 * <BR /><B CLASS=Opt-Top>OPTIONAL</B> 933 * 934 * @return An instance of <CODE>{@link Script}<{@link Accessibility.AXNode}[]></CODE> 935 * 936 * <BR /><BR />This <B>script</B> may be <B STYLE='color: red'>executed</B>, using 937 * {@link Script#exec(WebSocketSender) Script.exec}, and afterwards, a {@link Promise} 938 * <CODE><{@link Accessibility.AXNode}[]></CODE> will be returned 939 * 940 * <BR /><BR />Finally, the <B>{@code Promise}</B> may be <B STYLE='color: red'>awaited</B>, 941 * using {@link Promise#await()}, <I>and the returned result of this Browser Function may 942 * be retrieved.</I> 943 * 944 * <BR /><BR /><DIV CLASS=JDHint> 945 * This Browser Function's {@code Promise} returns: 946 * <CODE>{@link Accessibility.AXNode}[] (<B>nodes</B>)</CODE> 947 * <BR /> 948 * A list of <CODE>Accessibility.AXNode</CODE> matching the specified attributes, 949 * including nodes that are ignored for accessibility. 950 * </DIV> 951 */ 952 public static Script<Accessibility.AXNode[]> queryAXTree( 953 Integer nodeId, Integer backendNodeId, String objectId, String accessibleName, 954 String role 955 ) 956 { 957 // Convert all Method Parameters into a JSON Request-Object (as a String) 958 final String requestJSON = WriteJSON.get( 959 Accessibility$$Commands.queryAXTree$$, "Accessibility.queryAXTree", 960 nodeId, backendNodeId, objectId, accessibleName, role 961 ); 962 963 return new Script<>( 964 Domains.Accessibility, "queryAXTree", requestJSON, 965 Accessibility$$Commands::queryAXTree, 966 Accessibility.AXNode[].class 967 ); 968 } 969 970 971 // ******************************************************************************************** 972 // ******************************************************************************************** 973 // CommandBuilder Getter-Methods 974 // ******************************************************************************************** 975 // ******************************************************************************************** 976 977 978 /** 979 * Creates a buider for conveniently assigning parameters to this method. 980 * 981 * <BR /><BR /><DIV CLASS=JDHint> 982 * Note that the original method expects 5 parameters, and can be cumbersome. 983 * </DIV> 984 * 985 * @return {@link CommandBuilder} instance, for assigning parameter values, one by one. 986 * @see #queryAXTree 987 */ 988 public static CommandBuilder<Accessibility.AXNode[]> queryAXTree() 989 { return CommandBuilder.builder(Accessibility$$Commands.queryAXTree$$); } 990 991 992}