blob: a337c8a62a6d567221fcd7a23e83db9a48f7b2d8 [file] [log] [blame]
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
[
{
"namespace": "accessibilityPrivate",
"compiler_options": {
"implemented_in": "chromecast/browser/extensions/api/accessibility_private/accessibility_extension_api.h"
},
"description": "none",
"types": [
{
"id": "AlertInfo",
"type": "object",
"description": "Information about an alert",
"properties": {
"message": {
"type": "string",
"description": "The message the alert is showing."
}
}
},
{
"id": "ScreenRect",
"type": "object",
"description": "Bounding rectangle in global screen coordinates.",
"properties": {
"left": {"type": "integer", "description": "Left coordinate in global screen coordinates."},
"top": {"type": "integer", "description": "Top coordinate in global screen coordinates."},
"width": {"type": "integer", "description": "Width in pixels."},
"height": {"type": "integer", "description": "Height in pixels."}
}
},
{
"id": "Gesture",
"type": "string",
"enum": [ "click", "swipeLeft1", "swipeUp1", "swipeRight1", "swipeDown1", "swipeLeft2", "swipeUp2", "swipeRight2", "swipeDown2", "swipeLeft3", "swipeUp3", "swipeRight3", "swipeDown3", "swipeLeft4", "swipeUp4", "swipeRight4", "swipeDown4", "tap2", "tap3", "tap4" ],
"description": "Accessibility gestures fired by the touch exploration controller."
},
{
"id": "SyntheticKeyboardEventType",
"type": "string",
"description": "The event to send",
"enum": ["keyup", "keydown"]
},
{
"id": "SyntheticKeyboardModifiers",
"type": "object",
"properties": {
"ctrl": {
"type": "boolean",
"description": "Control modifier.",
"optional": true
},
"alt": {
"type": "boolean",
"description": "alt modifier.",
"optional": true
},
"search": {
"type": "boolean",
"description": "search modifier.",
"optional": true
},
"shift": {
"type": "boolean",
"description": "shift modifier.",
"optional": true
}
}
},
{
"id": "SyntheticKeyboardEvent",
"type": "object",
"properties": {
"type": {"$ref": "SyntheticKeyboardEventType"},
"keyCode": {"type": "integer", "description": "Virtual key code, which is independent of the keyboard layout or modifier state."},
"modifiers": {
"$ref": "SyntheticKeyboardModifiers",
"optional": true,
"description": "Contains all active modifiers."
}
}
},
{
"id": "SyntheticMouseEventType",
"type": "string",
"description": "The type of event to send",
"enum": ["press", "release", "drag", "move", "enter", "exit"]
},
{
"id": "SyntheticMouseEvent",
"type": "object",
"properties": {
"type": {"$ref": "SyntheticMouseEventType"},
"x": {"type": "integer", "description": "X coordinate for mouse event in global screen coordinates"},
"y": {"type": "integer", "description": "Y coordinate for mouse event in global screen coordinates"}
}
},
{
"id": "SelectToSpeakState",
"type": "string",
"description": "The state of the Select-to-Speak extension",
"enum": ["selecting", "speaking", "inactive"]
},
{
"id": "FocusType",
"type": "string",
"description": "The type of visual appearance for the focus ring.",
"enum": ["glow", "solid", "dashed"]
},
{
"id": "FocusRingInfo",
"type": "object",
"properties": {
"rects": {
"type": "array",
"items": { "$ref": "ScreenRect" },
"description": "Array of rectangles to draw the accessibility focus ring around."
},
"type": {
"$ref": "FocusType",
"description": "The FocusType for the ring."
},
"color": {
"type": "string",
"description": "A CSS-style color string (e.g. #3F8213) that describes the primary color of the focus ring."
},
"secondaryColor": {
"type": "string",
"description": "A CSS-style color string (e.g. #3F82E4) that describes the secondary color of the focus ring, if there is one.",
"optional": true
},
"id": {
"type": "string",
"description": "An identifier for this focus ring, unique within the extension.",
"optional": true
}
}
}
],
"functions": [
{
"name": "getBatteryDescription",
"type": "function",
"description": "Called to request battery status from Chrome OS system.",
"parameters": [
{
"name": "callback",
"type": "function",
"description": "Returns battery description as a string.",
"parameters": [
{
"name": "batteryDescription",
"type": "string"
}
]
}
],
"platforms": ["chromeos"]
},
{
"name": "setNativeAccessibilityEnabled",
"type": "function",
"description": "Enables or disables native accessibility support. Once disabled, it is up to the calling extension to provide accessibility for web contents.",
"parameters": [
{
"type": "boolean",
"name": "enabled",
"description": "True if native accessibility support should be enabled."
}
]
},
{
"name": "setFocusRings",
"type": "function",
"description": "Sets the given accessibility focus rings for this extension.",
"parameters": [
{
"name": "focusRings",
"type": "array",
"items": { "$ref": "FocusRingInfo" },
"description": "Array of focus rings to draw."
}
]
},
{
"name": "setHighlights",
"type": "function",
"description": "Sets the bounds of the accessibility highlight.",
"parameters": [
{
"name": "rects",
"type": "array",
"items": { "$ref": "ScreenRect" },
"description": "Array of rectangles to draw the highlight around."
},
{
"name": "color",
"type": "string",
"description": "CSS-style hex color string beginning with # like #FF9982 or #EEE."
}
]
},
{
"name": "setKeyboardListener",
"type": "function",
"description": "Sets the calling extension as a listener of all keyboard events optionally allowing the calling extension to capture/swallow the key event via DOM apis. Returns false via callback when unable to set the listener.",
"parameters": [
{
"type": "boolean",
"name": "enabled",
"description": "True if the caller wants to listen to key events; false to stop listening to events. Note that there is only ever one extension listening to key events."
},
{
"type": "boolean",
"name": "capture",
"description": "True if key events should be swallowed natively and not propagated if preventDefault() gets called by the extension's background page."
}
]
},
{
"name": "darkenScreen",
"type": "function",
"description": "Darkens or undarkens the screen.",
"parameters": [
{
"type": "boolean",
"name": "enabled",
"description": "True to darken screen; false to undarken screen."
}
]
},
{
"name": "setSwitchAccessKeys",
"type": "function",
"description": "Change the keyboard keys captured by Switch Access.",
"parameters": [
{
"name": "key_codes",
"type": "array",
"items": {
"type": "integer",
"minimum": 48, // '0' key
"maximum": 90 // 'z' key
},
"description": "The key codes for the keys that will be captured."
}
],
"platforms": ["chromeos"]
},
{
"name": "setSwitchAccessMenuState",
"type": "function",
"description": "Shows or hides the Switch Access menu. If shown, it is at the indicated location.",
"parameters": [
{
"name": "show",
"type": "boolean",
"description": "If true, show the menu. If false, hide the menu."
},
{
"name": "element_bounds",
"$ref": "ScreenRect",
"description": "Position of an element, in global screen coordinates, to place the menu next to."
},
{
"name": "item_count",
"type": "integer",
"description": "The number of items that need to be shown in the menu."
}
],
"platforms": ["chromeos"]
},
{
"name": "forwardKeyEventsToSwitchAccess",
"type": "function",
"description": "When enabled, forwards key events to the Switch Access extension",
"parameters": [
{
"name": "shouldForward",
"type": "boolean"
}
],
"platforms": ["chromeos"]
},
{
"name": "setNativeChromeVoxArcSupportForCurrentApp",
"type": "function",
"description": "Sets current ARC app to use native ARC support.",
"parameters": [
{
"name": "enabled",
"type": "boolean",
"description": "True for ChromeVox (native), false for TalkBack."
}
],
"platforms": ["chromeos"]
},
{
"name": "sendSyntheticKeyEvent",
"type": "function",
"description": "Sends a fabricated key event.",
"parameters": [
{
"name": "keyEvent",
"$ref": "SyntheticKeyboardEvent",
"description": "The event to send."
}
],
"platforms": ["chromeos"]
},
{
"name": "enableChromeVoxMouseEvents",
"type": "function",
"description": "Enables or disables mouse events in ChromeVox.",
"parameters": [
{
"name": "enabled",
"type": "boolean",
"description": "True if ChromeVox should receive mouse events."
}
],
"platforms": ["chromeos"]
},
{
"name": "sendSyntheticMouseEvent",
"type": "function",
"description": "Sends a fabricated mouse event.",
"parameters": [
{
"name": "mouseEvent",
"$ref": "SyntheticMouseEvent",
"description": "The event to send."
}
],
"platforms": ["chromeos"]
},
{
"name": "onSelectToSpeakStateChanged",
"type": "function",
"description": "Called by the Select-to-Speak extension when Select-to-Speak has changed states, between selecting with the mouse, speaking, and inactive.",
"parameters": [
{
"name": "state",
"$ref": "SelectToSpeakState"
}
],
"platforms": ["chromeos"]
},
{
"name": "toggleDictation",
"type": "function",
"description": "Toggles dictation between active and inactive states.",
"parameters": [],
"platforms": ["chromeos"]
},
{
"name": "setVirtualKeyboardVisible",
"type": "function",
"description": "Shows or hides the virtual keyboard.",
"parameters": [
{
"name": "isVisible",
"type": "boolean"
}
],
"platforms": ["chromeos"]
}
],
"events": [
{
"name": "onIntroduceChromeVox",
"type": "function",
"description": "Fired whenever ChromeVox should output introduction."
},
{
"name": "onAccessibilityGesture",
"type": "function",
"description": "Fired when an accessibility gesture is detected by the touch exploration controller.",
"parameters": [
{
"name": "gesture",
"$ref": "Gesture"
}
]
},
{
"name": "onTwoFingerTouchStart",
"type": "function",
"description": "Fired when we first detect two fingers are held down, which can be used to toggle spoken feedback on some touch-only devices.",
"parameters": []
},
{
"name": "onTwoFingerTouchStop",
"type": "function",
"description": "Fired when the user is no longer holding down two fingers (including releasing one, holding down three, or moving them).",
"parameters": []
},
{
"name": "onSelectToSpeakStateChangeRequested",
"type": "function",
"description": "Called when Chrome OS wants to change the Select-to-Speak state, between selecting with the mouse, speaking, and inactive.",
"parameters": [],
"platforms": ["chromeos"]
},
{
"name": "onAnnounceForAccessibility",
"type": "function",
"description": "Called when an internal component within accessibility wants to force speech output for an accessibility extension. Do not use without approval from accessibility owners.",
"parameters": [
{
"name": "announceText",
"type": "array",
"items": { "type": "string" },
"description": "Text to be announced."
}
],
"platforms": ["chromeos"]
}
]
}
]