merge the formfield patch from ooo-build
[ooovba.git] / toolkit / test / accessibility / tools / NameProvider.java
blob5b1d5a01b329d30d598112c7413db4fc5890a068
1 package tools;
3 import java.util.HashMap;
4 import com.sun.star.accessibility.AccessibleStateType;
5 import com.sun.star.accessibility.AccessibleEventId;
6 import com.sun.star.accessibility.AccessibleRole;
7 import com.sun.star.accessibility.AccessibleRelationType;
10 /** Provide names for several accessibility constants groups.
12 public class NameProvider
14 /** Return the name of the specified state.
15 @param nStateId
16 Id of the state for which to return its name. This is one of
17 the ids listed in the <type>AccessibleStateType</const>
18 constants group.
19 @return
20 Returns the name of the specified state or an empty string if an
21 invalid / unknown state id was given.
23 public static String getStateName (int nStateId)
25 return (String)maStateMap.get (new Integer(nStateId));
29 /** Return the name of the specified event.
30 @param nEventId
31 Id of the event type for which to return its name. This is one
32 of the ids listed in the <type>AccessibleEventId</const>
33 constants group.
34 @return
35 Returns the name of the specified event type or an empty string
36 if an invalid / unknown event id was given.
38 public static String getEventName (int nEventId)
40 return (String)maEventMap.get (new Integer(nEventId));
44 /** Return the name of the specified role.
45 @param nRole
46 Id of the role for which to return its name. This is one of
47 the ids listed in the <type>AccessibleRole</const>
48 constants group.
49 @return
50 Returns the name of the specified role or an empty string if an
51 invalid / unknown role id was given.
53 public static String getRoleName (int nRole)
55 return (String)maRoleMap.get (new Integer(nRole));
59 /** Return the name of the specified relation.
60 @param nRelation
61 Id of the relation for which to return its name. This is one of
62 the ids listed in the <type>AccessibleRelationType</const>
63 constants group.
64 @return
65 Returns the name of the specified relation type or an empty
66 string if an invalid / unknown role id was given.
68 public static String getRelationName (int nRelation)
70 return (String)maRelationMap.get (new Integer(nRelation));
74 private static HashMap maStateMap = new HashMap();
75 private static HashMap maEventMap = new HashMap();
76 private static HashMap maRoleMap = new HashMap();
77 private static HashMap maRelationMap = new HashMap();
79 static {
80 maStateMap.put (new Integer (AccessibleStateType.INVALID), "INVALID");
81 maStateMap.put (new Integer (AccessibleStateType.ACTIVE), "ACTIVE");
82 maStateMap.put (new Integer (AccessibleStateType.ARMED), "ARMED");
83 maStateMap.put (new Integer (AccessibleStateType.BUSY), "BUSY");
84 maStateMap.put (new Integer (AccessibleStateType.CHECKED), "CHECKED");
85 // maStateMap.put (new Integer (AccessibleStateType.COLLAPSED), "COLLAPSED");
86 maStateMap.put (new Integer (AccessibleStateType.DEFUNC), "DEFUNC");
87 maStateMap.put (new Integer (AccessibleStateType.EDITABLE), "EDITABLE");
88 maStateMap.put (new Integer (AccessibleStateType.ENABLED), "ENABLED");
89 maStateMap.put (new Integer (AccessibleStateType.EXPANDABLE), "EXPANDABLE");
90 maStateMap.put (new Integer (AccessibleStateType.EXPANDED), "EXPANDED");
91 maStateMap.put (new Integer (AccessibleStateType.FOCUSABLE), "FOCUSABLE");
92 maStateMap.put (new Integer (AccessibleStateType.FOCUSED), "FOCUSED");
93 maStateMap.put (new Integer (AccessibleStateType.HORIZONTAL), "HORIZONTAL");
94 maStateMap.put (new Integer (AccessibleStateType.ICONIFIED), "ICONIFIED");
95 maStateMap.put (new Integer (AccessibleStateType.MODAL), "MODAL");
96 maStateMap.put (new Integer (AccessibleStateType.MULTI_LINE), "MULTI_LINE");
97 maStateMap.put (new Integer (AccessibleStateType.MULTI_SELECTABLE), "MULTI_SELECTABLE");
98 maStateMap.put (new Integer (AccessibleStateType.OPAQUE), "OPAQUE");
99 maStateMap.put (new Integer (AccessibleStateType.PRESSED), "PRESSED");
100 maStateMap.put (new Integer (AccessibleStateType.RESIZABLE), "RESIZABLE");
101 maStateMap.put (new Integer (AccessibleStateType.SELECTABLE), "SELECTABLE");
102 maStateMap.put (new Integer (AccessibleStateType.SELECTED), "SELECTED");
103 maStateMap.put (new Integer (AccessibleStateType.SENSITIVE), "SENSITIVE");
104 maStateMap.put (new Integer (AccessibleStateType.SHOWING), "SHOWING");
105 maStateMap.put (new Integer (AccessibleStateType.SINGLE_LINE), "SINGLE_LINE");
106 maStateMap.put (new Integer (AccessibleStateType.STALE), "STALE");
107 maStateMap.put (new Integer (AccessibleStateType.TRANSIENT), "TRANSIENT");
108 maStateMap.put (new Integer (AccessibleStateType.VERTICAL), "VERTICAL");
109 maStateMap.put (new Integer (AccessibleStateType.VISIBLE), "VISIBLE");
110 maStateMap.put (new Integer (AccessibleStateType.MANAGES_DESCENDANTS),
111 "MANAGES_DESCENDANTS");
112 // maStateMap.put (new Integer (AccessibleStateType.INCONSISTENT),"INCONSISTENT");
115 maEventMap.put (new Integer (0),
116 "[UNKNOWN]");
117 maEventMap.put (new Integer (AccessibleEventId.NAME_CHANGED),
118 "NAME_CHANGED");
119 maEventMap.put (new Integer (AccessibleEventId.DESCRIPTION_CHANGED),
120 "DESCRIPTION_CHANGED");
121 maEventMap.put (new Integer (AccessibleEventId.ACTION_CHANGED),
122 "ACTION_CHANGED");
123 maEventMap.put (new Integer (AccessibleEventId.STATE_CHANGED),
124 "STATE_CHANGED");
125 maEventMap.put (new Integer (AccessibleEventId.ACTIVE_DESCENDANT_CHANGED),
126 "ACTIVE_DESCENDANT_CHANGED");
127 maEventMap.put (new Integer (AccessibleEventId.BOUNDRECT_CHANGED),
128 "BOUNDRECT_CHANGED");
129 maEventMap.put (new Integer (AccessibleEventId.CHILD),
130 "CHILD");
131 maEventMap.put (new Integer (AccessibleEventId.INVALIDATE_ALL_CHILDREN),
132 "INVALIDATE_ALL_CHILDREN");
133 maEventMap.put (new Integer (AccessibleEventId.SELECTION_CHANGED),
134 "SELECTION_CHANGED");
135 maEventMap.put (new Integer (AccessibleEventId.VISIBLE_DATA_CHANGED),
136 "VISIBLE_DATA_CHANGED");
137 maEventMap.put (new Integer (AccessibleEventId.VALUE_CHANGED),
138 "VALUE_CHANGED");
139 maEventMap.put (new Integer (AccessibleEventId.CONTENT_FLOWS_FROM_RELATION_CHANGED),
140 "CONTENT_FLOWS_FROM_RELATION_CHANGED");
141 maEventMap.put (new Integer (AccessibleEventId.CONTENT_FLOWS_TO_RELATION_CHANGED),
142 "CONTENT_FLOWS_TO_RELATION_CHANGED");
143 maEventMap.put (new Integer (AccessibleEventId.CONTROLLED_BY_RELATION_CHANGED),
144 "CONTROLLED_BY_RELATION_CHANGED");
145 maEventMap.put (new Integer (AccessibleEventId.CONTROLLER_FOR_RELATION_CHANGED),
146 "CONTROLLER_FOR_RELATION_CHANGED");
147 maEventMap.put (new Integer (AccessibleEventId.LABEL_FOR_RELATION_CHANGED),
148 "LABEL_FOR_RELATION_CHANGED");
149 maEventMap.put (new Integer (AccessibleEventId.LABELED_BY_RELATION_CHANGED),
150 "LABELED_BY_RELATION_CHANGED");
151 maEventMap.put (new Integer (AccessibleEventId.MEMBER_OF_RELATION_CHANGED),
152 "MEMBER_OF_RELATION_CHANGED");
153 maEventMap.put (new Integer (AccessibleEventId.SUB_WINDOW_OF_RELATION_CHANGED),
154 "SUB_WINDOW_OF_RELATION_CHANGED");
155 maEventMap.put (new Integer (AccessibleEventId.CARET_CHANGED),
156 "CARET_CHANGED");
157 maEventMap.put (new Integer (AccessibleEventId.TEXT_SELECTION_CHANGED),
158 "TEXT_SELECTION_CHANGED");
159 maEventMap.put (new Integer (AccessibleEventId.TEXT_CHANGED),
160 "TEXT_CHANGED");
161 maEventMap.put (new Integer (AccessibleEventId.TEXT_ATTRIBUTE_CHANGED),
162 "TEXT_ATTRIBUTE_CHANGED");
163 maEventMap.put (new Integer (AccessibleEventId.HYPERTEXT_CHANGED),
164 "HYPERTEXT_CHANGED");
165 maEventMap.put (new Integer (AccessibleEventId.TABLE_CAPTION_CHANGED),
166 "TABLE_CAPTION_CHANGED");
167 maEventMap.put (new Integer (AccessibleEventId.TABLE_COLUMN_DESCRIPTION_CHANGED),
168 "TABLE_COLUMN_DESCRIPTION_CHANGED");
169 maEventMap.put (new Integer (AccessibleEventId.TABLE_COLUMN_HEADER_CHANGED),
170 "TABLE_COLUMN_HEADER_CHANGED");
171 maEventMap.put (new Integer (AccessibleEventId.TABLE_MODEL_CHANGED),
172 "TABLE_MODEL_CHANGED");
173 maEventMap.put (new Integer (AccessibleEventId.TABLE_ROW_DESCRIPTION_CHANGED),
174 "TABLE_ROW_DESCRIPTION_CHANGED");
175 maEventMap.put (new Integer (AccessibleEventId.TABLE_ROW_HEADER_CHANGED),
176 "TABLE_ROW_HEADER_CHANGED");
177 maEventMap.put (new Integer (AccessibleEventId.TABLE_SUMMARY_CHANGED),
178 "TABLE_SUMMARY_CHANGED");
180 maRoleMap.put (new Integer(AccessibleRole.UNKNOWN), "UNKNOWN");
181 maRoleMap.put (new Integer (AccessibleRole.UNKNOWN), "UNKNOWN");
182 maRoleMap.put (new Integer (AccessibleRole.ALERT), "ALERT");
183 maRoleMap.put (new Integer (AccessibleRole.COLUMN_HEADER), "COLUMN_HEADER");
184 maRoleMap.put (new Integer (AccessibleRole.CANVAS), "CANVAS");
185 maRoleMap.put (new Integer (AccessibleRole.CHECK_BOX), "CHECK_BOX");
186 maRoleMap.put (new Integer (AccessibleRole.CHECK_MENU_ITEM), "CHECK_MENU_ITEM");
187 maRoleMap.put (new Integer (AccessibleRole.COLOR_CHOOSER), "COLOR_CHOOSER");
188 maRoleMap.put (new Integer (AccessibleRole.COMBO_BOX), "COMBO_BOX");
189 maRoleMap.put (new Integer (AccessibleRole.DESKTOP_ICON), "DESKTOP_ICON");
190 maRoleMap.put (new Integer (AccessibleRole.DESKTOP_PANE), "DESKTOP_PANE");
191 maRoleMap.put (new Integer (AccessibleRole.DIRECTORY_PANE), "DIRECTORY_PANE");
192 maRoleMap.put (new Integer (AccessibleRole.DIALOG), "DIALOG");
193 maRoleMap.put (new Integer (AccessibleRole.DOCUMENT), "DOCUMENT");
194 maRoleMap.put (new Integer (AccessibleRole.EMBEDDED_OBJECT), "EMBEDDED_OBJECT");
195 maRoleMap.put (new Integer (AccessibleRole.END_NOTE), "END_NOTE");
196 maRoleMap.put (new Integer (AccessibleRole.FILE_CHOOSER), "FILE_CHOOSER");
197 maRoleMap.put (new Integer (AccessibleRole.FILLER), "FILLER");
198 maRoleMap.put (new Integer (AccessibleRole.FONT_CHOOSER), "FONT_CHOOSER");
199 maRoleMap.put (new Integer (AccessibleRole.FOOTER), "FOOTER");
200 maRoleMap.put (new Integer (AccessibleRole.FOOTNOTE), "FOOTNOTE");
201 maRoleMap.put (new Integer (AccessibleRole.FRAME), "FRAME");
202 maRoleMap.put (new Integer (AccessibleRole.GLASS_PANE), "GLASS_PANE");
203 maRoleMap.put (new Integer (AccessibleRole.GRAPHIC), "GRAPHIC");
204 maRoleMap.put (new Integer (AccessibleRole.GROUP_BOX), "GROUP_BOX");
205 maRoleMap.put (new Integer (AccessibleRole.HEADER), "HEADER");
206 maRoleMap.put (new Integer (AccessibleRole.HEADING), "HEADING");
207 maRoleMap.put (new Integer (AccessibleRole.HYPER_LINK), "HYPER_LINK");
208 maRoleMap.put (new Integer (AccessibleRole.ICON), "ICON");
209 maRoleMap.put (new Integer (AccessibleRole.INTERNAL_FRAME), "INTERNAL_FRAME");
210 maRoleMap.put (new Integer (AccessibleRole.LABEL), "LABEL");
211 maRoleMap.put (new Integer (AccessibleRole.LAYERED_PANE), "LAYERED_PANE");
212 maRoleMap.put (new Integer (AccessibleRole.LIST), "LIST");
213 maRoleMap.put (new Integer (AccessibleRole.LIST_ITEM), "LIST_ITEM");
214 maRoleMap.put (new Integer (AccessibleRole.MENU), "MENU");
215 maRoleMap.put (new Integer (AccessibleRole.MENU_BAR), "MENU_BAR");
216 maRoleMap.put (new Integer (AccessibleRole.MENU_ITEM), "MENU_ITEM");
217 maRoleMap.put (new Integer (AccessibleRole.OPTION_PANE), "OPTION_PANE");
218 maRoleMap.put (new Integer (AccessibleRole.PAGE_TAB), "PAGE_TAB");
219 maRoleMap.put (new Integer (AccessibleRole.PAGE_TAB_LIST), "PAGE_TAB_LIST");
220 maRoleMap.put (new Integer (AccessibleRole.PANEL), "PANEL");
221 maRoleMap.put (new Integer (AccessibleRole.PARAGRAPH), "PARAGRAPH");
222 maRoleMap.put (new Integer (AccessibleRole.PASSWORD_TEXT), "PASSWORD_TEXT");
223 maRoleMap.put (new Integer (AccessibleRole.POPUP_MENU), "POPUP_MENU");
224 maRoleMap.put (new Integer (AccessibleRole.PUSH_BUTTON), "PUSH_BUTTON");
225 maRoleMap.put (new Integer (AccessibleRole.PROGRESS_BAR), "PROGRESS_BAR");
226 maRoleMap.put (new Integer (AccessibleRole.RADIO_BUTTON), "RADIO_BUTTON");
227 maRoleMap.put (new Integer (AccessibleRole.RADIO_MENU_ITEM), "RADIO_MENU_ITEM");
228 maRoleMap.put (new Integer (AccessibleRole.ROW_HEADER), "ROW_HEADER");
229 maRoleMap.put (new Integer (AccessibleRole.ROOT_PANE), "ROOT_PANE");
230 maRoleMap.put (new Integer (AccessibleRole.SCROLL_BAR), "SCROLL_BAR");
231 maRoleMap.put (new Integer (AccessibleRole.SCROLL_PANE), "SCROLL_PANE");
232 maRoleMap.put (new Integer (AccessibleRole.SHAPE), "SHAPE");
233 maRoleMap.put (new Integer (AccessibleRole.SEPARATOR), "SEPARATOR");
234 maRoleMap.put (new Integer (AccessibleRole.SLIDER), "SLIDER");
235 maRoleMap.put (new Integer (AccessibleRole.SPIN_BOX), "SPIN_BOX");
236 maRoleMap.put (new Integer (AccessibleRole.SPLIT_PANE), "SPLIT_PANE");
237 maRoleMap.put (new Integer (AccessibleRole.STATUS_BAR), "STATUS_BAR");
238 maRoleMap.put (new Integer (AccessibleRole.TABLE), "TABLE");
239 maRoleMap.put (new Integer (AccessibleRole.TABLE_CELL), "TABLE_CELL");
240 maRoleMap.put (new Integer (AccessibleRole.TEXT), "TEXT");
241 maRoleMap.put (new Integer (AccessibleRole.TEXT_FRAME), "TEXT_FRAME");
242 maRoleMap.put (new Integer (AccessibleRole.TOGGLE_BUTTON), "TOGGLE_BUTTON");
243 maRoleMap.put (new Integer (AccessibleRole.TOOL_BAR), "TOOL_BAR");
244 maRoleMap.put (new Integer (AccessibleRole.TOOL_TIP), "TOOL_TIP");
245 maRoleMap.put (new Integer (AccessibleRole.TREE), "TREE");
246 maRoleMap.put (new Integer (AccessibleRole.VIEW_PORT), "VIEW_PORT");
247 maRoleMap.put (new Integer (AccessibleRole.WINDOW), "WINDOW");
249 maRelationMap.put (new Integer (AccessibleRelationType.INVALID), "INVALID");
250 maRelationMap.put (new Integer (AccessibleRelationType.CONTENT_FLOWS_FROM), "CONTENT_FLOWS_FROM");
251 maRelationMap.put (new Integer (AccessibleRelationType.CONTENT_FLOWS_TO), "CONTENT_FLOWS_TO");
252 maRelationMap.put (new Integer (AccessibleRelationType.CONTROLLED_BY), "CONTROLLED_BY");
253 maRelationMap.put (new Integer (AccessibleRelationType.CONTROLLER_FOR), "CONTROLLER_FOR");
254 maRelationMap.put (new Integer (AccessibleRelationType.LABEL_FOR), "LABEL_FOR");
255 maRelationMap.put (new Integer (AccessibleRelationType.LABELED_BY), "LABELED_BY");
256 maRelationMap.put (new Integer (AccessibleRelationType.MEMBER_OF), "MEMBER_OF");
257 maRelationMap.put (new Integer (AccessibleRelationType.SUB_WINDOW_OF), "SUB_WINDOW_OF");