/
accessibility_features.clj
146 lines (109 loc) · 8.01 KB
/
accessibility_features.clj
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
(ns chromex.app.accessibility-features
"Use the chrome.accessibilityFeatures API to manage Chrome's accessibility features. This API relies on the ChromeSetting
prototype of the type API for getting and setting individual accessibility features. In order to get feature states the
extension must request accessibilityFeatures.read permission. For modifying feature state, the extension needs
accessibilityFeatures.modify permission. Note that accessibilityFeatures.modify does not imply accessibilityFeatures.read
permission.
* available since Chrome 37
* https://developer.chrome.com/apps/accessibilityFeatures"
(:refer-clojure :only [defmacro defn apply declare meta let partial])
(:require [chromex.wrapgen :refer [gen-wrap-helper]]
[chromex.callgen :refer [gen-call-helper gen-tap-all-events-call]]))
(declare api-table)
(declare gen-call)
; -- properties -------------------------------------------------------------------------------------------------------------
(defmacro get-spoken-feedback
"ChromeOS only.Spoken feedback (text-to-speech). The value indicates whether the feature is enabled or not. get() requires
accessibilityFeatures.read permission. set() and clear() require accessibilityFeatures.modify permission.
https://developer.chrome.com/apps/accessibilityFeatures#property-spokenFeedback."
([] (gen-call :property ::spoken-feedback &form)))
(defmacro get-large-cursor
"ChromeOS only.Enlarged cursor. The value indicates whether the feature is enabled or not. get() requires
accessibilityFeatures.read permission. set() and clear() require accessibilityFeatures.modify permission.
https://developer.chrome.com/apps/accessibilityFeatures#property-largeCursor."
([] (gen-call :property ::large-cursor &form)))
(defmacro get-sticky-keys
"ChromeOS only.Sticky modifier keys (like shift or alt). The value indicates whether the feature is enabled or not. get()
requires accessibilityFeatures.read permission. set() and clear() require accessibilityFeatures.modify permission.
https://developer.chrome.com/apps/accessibilityFeatures#property-stickyKeys."
([] (gen-call :property ::sticky-keys &form)))
(defmacro get-high-contrast
"ChromeOS only.High contrast rendering mode. The value indicates whether the feature is enabled or not. get() requires
accessibilityFeatures.read permission. set() and clear() require accessibilityFeatures.modify permission.
https://developer.chrome.com/apps/accessibilityFeatures#property-highContrast."
([] (gen-call :property ::high-contrast &form)))
(defmacro get-screen-magnifier
"ChromeOS only.Full screen magnification. The value indicates whether the feature is enabled or not. get() requires
accessibilityFeatures.read permission. set() and clear() require accessibilityFeatures.modify permission.
https://developer.chrome.com/apps/accessibilityFeatures#property-screenMagnifier."
([] (gen-call :property ::screen-magnifier &form)))
(defmacro get-autoclick
"ChromeOS only.Auto mouse click after mouse stops moving. The value indicates whether the feature is enabled or not. get()
requires accessibilityFeatures.read permission. set() and clear() require accessibilityFeatures.modify permission.
https://developer.chrome.com/apps/accessibilityFeatures#property-autoclick."
([] (gen-call :property ::autoclick &form)))
(defmacro get-virtual-keyboard
"ChromeOS only.Virtual on-screen keyboard. The value indicates whether the feature is enabled or not. get() requires
accessibilityFeatures.read permission. set() and clear() require accessibilityFeatures.modify permission.
https://developer.chrome.com/apps/accessibilityFeatures#property-virtualKeyboard."
([] (gen-call :property ::virtual-keyboard &form)))
(defmacro get-caret-highlight
"ChromeOS only.Caret highlighting. The value indicates whether the feature is enabled or not. get() requires
accessibilityFeatures.read permission. set() and clear() require accessibilityFeatures.modify permission.
https://developer.chrome.com/apps/accessibilityFeatures#property-caretHighlight."
([] (gen-call :property ::caret-highlight &form)))
(defmacro get-cursor-highlight
"ChromeOS only.Cursor highlighting. The value indicates whether the feature is enabled or not. get() requires
accessibilityFeatures.read permission. set() and clear() require accessibilityFeatures.modify permission.
https://developer.chrome.com/apps/accessibilityFeatures#property-cursorHighlight."
([] (gen-call :property ::cursor-highlight &form)))
(defmacro get-focus-highlight
"ChromeOS only.Focus highlighting. The value indicates whether the feature is enabled or not. get() requires
accessibilityFeatures.read permission. set() and clear() require accessibilityFeatures.modify permission.
https://developer.chrome.com/apps/accessibilityFeatures#property-focusHighlight."
([] (gen-call :property ::focus-highlight &form)))
(defmacro get-select-to-speak
"ChromeOS only.Select-to-speak. The value indicates whether the feature is enabled or not. get() requires
accessibilityFeatures.read permission. set() and clear() require accessibilityFeatures.modify permission.
https://developer.chrome.com/apps/accessibilityFeatures#property-selectToSpeak."
([] (gen-call :property ::select-to-speak &form)))
(defmacro get-switch-access
"ChromeOS only.Switch Access. The value indicates whether the feature is enabled or not. get() requires
accessibilityFeatures.read permission. set() and clear() require accessibilityFeatures.modify permission.
https://developer.chrome.com/apps/accessibilityFeatures#property-switchAccess."
([] (gen-call :property ::switch-access &form)))
(defmacro get-animation-policy
"get() requires accessibilityFeatures.read permission. set() and clear() require accessibilityFeatures.modify permission.
https://developer.chrome.com/apps/accessibilityFeatures#property-animationPolicy."
([] (gen-call :property ::animation-policy &form)))
; -- convenience ------------------------------------------------------------------------------------------------------------
(defmacro tap-all-events
"Taps all valid non-deprecated events in chromex.app.accessibility-features namespace."
[chan]
(gen-tap-all-events-call api-table (meta &form) chan))
; ---------------------------------------------------------------------------------------------------------------------------
; -- API TABLE --------------------------------------------------------------------------------------------------------------
; ---------------------------------------------------------------------------------------------------------------------------
(def api-table
{:namespace "chrome.accessibilityFeatures",
:since "37",
:properties
[{:id ::spoken-feedback, :name "spokenFeedback", :return-type "object"}
{:id ::large-cursor, :name "largeCursor", :return-type "object"}
{:id ::sticky-keys, :name "stickyKeys", :return-type "object"}
{:id ::high-contrast, :name "highContrast", :return-type "object"}
{:id ::screen-magnifier, :name "screenMagnifier", :return-type "object"}
{:id ::autoclick, :name "autoclick", :return-type "object"}
{:id ::virtual-keyboard, :name "virtualKeyboard", :return-type "object"}
{:id ::caret-highlight, :name "caretHighlight", :since "51", :return-type "object"}
{:id ::cursor-highlight, :name "cursorHighlight", :since "51", :return-type "object"}
{:id ::focus-highlight, :name "focusHighlight", :since "51", :return-type "object"}
{:id ::select-to-speak, :name "selectToSpeak", :since "51", :return-type "object"}
{:id ::switch-access, :name "switchAccess", :since "51", :return-type "object"}
{:id ::animation-policy, :name "animationPolicy", :since "42", :return-type "object"}]})
; -- helpers ----------------------------------------------------------------------------------------------------------------
; code generation for native API wrapper
(defmacro gen-wrap [kind item-id config & args]
(apply gen-wrap-helper api-table kind item-id config args))
; code generation for API call-site
(def gen-call (partial gen-call-helper api-table))