nsIAccessibilityService.idl (4157B)
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- 2 /* This Source Code Form is subject to the terms of the Mozilla Public 3 * License, v. 2.0. If a copy of the MPL was not distributed with this 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 5 6 #include "nsISupports.idl" 7 8 interface nsIAccessible; 9 interface nsIWeakReference; 10 interface nsIAccessiblePivot; 11 interface nsIAccessibleTextLeafPoint; 12 13 webidl Node; 14 15 /** 16 * An interface for in-process accessibility clients wishing to get an 17 * nsIAccessible for a given DOM node. More documentation at: 18 * http://www.mozilla.org/projects/ui/accessibility 19 */ 20 [scriptable, builtinclass, uuid(2188e3a0-c88e-11e7-8f1a-0800200c9a66)] 21 interface nsIAccessibilityService : nsISupports 22 { 23 /** 24 * Return application accessible. 25 */ 26 nsIAccessible getApplicationAccessible(); 27 28 /** 29 * Return an nsIAccessible for a DOM node in pres shell 0. 30 * Create a new accessible of the appropriate type if necessary, 31 * or use one from the accessibility cache if it already exists. 32 * @param aNode The DOM node to get an accessible for. 33 * @return The nsIAccessible for the given DOM node. 34 */ 35 nsIAccessible getAccessibleFor(in Node aNode); 36 37 nsIAccessible getAccessibleDescendantFor(in Node aNode); 38 39 /** 40 * Returns accessible role as a string. 41 * 42 * @param aRole - the accessible role constants. 43 */ 44 AString getStringRole(in unsigned long aRole); 45 46 /** 47 * Returns list which contains accessible states as a strings. 48 * 49 * @param aStates - accessible states. 50 * @param aExtraStates - accessible extra states. 51 */ 52 nsISupports getStringStates(in unsigned long aStates, 53 in unsigned long aExtraStates); 54 55 /** 56 * Get the type of accessible event as a string. 57 * 58 * @param aEventType - the accessible event type constant 59 * @return - accessible event type presented as human readable string 60 */ 61 AString getStringEventType(in unsigned long aEventType); 62 63 /** 64 * Get the type of accessible relation as a string. 65 * 66 * @param aRelationType - the accessible relation type constant 67 * @return - accessible relation type presented as human readable string 68 */ 69 AString getStringRelationType(in unsigned long aRelationType); 70 71 /** 72 * Return an accessible for the given DOM node from the cache. 73 * @note the method is intended for testing purposes 74 * 75 * @param aNode [in] the DOM node to get an accessible for 76 * 77 * @return cached accessible for the given DOM node if any 78 */ 79 nsIAccessible getAccessibleFromCache(in Node aNode); 80 81 /** 82 * Set the active cache domains. If any given domains are not currently 83 * active, then the accessibility service will enable them in all content 84 * processes, causing them to be cached. 85 * 86 * @param aCacheDomains [in] the cache domains to set 87 */ 88 void setCacheDomains(in unsigned long long aCacheDomains); 89 90 /** 91 * Create a new pivot for tracking a position and traversing a subtree. 92 * 93 * @param aRoot [in] the accessible root for the pivot 94 * @return a new pivot 95 */ 96 nsIAccessiblePivot createAccessiblePivot(in nsIAccessible aRoot); 97 98 /** 99 * Create a new nsIAccessibleTextLeafPoint. 100 * 101 * @param aAccessible [in] the accessible for the point 102 * @param aOffset [in] the offset of the point 103 * @return a new point 104 */ 105 nsIAccessibleTextLeafPoint createTextLeafPoint(in nsIAccessible aAccessible, 106 in long aOffset); 107 108 /** 109 * Enable logging for the given modules, all other modules aren't logged. 110 * 111 * @param aModules [in] list of modules, format is comma separated list 112 * like 'docload,doccreate'. 113 * @note Works on debug build only. 114 * @see Logging.cpp for list of possible values. 115 */ 116 void setLogging(in ACString aModules); 117 118 /** 119 * Return true if the given module is logged. 120 */ 121 boolean isLogged(in AString aModule); 122 123 /** 124 * Get the current accessibility service consumers. 125 * @returns a JSON string representing the accessibility service consumers. 126 */ 127 AString getConsumers(); 128 };