xref: /AOO41X/main/vcl/aqua/source/a11y/aqua11yrolehelper.mm (revision 323de322b8e3c385116436869e4ba6b658fb6405)
1*323de322SAndrew Rist/**************************************************************
2cdf0e10cSrcweir *
3*323de322SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
4*323de322SAndrew Rist * or more contributor license agreements.  See the NOTICE file
5*323de322SAndrew Rist * distributed with this work for additional information
6*323de322SAndrew Rist * regarding copyright ownership.  The ASF licenses this file
7*323de322SAndrew Rist * to you under the Apache License, Version 2.0 (the
8*323de322SAndrew Rist * "License"); you may not use this file except in compliance
9*323de322SAndrew Rist * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir *
11*323de322SAndrew Rist *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir *
13*323de322SAndrew Rist * Unless required by applicable law or agreed to in writing,
14*323de322SAndrew Rist * software distributed under the License is distributed on an
15*323de322SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*323de322SAndrew Rist * KIND, either express or implied.  See the License for the
17*323de322SAndrew Rist * specific language governing permissions and limitations
18*323de322SAndrew Rist * under the License.
19cdf0e10cSrcweir *
20*323de322SAndrew Rist *************************************************************/
21*323de322SAndrew Rist
22*323de322SAndrew Rist
23cdf0e10cSrcweir
24cdf0e10cSrcweir// MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir#include "precompiled_vcl.hxx"
26cdf0e10cSrcweir
27cdf0e10cSrcweir#include "aqua/aqua11yfactory.h"
28cdf0e10cSrcweir
29cdf0e10cSrcweir#include "aqua11yrolehelper.h"
30cdf0e10cSrcweir
31cdf0e10cSrcweir#include <com/sun/star/accessibility/AccessibleRole.hpp>
32cdf0e10cSrcweir#include <com/sun/star/accessibility/AccessibleStateType.hpp>
33cdf0e10cSrcweir
34cdf0e10cSrcweirusing namespace ::com::sun::star::accessibility;
35cdf0e10cSrcweirusing namespace ::com::sun::star::uno;
36cdf0e10cSrcweir
37cdf0e10cSrcweir@implementation AquaA11yRoleHelper
38cdf0e10cSrcweir
39cdf0e10cSrcweir+(id)simpleMapNativeRoleFrom: (XAccessibleContext *) accessibleContext {
40cdf0e10cSrcweir    id nativeRole = nil;
41cdf0e10cSrcweir    switch( accessibleContext -> getAccessibleRole() ) {
42cdf0e10cSrcweir#define MAP(a,b) \
43cdf0e10cSrcweir        case a: nativeRole = b; break
44cdf0e10cSrcweir
45cdf0e10cSrcweir        MAP( AccessibleRole::UNKNOWN, NSAccessibilityUnknownRole );
46cdf0e10cSrcweir        MAP( AccessibleRole::ALERT, NSAccessibilityUnknownRole ); // FIXME
47cdf0e10cSrcweir        MAP( AccessibleRole::COLUMN_HEADER, NSAccessibilityColumnRole );
48cdf0e10cSrcweir        MAP( AccessibleRole::CANVAS, NSAccessibilityUnknownRole ); // FIXME
49cdf0e10cSrcweir        MAP( AccessibleRole::CHECK_BOX, NSAccessibilityCheckBoxRole );
50cdf0e10cSrcweir        MAP( AccessibleRole::CHECK_MENU_ITEM, NSAccessibilityUnknownRole ); // FIXME
51cdf0e10cSrcweir        MAP( AccessibleRole::COLOR_CHOOSER, NSAccessibilityColorWellRole ); // FIXME
52cdf0e10cSrcweir        MAP( AccessibleRole::COMBO_BOX, NSAccessibilityComboBoxRole );
53cdf0e10cSrcweir        MAP( AccessibleRole::DATE_EDITOR, NSAccessibilityUnknownRole ); // FIXME
54cdf0e10cSrcweir        MAP( AccessibleRole::DESKTOP_ICON, NSAccessibilityUnknownRole ); // FIXME
55cdf0e10cSrcweir        MAP( AccessibleRole::DESKTOP_PANE, NSAccessibilityUnknownRole ); // FIXME
56cdf0e10cSrcweir        MAP( AccessibleRole::DIRECTORY_PANE, NSAccessibilityUnknownRole ); // FIXME
57cdf0e10cSrcweir        MAP( AccessibleRole::DIALOG, NSAccessibilityGroupRole );
58cdf0e10cSrcweir        MAP( AccessibleRole::DOCUMENT, NSAccessibilityGroupRole );
59cdf0e10cSrcweir        MAP( AccessibleRole::EMBEDDED_OBJECT, NSAccessibilityUnknownRole ); // FIXME
60cdf0e10cSrcweir        MAP( AccessibleRole::END_NOTE, NSAccessibilityUnknownRole ); // FIXME
61cdf0e10cSrcweir        MAP( AccessibleRole::FILE_CHOOSER, NSAccessibilityUnknownRole ); // FIXME
62cdf0e10cSrcweir        MAP( AccessibleRole::FILLER, NSAccessibilityUnknownRole ); // FIXME
63cdf0e10cSrcweir        MAP( AccessibleRole::FONT_CHOOSER, NSAccessibilityUnknownRole ); // FIXME
64cdf0e10cSrcweir        MAP( AccessibleRole::FOOTER, NSAccessibilityUnknownRole ); // FIXME
65cdf0e10cSrcweir        MAP( AccessibleRole::FOOTNOTE, NSAccessibilityUnknownRole ); // FIXME
66cdf0e10cSrcweir        MAP( AccessibleRole::FRAME, NSAccessibilityWindowRole );
67cdf0e10cSrcweir        MAP( AccessibleRole::GLASS_PANE, NSAccessibilityUnknownRole ); // FIXME
68cdf0e10cSrcweir        MAP( AccessibleRole::GRAPHIC, NSAccessibilityImageRole );
69cdf0e10cSrcweir        MAP( AccessibleRole::GROUP_BOX, NSAccessibilityGroupRole );
70cdf0e10cSrcweir        MAP( AccessibleRole::HEADER, NSAccessibilityUnknownRole ); // FIXME
71cdf0e10cSrcweir        MAP( AccessibleRole::HEADING, NSAccessibilityUnknownRole ); // FIXME
72cdf0e10cSrcweir        MAP( AccessibleRole::HYPER_LINK, NSAccessibilityLinkRole );
73cdf0e10cSrcweir        MAP( AccessibleRole::ICON, NSAccessibilityImageRole );
74cdf0e10cSrcweir        MAP( AccessibleRole::INTERNAL_FRAME, NSAccessibilityUnknownRole ); // FIXME
75cdf0e10cSrcweir        MAP( AccessibleRole::LABEL, NSAccessibilityStaticTextRole );
76cdf0e10cSrcweir        MAP( AccessibleRole::LAYERED_PANE, NSAccessibilityUnknownRole ); // FIXME
77cdf0e10cSrcweir        MAP( AccessibleRole::LIST, NSAccessibilityMenuRole );
78cdf0e10cSrcweir        MAP( AccessibleRole::LIST_ITEM, NSAccessibilityMenuItemRole );
79cdf0e10cSrcweir        MAP( AccessibleRole::MENU, NSAccessibilityMenuRole );
80cdf0e10cSrcweir        MAP( AccessibleRole::MENU_BAR, NSAccessibilityMenuBarRole );
81cdf0e10cSrcweir        MAP( AccessibleRole::MENU_ITEM, NSAccessibilityMenuItemRole );
82cdf0e10cSrcweir        MAP( AccessibleRole::OPTION_PANE, NSAccessibilityUnknownRole ); // FIXME
83cdf0e10cSrcweir        MAP( AccessibleRole::PAGE_TAB, NSAccessibilityButtonRole );
84cdf0e10cSrcweir        MAP( AccessibleRole::PAGE_TAB_LIST, NSAccessibilityTabGroupRole );
85cdf0e10cSrcweir        MAP( AccessibleRole::PANEL, NSAccessibilityGroupRole );
86cdf0e10cSrcweir        MAP( AccessibleRole::PARAGRAPH, NSAccessibilityTextAreaRole );
87cdf0e10cSrcweir        MAP( AccessibleRole::PASSWORD_TEXT, NSAccessibilityTextFieldRole );
88cdf0e10cSrcweir        MAP( AccessibleRole::POPUP_MENU, NSAccessibilityMenuRole );
89cdf0e10cSrcweir        MAP( AccessibleRole::PUSH_BUTTON, NSAccessibilityButtonRole );
90cdf0e10cSrcweir        MAP( AccessibleRole::PROGRESS_BAR, NSAccessibilityProgressIndicatorRole );
91cdf0e10cSrcweir        MAP( AccessibleRole::RADIO_BUTTON, NSAccessibilityRadioButtonRole );
92cdf0e10cSrcweir        MAP( AccessibleRole::RADIO_MENU_ITEM, NSAccessibilityUnknownRole ); // FIXME
93cdf0e10cSrcweir        MAP( AccessibleRole::ROW_HEADER, NSAccessibilityRowRole );
94cdf0e10cSrcweir        MAP( AccessibleRole::ROOT_PANE, NSAccessibilityUnknownRole ); // FIXME
95cdf0e10cSrcweir        MAP( AccessibleRole::SCROLL_BAR, NSAccessibilityScrollBarRole );
96cdf0e10cSrcweir        MAP( AccessibleRole::SCROLL_PANE, NSAccessibilityScrollAreaRole );
97cdf0e10cSrcweir        MAP( AccessibleRole::SHAPE, NSAccessibilityUnknownRole ); // FIXME
98cdf0e10cSrcweir        MAP( AccessibleRole::SEPARATOR, NSAccessibilitySplitterRole ); // FIXME
99cdf0e10cSrcweir        MAP( AccessibleRole::SLIDER, NSAccessibilitySliderRole );
100cdf0e10cSrcweir        MAP( AccessibleRole::SPIN_BOX, NSAccessibilityUnknownRole ); // FIXME
101cdf0e10cSrcweir        MAP( AccessibleRole::SPLIT_PANE, NSAccessibilitySplitterRole );
102cdf0e10cSrcweir        MAP( AccessibleRole::STATUS_BAR, NSAccessibilityGroupRole ); // FIXME
103cdf0e10cSrcweir        MAP( AccessibleRole::TABLE, NSAccessibilityTableRole );
104cdf0e10cSrcweir        MAP( AccessibleRole::TABLE_CELL, NSAccessibilityTextFieldRole );
105cdf0e10cSrcweir        MAP( AccessibleRole::TEXT, NSAccessibilityTextAreaRole );
106cdf0e10cSrcweir        MAP( AccessibleRole::TEXT_FRAME, NSAccessibilityGroupRole );
107cdf0e10cSrcweir        MAP( AccessibleRole::TOGGLE_BUTTON, NSAccessibilityCheckBoxRole );
108cdf0e10cSrcweir        MAP( AccessibleRole::TOOL_BAR, NSAccessibilityToolbarRole );
109cdf0e10cSrcweir        MAP( AccessibleRole::TOOL_TIP, NSAccessibilityUnknownRole ); // FIXME
110cdf0e10cSrcweir        MAP( AccessibleRole::TREE, NSAccessibilityGroupRole );
111cdf0e10cSrcweir        MAP( AccessibleRole::VIEW_PORT, NSAccessibilityUnknownRole ); // FIXME
112cdf0e10cSrcweir        MAP( AccessibleRole::WINDOW, NSAccessibilityWindowRole );
113cdf0e10cSrcweir
114cdf0e10cSrcweir        MAP( AccessibleRole::BUTTON_DROPDOWN, NSAccessibilityMenuButtonRole );
115cdf0e10cSrcweir        MAP( AccessibleRole::BUTTON_MENU, NSAccessibilityMenuButtonRole );
116cdf0e10cSrcweir        MAP( AccessibleRole::CAPTION, NSAccessibilityUnknownRole );
117cdf0e10cSrcweir        MAP( AccessibleRole::CHART, NSAccessibilityUnknownRole );
118cdf0e10cSrcweir        MAP( AccessibleRole::FORM, NSAccessibilityUnknownRole );
119cdf0e10cSrcweir        MAP( AccessibleRole::IMAGE_MAP, NSAccessibilityUnknownRole );
120cdf0e10cSrcweir        MAP( AccessibleRole::NOTE, NSAccessibilityUnknownRole );
121cdf0e10cSrcweir        MAP( AccessibleRole::PAGE, NSAccessibilityUnknownRole );
122cdf0e10cSrcweir        MAP( AccessibleRole::RULER, NSAccessibilityUnknownRole );
123cdf0e10cSrcweir        MAP( AccessibleRole::SECTION, NSAccessibilityUnknownRole );
124cdf0e10cSrcweir        MAP( AccessibleRole::TREE_ITEM, NSAccessibilityUnknownRole );
125cdf0e10cSrcweir        MAP( AccessibleRole::TREE_TABLE, NSAccessibilityUnknownRole );
126cdf0e10cSrcweir
127cdf0e10cSrcweir#undef MAP
128cdf0e10cSrcweir        default:
129cdf0e10cSrcweir            break;
130cdf0e10cSrcweir    }
131cdf0e10cSrcweir    return nativeRole;
132cdf0e10cSrcweir}
133cdf0e10cSrcweir
134cdf0e10cSrcweir+(id)getNativeRoleFrom: (XAccessibleContext *) accessibleContext {
135cdf0e10cSrcweir    id nativeRole = [ AquaA11yRoleHelper simpleMapNativeRoleFrom: accessibleContext ];
136cdf0e10cSrcweir    if ( accessibleContext -> getAccessibleRole() == AccessibleRole::LABEL ) {
137cdf0e10cSrcweir        if ( accessibleContext -> getAccessibleChildCount() > 0 ) {
138cdf0e10cSrcweir            [ nativeRole release ];
139cdf0e10cSrcweir            nativeRole = NSAccessibilityOutlineRole;
140cdf0e10cSrcweir        } else if ( accessibleContext -> getAccessibleParent().is() ) {
141cdf0e10cSrcweir            Reference < XAccessibleContext > rxParentContext = accessibleContext -> getAccessibleParent() -> getAccessibleContext();
142cdf0e10cSrcweir            if ( rxParentContext.is() ) {
143cdf0e10cSrcweir                NSString * roleParent = (NSString *) [ AquaA11yRoleHelper simpleMapNativeRoleFrom: rxParentContext.get() ];
144cdf0e10cSrcweir                if ( [ roleParent isEqualToString: NSAccessibilityOutlineRole ] ) {
145cdf0e10cSrcweir                    [ nativeRole release ];
146cdf0e10cSrcweir                    nativeRole = NSAccessibilityRowRole;
147cdf0e10cSrcweir                }
148cdf0e10cSrcweir                [ roleParent release ];
149cdf0e10cSrcweir            }
150cdf0e10cSrcweir        }
151cdf0e10cSrcweir    } else if ( accessibleContext -> getAccessibleRole() == AccessibleRole::COMBO_BOX ) {
152cdf0e10cSrcweir        Reference < XAccessible > rxAccessible = accessibleContext -> getAccessibleChild(0);
153cdf0e10cSrcweir        if ( rxAccessible.is() ) {
154cdf0e10cSrcweir            Reference < XAccessibleContext > rxAccessibleContext = rxAccessible -> getAccessibleContext();
155cdf0e10cSrcweir            if ( rxAccessibleContext.is() && rxAccessibleContext -> getAccessibleRole() == AccessibleRole::TEXT ) {
156cdf0e10cSrcweir                if ( ! rxAccessibleContext -> getAccessibleStateSet() -> contains ( AccessibleStateType::EDITABLE ) ) {
157cdf0e10cSrcweir                    [ nativeRole release ];
158cdf0e10cSrcweir                    nativeRole = NSAccessibilityPopUpButtonRole;
159cdf0e10cSrcweir                }
160cdf0e10cSrcweir            }
161cdf0e10cSrcweir        }
162cdf0e10cSrcweir    }
163cdf0e10cSrcweir    return nativeRole;
164cdf0e10cSrcweir}
165cdf0e10cSrcweir
166cdf0e10cSrcweir+(id)getNativeSubroleFrom: (sal_Int16) nRole {
167cdf0e10cSrcweir    id nativeSubrole = nil;
168cdf0e10cSrcweir    switch( nRole ) {
169cdf0e10cSrcweir#define MAP(a,b) \
170cdf0e10cSrcweir        case a: nativeSubrole = b; break
171cdf0e10cSrcweir
172cdf0e10cSrcweir        MAP( AccessibleRole::UNKNOWN, NSAccessibilityUnknownSubrole );
173cdf0e10cSrcweir        MAP( AccessibleRole::ALERT, NSAccessibilitySystemDialogSubrole );
174cdf0e10cSrcweir        MAP( AccessibleRole::COLUMN_HEADER, @"" );
175cdf0e10cSrcweir        MAP( AccessibleRole::CANVAS, @"" );
176cdf0e10cSrcweir        MAP( AccessibleRole::CHECK_BOX, @"" );
177cdf0e10cSrcweir        MAP( AccessibleRole::CHECK_MENU_ITEM, @"" );
178cdf0e10cSrcweir        MAP( AccessibleRole::COLOR_CHOOSER, @"" );
179cdf0e10cSrcweir        MAP( AccessibleRole::COMBO_BOX, @"" );
180cdf0e10cSrcweir        MAP( AccessibleRole::DATE_EDITOR, @"" );
181cdf0e10cSrcweir        MAP( AccessibleRole::DESKTOP_ICON, @"" );
182cdf0e10cSrcweir        MAP( AccessibleRole::DESKTOP_PANE, @"" );
183cdf0e10cSrcweir        MAP( AccessibleRole::DIRECTORY_PANE, @"" );
184cdf0e10cSrcweir        MAP( AccessibleRole::DIALOG, NSAccessibilityDialogSubrole );
185cdf0e10cSrcweir        MAP( AccessibleRole::DOCUMENT, @"" );
186cdf0e10cSrcweir        MAP( AccessibleRole::EMBEDDED_OBJECT, @"" );
187cdf0e10cSrcweir        MAP( AccessibleRole::END_NOTE, @"" );
188cdf0e10cSrcweir        MAP( AccessibleRole::FILE_CHOOSER, @"" );
189cdf0e10cSrcweir        MAP( AccessibleRole::FILLER, @"" );
190cdf0e10cSrcweir        MAP( AccessibleRole::FONT_CHOOSER, @"" );
191cdf0e10cSrcweir        MAP( AccessibleRole::FOOTER, @"" );
192cdf0e10cSrcweir        MAP( AccessibleRole::FOOTNOTE, @"" );
193cdf0e10cSrcweir        MAP( AccessibleRole::FRAME, @"" );
194cdf0e10cSrcweir        MAP( AccessibleRole::GLASS_PANE, @"" );
195cdf0e10cSrcweir        MAP( AccessibleRole::GRAPHIC, @"" );
196cdf0e10cSrcweir        MAP( AccessibleRole::GROUP_BOX, @"" );
197cdf0e10cSrcweir        MAP( AccessibleRole::HEADER, @"" );
198cdf0e10cSrcweir        MAP( AccessibleRole::HEADING, @"" );
199cdf0e10cSrcweir        MAP( AccessibleRole::HYPER_LINK, NSAccessibilityTextLinkSubrole );
200cdf0e10cSrcweir        MAP( AccessibleRole::ICON, @"" );
201cdf0e10cSrcweir        MAP( AccessibleRole::INTERNAL_FRAME, @"" );
202cdf0e10cSrcweir        MAP( AccessibleRole::LABEL, @"" );
203cdf0e10cSrcweir        MAP( AccessibleRole::LAYERED_PANE, @"" );
204cdf0e10cSrcweir        MAP( AccessibleRole::LIST, @"" );
205cdf0e10cSrcweir        MAP( AccessibleRole::LIST_ITEM, NSAccessibilityOutlineRowSubrole );
206cdf0e10cSrcweir        MAP( AccessibleRole::MENU, @"" );
207cdf0e10cSrcweir        MAP( AccessibleRole::MENU_BAR, @"" );
208cdf0e10cSrcweir        MAP( AccessibleRole::MENU_ITEM, @"" );
209cdf0e10cSrcweir        MAP( AccessibleRole::OPTION_PANE, @"" );
210cdf0e10cSrcweir        MAP( AccessibleRole::PAGE_TAB, @"" );
211cdf0e10cSrcweir        MAP( AccessibleRole::PAGE_TAB_LIST, @"" );
212cdf0e10cSrcweir        MAP( AccessibleRole::PANEL, @"" );
213cdf0e10cSrcweir        MAP( AccessibleRole::PARAGRAPH, @"" );
214cdf0e10cSrcweir        MAP( AccessibleRole::PASSWORD_TEXT, NSAccessibilitySecureTextFieldSubrole );
215cdf0e10cSrcweir        MAP( AccessibleRole::POPUP_MENU, @"" );
216cdf0e10cSrcweir        MAP( AccessibleRole::PUSH_BUTTON, @"" );
217cdf0e10cSrcweir        MAP( AccessibleRole::PROGRESS_BAR, @"" );
218cdf0e10cSrcweir        MAP( AccessibleRole::RADIO_BUTTON, @"" );
219cdf0e10cSrcweir        MAP( AccessibleRole::RADIO_MENU_ITEM, @"" );
220cdf0e10cSrcweir        MAP( AccessibleRole::ROW_HEADER, @"" );
221cdf0e10cSrcweir        MAP( AccessibleRole::ROOT_PANE, @"" );
222cdf0e10cSrcweir        MAP( AccessibleRole::SCROLL_BAR, @"" );
223cdf0e10cSrcweir        MAP( AccessibleRole::SCROLL_PANE, @"" );
224cdf0e10cSrcweir        MAP( AccessibleRole::SHAPE, @"" );
225cdf0e10cSrcweir        MAP( AccessibleRole::SEPARATOR, @"" );
226cdf0e10cSrcweir        MAP( AccessibleRole::SLIDER, @"" );
227cdf0e10cSrcweir        MAP( AccessibleRole::SPIN_BOX, @"" );
228cdf0e10cSrcweir        MAP( AccessibleRole::SPLIT_PANE, @"" );
229cdf0e10cSrcweir        MAP( AccessibleRole::STATUS_BAR, @"" );
230cdf0e10cSrcweir        MAP( AccessibleRole::TABLE, @"" );
231cdf0e10cSrcweir        MAP( AccessibleRole::TABLE_CELL, @"" );
232cdf0e10cSrcweir        MAP( AccessibleRole::TEXT, @"" );
233cdf0e10cSrcweir        MAP( AccessibleRole::TEXT_FRAME, @"" );
234cdf0e10cSrcweir        MAP( AccessibleRole::TOGGLE_BUTTON, @"" );
235cdf0e10cSrcweir        MAP( AccessibleRole::TOOL_BAR, @"" );
236cdf0e10cSrcweir        MAP( AccessibleRole::TOOL_TIP, @"" );
237cdf0e10cSrcweir        MAP( AccessibleRole::TREE, @"" );
238cdf0e10cSrcweir        MAP( AccessibleRole::VIEW_PORT, @"" );
239cdf0e10cSrcweir        MAP( AccessibleRole::WINDOW, NSAccessibilityStandardWindowSubrole );
240cdf0e10cSrcweir
241cdf0e10cSrcweir        MAP( AccessibleRole::BUTTON_DROPDOWN, @"" );
242cdf0e10cSrcweir        MAP( AccessibleRole::BUTTON_MENU, @"" );
243cdf0e10cSrcweir        MAP( AccessibleRole::CAPTION, @"" );
244cdf0e10cSrcweir        MAP( AccessibleRole::CHART, @"" );
245cdf0e10cSrcweir        MAP( AccessibleRole::FORM, @"" );
246cdf0e10cSrcweir        MAP( AccessibleRole::IMAGE_MAP, @"" );
247cdf0e10cSrcweir        MAP( AccessibleRole::NOTE, @"" );
248cdf0e10cSrcweir        MAP( AccessibleRole::PAGE, @"" );
249cdf0e10cSrcweir        MAP( AccessibleRole::RULER, @"" );
250cdf0e10cSrcweir        MAP( AccessibleRole::SECTION, @"" );
251cdf0e10cSrcweir        MAP( AccessibleRole::TREE_ITEM, @"" );
252cdf0e10cSrcweir        MAP( AccessibleRole::TREE_TABLE, @"" );
253cdf0e10cSrcweir
254cdf0e10cSrcweir#undef MAP
255cdf0e10cSrcweir        default:
256cdf0e10cSrcweir            break;
257cdf0e10cSrcweir    }
258cdf0e10cSrcweir    return nativeSubrole;
259cdf0e10cSrcweir}
260cdf0e10cSrcweir
261cdf0e10cSrcweir+(id)getRoleDescriptionFrom: (NSString *) role with: (NSString *) subRole {
262cdf0e10cSrcweir	id roleDescription;
263cdf0e10cSrcweir	if ( [ subRole length ] == 0 )
264cdf0e10cSrcweir		roleDescription = NSAccessibilityRoleDescription( role, nil );
265cdf0e10cSrcweir	else
266cdf0e10cSrcweir		roleDescription = NSAccessibilityRoleDescription( role, subRole );
267cdf0e10cSrcweir    return roleDescription;
268cdf0e10cSrcweir}
269cdf0e10cSrcweir
270cdf0e10cSrcweir@end
271