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 #include "accessibility/extended/AccessibleBrowseBoxTableCell.hxx" 32*cdf0e10cSrcweir #include <svtools/accessibletableprovider.hxx> 33*cdf0e10cSrcweir #include "accessibility/extended/AccessibleBrowseBox.hxx" 34*cdf0e10cSrcweir #include <tools/gen.hxx> 35*cdf0e10cSrcweir #include <toolkit/helper/vclunohelper.hxx> 36*cdf0e10cSrcweir #include <com/sun/star/accessibility/AccessibleEventId.hpp> 37*cdf0e10cSrcweir 38*cdf0e10cSrcweir namespace accessibility 39*cdf0e10cSrcweir { 40*cdf0e10cSrcweir namespace 41*cdf0e10cSrcweir { 42*cdf0e10cSrcweir void checkIndex_Impl( sal_Int32 _nIndex, const ::rtl::OUString& _sText ) throw (::com::sun::star::lang::IndexOutOfBoundsException) 43*cdf0e10cSrcweir { 44*cdf0e10cSrcweir if ( _nIndex >= _sText.getLength() ) 45*cdf0e10cSrcweir throw ::com::sun::star::lang::IndexOutOfBoundsException(); 46*cdf0e10cSrcweir } 47*cdf0e10cSrcweir 48*cdf0e10cSrcweir sal_Int32 getIndex_Impl( sal_Int32 _nRow, sal_uInt16 _nColumn, sal_uInt16 _nColumnCount ) 49*cdf0e10cSrcweir { 50*cdf0e10cSrcweir return _nRow * _nColumnCount + _nColumn; 51*cdf0e10cSrcweir } 52*cdf0e10cSrcweir } 53*cdf0e10cSrcweir using namespace ::com::sun::star::lang; 54*cdf0e10cSrcweir using namespace utl; 55*cdf0e10cSrcweir using namespace comphelper; 56*cdf0e10cSrcweir using ::rtl::OUString; 57*cdf0e10cSrcweir using ::accessibility::AccessibleBrowseBox; 58*cdf0e10cSrcweir using namespace ::com::sun::star::uno; 59*cdf0e10cSrcweir using ::com::sun::star::accessibility::XAccessible; 60*cdf0e10cSrcweir using namespace ::com::sun::star::accessibility; 61*cdf0e10cSrcweir using namespace ::svt; 62*cdf0e10cSrcweir 63*cdf0e10cSrcweir 64*cdf0e10cSrcweir // implementation of a table cell 65*cdf0e10cSrcweir ::rtl::OUString AccessibleBrowseBoxTableCell::implGetText() 66*cdf0e10cSrcweir { 67*cdf0e10cSrcweir ensureIsAlive(); 68*cdf0e10cSrcweir return mpBrowseBox->GetAccessibleCellText( getRowPos(), static_cast< sal_uInt16 >( getColumnPos() ) ); 69*cdf0e10cSrcweir } 70*cdf0e10cSrcweir 71*cdf0e10cSrcweir ::com::sun::star::lang::Locale AccessibleBrowseBoxTableCell::implGetLocale() 72*cdf0e10cSrcweir { 73*cdf0e10cSrcweir ensureIsAlive(); 74*cdf0e10cSrcweir return mpBrowseBox->GetAccessible()->getAccessibleContext()->getLocale(); 75*cdf0e10cSrcweir } 76*cdf0e10cSrcweir 77*cdf0e10cSrcweir void AccessibleBrowseBoxTableCell::implGetSelection( sal_Int32& nStartIndex, sal_Int32& nEndIndex ) 78*cdf0e10cSrcweir { 79*cdf0e10cSrcweir nStartIndex = 0; 80*cdf0e10cSrcweir nEndIndex = 0; 81*cdf0e10cSrcweir } 82*cdf0e10cSrcweir 83*cdf0e10cSrcweir AccessibleBrowseBoxTableCell::AccessibleBrowseBoxTableCell(const Reference<XAccessible >& _rxParent, 84*cdf0e10cSrcweir IAccessibleTableProvider& _rBrowseBox, 85*cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow >& _xFocusWindow, 86*cdf0e10cSrcweir sal_Int32 _nRowPos, 87*cdf0e10cSrcweir sal_uInt16 _nColPos, 88*cdf0e10cSrcweir sal_Int32 _nOffset ) 89*cdf0e10cSrcweir :AccessibleBrowseBoxCell( _rxParent, _rBrowseBox, _xFocusWindow, _nRowPos, _nColPos ) 90*cdf0e10cSrcweir { 91*cdf0e10cSrcweir m_nOffset = ( OFFSET_DEFAULT == _nOffset ) ? (sal_Int32)BBINDEX_FIRSTCONTROL : _nOffset; 92*cdf0e10cSrcweir sal_Int32 nIndex = getIndex_Impl( _nRowPos, _nColPos, _rBrowseBox.GetColumnCount() ); 93*cdf0e10cSrcweir setAccessibleName( _rBrowseBox.GetAccessibleObjectName( BBTYPE_TABLECELL, nIndex ) ); 94*cdf0e10cSrcweir setAccessibleDescription( _rBrowseBox.GetAccessibleObjectDescription( BBTYPE_TABLECELL, nIndex ) ); 95*cdf0e10cSrcweir // Need to register as event listener 96*cdf0e10cSrcweir Reference< XComponent > xComponent(_rxParent, UNO_QUERY); 97*cdf0e10cSrcweir if( xComponent.is() ) 98*cdf0e10cSrcweir xComponent->addEventListener(static_cast< XEventListener *> (this)); 99*cdf0e10cSrcweir } 100*cdf0e10cSrcweir 101*cdf0e10cSrcweir void AccessibleBrowseBoxTableCell::nameChanged( const ::rtl::OUString& rNewName, const ::rtl::OUString& rOldName ) 102*cdf0e10cSrcweir { 103*cdf0e10cSrcweir implSetName( rNewName ); 104*cdf0e10cSrcweir Any aOldValue, aNewValue; 105*cdf0e10cSrcweir aOldValue <<= rOldName; 106*cdf0e10cSrcweir aNewValue <<= rNewName; 107*cdf0e10cSrcweir commitEvent( AccessibleEventId::NAME_CHANGED, aOldValue, aNewValue ); 108*cdf0e10cSrcweir } 109*cdf0e10cSrcweir 110*cdf0e10cSrcweir // XInterface ------------------------------------------------------------- 111*cdf0e10cSrcweir 112*cdf0e10cSrcweir /** Queries for a new interface. */ 113*cdf0e10cSrcweir ::com::sun::star::uno::Any SAL_CALL AccessibleBrowseBoxTableCell::queryInterface( 114*cdf0e10cSrcweir const ::com::sun::star::uno::Type& rType ) 115*cdf0e10cSrcweir throw ( ::com::sun::star::uno::RuntimeException ) 116*cdf0e10cSrcweir { 117*cdf0e10cSrcweir Any aRet = AccessibleBrowseBoxCell::queryInterface(rType); 118*cdf0e10cSrcweir if ( !aRet.hasValue() ) 119*cdf0e10cSrcweir aRet = AccessibleTextHelper_BASE::queryInterface(rType); 120*cdf0e10cSrcweir return aRet; 121*cdf0e10cSrcweir } 122*cdf0e10cSrcweir 123*cdf0e10cSrcweir /** Aquires the object (calls acquire() on base class). */ 124*cdf0e10cSrcweir void SAL_CALL AccessibleBrowseBoxTableCell::acquire() throw () 125*cdf0e10cSrcweir { 126*cdf0e10cSrcweir AccessibleBrowseBoxCell::acquire(); 127*cdf0e10cSrcweir } 128*cdf0e10cSrcweir 129*cdf0e10cSrcweir /** Releases the object (calls release() on base class). */ 130*cdf0e10cSrcweir void SAL_CALL AccessibleBrowseBoxTableCell::release() throw () 131*cdf0e10cSrcweir { 132*cdf0e10cSrcweir AccessibleBrowseBoxCell::release(); 133*cdf0e10cSrcweir } 134*cdf0e10cSrcweir 135*cdf0e10cSrcweir ::com::sun::star::awt::Rectangle SAL_CALL AccessibleBrowseBoxTableCell::getCharacterBounds( sal_Int32 nIndex ) throw (IndexOutOfBoundsException, RuntimeException) 136*cdf0e10cSrcweir { 137*cdf0e10cSrcweir BBSolarGuard aSolarGuard; 138*cdf0e10cSrcweir ::osl::MutexGuard aGuard( getOslMutex() ); 139*cdf0e10cSrcweir 140*cdf0e10cSrcweir ensureIsAlive(); 141*cdf0e10cSrcweir if ( !implIsValidIndex( nIndex, implGetText().getLength() ) ) 142*cdf0e10cSrcweir throw IndexOutOfBoundsException(); 143*cdf0e10cSrcweir 144*cdf0e10cSrcweir ::com::sun::star::awt::Rectangle aRect; 145*cdf0e10cSrcweir 146*cdf0e10cSrcweir if ( mpBrowseBox ) 147*cdf0e10cSrcweir { 148*cdf0e10cSrcweir aRect = AWTRectangle( mpBrowseBox->GetFieldCharacterBounds( getRowPos(), getColumnPos(), nIndex ) ); 149*cdf0e10cSrcweir } 150*cdf0e10cSrcweir 151*cdf0e10cSrcweir return aRect; 152*cdf0e10cSrcweir } 153*cdf0e10cSrcweir 154*cdf0e10cSrcweir sal_Int32 SAL_CALL AccessibleBrowseBoxTableCell::getIndexAtPoint( const ::com::sun::star::awt::Point& _aPoint ) throw (RuntimeException) 155*cdf0e10cSrcweir { 156*cdf0e10cSrcweir //! TODO CTL bidi 157*cdf0e10cSrcweir // DBG_ASSERT(0,"Need to be done by base class!"); 158*cdf0e10cSrcweir BBSolarGuard aSolarGuard; 159*cdf0e10cSrcweir ::osl::MutexGuard aGuard( getOslMutex() ); 160*cdf0e10cSrcweir ensureIsAlive(); 161*cdf0e10cSrcweir 162*cdf0e10cSrcweir return mpBrowseBox->GetFieldIndexAtPoint( getRowPos(), getColumnPos(), VCLPoint( _aPoint ) ); 163*cdf0e10cSrcweir } 164*cdf0e10cSrcweir 165*cdf0e10cSrcweir /** @return 166*cdf0e10cSrcweir The name of this class. 167*cdf0e10cSrcweir */ 168*cdf0e10cSrcweir ::rtl::OUString SAL_CALL AccessibleBrowseBoxTableCell::getImplementationName() 169*cdf0e10cSrcweir throw ( ::com::sun::star::uno::RuntimeException ) 170*cdf0e10cSrcweir { 171*cdf0e10cSrcweir return ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.svtools.AccessibleBrowseBoxTableCell" ) ); 172*cdf0e10cSrcweir } 173*cdf0e10cSrcweir 174*cdf0e10cSrcweir /** @return The count of visible children. */ 175*cdf0e10cSrcweir sal_Int32 SAL_CALL AccessibleBrowseBoxTableCell::getAccessibleChildCount() 176*cdf0e10cSrcweir throw ( ::com::sun::star::uno::RuntimeException ) 177*cdf0e10cSrcweir { 178*cdf0e10cSrcweir return 0; 179*cdf0e10cSrcweir } 180*cdf0e10cSrcweir 181*cdf0e10cSrcweir /** @return The XAccessible interface of the specified child. */ 182*cdf0e10cSrcweir ::com::sun::star::uno::Reference< 183*cdf0e10cSrcweir ::com::sun::star::accessibility::XAccessible > SAL_CALL 184*cdf0e10cSrcweir AccessibleBrowseBoxTableCell::getAccessibleChild( sal_Int32 ) 185*cdf0e10cSrcweir throw ( ::com::sun::star::lang::IndexOutOfBoundsException, 186*cdf0e10cSrcweir ::com::sun::star::uno::RuntimeException ) 187*cdf0e10cSrcweir { 188*cdf0e10cSrcweir throw ::com::sun::star::lang::IndexOutOfBoundsException(); 189*cdf0e10cSrcweir } 190*cdf0e10cSrcweir 191*cdf0e10cSrcweir /** Creates a new AccessibleStateSetHelper and fills it with states of the 192*cdf0e10cSrcweir current object. 193*cdf0e10cSrcweir @return 194*cdf0e10cSrcweir A filled AccessibleStateSetHelper. 195*cdf0e10cSrcweir */ 196*cdf0e10cSrcweir ::utl::AccessibleStateSetHelper* AccessibleBrowseBoxTableCell::implCreateStateSetHelper() 197*cdf0e10cSrcweir { 198*cdf0e10cSrcweir BBSolarGuard aSolarGuard; 199*cdf0e10cSrcweir ::osl::MutexGuard aGuard( getOslMutex() ); 200*cdf0e10cSrcweir 201*cdf0e10cSrcweir ::utl::AccessibleStateSetHelper* pStateSetHelper = new ::utl::AccessibleStateSetHelper; 202*cdf0e10cSrcweir 203*cdf0e10cSrcweir if( isAlive() ) 204*cdf0e10cSrcweir { 205*cdf0e10cSrcweir // SHOWING done with mxParent 206*cdf0e10cSrcweir if( implIsShowing() ) 207*cdf0e10cSrcweir pStateSetHelper->AddState( AccessibleStateType::SHOWING ); 208*cdf0e10cSrcweir 209*cdf0e10cSrcweir mpBrowseBox->FillAccessibleStateSetForCell( *pStateSetHelper, getRowPos(), static_cast< sal_uInt16 >( getColumnPos() ) ); 210*cdf0e10cSrcweir } 211*cdf0e10cSrcweir else 212*cdf0e10cSrcweir pStateSetHelper->AddState( AccessibleStateType::DEFUNC ); 213*cdf0e10cSrcweir 214*cdf0e10cSrcweir return pStateSetHelper; 215*cdf0e10cSrcweir } 216*cdf0e10cSrcweir 217*cdf0e10cSrcweir 218*cdf0e10cSrcweir // XAccessible ------------------------------------------------------------ 219*cdf0e10cSrcweir 220*cdf0e10cSrcweir /** @return The XAccessibleContext interface of this object. */ 221*cdf0e10cSrcweir Reference< XAccessibleContext > SAL_CALL AccessibleBrowseBoxTableCell::getAccessibleContext() throw ( RuntimeException ) 222*cdf0e10cSrcweir { 223*cdf0e10cSrcweir ensureIsAlive(); 224*cdf0e10cSrcweir return this; 225*cdf0e10cSrcweir } 226*cdf0e10cSrcweir 227*cdf0e10cSrcweir // XAccessibleContext ----------------------------------------------------- 228*cdf0e10cSrcweir 229*cdf0e10cSrcweir sal_Int32 SAL_CALL AccessibleBrowseBoxTableCell::getAccessibleIndexInParent() 230*cdf0e10cSrcweir throw ( ::com::sun::star::uno::RuntimeException ) 231*cdf0e10cSrcweir { 232*cdf0e10cSrcweir BBSolarGuard aSolarGuard; 233*cdf0e10cSrcweir ::osl::MutexGuard aGuard( getOslMutex() ); 234*cdf0e10cSrcweir ensureIsAlive(); 235*cdf0e10cSrcweir 236*cdf0e10cSrcweir return /*BBINDEX_FIRSTCONTROL*/ m_nOffset + ( getRowPos() * mpBrowseBox->GetColumnCount() ) + getColumnPos(); 237*cdf0e10cSrcweir } 238*cdf0e10cSrcweir 239*cdf0e10cSrcweir sal_Int32 SAL_CALL AccessibleBrowseBoxTableCell::getCaretPosition( ) throw (::com::sun::star::uno::RuntimeException) 240*cdf0e10cSrcweir { 241*cdf0e10cSrcweir return -1; 242*cdf0e10cSrcweir } 243*cdf0e10cSrcweir sal_Bool SAL_CALL AccessibleBrowseBoxTableCell::setCaretPosition ( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException) 244*cdf0e10cSrcweir { 245*cdf0e10cSrcweir BBSolarGuard aSolarGuard; 246*cdf0e10cSrcweir ::osl::MutexGuard aGuard( getOslMutex() ); 247*cdf0e10cSrcweir 248*cdf0e10cSrcweir if ( !implIsValidRange( nIndex, nIndex, implGetText().getLength() ) ) 249*cdf0e10cSrcweir throw IndexOutOfBoundsException(); 250*cdf0e10cSrcweir 251*cdf0e10cSrcweir return sal_False; 252*cdf0e10cSrcweir } 253*cdf0e10cSrcweir sal_Unicode SAL_CALL AccessibleBrowseBoxTableCell::getCharacter( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException) 254*cdf0e10cSrcweir { 255*cdf0e10cSrcweir BBSolarGuard aSolarGuard; 256*cdf0e10cSrcweir ::osl::MutexGuard aGuard( getOslMutex() ); 257*cdf0e10cSrcweir return OCommonAccessibleText::getCharacter( nIndex ); 258*cdf0e10cSrcweir } 259*cdf0e10cSrcweir ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > SAL_CALL AccessibleBrowseBoxTableCell::getCharacterAttributes( sal_Int32 nIndex, const ::com::sun::star::uno::Sequence< ::rtl::OUString >& ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException) 260*cdf0e10cSrcweir { 261*cdf0e10cSrcweir BBSolarGuard aSolarGuard; 262*cdf0e10cSrcweir ::osl::MutexGuard aGuard( getOslMutex() ); 263*cdf0e10cSrcweir 264*cdf0e10cSrcweir ::rtl::OUString sText( implGetText() ); 265*cdf0e10cSrcweir 266*cdf0e10cSrcweir if ( !implIsValidIndex( nIndex, sText.getLength() ) ) 267*cdf0e10cSrcweir throw IndexOutOfBoundsException(); 268*cdf0e10cSrcweir 269*cdf0e10cSrcweir return ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >(); 270*cdf0e10cSrcweir } 271*cdf0e10cSrcweir sal_Int32 SAL_CALL AccessibleBrowseBoxTableCell::getCharacterCount( ) throw (::com::sun::star::uno::RuntimeException) 272*cdf0e10cSrcweir { 273*cdf0e10cSrcweir BBSolarGuard aSolarGuard; 274*cdf0e10cSrcweir ::osl::MutexGuard aGuard( getOslMutex() ); 275*cdf0e10cSrcweir return OCommonAccessibleText::getCharacterCount( ); 276*cdf0e10cSrcweir } 277*cdf0e10cSrcweir 278*cdf0e10cSrcweir ::rtl::OUString SAL_CALL AccessibleBrowseBoxTableCell::getSelectedText( ) throw (::com::sun::star::uno::RuntimeException) 279*cdf0e10cSrcweir { 280*cdf0e10cSrcweir BBSolarGuard aSolarGuard; 281*cdf0e10cSrcweir ::osl::MutexGuard aGuard( getOslMutex() ); 282*cdf0e10cSrcweir return OCommonAccessibleText::getSelectedText( ); 283*cdf0e10cSrcweir } 284*cdf0e10cSrcweir sal_Int32 SAL_CALL AccessibleBrowseBoxTableCell::getSelectionStart( ) throw (::com::sun::star::uno::RuntimeException) 285*cdf0e10cSrcweir { 286*cdf0e10cSrcweir BBSolarGuard aSolarGuard; 287*cdf0e10cSrcweir ::osl::MutexGuard aGuard( getOslMutex() ); 288*cdf0e10cSrcweir return OCommonAccessibleText::getSelectionStart( ); 289*cdf0e10cSrcweir } 290*cdf0e10cSrcweir sal_Int32 SAL_CALL AccessibleBrowseBoxTableCell::getSelectionEnd( ) throw (::com::sun::star::uno::RuntimeException) 291*cdf0e10cSrcweir { 292*cdf0e10cSrcweir BBSolarGuard aSolarGuard; 293*cdf0e10cSrcweir ::osl::MutexGuard aGuard( getOslMutex() ); 294*cdf0e10cSrcweir return OCommonAccessibleText::getSelectionEnd( ); 295*cdf0e10cSrcweir } 296*cdf0e10cSrcweir sal_Bool SAL_CALL AccessibleBrowseBoxTableCell::setSelection( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException) 297*cdf0e10cSrcweir { 298*cdf0e10cSrcweir BBSolarGuard aSolarGuard; 299*cdf0e10cSrcweir ::osl::MutexGuard aGuard( getOslMutex() ); 300*cdf0e10cSrcweir if ( !implIsValidRange( nStartIndex, nEndIndex, implGetText().getLength() ) ) 301*cdf0e10cSrcweir throw IndexOutOfBoundsException(); 302*cdf0e10cSrcweir 303*cdf0e10cSrcweir return sal_False; 304*cdf0e10cSrcweir } 305*cdf0e10cSrcweir ::rtl::OUString SAL_CALL AccessibleBrowseBoxTableCell::getText( ) throw (::com::sun::star::uno::RuntimeException) 306*cdf0e10cSrcweir { 307*cdf0e10cSrcweir BBSolarGuard aSolarGuard; 308*cdf0e10cSrcweir ::osl::MutexGuard aGuard( getOslMutex() ); 309*cdf0e10cSrcweir return OCommonAccessibleText::getText( ); 310*cdf0e10cSrcweir } 311*cdf0e10cSrcweir ::rtl::OUString SAL_CALL AccessibleBrowseBoxTableCell::getTextRange( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException) 312*cdf0e10cSrcweir { 313*cdf0e10cSrcweir BBSolarGuard aSolarGuard; 314*cdf0e10cSrcweir ::osl::MutexGuard aGuard( getOslMutex() ); 315*cdf0e10cSrcweir return OCommonAccessibleText::getTextRange( nStartIndex, nEndIndex ); 316*cdf0e10cSrcweir } 317*cdf0e10cSrcweir ::com::sun::star::accessibility::TextSegment SAL_CALL AccessibleBrowseBoxTableCell::getTextAtIndex( sal_Int32 nIndex, sal_Int16 aTextType ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException) 318*cdf0e10cSrcweir { 319*cdf0e10cSrcweir BBSolarGuard aSolarGuard; 320*cdf0e10cSrcweir ::osl::MutexGuard aGuard( getOslMutex() ); 321*cdf0e10cSrcweir return OCommonAccessibleText::getTextAtIndex( nIndex ,aTextType); 322*cdf0e10cSrcweir } 323*cdf0e10cSrcweir ::com::sun::star::accessibility::TextSegment SAL_CALL AccessibleBrowseBoxTableCell::getTextBeforeIndex( sal_Int32 nIndex, sal_Int16 aTextType ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException) 324*cdf0e10cSrcweir { 325*cdf0e10cSrcweir BBSolarGuard aSolarGuard; 326*cdf0e10cSrcweir ::osl::MutexGuard aGuard( getOslMutex() ); 327*cdf0e10cSrcweir return OCommonAccessibleText::getTextBeforeIndex( nIndex ,aTextType); 328*cdf0e10cSrcweir } 329*cdf0e10cSrcweir ::com::sun::star::accessibility::TextSegment SAL_CALL AccessibleBrowseBoxTableCell::getTextBehindIndex( sal_Int32 nIndex, sal_Int16 aTextType ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException) 330*cdf0e10cSrcweir { 331*cdf0e10cSrcweir BBSolarGuard aSolarGuard; 332*cdf0e10cSrcweir ::osl::MutexGuard aGuard( getOslMutex() ); 333*cdf0e10cSrcweir return OCommonAccessibleText::getTextBehindIndex( nIndex ,aTextType); 334*cdf0e10cSrcweir } 335*cdf0e10cSrcweir sal_Bool SAL_CALL AccessibleBrowseBoxTableCell::copyText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException) 336*cdf0e10cSrcweir { 337*cdf0e10cSrcweir BBSolarGuard aSolarGuard; 338*cdf0e10cSrcweir ::osl::MutexGuard aGuard( getOslMutex() ); 339*cdf0e10cSrcweir ::rtl::OUString sText = implGetText(); 340*cdf0e10cSrcweir checkIndex_Impl( nStartIndex, sText ); 341*cdf0e10cSrcweir checkIndex_Impl( nEndIndex, sText ); 342*cdf0e10cSrcweir 343*cdf0e10cSrcweir //!!! don't know how to put a string into the clipboard 344*cdf0e10cSrcweir return sal_False; 345*cdf0e10cSrcweir } 346*cdf0e10cSrcweir void AccessibleBrowseBoxTableCell::disposing( const EventObject& _rSource ) throw (RuntimeException) 347*cdf0e10cSrcweir { 348*cdf0e10cSrcweir if ( _rSource.Source == mxParent ) 349*cdf0e10cSrcweir { 350*cdf0e10cSrcweir dispose(); 351*cdf0e10cSrcweir } 352*cdf0e10cSrcweir } 353*cdf0e10cSrcweir 354*cdf0e10cSrcweir } 355