fdo#74697 Add Bluez 5 support for impress remote.
[LibreOffice.git] / toolkit / test / accessibility / tools / NameProvider.java
blobccd7356100011af96f96f03a4413b4276da624df
1 /*
2 * This file is part of the LibreOffice project.
4 * This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 * This file incorporates work covered by the following license notice:
10 * Licensed to the Apache Software Foundation (ASF) under one or more
11 * contributor license agreements. See the NOTICE file distributed
12 * with this work for additional information regarding copyright
13 * ownership. The ASF licenses this file to you under the Apache
14 * License, Version 2.0 (the "License"); you may not use this file
15 * except in compliance with the License. You may obtain a copy of
16 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 package tools;
21 import java.util.HashMap;
22 import com.sun.star.accessibility.AccessibleStateType;
23 import com.sun.star.accessibility.AccessibleEventId;
24 import com.sun.star.accessibility.AccessibleRole;
25 import com.sun.star.accessibility.AccessibleRelationType;
28 /** Provide names for several accessibility constants groups.
30 public class NameProvider
32 /** Return the name of the specified state.
33 @param nStateId
34 Id of the state for which to return its name. This is one of
35 the ids listed in the <type>AccessibleStateType</const>
36 constants group.
37 @return
38 Returns the name of the specified state or an empty string if an
39 invalid / unknown state id was given.
41 public static String getStateName (int nStateId)
43 return maStateMap.get (new Integer(nStateId));
47 /** Return the name of the specified event.
48 @param nEventId
49 Id of the event type for which to return its name. This is one
50 of the ids listed in the <type>AccessibleEventId</const>
51 constants group.
52 @return
53 Returns the name of the specified event type or an empty string
54 if an invalid / unknown event id was given.
56 public static String getEventName (int nEventId)
58 return maEventMap.get (new Integer(nEventId));
62 /** Return the name of the specified role.
63 @param nRole
64 Id of the role for which to return its name. This is one of
65 the ids listed in the <type>AccessibleRole</const>
66 constants group.
67 @return
68 Returns the name of the specified role or an empty string if an
69 invalid / unknown role id was given.
71 public static String getRoleName (int nRole)
73 return maRoleMap.get (new Integer(nRole));
77 /** Return the name of the specified relation.
78 @param nRelation
79 Id of the relation for which to return its name. This is one of
80 the ids listed in the <type>AccessibleRelationType</const>
81 constants group.
82 @return
83 Returns the name of the specified relation type or an empty
84 string if an invalid / unknown role id was given.
86 public static String getRelationName (int nRelation)
88 return maRelationMap.get (new Integer(nRelation));
92 private static HashMap<Integer, String> maStateMap = new HashMap<Integer, String>();
93 private static HashMap<Integer, String> maEventMap = new HashMap<Integer, String>();
94 private static HashMap<Integer, String> maRoleMap = new HashMap<Integer, String>();
95 private static HashMap<Integer, String> maRelationMap = new HashMap<Integer, String>();
97 static {
98 maStateMap.put (new Integer (AccessibleStateType.INVALID), "INVALID");
99 maStateMap.put (new Integer (AccessibleStateType.ACTIVE), "ACTIVE");
100 maStateMap.put (new Integer (AccessibleStateType.ARMED), "ARMED");
101 maStateMap.put (new Integer (AccessibleStateType.BUSY), "BUSY");
102 maStateMap.put (new Integer (AccessibleStateType.CHECKED), "CHECKED");
103 // maStateMap.put (new Integer (AccessibleStateType.COLLAPSED), "COLLAPSED");
104 maStateMap.put (new Integer (AccessibleStateType.DEFUNC), "DEFUNC");
105 maStateMap.put (new Integer (AccessibleStateType.EDITABLE), "EDITABLE");
106 maStateMap.put (new Integer (AccessibleStateType.ENABLED), "ENABLED");
107 maStateMap.put (new Integer (AccessibleStateType.EXPANDABLE), "EXPANDABLE");
108 maStateMap.put (new Integer (AccessibleStateType.EXPANDED), "EXPANDED");
109 maStateMap.put (new Integer (AccessibleStateType.FOCUSABLE), "FOCUSABLE");
110 maStateMap.put (new Integer (AccessibleStateType.FOCUSED), "FOCUSED");
111 maStateMap.put (new Integer (AccessibleStateType.HORIZONTAL), "HORIZONTAL");
112 maStateMap.put (new Integer (AccessibleStateType.ICONIFIED), "ICONIFIED");
113 maStateMap.put (new Integer (AccessibleStateType.MODAL), "MODAL");
114 maStateMap.put (new Integer (AccessibleStateType.MULTI_LINE), "MULTI_LINE");
115 maStateMap.put (new Integer (AccessibleStateType.MULTI_SELECTABLE), "MULTI_SELECTABLE");
116 maStateMap.put (new Integer (AccessibleStateType.OPAQUE), "OPAQUE");
117 maStateMap.put (new Integer (AccessibleStateType.PRESSED), "PRESSED");
118 maStateMap.put (new Integer (AccessibleStateType.RESIZABLE), "RESIZABLE");
119 maStateMap.put (new Integer (AccessibleStateType.SELECTABLE), "SELECTABLE");
120 maStateMap.put (new Integer (AccessibleStateType.SELECTED), "SELECTED");
121 maStateMap.put (new Integer (AccessibleStateType.SENSITIVE), "SENSITIVE");
122 maStateMap.put (new Integer (AccessibleStateType.SHOWING), "SHOWING");
123 maStateMap.put (new Integer (AccessibleStateType.SINGLE_LINE), "SINGLE_LINE");
124 maStateMap.put (new Integer (AccessibleStateType.STALE), "STALE");
125 maStateMap.put (new Integer (AccessibleStateType.TRANSIENT), "TRANSIENT");
126 maStateMap.put (new Integer (AccessibleStateType.VERTICAL), "VERTICAL");
127 maStateMap.put (new Integer (AccessibleStateType.VISIBLE), "VISIBLE");
128 maStateMap.put (new Integer (AccessibleStateType.MANAGES_DESCENDANTS),
129 "MANAGES_DESCENDANTS");
130 // maStateMap.put (new Integer (AccessibleStateType.INCONSISTENT),"INCONSISTENT");
133 maEventMap.put (new Integer (0),
134 "[UNKNOWN]");
135 maEventMap.put (new Integer (AccessibleEventId.NAME_CHANGED),
136 "NAME_CHANGED");
137 maEventMap.put (new Integer (AccessibleEventId.DESCRIPTION_CHANGED),
138 "DESCRIPTION_CHANGED");
139 maEventMap.put (new Integer (AccessibleEventId.ACTION_CHANGED),
140 "ACTION_CHANGED");
141 maEventMap.put (new Integer (AccessibleEventId.STATE_CHANGED),
142 "STATE_CHANGED");
143 maEventMap.put (new Integer (AccessibleEventId.ACTIVE_DESCENDANT_CHANGED),
144 "ACTIVE_DESCENDANT_CHANGED");
145 maEventMap.put (new Integer (AccessibleEventId.BOUNDRECT_CHANGED),
146 "BOUNDRECT_CHANGED");
147 maEventMap.put (new Integer (AccessibleEventId.CHILD),
148 "CHILD");
149 maEventMap.put (new Integer (AccessibleEventId.INVALIDATE_ALL_CHILDREN),
150 "INVALIDATE_ALL_CHILDREN");
151 maEventMap.put (new Integer (AccessibleEventId.SELECTION_CHANGED),
152 "SELECTION_CHANGED");
153 maEventMap.put (new Integer (AccessibleEventId.VISIBLE_DATA_CHANGED),
154 "VISIBLE_DATA_CHANGED");
155 maEventMap.put (new Integer (AccessibleEventId.VALUE_CHANGED),
156 "VALUE_CHANGED");
157 maEventMap.put (new Integer (AccessibleEventId.CONTENT_FLOWS_FROM_RELATION_CHANGED),
158 "CONTENT_FLOWS_FROM_RELATION_CHANGED");
159 maEventMap.put (new Integer (AccessibleEventId.CONTENT_FLOWS_TO_RELATION_CHANGED),
160 "CONTENT_FLOWS_TO_RELATION_CHANGED");
161 maEventMap.put (new Integer (AccessibleEventId.CONTROLLED_BY_RELATION_CHANGED),
162 "CONTROLLED_BY_RELATION_CHANGED");
163 maEventMap.put (new Integer (AccessibleEventId.CONTROLLER_FOR_RELATION_CHANGED),
164 "CONTROLLER_FOR_RELATION_CHANGED");
165 maEventMap.put (new Integer (AccessibleEventId.LABEL_FOR_RELATION_CHANGED),
166 "LABEL_FOR_RELATION_CHANGED");
167 maEventMap.put (new Integer (AccessibleEventId.LABELED_BY_RELATION_CHANGED),
168 "LABELED_BY_RELATION_CHANGED");
169 maEventMap.put (new Integer (AccessibleEventId.MEMBER_OF_RELATION_CHANGED),
170 "MEMBER_OF_RELATION_CHANGED");
171 maEventMap.put (new Integer (AccessibleEventId.SUB_WINDOW_OF_RELATION_CHANGED),
172 "SUB_WINDOW_OF_RELATION_CHANGED");
173 maEventMap.put (new Integer (AccessibleEventId.CARET_CHANGED),
174 "CARET_CHANGED");
175 maEventMap.put (new Integer (AccessibleEventId.TEXT_SELECTION_CHANGED),
176 "TEXT_SELECTION_CHANGED");
177 maEventMap.put (new Integer (AccessibleEventId.TEXT_CHANGED),
178 "TEXT_CHANGED");
179 maEventMap.put (new Integer (AccessibleEventId.TEXT_ATTRIBUTE_CHANGED),
180 "TEXT_ATTRIBUTE_CHANGED");
181 maEventMap.put (new Integer (AccessibleEventId.HYPERTEXT_CHANGED),
182 "HYPERTEXT_CHANGED");
183 maEventMap.put (new Integer (AccessibleEventId.TABLE_CAPTION_CHANGED),
184 "TABLE_CAPTION_CHANGED");
185 maEventMap.put (new Integer (AccessibleEventId.TABLE_COLUMN_DESCRIPTION_CHANGED),
186 "TABLE_COLUMN_DESCRIPTION_CHANGED");
187 maEventMap.put (new Integer (AccessibleEventId.TABLE_COLUMN_HEADER_CHANGED),
188 "TABLE_COLUMN_HEADER_CHANGED");
189 maEventMap.put (new Integer (AccessibleEventId.TABLE_MODEL_CHANGED),
190 "TABLE_MODEL_CHANGED");
191 maEventMap.put (new Integer (AccessibleEventId.TABLE_ROW_DESCRIPTION_CHANGED),
192 "TABLE_ROW_DESCRIPTION_CHANGED");
193 maEventMap.put (new Integer (AccessibleEventId.TABLE_ROW_HEADER_CHANGED),
194 "TABLE_ROW_HEADER_CHANGED");
195 maEventMap.put (new Integer (AccessibleEventId.TABLE_SUMMARY_CHANGED),
196 "TABLE_SUMMARY_CHANGED");
198 maRoleMap.put (new Integer(AccessibleRole.UNKNOWN), "UNKNOWN");
199 maRoleMap.put (new Integer (AccessibleRole.UNKNOWN), "UNKNOWN");
200 maRoleMap.put (new Integer (AccessibleRole.ALERT), "ALERT");
201 maRoleMap.put (new Integer (AccessibleRole.COLUMN_HEADER), "COLUMN_HEADER");
202 maRoleMap.put (new Integer (AccessibleRole.CANVAS), "CANVAS");
203 maRoleMap.put (new Integer (AccessibleRole.CHECK_BOX), "CHECK_BOX");
204 maRoleMap.put (new Integer (AccessibleRole.CHECK_MENU_ITEM), "CHECK_MENU_ITEM");
205 maRoleMap.put (new Integer (AccessibleRole.COLOR_CHOOSER), "COLOR_CHOOSER");
206 maRoleMap.put (new Integer (AccessibleRole.COMBO_BOX), "COMBO_BOX");
207 maRoleMap.put (new Integer (AccessibleRole.DESKTOP_ICON), "DESKTOP_ICON");
208 maRoleMap.put (new Integer (AccessibleRole.DESKTOP_PANE), "DESKTOP_PANE");
209 maRoleMap.put (new Integer (AccessibleRole.DIRECTORY_PANE), "DIRECTORY_PANE");
210 maRoleMap.put (new Integer (AccessibleRole.DIALOG), "DIALOG");
211 maRoleMap.put (new Integer (AccessibleRole.DOCUMENT), "DOCUMENT");
212 maRoleMap.put (new Integer (AccessibleRole.EMBEDDED_OBJECT), "EMBEDDED_OBJECT");
213 maRoleMap.put (new Integer (AccessibleRole.END_NOTE), "END_NOTE");
214 maRoleMap.put (new Integer (AccessibleRole.FILE_CHOOSER), "FILE_CHOOSER");
215 maRoleMap.put (new Integer (AccessibleRole.FILLER), "FILLER");
216 maRoleMap.put (new Integer (AccessibleRole.FONT_CHOOSER), "FONT_CHOOSER");
217 maRoleMap.put (new Integer (AccessibleRole.FOOTER), "FOOTER");
218 maRoleMap.put (new Integer (AccessibleRole.FOOTNOTE), "FOOTNOTE");
219 maRoleMap.put (new Integer (AccessibleRole.FRAME), "FRAME");
220 maRoleMap.put (new Integer (AccessibleRole.GLASS_PANE), "GLASS_PANE");
221 maRoleMap.put (new Integer (AccessibleRole.GRAPHIC), "GRAPHIC");
222 maRoleMap.put (new Integer (AccessibleRole.GROUP_BOX), "GROUP_BOX");
223 maRoleMap.put (new Integer (AccessibleRole.HEADER), "HEADER");
224 maRoleMap.put (new Integer (AccessibleRole.HEADING), "HEADING");
225 maRoleMap.put (new Integer (AccessibleRole.HYPER_LINK), "HYPER_LINK");
226 maRoleMap.put (new Integer (AccessibleRole.ICON), "ICON");
227 maRoleMap.put (new Integer (AccessibleRole.INTERNAL_FRAME), "INTERNAL_FRAME");
228 maRoleMap.put (new Integer (AccessibleRole.LABEL), "LABEL");
229 maRoleMap.put (new Integer (AccessibleRole.LAYERED_PANE), "LAYERED_PANE");
230 maRoleMap.put (new Integer (AccessibleRole.LIST), "LIST");
231 maRoleMap.put (new Integer (AccessibleRole.LIST_ITEM), "LIST_ITEM");
232 maRoleMap.put (new Integer (AccessibleRole.MENU), "MENU");
233 maRoleMap.put (new Integer (AccessibleRole.MENU_BAR), "MENU_BAR");
234 maRoleMap.put (new Integer (AccessibleRole.MENU_ITEM), "MENU_ITEM");
235 maRoleMap.put (new Integer (AccessibleRole.OPTION_PANE), "OPTION_PANE");
236 maRoleMap.put (new Integer (AccessibleRole.PAGE_TAB), "PAGE_TAB");
237 maRoleMap.put (new Integer (AccessibleRole.PAGE_TAB_LIST), "PAGE_TAB_LIST");
238 maRoleMap.put (new Integer (AccessibleRole.PANEL), "PANEL");
239 maRoleMap.put (new Integer (AccessibleRole.PARAGRAPH), "PARAGRAPH");
240 maRoleMap.put (new Integer (AccessibleRole.PASSWORD_TEXT), "PASSWORD_TEXT");
241 maRoleMap.put (new Integer (AccessibleRole.POPUP_MENU), "POPUP_MENU");
242 maRoleMap.put (new Integer (AccessibleRole.PUSH_BUTTON), "PUSH_BUTTON");
243 maRoleMap.put (new Integer (AccessibleRole.PROGRESS_BAR), "PROGRESS_BAR");
244 maRoleMap.put (new Integer (AccessibleRole.RADIO_BUTTON), "RADIO_BUTTON");
245 maRoleMap.put (new Integer (AccessibleRole.RADIO_MENU_ITEM), "RADIO_MENU_ITEM");
246 maRoleMap.put (new Integer (AccessibleRole.ROW_HEADER), "ROW_HEADER");
247 maRoleMap.put (new Integer (AccessibleRole.ROOT_PANE), "ROOT_PANE");
248 maRoleMap.put (new Integer (AccessibleRole.SCROLL_BAR), "SCROLL_BAR");
249 maRoleMap.put (new Integer (AccessibleRole.SCROLL_PANE), "SCROLL_PANE");
250 maRoleMap.put (new Integer (AccessibleRole.SHAPE), "SHAPE");
251 maRoleMap.put (new Integer (AccessibleRole.SEPARATOR), "SEPARATOR");
252 maRoleMap.put (new Integer (AccessibleRole.SLIDER), "SLIDER");
253 maRoleMap.put (new Integer (AccessibleRole.SPIN_BOX), "SPIN_BOX");
254 maRoleMap.put (new Integer (AccessibleRole.SPLIT_PANE), "SPLIT_PANE");
255 maRoleMap.put (new Integer (AccessibleRole.STATUS_BAR), "STATUS_BAR");
256 maRoleMap.put (new Integer (AccessibleRole.TABLE), "TABLE");
257 maRoleMap.put (new Integer (AccessibleRole.TABLE_CELL), "TABLE_CELL");
258 maRoleMap.put (new Integer (AccessibleRole.TEXT), "TEXT");
259 maRoleMap.put (new Integer (AccessibleRole.TEXT_FRAME), "TEXT_FRAME");
260 maRoleMap.put (new Integer (AccessibleRole.TOGGLE_BUTTON), "TOGGLE_BUTTON");
261 maRoleMap.put (new Integer (AccessibleRole.TOOL_BAR), "TOOL_BAR");
262 maRoleMap.put (new Integer (AccessibleRole.TOOL_TIP), "TOOL_TIP");
263 maRoleMap.put (new Integer (AccessibleRole.TREE), "TREE");
264 maRoleMap.put (new Integer (AccessibleRole.VIEW_PORT), "VIEW_PORT");
265 maRoleMap.put (new Integer (AccessibleRole.WINDOW), "WINDOW");
267 maRelationMap.put (new Integer (AccessibleRelationType.INVALID), "INVALID");
268 maRelationMap.put (new Integer (AccessibleRelationType.CONTENT_FLOWS_FROM), "CONTENT_FLOWS_FROM");
269 maRelationMap.put (new Integer (AccessibleRelationType.CONTENT_FLOWS_TO), "CONTENT_FLOWS_TO");
270 maRelationMap.put (new Integer (AccessibleRelationType.CONTROLLED_BY), "CONTROLLED_BY");
271 maRelationMap.put (new Integer (AccessibleRelationType.CONTROLLER_FOR), "CONTROLLER_FOR");
272 maRelationMap.put (new Integer (AccessibleRelationType.LABEL_FOR), "LABEL_FOR");
273 maRelationMap.put (new Integer (AccessibleRelationType.LABELED_BY), "LABELED_BY");
274 maRelationMap.put (new Integer (AccessibleRelationType.MEMBER_OF), "MEMBER_OF");
275 maRelationMap.put (new Integer (AccessibleRelationType.SUB_WINDOW_OF), "SUB_WINDOW_OF");