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 }; 23 24 // A deletate class to control accessibility features. 25 class ASH_EXPORT AccessibilityDelegate { 26 public: 27 virtual ~AccessibilityDelegate() {} 28 29 // Invoked to toggle spoken feedback for accessibility 30 virtual void ToggleSpokenFeedback( 31 AccessibilityNotificationVisibility notify) = 0; 32 33 // Returns true if spoken feedback is enabled. 34 virtual bool IsSpokenFeedbackEnabled() const = 0; 35 36 // Invoked to toggle high contrast mode for accessibility. 37 virtual void ToggleHighContrast() = 0; 38 39 // Returns true if high contrast mode is enabled. 40 virtual bool IsHighContrastEnabled() const = 0; 41 42 // Invoked to enable the screen magnifier. 43 virtual void SetMagnifierEnabled(bool enabled) = 0; 44 45 // Invoked to change the type of the screen magnifier. 46 virtual void SetMagnifierType(MagnifierType type) = 0; 47 48 // Returns true if the screen magnifier is enabled or not. 49 virtual bool IsMagnifierEnabled() const = 0; 50 51 // Returns the current screen magnifier mode. 52 virtual MagnifierType GetMagnifierType() const = 0; 53 54 // Invoked to enable Large Cursor. 55 virtual void SetLargeCursorEnabled(bool enabled) = 0; 56 57 // Returns ture if Large Cursor is enabled or not. 58 virtual bool IsLargeCursorEnabled() const = 0; 59 60 // Invoked to enable autoclick. 61 virtual void SetAutoclickEnabled(bool enabled) = 0; 62 63 // Returns if autoclick is enabled or not. 64 virtual bool IsAutoclickEnabled() const = 0; 65 66 // Returns true when the accessibility menu should be shown. 67 virtual bool ShouldShowAccessibilityMenu() const = 0; 68 69 // Cancel all current and queued speech immediately. 70 virtual void SilenceSpokenFeedback() const = 0; 71 72 // Saves the zoom scale of the full screen magnifier. 73 virtual void SaveScreenMagnifierScale(double scale) = 0; 74 75 // Gets a saved value of the zoom scale of full screen magnifier. If a value 76 // is not saved, return a negative value. 77 virtual double GetSavedScreenMagnifierScale() = 0; 78 79 // Triggers an accessibility alert to give the user feedback. 80 virtual void TriggerAccessibilityAlert(AccessibilityAlert alert) = 0; 81 82 // Gets the last accessibility alert that was triggered. 83 virtual AccessibilityAlert GetLastAccessibilityAlert() = 0; 84 85 // Initiates play of shutdown sound and returns it's duration. 86 virtual base::TimeDelta PlayShutdownSound() const = 0; 87 }; 88 89 } // namespace ash 90 91 #endif // ASH_ACCESSIBILITYDELEGATE_H_ 92