Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #include <accessibility/standard/vclxaccessibletabcontrol.hxx>
30 : : #include <accessibility/standard/vclxaccessibletabpage.hxx>
31 : :
32 : : #include <com/sun/star/accessibility/AccessibleEventId.hpp>
33 : : #include <com/sun/star/accessibility/AccessibleRole.hpp>
34 : : #include <com/sun/star/accessibility/AccessibleStateType.hpp>
35 : : #include <unotools/accessiblestatesethelper.hxx>
36 : : #include <vcl/tabctrl.hxx>
37 : : #include <vcl/tabpage.hxx>
38 : :
39 : : #include <vector>
40 : :
41 : : using namespace ::com::sun::star;
42 : : using namespace ::com::sun::star::uno;
43 : : using namespace ::com::sun::star::lang;
44 : : using namespace ::com::sun::star::accessibility;
45 : : using namespace ::comphelper;
46 : :
47 : :
48 : : // ----------------------------------------------------
49 : : // class VCLXAccessibleTabControl
50 : : // ----------------------------------------------------
51 : :
52 : 0 : VCLXAccessibleTabControl::VCLXAccessibleTabControl( VCLXWindow* pVCLXWindow )
53 [ # # ]: 0 : :VCLXAccessibleComponent( pVCLXWindow )
54 : : {
55 [ # # ]: 0 : m_pTabControl = static_cast< TabControl* >( GetWindow() );
56 : :
57 [ # # ]: 0 : if ( m_pTabControl )
58 [ # # ][ # # ]: 0 : m_aAccessibleChildren.assign( m_pTabControl->GetPageCount(), Reference< XAccessible >() );
59 : 0 : }
60 : :
61 : : // -----------------------------------------------------------------------------
62 : :
63 : 0 : VCLXAccessibleTabControl::~VCLXAccessibleTabControl()
64 : : {
65 [ # # ]: 0 : }
66 : :
67 : : // -----------------------------------------------------------------------------
68 : :
69 : 0 : void VCLXAccessibleTabControl::UpdateFocused()
70 : : {
71 [ # # ]: 0 : for ( sal_uInt32 i = 0; i < m_aAccessibleChildren.size(); ++i )
72 : : {
73 : 0 : Reference< XAccessible > xChild( m_aAccessibleChildren[i] );
74 [ # # ]: 0 : if ( xChild.is() )
75 : : {
76 [ # # ][ # # ]: 0 : VCLXAccessibleTabPage* pVCLXAccessibleTabPage = static_cast< VCLXAccessibleTabPage* >( xChild.get() );
77 [ # # ]: 0 : if ( pVCLXAccessibleTabPage )
78 [ # # ][ # # ]: 0 : pVCLXAccessibleTabPage->SetFocused( pVCLXAccessibleTabPage->IsFocused() );
79 : : }
80 : 0 : }
81 : 0 : }
82 : :
83 : : // -----------------------------------------------------------------------------
84 : :
85 : 0 : void VCLXAccessibleTabControl::UpdateSelected( sal_Int32 i, bool bSelected )
86 : : {
87 [ # # ]: 0 : NotifyAccessibleEvent( AccessibleEventId::SELECTION_CHANGED, Any(), Any() );
88 : :
89 [ # # ][ # # ]: 0 : if ( i >= 0 && i < (sal_Int32)m_aAccessibleChildren.size() )
[ # # ]
90 : : {
91 : 0 : Reference< XAccessible > xChild( m_aAccessibleChildren[i] );
92 [ # # ]: 0 : if ( xChild.is() )
93 : : {
94 [ # # ][ # # ]: 0 : VCLXAccessibleTabPage* pVCLXAccessibleTabPage = static_cast< VCLXAccessibleTabPage* >( xChild.get() );
95 [ # # ]: 0 : if ( pVCLXAccessibleTabPage )
96 [ # # ]: 0 : pVCLXAccessibleTabPage->SetSelected( bSelected );
97 : 0 : }
98 : : }
99 : 0 : }
100 : :
101 : : // -----------------------------------------------------------------------------
102 : :
103 : 0 : void VCLXAccessibleTabControl::UpdatePageText( sal_Int32 i )
104 : : {
105 [ # # ][ # # ]: 0 : if ( i >= 0 && i < (sal_Int32)m_aAccessibleChildren.size() )
[ # # ]
106 : : {
107 : 0 : Reference< XAccessible > xChild( m_aAccessibleChildren[i] );
108 [ # # ]: 0 : if ( xChild.is() )
109 : : {
110 [ # # ][ # # ]: 0 : VCLXAccessibleTabPage* pVCLXAccessibleTabPage = static_cast< VCLXAccessibleTabPage* >( xChild.get() );
111 [ # # ]: 0 : if ( pVCLXAccessibleTabPage )
112 [ # # ][ # # ]: 0 : pVCLXAccessibleTabPage->SetPageText( pVCLXAccessibleTabPage->GetPageText() );
113 : 0 : }
114 : : }
115 : 0 : }
116 : :
117 : : // -----------------------------------------------------------------------------
118 : :
119 : 0 : void VCLXAccessibleTabControl::UpdateTabPage( sal_Int32 i, bool bNew )
120 : : {
121 [ # # ][ # # ]: 0 : if ( i >= 0 && i < (sal_Int32)m_aAccessibleChildren.size() )
[ # # ]
122 : : {
123 : 0 : Reference< XAccessible > xChild( m_aAccessibleChildren[i] );
124 [ # # ]: 0 : if ( xChild.is() )
125 : : {
126 [ # # ][ # # ]: 0 : VCLXAccessibleTabPage* pVCLXAccessibleTabPage = static_cast< VCLXAccessibleTabPage* >( xChild.get() );
127 [ # # ]: 0 : if ( pVCLXAccessibleTabPage )
128 [ # # ]: 0 : pVCLXAccessibleTabPage->Update( bNew );
129 : 0 : }
130 : : }
131 : 0 : }
132 : :
133 : : // -----------------------------------------------------------------------------
134 : :
135 : 0 : void VCLXAccessibleTabControl::InsertChild( sal_Int32 i )
136 : : {
137 [ # # ][ # # ]: 0 : if ( i >= 0 && i <= (sal_Int32)m_aAccessibleChildren.size() )
[ # # ]
138 : : {
139 : : // insert entry in child list
140 [ # # ][ # # ]: 0 : m_aAccessibleChildren.insert( m_aAccessibleChildren.begin() + i, Reference< XAccessible >() );
141 : :
142 : : // send accessible child event
143 [ # # ]: 0 : Reference< XAccessible > xChild( getAccessibleChild( i ) );
144 [ # # ]: 0 : if ( xChild.is() )
145 : : {
146 : 0 : Any aOldValue, aNewValue;
147 [ # # ]: 0 : aNewValue <<= xChild;
148 [ # # ]: 0 : NotifyAccessibleEvent( AccessibleEventId::CHILD, aOldValue, aNewValue );
149 : 0 : }
150 : : }
151 : 0 : }
152 : :
153 : : // -----------------------------------------------------------------------------
154 : :
155 : 0 : void VCLXAccessibleTabControl::RemoveChild( sal_Int32 i )
156 : : {
157 [ # # ][ # # ]: 0 : if ( i >= 0 && i < (sal_Int32)m_aAccessibleChildren.size() )
[ # # ]
158 : : {
159 : : // get the accessible of the removed page
160 : 0 : Reference< XAccessible > xChild( m_aAccessibleChildren[i] );
161 : :
162 : : // remove entry in child list
163 [ # # ][ # # ]: 0 : m_aAccessibleChildren.erase( m_aAccessibleChildren.begin() + i );
164 : :
165 : : // send accessible child event
166 [ # # ]: 0 : if ( xChild.is() )
167 : : {
168 : 0 : Any aOldValue, aNewValue;
169 [ # # ]: 0 : aOldValue <<= xChild;
170 [ # # ]: 0 : NotifyAccessibleEvent( AccessibleEventId::CHILD, aOldValue, aNewValue );
171 : :
172 [ # # ]: 0 : Reference< XComponent > xComponent( xChild, UNO_QUERY );
173 [ # # ]: 0 : if ( xComponent.is() )
174 [ # # ][ # # ]: 0 : xComponent->dispose();
175 : 0 : }
176 : : }
177 : 0 : }
178 : :
179 : : // -----------------------------------------------------------------------------
180 : :
181 : 0 : void VCLXAccessibleTabControl::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent )
182 : : {
183 [ # # # # : 0 : switch ( rVclWindowEvent.GetId() )
# # # # ]
184 : : {
185 : : case VCLEVENT_TABPAGE_ACTIVATE:
186 : : case VCLEVENT_TABPAGE_DEACTIVATE:
187 : : {
188 [ # # ]: 0 : if ( m_pTabControl )
189 : : {
190 : 0 : sal_uInt16 nPageId = (sal_uInt16)(sal_IntPtr) rVclWindowEvent.GetData();
191 : 0 : sal_uInt16 nPagePos = m_pTabControl->GetPagePos( nPageId );
192 : 0 : UpdateFocused();
193 : 0 : UpdateSelected( nPagePos, rVclWindowEvent.GetId() == VCLEVENT_TABPAGE_ACTIVATE );
194 : : }
195 : : }
196 : 0 : break;
197 : : case VCLEVENT_TABPAGE_PAGETEXTCHANGED:
198 : : {
199 [ # # ]: 0 : if ( m_pTabControl )
200 : : {
201 : 0 : sal_uInt16 nPageId = (sal_uInt16)(sal_IntPtr) rVclWindowEvent.GetData();
202 : 0 : sal_uInt16 nPagePos = m_pTabControl->GetPagePos( nPageId );
203 : 0 : UpdatePageText( nPagePos );
204 : : }
205 : : }
206 : 0 : break;
207 : : case VCLEVENT_TABPAGE_INSERTED:
208 : : {
209 [ # # ]: 0 : if ( m_pTabControl )
210 : : {
211 : 0 : sal_uInt16 nPageId = (sal_uInt16)(sal_IntPtr) rVclWindowEvent.GetData();
212 : 0 : sal_uInt16 nPagePos = m_pTabControl->GetPagePos( nPageId );
213 : 0 : InsertChild( nPagePos );
214 : : }
215 : : }
216 : 0 : break;
217 : : case VCLEVENT_TABPAGE_REMOVED:
218 : : {
219 [ # # ]: 0 : if ( m_pTabControl )
220 : : {
221 : 0 : sal_uInt16 nPageId = (sal_uInt16)(sal_IntPtr) rVclWindowEvent.GetData();
222 [ # # ]: 0 : for ( sal_Int32 i = 0, nCount = getAccessibleChildCount(); i < nCount; ++i )
223 : : {
224 [ # # ]: 0 : Reference< XAccessible > xChild( getAccessibleChild( i ) );
225 [ # # ]: 0 : if ( xChild.is() )
226 : : {
227 [ # # ][ # # ]: 0 : VCLXAccessibleTabPage* pVCLXAccessibleTabPage = static_cast< VCLXAccessibleTabPage* >( xChild.get() );
228 [ # # ][ # # ]: 0 : if ( pVCLXAccessibleTabPage && pVCLXAccessibleTabPage->GetPageId() == nPageId )
[ # # ]
229 : : {
230 [ # # ]: 0 : RemoveChild( i );
231 : : break;
232 : : }
233 : : }
234 [ # # ]: 0 : }
235 : : }
236 : : }
237 : 0 : break;
238 : : case VCLEVENT_TABPAGE_REMOVEDALL:
239 : : {
240 [ # # ]: 0 : for ( sal_Int32 i = m_aAccessibleChildren.size() - 1; i >= 0; --i )
241 : 0 : RemoveChild( i );
242 : : }
243 : 0 : break;
244 : : case VCLEVENT_WINDOW_GETFOCUS:
245 : : case VCLEVENT_WINDOW_LOSEFOCUS:
246 : : {
247 : 0 : UpdateFocused();
248 : : }
249 : 0 : break;
250 : : case VCLEVENT_OBJECT_DYING:
251 : : {
252 [ # # ]: 0 : if ( m_pTabControl )
253 : : {
254 : 0 : m_pTabControl = NULL;
255 : :
256 : : // dispose all tab pages
257 [ # # ]: 0 : for ( sal_uInt32 i = 0; i < m_aAccessibleChildren.size(); ++i )
258 : : {
259 [ # # ]: 0 : Reference< XComponent > xComponent( m_aAccessibleChildren[i], UNO_QUERY );
260 [ # # ]: 0 : if ( xComponent.is() )
261 [ # # ][ # # ]: 0 : xComponent->dispose();
262 : 0 : }
263 : 0 : m_aAccessibleChildren.clear();
264 : : }
265 : :
266 : 0 : VCLXAccessibleComponent::ProcessWindowEvent( rVclWindowEvent );
267 : : }
268 : 0 : break;
269 : : default:
270 : 0 : VCLXAccessibleComponent::ProcessWindowEvent( rVclWindowEvent );
271 : : }
272 : 0 : }
273 : :
274 : : // -----------------------------------------------------------------------------
275 : :
276 : 0 : void VCLXAccessibleTabControl::ProcessWindowChildEvent( const VclWindowEvent& rVclWindowEvent )
277 : : {
278 [ # # ]: 0 : switch ( rVclWindowEvent.GetId() )
279 : : {
280 : : case VCLEVENT_WINDOW_SHOW:
281 : : case VCLEVENT_WINDOW_HIDE:
282 : : {
283 [ # # ]: 0 : if ( m_pTabControl )
284 : : {
285 : 0 : Window* pChild = static_cast< Window* >( rVclWindowEvent.GetData() );
286 [ # # ][ # # ]: 0 : if ( pChild && pChild->GetType() == WINDOW_TABPAGE )
[ # # ]
287 : : {
288 [ # # ]: 0 : for ( sal_Int32 i = 0, nCount = m_pTabControl->GetPageCount(); i < nCount; ++i )
289 : : {
290 : 0 : sal_uInt16 nPageId = m_pTabControl->GetPageId( (sal_uInt16)i );
291 : 0 : TabPage* pTabPage = m_pTabControl->GetTabPage( nPageId );
292 [ # # ]: 0 : if ( pTabPage == (TabPage*) pChild )
293 : 0 : UpdateTabPage( i, rVclWindowEvent.GetId() == VCLEVENT_WINDOW_SHOW );
294 : : }
295 : : }
296 : : }
297 : : }
298 : 0 : break;
299 : : default:
300 : 0 : VCLXAccessibleComponent::ProcessWindowChildEvent( rVclWindowEvent );
301 : : }
302 : 0 : }
303 : :
304 : :
305 : : // -----------------------------------------------------------------------------
306 : :
307 : 0 : void VCLXAccessibleTabControl::FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet )
308 : : {
309 : 0 : VCLXAccessibleComponent::FillAccessibleStateSet( rStateSet );
310 : :
311 [ # # ]: 0 : if ( m_pTabControl )
312 : 0 : rStateSet.AddState( AccessibleStateType::FOCUSABLE );
313 : 0 : }
314 : :
315 : : // -----------------------------------------------------------------------------
316 : : // XInterface
317 : : // -----------------------------------------------------------------------------
318 : :
319 [ # # ][ # # ]: 0 : IMPLEMENT_FORWARD_XINTERFACE2( VCLXAccessibleTabControl, VCLXAccessibleComponent, VCLXAccessibleTabControl_BASE )
320 : :
321 : : // -----------------------------------------------------------------------------
322 : : // XTypeProvider
323 : : // -----------------------------------------------------------------------------
324 : :
325 [ # # ][ # # ]: 0 : IMPLEMENT_FORWARD_XTYPEPROVIDER2( VCLXAccessibleTabControl, VCLXAccessibleComponent, VCLXAccessibleTabControl_BASE )
[ # # ]
326 : :
327 : : // -----------------------------------------------------------------------------
328 : : // XComponent
329 : : // -----------------------------------------------------------------------------
330 : :
331 : 0 : void VCLXAccessibleTabControl::disposing()
332 : : {
333 : 0 : VCLXAccessibleComponent::disposing();
334 : :
335 [ # # ]: 0 : if ( m_pTabControl )
336 : : {
337 : 0 : m_pTabControl = NULL;
338 : :
339 : : // dispose all tab pages
340 [ # # ]: 0 : for ( sal_uInt32 i = 0; i < m_aAccessibleChildren.size(); ++i )
341 : : {
342 [ # # ]: 0 : Reference< XComponent > xComponent( m_aAccessibleChildren[i], UNO_QUERY );
343 [ # # ]: 0 : if ( xComponent.is() )
344 [ # # ][ # # ]: 0 : xComponent->dispose();
345 : 0 : }
346 : 0 : m_aAccessibleChildren.clear();
347 : : }
348 : 0 : }
349 : :
350 : : // -----------------------------------------------------------------------------
351 : : // XServiceInfo
352 : : // -----------------------------------------------------------------------------
353 : :
354 : 0 : ::rtl::OUString VCLXAccessibleTabControl::getImplementationName() throw (RuntimeException)
355 : : {
356 : 0 : return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.toolkit.AccessibleTabControl") );
357 : : }
358 : :
359 : : // -----------------------------------------------------------------------------
360 : :
361 : 0 : Sequence< ::rtl::OUString > VCLXAccessibleTabControl::getSupportedServiceNames() throw (RuntimeException)
362 : : {
363 : 0 : Sequence< ::rtl::OUString > aNames(1);
364 [ # # ][ # # ]: 0 : aNames[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.awt.AccessibleTabControl") );
365 : 0 : return aNames;
366 : : }
367 : :
368 : : // -----------------------------------------------------------------------------
369 : : // XAccessibleContext
370 : : // -----------------------------------------------------------------------------
371 : :
372 : 0 : sal_Int32 VCLXAccessibleTabControl::getAccessibleChildCount() throw (RuntimeException)
373 : : {
374 [ # # ]: 0 : OExternalLockGuard aGuard( this );
375 : :
376 [ # # ]: 0 : return m_aAccessibleChildren.size();
377 : : }
378 : :
379 : : // -----------------------------------------------------------------------------
380 : :
381 : 0 : Reference< XAccessible > VCLXAccessibleTabControl::getAccessibleChild( sal_Int32 i ) throw (IndexOutOfBoundsException, RuntimeException)
382 : : {
383 [ # # ]: 0 : OExternalLockGuard aGuard( this );
384 : :
385 [ # # ][ # # ]: 0 : if ( i < 0 || i >= getAccessibleChildCount() )
[ # # ][ # # ]
386 [ # # ]: 0 : throw IndexOutOfBoundsException();
387 : :
388 : 0 : Reference< XAccessible > xChild = m_aAccessibleChildren[i];
389 [ # # ]: 0 : if ( !xChild.is() )
390 : : {
391 [ # # ]: 0 : if ( m_pTabControl )
392 : : {
393 [ # # ]: 0 : sal_uInt16 nPageId = m_pTabControl->GetPageId( (sal_uInt16)i );
394 : :
395 [ # # ][ # # ]: 0 : xChild = new VCLXAccessibleTabPage( m_pTabControl, nPageId );
[ # # ]
396 : :
397 : : // insert into tab page list
398 [ # # ]: 0 : m_aAccessibleChildren[i] = xChild;
399 : : }
400 : : }
401 : :
402 [ # # ]: 0 : return xChild;
403 : : }
404 : :
405 : : // -----------------------------------------------------------------------------
406 : :
407 : 0 : sal_Int16 VCLXAccessibleTabControl::getAccessibleRole( ) throw (RuntimeException)
408 : : {
409 [ # # ]: 0 : OExternalLockGuard aGuard( this );
410 : :
411 [ # # ]: 0 : return AccessibleRole::PAGE_TAB_LIST;
412 : : }
413 : :
414 : : // -----------------------------------------------------------------------------
415 : :
416 : 0 : ::rtl::OUString VCLXAccessibleTabControl::getAccessibleName( ) throw (RuntimeException)
417 : : {
418 [ # # ]: 0 : OExternalLockGuard aGuard( this );
419 : :
420 [ # # ]: 0 : return ::rtl::OUString();
421 : : }
422 : :
423 : : // -----------------------------------------------------------------------------
424 : : // XAccessibleSelection
425 : : // -----------------------------------------------------------------------------
426 : :
427 : 0 : void VCLXAccessibleTabControl::selectAccessibleChild( sal_Int32 nChildIndex ) throw (IndexOutOfBoundsException, RuntimeException)
428 : : {
429 [ # # ]: 0 : OExternalLockGuard aGuard( this );
430 : :
431 [ # # ][ # # ]: 0 : if ( nChildIndex < 0 || nChildIndex >= getAccessibleChildCount() )
[ # # ][ # # ]
432 [ # # ]: 0 : throw IndexOutOfBoundsException();
433 : :
434 [ # # ]: 0 : if ( m_pTabControl )
435 [ # # ][ # # ]: 0 : m_pTabControl->SelectTabPage( m_pTabControl->GetPageId( (sal_uInt16)nChildIndex ) );
[ # # ]
436 : 0 : }
437 : :
438 : : // -----------------------------------------------------------------------------
439 : :
440 : 0 : sal_Bool VCLXAccessibleTabControl::isAccessibleChildSelected( sal_Int32 nChildIndex ) throw (IndexOutOfBoundsException, RuntimeException)
441 : : {
442 [ # # ]: 0 : OExternalLockGuard aGuard( this );
443 : :
444 [ # # ][ # # ]: 0 : if ( nChildIndex < 0 || nChildIndex >= getAccessibleChildCount() )
[ # # ][ # # ]
445 [ # # ]: 0 : throw IndexOutOfBoundsException();
446 : :
447 : 0 : sal_Bool bSelected = sal_False;
448 [ # # ][ # # ]: 0 : if ( m_pTabControl && m_pTabControl->GetCurPageId() == m_pTabControl->GetPageId( (sal_uInt16)nChildIndex ) )
[ # # ][ # # ]
[ # # ]
449 : 0 : bSelected = sal_True;
450 : :
451 [ # # ]: 0 : return bSelected;
452 : : }
453 : :
454 : : // -----------------------------------------------------------------------------
455 : :
456 : 0 : void VCLXAccessibleTabControl::clearAccessibleSelection( ) throw (RuntimeException)
457 : : {
458 : : // This method makes no sense in a tab control, and so does nothing.
459 : 0 : }
460 : :
461 : : // -----------------------------------------------------------------------------
462 : :
463 : 0 : void VCLXAccessibleTabControl::selectAllAccessibleChildren( ) throw (RuntimeException)
464 : : {
465 [ # # ]: 0 : OExternalLockGuard aGuard( this );
466 : :
467 [ # # ][ # # ]: 0 : selectAccessibleChild( 0 );
468 : 0 : }
469 : :
470 : : // -----------------------------------------------------------------------------
471 : :
472 : 0 : sal_Int32 VCLXAccessibleTabControl::getSelectedAccessibleChildCount( ) throw (RuntimeException)
473 : : {
474 [ # # ]: 0 : OExternalLockGuard aGuard( this );
475 : :
476 [ # # ]: 0 : return 1;
477 : : }
478 : :
479 : : // -----------------------------------------------------------------------------
480 : :
481 : 0 : Reference< XAccessible > VCLXAccessibleTabControl::getSelectedAccessibleChild( sal_Int32 nSelectedChildIndex ) throw (IndexOutOfBoundsException, RuntimeException)
482 : : {
483 [ # # ]: 0 : OExternalLockGuard aGuard( this );
484 : :
485 [ # # ][ # # ]: 0 : if ( nSelectedChildIndex < 0 || nSelectedChildIndex >= getSelectedAccessibleChildCount() )
[ # # ][ # # ]
486 [ # # ]: 0 : throw IndexOutOfBoundsException();
487 : :
488 : 0 : Reference< XAccessible > xChild;
489 : :
490 [ # # ][ # # ]: 0 : for ( sal_Int32 i = 0, j = 0, nCount = getAccessibleChildCount(); i < nCount; i++ )
491 : : {
492 [ # # ][ # # ]: 0 : if ( isAccessibleChildSelected( i ) && ( j++ == nSelectedChildIndex ) )
[ # # ][ # # ]
493 : : {
494 [ # # ][ # # ]: 0 : xChild = getAccessibleChild( i );
495 : 0 : break;
496 : : }
497 : : }
498 : :
499 [ # # ]: 0 : return xChild;
500 : : }
501 : :
502 : : // -----------------------------------------------------------------------------
503 : :
504 : 0 : void VCLXAccessibleTabControl::deselectAccessibleChild( sal_Int32 nChildIndex ) throw (IndexOutOfBoundsException, RuntimeException)
505 : : {
506 [ # # ]: 0 : OExternalLockGuard aGuard( this );
507 : :
508 [ # # ][ # # ]: 0 : if ( nChildIndex < 0 || nChildIndex >= getAccessibleChildCount() )
[ # # ][ # # ]
509 [ # # ][ # # ]: 0 : throw IndexOutOfBoundsException();
510 : :
511 : : // This method makes no sense in a tab control, and so does nothing.
512 : 0 : }
513 : :
514 : : // -----------------------------------------------------------------------------
515 : :
516 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|