1*cdf0e10cSrcweir /************************************************************************* 2*cdf0e10cSrcweir * 3*cdf0e10cSrcweir * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4*cdf0e10cSrcweir * 5*cdf0e10cSrcweir * Copyright 2000, 2010 Oracle and/or its affiliates. 6*cdf0e10cSrcweir * 7*cdf0e10cSrcweir * OpenOffice.org - a multi-platform office productivity suite 8*cdf0e10cSrcweir * 9*cdf0e10cSrcweir * This file is part of OpenOffice.org. 10*cdf0e10cSrcweir * 11*cdf0e10cSrcweir * OpenOffice.org is free software: you can redistribute it and/or modify 12*cdf0e10cSrcweir * it under the terms of the GNU Lesser General Public License version 3 13*cdf0e10cSrcweir * only, as published by the Free Software Foundation. 14*cdf0e10cSrcweir * 15*cdf0e10cSrcweir * OpenOffice.org is distributed in the hope that it will be useful, 16*cdf0e10cSrcweir * but WITHOUT ANY WARRANTY; without even the implied warranty of 17*cdf0e10cSrcweir * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18*cdf0e10cSrcweir * GNU Lesser General Public License version 3 for more details 19*cdf0e10cSrcweir * (a copy is included in the LICENSE file that accompanied this code). 20*cdf0e10cSrcweir * 21*cdf0e10cSrcweir * You should have received a copy of the GNU Lesser General Public License 22*cdf0e10cSrcweir * version 3 along with OpenOffice.org. If not, see 23*cdf0e10cSrcweir * <http://www.openoffice.org/license.html> 24*cdf0e10cSrcweir * for a copy of the LGPLv3 License. 25*cdf0e10cSrcweir * 26*cdf0e10cSrcweir ************************************************************************/ 27*cdf0e10cSrcweir 28*cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove 29*cdf0e10cSrcweir #include "precompiled_accessibility.hxx" 30*cdf0e10cSrcweir 31*cdf0e10cSrcweir #ifndef ACCESSIBILITY_EXT_ACCESSIBLETABLISTBOXTABLE_HXX_ 32*cdf0e10cSrcweir #include "accessibility/extended/accessibletablistboxtable.hxx" 33*cdf0e10cSrcweir #endif 34*cdf0e10cSrcweir #include "accessibility/extended/AccessibleBrowseBoxTableCell.hxx" 35*cdf0e10cSrcweir #include "accessibility/extended/AccessibleBrowseBoxCheckBoxCell.hxx" 36*cdf0e10cSrcweir #include <svtools/svtabbx.hxx> 37*cdf0e10cSrcweir #include <com/sun/star/accessibility/AccessibleEventId.hpp> 38*cdf0e10cSrcweir 39*cdf0e10cSrcweir //........................................................................ 40*cdf0e10cSrcweir namespace accessibility 41*cdf0e10cSrcweir { 42*cdf0e10cSrcweir //........................................................................ 43*cdf0e10cSrcweir 44*cdf0e10cSrcweir // class TLBSolarGuard --------------------------------------------------------- 45*cdf0e10cSrcweir 46*cdf0e10cSrcweir /** Aquire the solar mutex. */ 47*cdf0e10cSrcweir class TLBSolarGuard : public ::vos::OGuard 48*cdf0e10cSrcweir { 49*cdf0e10cSrcweir public: 50*cdf0e10cSrcweir inline TLBSolarGuard() : ::vos::OGuard( Application::GetSolarMutex() ) {} 51*cdf0e10cSrcweir }; 52*cdf0e10cSrcweir 53*cdf0e10cSrcweir // class AccessibleTabListBoxTable --------------------------------------------- 54*cdf0e10cSrcweir 55*cdf0e10cSrcweir using namespace ::com::sun::star::accessibility; 56*cdf0e10cSrcweir using namespace ::com::sun::star::uno; 57*cdf0e10cSrcweir using namespace ::com::sun::star::lang; 58*cdf0e10cSrcweir using namespace ::com::sun::star; 59*cdf0e10cSrcweir 60*cdf0e10cSrcweir DBG_NAME(AccessibleTabListBoxTable) 61*cdf0e10cSrcweir 62*cdf0e10cSrcweir // ----------------------------------------------------------------------------- 63*cdf0e10cSrcweir // Ctor() and Dtor() 64*cdf0e10cSrcweir // ----------------------------------------------------------------------------- 65*cdf0e10cSrcweir AccessibleTabListBoxTable::AccessibleTabListBoxTable( const Reference< XAccessible >& rxParent, SvHeaderTabListBox& rBox ) : 66*cdf0e10cSrcweir 67*cdf0e10cSrcweir AccessibleBrowseBoxTable( rxParent, rBox ), 68*cdf0e10cSrcweir 69*cdf0e10cSrcweir m_pTabListBox ( &rBox ) 70*cdf0e10cSrcweir 71*cdf0e10cSrcweir { 72*cdf0e10cSrcweir DBG_CTOR( AccessibleTabListBoxTable, NULL ); 73*cdf0e10cSrcweir 74*cdf0e10cSrcweir m_pTabListBox->AddEventListener( LINK( this, AccessibleTabListBoxTable, WindowEventListener ) ); 75*cdf0e10cSrcweir } 76*cdf0e10cSrcweir // ----------------------------------------------------------------------------- 77*cdf0e10cSrcweir AccessibleTabListBoxTable::~AccessibleTabListBoxTable() 78*cdf0e10cSrcweir { 79*cdf0e10cSrcweir DBG_DTOR( AccessibleTabListBoxTable, NULL ); 80*cdf0e10cSrcweir 81*cdf0e10cSrcweir if ( isAlive() ) 82*cdf0e10cSrcweir { 83*cdf0e10cSrcweir m_pTabListBox = NULL; 84*cdf0e10cSrcweir 85*cdf0e10cSrcweir // increment ref count to prevent double call of Dtor 86*cdf0e10cSrcweir osl_incrementInterlockedCount( &m_refCount ); 87*cdf0e10cSrcweir dispose(); 88*cdf0e10cSrcweir } 89*cdf0e10cSrcweir } 90*cdf0e10cSrcweir // ----------------------------------------------------------------------------- 91*cdf0e10cSrcweir void AccessibleTabListBoxTable::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ) 92*cdf0e10cSrcweir { 93*cdf0e10cSrcweir if ( isAlive() ) 94*cdf0e10cSrcweir { 95*cdf0e10cSrcweir sal_uLong nEventId = rVclWindowEvent.GetId(); 96*cdf0e10cSrcweir switch ( nEventId ) 97*cdf0e10cSrcweir { 98*cdf0e10cSrcweir case VCLEVENT_OBJECT_DYING : 99*cdf0e10cSrcweir { 100*cdf0e10cSrcweir m_pTabListBox->RemoveEventListener( LINK( this, AccessibleTabListBoxTable, WindowEventListener ) ); 101*cdf0e10cSrcweir m_pTabListBox = NULL; 102*cdf0e10cSrcweir break; 103*cdf0e10cSrcweir } 104*cdf0e10cSrcweir 105*cdf0e10cSrcweir case VCLEVENT_CONTROL_GETFOCUS : 106*cdf0e10cSrcweir case VCLEVENT_CONTROL_LOSEFOCUS : 107*cdf0e10cSrcweir { 108*cdf0e10cSrcweir uno::Any aOldValue, aNewValue; 109*cdf0e10cSrcweir if ( VCLEVENT_CONTROL_GETFOCUS == nEventId ) 110*cdf0e10cSrcweir aNewValue <<= AccessibleStateType::FOCUSED; 111*cdf0e10cSrcweir else 112*cdf0e10cSrcweir aOldValue <<= AccessibleStateType::FOCUSED; 113*cdf0e10cSrcweir commitEvent( AccessibleEventId::STATE_CHANGED, aNewValue, aOldValue ); 114*cdf0e10cSrcweir break; 115*cdf0e10cSrcweir } 116*cdf0e10cSrcweir 117*cdf0e10cSrcweir case VCLEVENT_LISTBOX_SELECT : 118*cdf0e10cSrcweir { 119*cdf0e10cSrcweir // First send an event that tells the listeners of a 120*cdf0e10cSrcweir // modified selection. The active descendant event is 121*cdf0e10cSrcweir // send after that so that the receiving AT has time to 122*cdf0e10cSrcweir // read the text or name of the active child. 123*cdf0e10cSrcweir commitEvent( AccessibleEventId::SELECTION_CHANGED, Any(), Any() ); 124*cdf0e10cSrcweir if ( m_pTabListBox && m_pTabListBox->HasFocus() ) 125*cdf0e10cSrcweir { 126*cdf0e10cSrcweir SvLBoxEntry* pEntry = static_cast< SvLBoxEntry* >( rVclWindowEvent.GetData() ); 127*cdf0e10cSrcweir if ( pEntry ) 128*cdf0e10cSrcweir { 129*cdf0e10cSrcweir sal_Int32 nRow = m_pTabListBox->GetEntryPos( pEntry ); 130*cdf0e10cSrcweir sal_uInt16 nCol = m_pTabListBox->GetCurrColumn(); 131*cdf0e10cSrcweir Reference< XAccessible > xChild = 132*cdf0e10cSrcweir m_pTabListBox->CreateAccessibleCell( nRow, nCol ); 133*cdf0e10cSrcweir uno::Any aOldValue, aNewValue; 134*cdf0e10cSrcweir 135*cdf0e10cSrcweir if ( m_pTabListBox->IsTransientChildrenDisabled() ) 136*cdf0e10cSrcweir { 137*cdf0e10cSrcweir aNewValue <<= AccessibleStateType::FOCUSED; 138*cdf0e10cSrcweir TriState eState = STATE_DONTKNOW; 139*cdf0e10cSrcweir if ( m_pTabListBox->IsCellCheckBox( nRow, nCol, eState ) ) 140*cdf0e10cSrcweir { 141*cdf0e10cSrcweir AccessibleCheckBoxCell* pCell = 142*cdf0e10cSrcweir static_cast< AccessibleCheckBoxCell* >( xChild.get() ); 143*cdf0e10cSrcweir pCell->commitEvent( AccessibleEventId::STATE_CHANGED, aNewValue, aOldValue ); 144*cdf0e10cSrcweir } 145*cdf0e10cSrcweir else 146*cdf0e10cSrcweir { 147*cdf0e10cSrcweir AccessibleBrowseBoxTableCell* pCell = 148*cdf0e10cSrcweir static_cast< AccessibleBrowseBoxTableCell* >( xChild.get() ); 149*cdf0e10cSrcweir pCell->commitEvent( AccessibleEventId::STATE_CHANGED, aNewValue, aOldValue ); 150*cdf0e10cSrcweir } 151*cdf0e10cSrcweir } 152*cdf0e10cSrcweir else 153*cdf0e10cSrcweir { 154*cdf0e10cSrcweir aNewValue <<= xChild; 155*cdf0e10cSrcweir commitEvent( AccessibleEventId::ACTIVE_DESCENDANT_CHANGED, aNewValue, aOldValue ); 156*cdf0e10cSrcweir } 157*cdf0e10cSrcweir } 158*cdf0e10cSrcweir } 159*cdf0e10cSrcweir break; 160*cdf0e10cSrcweir } 161*cdf0e10cSrcweir 162*cdf0e10cSrcweir case VCLEVENT_CHECKBOX_TOGGLE : 163*cdf0e10cSrcweir { 164*cdf0e10cSrcweir if ( m_pTabListBox && m_pTabListBox->HasFocus() ) 165*cdf0e10cSrcweir { 166*cdf0e10cSrcweir SvLBoxEntry* pEntry = static_cast< SvLBoxEntry* >( rVclWindowEvent.GetData() ); 167*cdf0e10cSrcweir if ( pEntry ) 168*cdf0e10cSrcweir { 169*cdf0e10cSrcweir sal_Int32 nRow = m_pTabListBox->GetEntryPos( pEntry ); 170*cdf0e10cSrcweir sal_uInt16 nCol = m_pTabListBox->GetCurrColumn(); 171*cdf0e10cSrcweir TriState eState = STATE_DONTKNOW; 172*cdf0e10cSrcweir if ( m_pTabListBox->IsCellCheckBox( nRow, nCol, eState ) ) 173*cdf0e10cSrcweir { 174*cdf0e10cSrcweir Reference< XAccessible > xChild = 175*cdf0e10cSrcweir m_pTabListBox->CreateAccessibleCell( nRow, nCol ); 176*cdf0e10cSrcweir AccessibleCheckBoxCell* pCell = 177*cdf0e10cSrcweir static_cast< AccessibleCheckBoxCell* >( xChild.get() ); 178*cdf0e10cSrcweir pCell->SetChecked( m_pTabListBox->IsItemChecked( pEntry, nCol ) ); 179*cdf0e10cSrcweir } 180*cdf0e10cSrcweir } 181*cdf0e10cSrcweir } 182*cdf0e10cSrcweir break; 183*cdf0e10cSrcweir } 184*cdf0e10cSrcweir 185*cdf0e10cSrcweir case VCLEVENT_TABLECELL_NAMECHANGED : 186*cdf0e10cSrcweir { 187*cdf0e10cSrcweir if ( m_pTabListBox->IsTransientChildrenDisabled() ) 188*cdf0e10cSrcweir { 189*cdf0e10cSrcweir commitEvent( AccessibleEventId::SELECTION_CHANGED, Any(), Any() ); 190*cdf0e10cSrcweir TabListBoxEventData* pData = static_cast< TabListBoxEventData* >( rVclWindowEvent.GetData() ); 191*cdf0e10cSrcweir SvLBoxEntry* pEntry = pData != NULL ? pData->m_pEntry : NULL; 192*cdf0e10cSrcweir if ( pEntry ) 193*cdf0e10cSrcweir { 194*cdf0e10cSrcweir sal_Int32 nRow = m_pTabListBox->GetEntryPos( pEntry ); 195*cdf0e10cSrcweir sal_uInt16 nCol = pData->m_nColumn; 196*cdf0e10cSrcweir Reference< XAccessible > xChild = 197*cdf0e10cSrcweir m_pTabListBox->CreateAccessibleCell( nRow, nCol ); 198*cdf0e10cSrcweir uno::Any aOldValue, aNewValue; 199*cdf0e10cSrcweir aOldValue <<= ::rtl::OUString( pData->m_sOldText ); 200*cdf0e10cSrcweir ::rtl::OUString sNewText( m_pTabListBox->GetCellText( nRow, nCol ) ); 201*cdf0e10cSrcweir aNewValue <<= sNewText; 202*cdf0e10cSrcweir TriState eState = STATE_DONTKNOW; 203*cdf0e10cSrcweir 204*cdf0e10cSrcweir if ( m_pTabListBox->IsCellCheckBox( nRow, nCol, eState ) ) 205*cdf0e10cSrcweir { 206*cdf0e10cSrcweir AccessibleCheckBoxCell* pCell = 207*cdf0e10cSrcweir static_cast< AccessibleCheckBoxCell* >( xChild.get() ); 208*cdf0e10cSrcweir pCell->commitEvent( AccessibleEventId::NAME_CHANGED, aOldValue, aNewValue ); 209*cdf0e10cSrcweir } 210*cdf0e10cSrcweir else 211*cdf0e10cSrcweir { 212*cdf0e10cSrcweir AccessibleBrowseBoxTableCell* pCell = 213*cdf0e10cSrcweir static_cast< AccessibleBrowseBoxTableCell* >( xChild.get() ); 214*cdf0e10cSrcweir pCell->nameChanged( sNewText, pData->m_sOldText ); 215*cdf0e10cSrcweir } 216*cdf0e10cSrcweir } 217*cdf0e10cSrcweir } 218*cdf0e10cSrcweir break; 219*cdf0e10cSrcweir } 220*cdf0e10cSrcweir } 221*cdf0e10cSrcweir } 222*cdf0e10cSrcweir } 223*cdf0e10cSrcweir // ----------------------------------------------------------------------------- 224*cdf0e10cSrcweir IMPL_LINK( AccessibleTabListBoxTable, WindowEventListener, VclSimpleEvent*, pEvent ) 225*cdf0e10cSrcweir { 226*cdf0e10cSrcweir DBG_ASSERT( pEvent && pEvent->ISA( VclWindowEvent ), "Unknown WindowEvent!" ); 227*cdf0e10cSrcweir if ( pEvent && pEvent->ISA( VclWindowEvent ) ) 228*cdf0e10cSrcweir { 229*cdf0e10cSrcweir DBG_ASSERT( ( (VclWindowEvent*)pEvent )->GetWindow() && m_pTabListBox, "no event window" ); 230*cdf0e10cSrcweir ProcessWindowEvent( *(VclWindowEvent*)pEvent ); 231*cdf0e10cSrcweir } 232*cdf0e10cSrcweir return 0; 233*cdf0e10cSrcweir } 234*cdf0e10cSrcweir // helpers -------------------------------------------------------------------- 235*cdf0e10cSrcweir 236*cdf0e10cSrcweir void AccessibleTabListBoxTable::ensureValidIndex( sal_Int32 _nIndex ) const 237*cdf0e10cSrcweir SAL_THROW( ( IndexOutOfBoundsException ) ) 238*cdf0e10cSrcweir { 239*cdf0e10cSrcweir if ( ( _nIndex < 0 ) || ( _nIndex >= implGetCellCount() ) ) 240*cdf0e10cSrcweir throw IndexOutOfBoundsException(); 241*cdf0e10cSrcweir } 242*cdf0e10cSrcweir 243*cdf0e10cSrcweir sal_Bool AccessibleTabListBoxTable::implIsRowSelected( sal_Int32 _nRow ) const 244*cdf0e10cSrcweir { 245*cdf0e10cSrcweir return m_pTabListBox ? m_pTabListBox->IsSelected( m_pTabListBox->GetEntry( _nRow ) ) : sal_False; 246*cdf0e10cSrcweir } 247*cdf0e10cSrcweir 248*cdf0e10cSrcweir void AccessibleTabListBoxTable::implSelectRow( sal_Int32 _nRow, sal_Bool _bSelect ) 249*cdf0e10cSrcweir { 250*cdf0e10cSrcweir if ( m_pTabListBox ) 251*cdf0e10cSrcweir m_pTabListBox->Select( m_pTabListBox->GetEntry( _nRow ), _bSelect ); 252*cdf0e10cSrcweir } 253*cdf0e10cSrcweir 254*cdf0e10cSrcweir sal_Int32 AccessibleTabListBoxTable::implGetRowCount() const 255*cdf0e10cSrcweir { 256*cdf0e10cSrcweir return m_pTabListBox ? m_pTabListBox->GetEntryCount() : 0; 257*cdf0e10cSrcweir } 258*cdf0e10cSrcweir 259*cdf0e10cSrcweir sal_Int32 AccessibleTabListBoxTable::implGetColumnCount() const 260*cdf0e10cSrcweir { 261*cdf0e10cSrcweir return m_pTabListBox ? m_pTabListBox->GetColumnCount() : 0; 262*cdf0e10cSrcweir } 263*cdf0e10cSrcweir 264*cdf0e10cSrcweir sal_Int32 AccessibleTabListBoxTable::implGetSelRowCount() const 265*cdf0e10cSrcweir { 266*cdf0e10cSrcweir return m_pTabListBox ? m_pTabListBox->GetSelectionCount() : 0; 267*cdf0e10cSrcweir } 268*cdf0e10cSrcweir 269*cdf0e10cSrcweir sal_Int32 AccessibleTabListBoxTable::implGetSelRow( sal_Int32 nSelRow ) const 270*cdf0e10cSrcweir { 271*cdf0e10cSrcweir if ( m_pTabListBox ) 272*cdf0e10cSrcweir { 273*cdf0e10cSrcweir sal_Int32 nRow = 0; 274*cdf0e10cSrcweir SvLBoxEntry* pEntry = m_pTabListBox->FirstSelected(); 275*cdf0e10cSrcweir while ( pEntry ) 276*cdf0e10cSrcweir { 277*cdf0e10cSrcweir ++nRow; 278*cdf0e10cSrcweir if ( nRow == nSelRow ) 279*cdf0e10cSrcweir return m_pTabListBox->GetEntryPos( pEntry ); 280*cdf0e10cSrcweir pEntry = m_pTabListBox->NextSelected( pEntry ); 281*cdf0e10cSrcweir } 282*cdf0e10cSrcweir } 283*cdf0e10cSrcweir 284*cdf0e10cSrcweir return 0; 285*cdf0e10cSrcweir } 286*cdf0e10cSrcweir // ----------------------------------------------------------------------------- 287*cdf0e10cSrcweir // XInterface & XTypeProvider 288*cdf0e10cSrcweir // ----------------------------------------------------------------------------- 289*cdf0e10cSrcweir IMPLEMENT_FORWARD_XINTERFACE2(AccessibleTabListBoxTable, AccessibleBrowseBoxTable, AccessibleTabListBoxTableImplHelper) 290*cdf0e10cSrcweir IMPLEMENT_FORWARD_XTYPEPROVIDER2(AccessibleTabListBoxTable, AccessibleBrowseBoxTable, AccessibleTabListBoxTableImplHelper) 291*cdf0e10cSrcweir // ----------------------------------------------------------------------------- 292*cdf0e10cSrcweir // XServiceInfo 293*cdf0e10cSrcweir // ----------------------------------------------------------------------------- 294*cdf0e10cSrcweir ::rtl::OUString AccessibleTabListBoxTable::getImplementationName (void) throw (RuntimeException) 295*cdf0e10cSrcweir { 296*cdf0e10cSrcweir return ::rtl::OUString::createFromAscii("com.sun.star.comp.svtools.AccessibleTabListBoxTable"); 297*cdf0e10cSrcweir } 298*cdf0e10cSrcweir // ----------------------------------------------------------------------------- 299*cdf0e10cSrcweir // XAccessibleSelection 300*cdf0e10cSrcweir // ----------------------------------------------------------------------------- 301*cdf0e10cSrcweir void SAL_CALL AccessibleTabListBoxTable::selectAccessibleChild( sal_Int32 nChildIndex ) throw (IndexOutOfBoundsException, RuntimeException) 302*cdf0e10cSrcweir { 303*cdf0e10cSrcweir TLBSolarGuard aSolarGuard; 304*cdf0e10cSrcweir ::osl::MutexGuard aGuard( getOslMutex() ); 305*cdf0e10cSrcweir 306*cdf0e10cSrcweir ensureIsAlive(); 307*cdf0e10cSrcweir ensureValidIndex( nChildIndex ); 308*cdf0e10cSrcweir 309*cdf0e10cSrcweir implSelectRow( implGetRow( nChildIndex ), sal_True ); 310*cdf0e10cSrcweir } 311*cdf0e10cSrcweir // ----------------------------------------------------------------------------- 312*cdf0e10cSrcweir sal_Bool SAL_CALL AccessibleTabListBoxTable::isAccessibleChildSelected( sal_Int32 nChildIndex ) throw (IndexOutOfBoundsException, RuntimeException) 313*cdf0e10cSrcweir { 314*cdf0e10cSrcweir TLBSolarGuard aSolarGuard; 315*cdf0e10cSrcweir ::osl::MutexGuard aGuard( getOslMutex() ); 316*cdf0e10cSrcweir 317*cdf0e10cSrcweir ensureIsAlive(); 318*cdf0e10cSrcweir ensureValidIndex( nChildIndex ); 319*cdf0e10cSrcweir 320*cdf0e10cSrcweir return implIsRowSelected( implGetRow( nChildIndex ) ); 321*cdf0e10cSrcweir } 322*cdf0e10cSrcweir // ----------------------------------------------------------------------------- 323*cdf0e10cSrcweir void SAL_CALL AccessibleTabListBoxTable::clearAccessibleSelection( ) throw (RuntimeException) 324*cdf0e10cSrcweir { 325*cdf0e10cSrcweir TLBSolarGuard aSolarGuard; 326*cdf0e10cSrcweir ::osl::MutexGuard aGuard( getOslMutex() ); 327*cdf0e10cSrcweir 328*cdf0e10cSrcweir ensureIsAlive(); 329*cdf0e10cSrcweir 330*cdf0e10cSrcweir m_pTabListBox->SetNoSelection(); 331*cdf0e10cSrcweir } 332*cdf0e10cSrcweir // ----------------------------------------------------------------------------- 333*cdf0e10cSrcweir void SAL_CALL AccessibleTabListBoxTable::selectAllAccessibleChildren( ) throw (RuntimeException) 334*cdf0e10cSrcweir { 335*cdf0e10cSrcweir TLBSolarGuard aSolarGuard; 336*cdf0e10cSrcweir ::osl::MutexGuard aGuard( getOslMutex() ); 337*cdf0e10cSrcweir 338*cdf0e10cSrcweir ensureIsAlive(); 339*cdf0e10cSrcweir 340*cdf0e10cSrcweir m_pTabListBox->SelectAll(); 341*cdf0e10cSrcweir } 342*cdf0e10cSrcweir // ----------------------------------------------------------------------------- 343*cdf0e10cSrcweir sal_Int32 SAL_CALL AccessibleTabListBoxTable::getSelectedAccessibleChildCount( ) throw (RuntimeException) 344*cdf0e10cSrcweir { 345*cdf0e10cSrcweir TLBSolarGuard aSolarGuard; 346*cdf0e10cSrcweir ::osl::MutexGuard aGuard( getOslMutex() ); 347*cdf0e10cSrcweir 348*cdf0e10cSrcweir ensureIsAlive(); 349*cdf0e10cSrcweir 350*cdf0e10cSrcweir return implGetColumnCount() * implGetSelRowCount(); 351*cdf0e10cSrcweir } 352*cdf0e10cSrcweir // ----------------------------------------------------------------------------- 353*cdf0e10cSrcweir Reference< XAccessible > SAL_CALL AccessibleTabListBoxTable::getSelectedAccessibleChild( sal_Int32 nSelectedChildIndex ) throw (IndexOutOfBoundsException, RuntimeException) 354*cdf0e10cSrcweir { 355*cdf0e10cSrcweir TLBSolarGuard aSolarGuard; 356*cdf0e10cSrcweir ::osl::MutexGuard aGuard( getOslMutex() ); 357*cdf0e10cSrcweir 358*cdf0e10cSrcweir ensureIsAlive(); 359*cdf0e10cSrcweir 360*cdf0e10cSrcweir sal_Int32 nRows = implGetSelRowCount(); 361*cdf0e10cSrcweir if ( nRows == 0 ) 362*cdf0e10cSrcweir throw IndexOutOfBoundsException(); 363*cdf0e10cSrcweir 364*cdf0e10cSrcweir sal_Int32 nRow = implGetSelRow( nSelectedChildIndex % nRows ); 365*cdf0e10cSrcweir sal_Int32 nColumn = nSelectedChildIndex / nRows; 366*cdf0e10cSrcweir return getAccessibleCellAt( nRow, nColumn ); 367*cdf0e10cSrcweir } 368*cdf0e10cSrcweir // ----------------------------------------------------------------------------- 369*cdf0e10cSrcweir void SAL_CALL AccessibleTabListBoxTable::deselectAccessibleChild( sal_Int32 nSelectedChildIndex ) throw (IndexOutOfBoundsException, RuntimeException) 370*cdf0e10cSrcweir { 371*cdf0e10cSrcweir TLBSolarGuard aSolarGuard; 372*cdf0e10cSrcweir ::osl::MutexGuard aGuard( getOslMutex() ); 373*cdf0e10cSrcweir 374*cdf0e10cSrcweir ensureIsAlive(); 375*cdf0e10cSrcweir ensureValidIndex( nSelectedChildIndex ); 376*cdf0e10cSrcweir 377*cdf0e10cSrcweir implSelectRow( implGetRow( nSelectedChildIndex ), sal_False ); 378*cdf0e10cSrcweir } 379*cdf0e10cSrcweir 380*cdf0e10cSrcweir //........................................................................ 381*cdf0e10cSrcweir }// namespace accessibility 382*cdf0e10cSrcweir //........................................................................ 383*cdf0e10cSrcweir 384