OLD | NEW |
| (Empty) |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef ASH_COMMON_ACCESSIBILITY_DELEGATE_H_ | |
6 #define ASH_COMMON_ACCESSIBILITY_DELEGATE_H_ | |
7 | |
8 #include "ash/ash_export.h" | |
9 #include "ash/common/accessibility_types.h" | |
10 #include "base/time/time.h" | |
11 #include "ui/accessibility/ax_enums.h" | |
12 | |
13 namespace ash { | |
14 | |
15 // A delegate class to control and query accessibility features. | |
16 class ASH_EXPORT AccessibilityDelegate { | |
17 public: | |
18 virtual ~AccessibilityDelegate() {} | |
19 | |
20 // Invoked to toggle spoken feedback for accessibility | |
21 virtual void ToggleSpokenFeedback( | |
22 AccessibilityNotificationVisibility notify) = 0; | |
23 | |
24 // Returns true if spoken feedback is enabled. | |
25 virtual bool IsSpokenFeedbackEnabled() const = 0; | |
26 | |
27 // Invoked to toggle high contrast mode for accessibility. | |
28 virtual void ToggleHighContrast() = 0; | |
29 | |
30 // Returns true if high contrast mode is enabled. | |
31 virtual bool IsHighContrastEnabled() const = 0; | |
32 | |
33 // Invoked to enable the screen magnifier. | |
34 virtual void SetMagnifierEnabled(bool enabled) = 0; | |
35 | |
36 // Invoked to change the type of the screen magnifier. | |
37 virtual void SetMagnifierType(MagnifierType type) = 0; | |
38 | |
39 // Returns true if the screen magnifier is enabled. | |
40 virtual bool IsMagnifierEnabled() const = 0; | |
41 | |
42 // Returns the current screen magnifier mode. | |
43 virtual MagnifierType GetMagnifierType() const = 0; | |
44 | |
45 // Invoked to enable Large Cursor. | |
46 virtual void SetLargeCursorEnabled(bool enabled) = 0; | |
47 | |
48 // Returns true if Large Cursor is enabled. | |
49 virtual bool IsLargeCursorEnabled() const = 0; | |
50 | |
51 // Invoked to enable autoclick. | |
52 virtual void SetAutoclickEnabled(bool enabled) = 0; | |
53 | |
54 // Returns if autoclick is enabled or not. | |
55 virtual bool IsAutoclickEnabled() const = 0; | |
56 | |
57 // Invoked to enable or disable the a11y on-screen keyboard. | |
58 virtual void SetVirtualKeyboardEnabled(bool enabled) = 0; | |
59 | |
60 // Returns if the a11y virtual keyboard is enabled. | |
61 virtual bool IsVirtualKeyboardEnabled() const = 0; | |
62 | |
63 // Invoked to enable or disable the mono audio output. | |
64 virtual void SetMonoAudioEnabled(bool enabled) = 0; | |
65 | |
66 // Returns if the mono audio output is enabled. | |
67 virtual bool IsMonoAudioEnabled() const = 0; | |
68 | |
69 // Invoked to enable or disable caret highlighting. | |
70 virtual void SetCaretHighlightEnabled(bool enabled) = 0; | |
71 | |
72 // Returns if caret highlighting is enabled. | |
73 virtual bool IsCaretHighlightEnabled() const = 0; | |
74 | |
75 // Invoked to enable or disable cursor highlighting. | |
76 virtual void SetCursorHighlightEnabled(bool enabled) = 0; | |
77 | |
78 // Returns if cursor highlighting is enabled. | |
79 virtual bool IsCursorHighlightEnabled() const = 0; | |
80 | |
81 // Invoked to enable or disable focus highlighting. | |
82 virtual void SetFocusHighlightEnabled(bool enabled) = 0; | |
83 | |
84 // Returns if focus highlighting is enabled. | |
85 virtual bool IsFocusHighlightEnabled() const = 0; | |
86 | |
87 // Invoked to enable or disable select-to-speak. | |
88 virtual void SetSelectToSpeakEnabled(bool enabled) = 0; | |
89 | |
90 // Returns if select-to-speak is enabled. | |
91 virtual bool IsSelectToSpeakEnabled() const = 0; | |
92 | |
93 // Invoked to enable or disable switch access. | |
94 virtual void SetSwitchAccessEnabled(bool enabled) = 0; | |
95 | |
96 // Returns if switch access is enabled. | |
97 virtual bool IsSwitchAccessEnabled() const = 0; | |
98 | |
99 // Returns true when the accessibility menu should be shown. | |
100 virtual bool ShouldShowAccessibilityMenu() const = 0; | |
101 | |
102 // Returns true if a braille display is connected to the system. | |
103 virtual bool IsBrailleDisplayConnected() const = 0; | |
104 | |
105 // Cancel all current and queued speech immediately. | |
106 virtual void SilenceSpokenFeedback() const = 0; | |
107 | |
108 // Clear the focus highlight | |
109 virtual void ClearFocusHighlight() const = 0; | |
110 | |
111 // Saves the zoom scale of the full screen magnifier. | |
112 virtual void SaveScreenMagnifierScale(double scale) = 0; | |
113 | |
114 // Gets a saved value of the zoom scale of full screen magnifier. If a value | |
115 // is not saved, return a negative value. | |
116 virtual double GetSavedScreenMagnifierScale() = 0; | |
117 | |
118 // Triggers an accessibility alert to give the user feedback. | |
119 virtual void TriggerAccessibilityAlert(AccessibilityAlert alert) = 0; | |
120 | |
121 // Gets the last accessibility alert that was triggered. | |
122 virtual AccessibilityAlert GetLastAccessibilityAlert() = 0; | |
123 | |
124 // Whether or not to enable toggling spoken feedback via holding down | |
125 // two fingers on the screen. | |
126 virtual bool ShouldToggleSpokenFeedbackViaTouch() = 0; | |
127 | |
128 // Play tick sound indicating spoken feedback will be toggled after countdown. | |
129 virtual void PlaySpokenFeedbackToggleCountdown(int tick_count) = 0; | |
130 | |
131 // Plays an earcon. Earcons are brief and distinctive sounds that indicate | |
132 // when their mapped event has occurred. The sound key enums can be found in | |
133 // chromeos/audio/chromeos_sounds.h. | |
134 virtual void PlayEarcon(int sound_key) = 0; | |
135 | |
136 // Initiates play of shutdown sound and returns it's duration. | |
137 virtual base::TimeDelta PlayShutdownSound() const = 0; | |
138 | |
139 // Forward an accessibility gesture from the touch exploration controller to | |
140 // ChromeVox. | |
141 virtual void HandleAccessibilityGesture(ui::AXGesture gesture) = 0; | |
142 }; | |
143 | |
144 } // namespace ash | |
145 | |
146 #endif // ASH_COMMON_ACCESSIBILITY_DELEGATE_H_ | |
OLD | NEW |