• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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_ACCESSIBILITY_DELEGATE_H_
6 #define ASH_ACCESSIBILITY_DELEGATE_H_
7 
8 #include "ash/ash_export.h"
9 #include "ash/magnifier/magnifier_constants.h"
10 #include "base/time/time.h"
11 
12 namespace ash {
13 
14 enum AccessibilityNotificationVisibility {
15   A11Y_NOTIFICATION_NONE,
16   A11Y_NOTIFICATION_SHOW,
17 };
18 
19 enum AccessibilityAlert {
20   A11Y_ALERT_NONE,
21   A11Y_ALERT_WINDOW_NEEDED,
22   A11Y_ALERT_WINDOW_OVERVIEW_MODE_ENTERED
23 };
24 
25 // A delegate class to control and query accessibility features.
26 class ASH_EXPORT AccessibilityDelegate {
27  public:
~AccessibilityDelegate()28   virtual ~AccessibilityDelegate() {}
29 
30   // Invoked to toggle spoken feedback for accessibility
31   virtual void ToggleSpokenFeedback(
32       AccessibilityNotificationVisibility notify) = 0;
33 
34   // Returns true if spoken feedback is enabled.
35   virtual bool IsSpokenFeedbackEnabled() const = 0;
36 
37   // Invoked to toggle high contrast mode for accessibility.
38   virtual void ToggleHighContrast() = 0;
39 
40   // Returns true if high contrast mode is enabled.
41   virtual bool IsHighContrastEnabled() const = 0;
42 
43   // Invoked to enable the screen magnifier.
44   virtual void SetMagnifierEnabled(bool enabled) = 0;
45 
46   // Invoked to change the type of the screen magnifier.
47   virtual void SetMagnifierType(MagnifierType type) = 0;
48 
49   // Returns true if the screen magnifier is enabled.
50   virtual bool IsMagnifierEnabled() const = 0;
51 
52   // Returns the current screen magnifier mode.
53   virtual MagnifierType GetMagnifierType() const = 0;
54 
55   // Invoked to enable Large Cursor.
56   virtual void SetLargeCursorEnabled(bool enabled) = 0;
57 
58   // Returns ture if Large Cursor is enabled.
59   virtual bool IsLargeCursorEnabled() const = 0;
60 
61   // Invoked to enable autoclick.
62   virtual void SetAutoclickEnabled(bool enabled) = 0;
63 
64   // Returns if autoclick is enabled or not.
65   virtual bool IsAutoclickEnabled() const = 0;
66 
67   // Invoked to enable or disable the a11y on-screen keyboard.
68   virtual void SetVirtualKeyboardEnabled(bool enabled) = 0;
69 
70   // Returns if the a11y virtual keyboard is enabled.
71   virtual bool IsVirtualKeyboardEnabled() const = 0;
72 
73   // Returns true when the accessibility menu should be shown.
74   virtual bool ShouldShowAccessibilityMenu() const = 0;
75 
76   // Returns true if a braille display is connected to the system.
77   virtual bool IsBrailleDisplayConnected() const = 0;
78 
79   // Cancel all current and queued speech immediately.
80   virtual void SilenceSpokenFeedback() const = 0;
81 
82   // Saves the zoom scale of the full screen magnifier.
83   virtual void SaveScreenMagnifierScale(double scale) = 0;
84 
85   // Gets a saved value of the zoom scale of full screen magnifier. If a value
86   // is not saved, return a negative value.
87   virtual double GetSavedScreenMagnifierScale() = 0;
88 
89   // Triggers an accessibility alert to give the user feedback.
90   virtual void TriggerAccessibilityAlert(AccessibilityAlert alert) = 0;
91 
92   // Gets the last accessibility alert that was triggered.
93   virtual AccessibilityAlert GetLastAccessibilityAlert() = 0;
94 
95   // Plays an earcon. Earcons are brief and distinctive sounds that indicate
96   // when their mapped event has occurred. The sound key enums can be found in
97   // chromeos/audio/chromeos_sounds.h.
98   virtual void PlayEarcon(int sound_key) = 0;
99 
100   // Initiates play of shutdown sound and returns it's duration.
101   virtual base::TimeDelta PlayShutdownSound() const = 0;
102 };
103 
104 }  // namespace ash
105 
106 #endif  // ASH_ACCESSIBILITY_DELEGATE_H_
107