OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2006-2008 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 WEBKIT_GLUE_WEBACCESSIBILITY_H_ |
| 6 #define WEBKIT_GLUE_WEBACCESSIBILITY_H_ |
| 7 |
| 8 #include "base/string16.h" |
| 9 |
| 10 namespace webkit_glue { |
| 11 |
| 12 class WebAccessibility { |
| 13 public: |
| 14 // This defines an enumeration of IDs that can uniquely identify a call to a |
| 15 // specific accessibility information function. Should match the support |
| 16 // implemented in WebKit and GlueAccessibilityObject (functions marked with |
| 17 // return value E_NOTIMPL in WebKit are also excluded). |
| 18 enum Function { |
| 19 FUNCTION_NONE = 0, |
| 20 |
| 21 // Supported accessibility information retrieval functions. |
| 22 FUNCTION_DODEFAULTACTION, |
| 23 FUNCTION_HITTEST, |
| 24 FUNCTION_LOCATION, |
| 25 FUNCTION_NAVIGATE, |
| 26 FUNCTION_GETCHILD, |
| 27 FUNCTION_CHILDCOUNT, |
| 28 FUNCTION_DEFAULTACTION, |
| 29 FUNCTION_DESCRIPTION, |
| 30 FUNCTION_GETFOCUSEDCHILD, |
| 31 FUNCTION_HELPTEXT, |
| 32 FUNCTION_KEYBOARDSHORTCUT, |
| 33 FUNCTION_NAME, |
| 34 FUNCTION_GETPARENT, |
| 35 FUNCTION_ROLE, |
| 36 FUNCTION_STATE, |
| 37 FUNCTION_VALUE |
| 38 |
| 39 // The deprecated put_accName and put_accValue (IAccessible) are not |
| 40 // supported here, nor is accSelect, get_accHelpTopic and get_accSelection |
| 41 // (matching WebKit's support for IAccessible). |
| 42 }; |
| 43 |
| 44 // This defines an enumeration of navigation directions based on (but |
| 45 // independent of) the MSAA Navigation Constants. However, to avoid the use of |
| 46 // COM in our Glue layer, we use this as a substitute with a one-to-one |
| 47 // conversion between Browser side (has COM) and Glue. |
| 48 enum Direction { |
| 49 DIRECTION_NONE = 0, |
| 50 |
| 51 // Valid directions. |
| 52 DIRECTION_UP, |
| 53 DIRECTION_DOWN, |
| 54 DIRECTION_LEFT, |
| 55 DIRECTION_RIGHT, |
| 56 DIRECTION_NEXT, |
| 57 DIRECTION_PREVIOUS, |
| 58 DIRECTION_FIRSTCHILD, |
| 59 DIRECTION_LASTCHILD |
| 60 }; |
| 61 |
| 62 // This defines an enumeration of the supported accessibility roles in our |
| 63 // Glue layer (used in GlueAccessibilityObject::Role). Any interface using |
| 64 // roles must provide a conversion to its own roles (see e.g. |
| 65 // BrowserAccessibility::get_accRole and BrowserAccessibility::MSAARole). |
| 66 enum Role { |
| 67 ROLE_PUSHBUTTON, |
| 68 ROLE_RADIOBUTTON, |
| 69 ROLE_CHECKBUTTON, |
| 70 ROLE_SLIDER, |
| 71 ROLE_PAGETABLIST, |
| 72 ROLE_TEXT, |
| 73 ROLE_STATICTEXT, |
| 74 ROLE_OUTLINE, |
| 75 ROLE_COLUMN, |
| 76 ROLE_ROW, |
| 77 ROLE_GROUPING, |
| 78 ROLE_LIST, |
| 79 ROLE_TABLE, |
| 80 ROLE_LINK, |
| 81 ROLE_GRAPHIC, |
| 82 ROLE_CLIENT |
| 83 }; |
| 84 |
| 85 // This defines an enumeration of the supported accessibility states in our |
| 86 // Glue layer (used in GlueAccessibilityObject::State). Any interface using |
| 87 // states must provide a conversion to its own states (see e.g. |
| 88 // BrowserAccessibility::get_accState and BrowserAccessibility::MSAAState). |
| 89 enum State { |
| 90 STATE_LINKED, |
| 91 STATE_HOTTRACKED, |
| 92 STATE_UNAVAILABLE, |
| 93 STATE_READONLY, |
| 94 STATE_OFFSCREEN, |
| 95 STATE_MULTISELECTABLE, |
| 96 STATE_PROTECTED, |
| 97 STATE_INDETERMINATE, |
| 98 STATE_CHECKED, |
| 99 STATE_PRESSED, |
| 100 STATE_FOCUSED, |
| 101 STATE_TRAVERSED, |
| 102 STATE_FOCUSABLE |
| 103 }; |
| 104 |
| 105 // Parameters structure to hold a union of the possible accessibility function |
| 106 // INPUT variables, with the unused fields always set to default value. Used |
| 107 // in ViewMsg_GetAccessibilityInfo, as only parameter. |
| 108 struct InParams { |
| 109 // Identifier to uniquely distinguish which instance of accessibility |
| 110 // information is being called upon on the renderer side. |
| 111 int object_id; |
| 112 |
| 113 // Identifier to resolve which accessibility information retrieval function |
| 114 // is being called. |
| 115 int function_id; |
| 116 |
| 117 // Id of accessible child, whose information is being requested. |
| 118 int child_id; |
| 119 |
| 120 // LONG input parameters, used differently depending on the function called. |
| 121 long input_long1; |
| 122 long input_long2; |
| 123 }; |
| 124 |
| 125 // Parameters structure to hold a union of the possible accessibility function |
| 126 // OUTPUT variables, with the unused fields always set to default value. Used |
| 127 // in ViewHostMsg_GetAccessibilityInfoResponse, as only parameter. |
| 128 struct OutParams { |
| 129 // Identifier to uniquely distinguish which instance of accessibility |
| 130 // information is being called upon on the renderer side. |
| 131 int object_id; |
| 132 |
| 133 // LONG output parameters, used differently depending on the function |
| 134 // called. [output_long1] can in some cases be set to -1 to indicate that |
| 135 // the child object found by the called IAccessible function is not a simple |
| 136 // object. |
| 137 long output_long1; |
| 138 long output_long2; |
| 139 long output_long3; |
| 140 long output_long4; |
| 141 |
| 142 // String output parameter. |
| 143 string16 output_string; |
| 144 |
| 145 // Return code, either true (MSAA S_OK) or false (MSAA S_FALSE). |
| 146 // Interface-specific error return codes (e.g. MSAA's E_POINTER, |
| 147 // E_INVALIDARG, E_FAIL, E_NOTIMPL) must be handled on the browser side by |
| 148 // input validation. |
| 149 bool return_code; |
| 150 }; |
| 151 }; |
| 152 |
| 153 } // namespace webkit_glue |
| 154 |
| 155 #endif // WEBKIT_GLUE_WEBACCESSIBILITY_H_ |
OLD | NEW |