1 // Copyright (c) 2012 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 UI_BASE_ACCESSIBILITY_ACCESSIBILITY_TYPES_H_ 6 #define UI_BASE_ACCESSIBILITY_ACCESSIBILITY_TYPES_H_ 7 8 #include "base/basictypes.h" 9 10 namespace ui { 11 12 //////////////////////////////////////////////////////////////////////////////// 13 // 14 // AccessibilityTypes 15 // 16 // Provides enumerations used to preserve platform-independence in 17 // accessibility functions. 18 // 19 //////////////////////////////////////////////////////////////////////////////// 20 class AccessibilityTypes { 21 public: 22 23 // This defines states of the supported accessibility roles in our 24 // Views (e.g. used in View::GetAccessibleState). Any interface using states 25 // must provide a conversion to its own states (see e.g. 26 // NativeViewAccessibilityWin::get_accState). 27 typedef uint32 State; 28 enum StateFlag { 29 STATE_CHECKED = 1 << 0, 30 STATE_COLLAPSED = 1 << 1, 31 STATE_DEFAULT = 1 << 2, 32 STATE_EDITABLE = 1 << 3, 33 STATE_EXPANDED = 1 << 4, 34 STATE_FOCUSED = 1 << 5, 35 STATE_HASPOPUP = 1 << 6, 36 STATE_HOTTRACKED = 1 << 7, 37 STATE_INVISIBLE = 1 << 8, 38 STATE_LINKED = 1 << 9, 39 STATE_OFFSCREEN = 1 << 10, 40 STATE_PRESSED = 1 << 11, 41 STATE_PROTECTED = 1 << 12, 42 STATE_READONLY = 1 << 13, 43 STATE_SELECTED = 1 << 14, 44 STATE_UNAVAILABLE = 1 << 15 45 }; 46 47 // This defines an enumeration of the supported accessibility roles in our 48 // Views (e.g. used in View::GetAccessibleRole). Any interface using roles 49 // must provide a conversion to its own roles (see e.g. 50 // NativeViewAccessibilityWin::get_accRole). 51 enum Role { 52 ROLE_ALERT, 53 ROLE_APPLICATION, 54 ROLE_BUTTONDROPDOWN, 55 ROLE_BUTTONMENU, 56 ROLE_CHECKBUTTON, 57 ROLE_CLIENT, 58 ROLE_COMBOBOX, 59 ROLE_DIALOG, 60 ROLE_GRAPHIC, 61 ROLE_GROUPING, 62 ROLE_LINK, 63 ROLE_LOCATION_BAR, 64 ROLE_MENUBAR, 65 ROLE_MENUITEM, 66 ROLE_MENUPOPUP, 67 ROLE_OUTLINE, 68 ROLE_OUTLINEITEM, 69 ROLE_PAGETAB, 70 ROLE_PAGETABLIST, 71 ROLE_PANE, 72 ROLE_PROGRESSBAR, 73 ROLE_PUSHBUTTON, 74 ROLE_RADIOBUTTON, 75 ROLE_SCROLLBAR, 76 ROLE_SEPARATOR, 77 ROLE_SLIDER, 78 ROLE_STATICTEXT, 79 ROLE_TEXT, 80 ROLE_TITLEBAR, 81 ROLE_TOOLBAR, 82 ROLE_WINDOW 83 }; 84 85 // This defines an enumeration of the supported accessibility events in our 86 // Views (e.g. used in View::NotifyAccessibilityEvent). Any interface using 87 // events must provide a conversion to its own events (see e.g. 88 // ViewAccessibility::MSAAEvent). 89 enum Event { 90 EVENT_ALERT, 91 EVENT_FOCUS, 92 EVENT_MENUSTART, 93 EVENT_MENUEND, 94 EVENT_MENUPOPUPSTART, 95 EVENT_MENUPOPUPEND, 96 EVENT_NAME_CHANGED, 97 EVENT_TEXT_CHANGED, 98 EVENT_SELECTION_CHANGED, 99 EVENT_VALUE_CHANGED 100 }; 101 102 private: 103 // Do not instantiate this class. 104 AccessibilityTypes() {} 105 ~AccessibilityTypes() {} 106 }; 107 108 } // namespace ui 109 110 #endif // UI_BASE_ACCESSIBILITY_ACCESSIBILITY_TYPES_H_ 111