1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24 #include "precompiled_accessibility.hxx" 25 26 #include "accessibility/extended/AccessibleToolPanelDeckTabBar.hxx" 27 #include "accessibility/extended/AccessibleToolPanelDeckTabBarItem.hxx" 28 #include "accessibility/helper/accresmgr.hxx" 29 #include "accessibility/helper/accessiblestrings.hrc" 30 31 /** === begin UNO includes === **/ 32 #include <com/sun/star/accessibility/AccessibleRole.hpp> 33 #include <com/sun/star/accessibility/AccessibleEventId.hpp> 34 #include <com/sun/star/accessibility/AccessibleStateType.hpp> 35 #include <com/sun/star/lang/DisposedException.hpp> 36 /** === end UNO includes === **/ 37 38 #include <svtools/toolpanel/toolpaneldeck.hxx> 39 #include <svtools/toolpanel/paneltabbar.hxx> 40 #include <unotools/accessiblestatesethelper.hxx> 41 #include <toolkit/awt/vclxwindow.hxx> 42 #include <toolkit/helper/vclunohelper.hxx> 43 #include <vcl/svapp.hxx> 44 #include <vcl/button.hxx> 45 #include <vos/mutex.hxx> 46 #include <tools/diagnose_ex.h> 47 48 #include <vector> 49 50 //...................................................................................................................... 51 namespace accessibility 52 { 53 //...................................................................................................................... 54 55 /** === begin UNO using === **/ 56 using ::com::sun::star::uno::Reference; 57 using ::com::sun::star::uno::XInterface; 58 using ::com::sun::star::uno::UNO_QUERY; 59 using ::com::sun::star::uno::UNO_QUERY_THROW; 60 using ::com::sun::star::uno::UNO_SET_THROW; 61 using ::com::sun::star::uno::Exception; 62 using ::com::sun::star::uno::RuntimeException; 63 using ::com::sun::star::uno::Any; 64 using ::com::sun::star::uno::makeAny; 65 using ::com::sun::star::uno::Sequence; 66 using ::com::sun::star::uno::Type; 67 using ::com::sun::star::accessibility::XAccessible; 68 using ::com::sun::star::lang::DisposedException; 69 using ::com::sun::star::lang::IndexOutOfBoundsException; 70 using ::com::sun::star::accessibility::XAccessibleContext; 71 /** === end UNO using === **/ 72 73 namespace AccessibleRole = ::com::sun::star::accessibility::AccessibleRole; 74 namespace AccessibleEventId = ::com::sun::star::accessibility::AccessibleEventId; 75 namespace AccessibleStateType = ::com::sun::star::accessibility::AccessibleStateType; 76 77 typedef ::com::sun::star::awt::Point UnoPoint; 78 typedef ::com::sun::star::awt::Size UnoSize; 79 typedef ::com::sun::star::awt::Rectangle UnoRectangle; 80 81 //================================================================================================================== 82 //= AccessibleWrapper 83 //================================================================================================================== 84 typedef ::cppu::WeakImplHelper1< XAccessible > AccessibleWrapper_Base; 85 class AccessibleWrapper : public AccessibleWrapper_Base 86 { 87 public: AccessibleWrapper(const Reference<XAccessibleContext> & i_rContext)88 AccessibleWrapper( const Reference< XAccessibleContext >& i_rContext ) 89 :m_xContext( i_rContext ) 90 { 91 } 92 93 // XAccessible getAccessibleContext()94 virtual Reference< XAccessibleContext > SAL_CALL getAccessibleContext( ) throw (RuntimeException) 95 { 96 return m_xContext; 97 } 98 99 private: 100 const Reference< XAccessibleContext > m_xContext; 101 }; 102 103 //================================================================================================================== 104 //= AccessibleToolPanelTabBar_Impl 105 //================================================================================================================== 106 class AccessibleToolPanelTabBar_Impl :public ::boost::noncopyable 107 ,public ::svt::IToolPanelDeckListener 108 { 109 public: 110 AccessibleToolPanelTabBar_Impl( 111 AccessibleToolPanelTabBar& i_rAntiImpl, 112 const Reference< XAccessible >& i_rAccessibleParent, 113 ::svt::IToolPanelDeck& i_rPanelDeck, 114 ::svt::PanelTabBar& i_rTabBar 115 ); 116 ~AccessibleToolPanelTabBar_Impl(); 117 118 void checkDisposed(); isDisposed() const119 bool isDisposed() const { return m_pPanelDeck == NULL; } 120 void dispose(); 121 getPanelDeck() const122 ::svt::IToolPanelDeck* getPanelDeck() const { return m_pPanelDeck; } getTabBar() const123 ::svt::PanelTabBar* getTabBar() const { return m_pTabBar; } getAccessibleParent() const124 const Reference< XAccessible >& getAccessibleParent() const { return m_xAccessibleParent; } 125 Reference< XAccessible > getAccessiblePanelItem( size_t i_nPosition ); 126 Reference< XAccessible > getOwnAccessible() const; 127 128 protected: 129 // IToolPanelDeckListener 130 virtual void PanelInserted( const ::svt::PToolPanel& i_pPanel, const size_t i_nPosition ); 131 virtual void PanelRemoved( const size_t i_nPosition ); 132 virtual void ActivePanelChanged( const ::boost::optional< size_t >& i_rOldActive, const ::boost::optional< size_t >& i_rNewActive ); 133 virtual void LayouterChanged( const ::svt::PDeckLayouter& i_rNewLayouter ); 134 virtual void Dying(); 135 136 DECL_LINK( OnWindowEvent, const VclSimpleEvent* ); 137 138 private: 139 AccessibleToolPanelTabBar& m_rAntiImpl; 140 Reference< XAccessible > m_xAccessibleParent; 141 ::svt::IToolPanelDeck* m_pPanelDeck; 142 ::svt::PanelTabBar* m_pTabBar; 143 ::std::vector< Reference< XAccessible > > m_aChildren; 144 }; 145 146 //------------------------------------------------------------------------------------------------------------------ AccessibleToolPanelTabBar_Impl(AccessibleToolPanelTabBar & i_rAntiImpl,const Reference<XAccessible> & i_rAccessibleParent,::svt::IToolPanelDeck & i_rPanelDeck,::svt::PanelTabBar & i_rTabBar)147 AccessibleToolPanelTabBar_Impl::AccessibleToolPanelTabBar_Impl( AccessibleToolPanelTabBar& i_rAntiImpl, 148 const Reference< XAccessible >& i_rAccessibleParent, ::svt::IToolPanelDeck& i_rPanelDeck, ::svt::PanelTabBar& i_rTabBar ) 149 :m_rAntiImpl( i_rAntiImpl ) 150 ,m_xAccessibleParent( i_rAccessibleParent ) 151 ,m_pPanelDeck( &i_rPanelDeck ) 152 ,m_pTabBar( &i_rTabBar ) 153 ,m_aChildren() 154 { 155 m_pPanelDeck->AddListener( *this ); 156 m_aChildren.resize( m_pPanelDeck->GetPanelCount() ); 157 158 const String sAccessibleDescription( TK_RES_STRING( RID_STR_ACC_DESC_PANELDECL_TABBAR ) ); 159 i_rTabBar.SetAccessibleName( sAccessibleDescription ); 160 i_rTabBar.SetAccessibleDescription( sAccessibleDescription ); 161 162 i_rTabBar.GetScrollButton( true ).AddEventListener( LINK( this, AccessibleToolPanelTabBar_Impl, OnWindowEvent ) ); 163 i_rTabBar.GetScrollButton( false ).AddEventListener( LINK( this, AccessibleToolPanelTabBar_Impl, OnWindowEvent ) ); 164 } 165 166 //------------------------------------------------------------------------------------------------------------------ checkDisposed()167 void AccessibleToolPanelTabBar_Impl::checkDisposed() 168 { 169 if ( isDisposed() ) 170 throw DisposedException( ::rtl::OUString(), *&m_rAntiImpl ); 171 } 172 173 //------------------------------------------------------------------------------------------------------------------ ~AccessibleToolPanelTabBar_Impl()174 AccessibleToolPanelTabBar_Impl::~AccessibleToolPanelTabBar_Impl() 175 { 176 if ( !isDisposed() ) 177 dispose(); 178 } 179 180 //------------------------------------------------------------------------------------------------------------------ dispose()181 void AccessibleToolPanelTabBar_Impl::dispose() 182 { 183 ENSURE_OR_RETURN_VOID( !isDisposed(), "disposed twice" ); 184 m_pPanelDeck->RemoveListener( *this ); 185 m_pPanelDeck = NULL; 186 187 m_pTabBar->GetScrollButton( true ).RemoveEventListener( LINK( this, AccessibleToolPanelTabBar_Impl, OnWindowEvent ) ); 188 m_pTabBar->GetScrollButton( false ).RemoveEventListener( LINK( this, AccessibleToolPanelTabBar_Impl, OnWindowEvent ) ); 189 m_pTabBar = NULL; 190 191 m_xAccessibleParent.clear(); 192 } 193 194 //------------------------------------------------------------------------------------------------------------------ getAccessiblePanelItem(size_t i_nPosition)195 Reference< XAccessible > AccessibleToolPanelTabBar_Impl::getAccessiblePanelItem( size_t i_nPosition ) 196 { 197 ENSURE_OR_RETURN( !isDisposed(), "AccessibleToolPanelTabBar_Impl::getAccessiblePanelItem: already disposed!", NULL ); 198 ENSURE_OR_RETURN( i_nPosition < m_aChildren.size(), "AccessibleToolPanelTabBar_Impl::getAccessiblePanelItem: invalid index!", NULL ); 199 200 Reference< XAccessible >& rAccessibleChild( m_aChildren[ i_nPosition ] ); 201 if ( !rAccessibleChild.is() ) 202 { 203 ::rtl::Reference< AccessibleToolPanelDeckTabBarItem > pAccesibleItemContext( new AccessibleToolPanelDeckTabBarItem( 204 getOwnAccessible(), *m_pPanelDeck, *m_pTabBar, i_nPosition ) ); 205 rAccessibleChild.set( new AccessibleWrapper( pAccesibleItemContext.get() ) ); 206 pAccesibleItemContext->lateInit( rAccessibleChild ); 207 } 208 return rAccessibleChild; 209 } 210 211 //------------------------------------------------------------------------------------------------------------------ getOwnAccessible() const212 Reference< XAccessible > AccessibleToolPanelTabBar_Impl::getOwnAccessible() const 213 { 214 Reference< XAccessible > xOwnAccessible( static_cast< XAccessible* >( m_rAntiImpl.GetVCLXWindow() ) ); 215 OSL_ENSURE( xOwnAccessible->getAccessibleContext() == Reference< XAccessibleContext >( &m_rAntiImpl ), 216 "AccessibleToolPanelTabBar_Impl::getOwnAccessible: could not retrieve proper XAccessible for /myself!" ); 217 return xOwnAccessible; 218 } 219 220 //------------------------------------------------------------------------------------------------------------------ PanelInserted(const::svt::PToolPanel & i_pPanel,const size_t i_nPosition)221 void AccessibleToolPanelTabBar_Impl::PanelInserted( const ::svt::PToolPanel& i_pPanel, const size_t i_nPosition ) 222 { 223 ENSURE_OR_RETURN_VOID( i_nPosition <= m_aChildren.size(), "AccessibleToolPanelTabBar_Impl::PanelInserted: illegal position (or invalid cache!)" ); 224 (void)i_pPanel; 225 m_aChildren.insert( m_aChildren.begin() + i_nPosition, NULL ); 226 m_rAntiImpl.NotifyAccessibleEvent( AccessibleEventId::CHILD, Any(), makeAny( getAccessiblePanelItem( i_nPosition ) ) ); 227 } 228 229 //------------------------------------------------------------------------------------------------------------------ PanelRemoved(const size_t i_nPosition)230 void AccessibleToolPanelTabBar_Impl::PanelRemoved( const size_t i_nPosition ) 231 { 232 ENSURE_OR_RETURN_VOID( i_nPosition < m_aChildren.size(), "AccessibleToolPanelTabBar_Impl::PanelInserted: illegal position (or invalid cache!)" ); 233 234 const Reference< XAccessible > xOldChild( getAccessiblePanelItem( i_nPosition ) ); 235 m_aChildren.erase( m_aChildren.begin() + i_nPosition ); 236 m_rAntiImpl.NotifyAccessibleEvent( AccessibleEventId::CHILD, makeAny( xOldChild ), Any() ); 237 } 238 239 //------------------------------------------------------------------------------------------------------------------ ActivePanelChanged(const::boost::optional<size_t> & i_rOldActive,const::boost::optional<size_t> & i_rNewActive)240 void AccessibleToolPanelTabBar_Impl::ActivePanelChanged( const ::boost::optional< size_t >& i_rOldActive, const ::boost::optional< size_t >& i_rNewActive ) 241 { 242 (void)i_rOldActive; 243 (void)i_rNewActive; 244 } 245 246 //------------------------------------------------------------------------------------------------------------------ LayouterChanged(const::svt::PDeckLayouter & i_rNewLayouter)247 void AccessibleToolPanelTabBar_Impl::LayouterChanged( const ::svt::PDeckLayouter& i_rNewLayouter ) 248 { 249 (void)i_rNewLayouter; 250 m_rAntiImpl.dispose(); 251 } 252 253 //------------------------------------------------------------------------------------------------------------------ Dying()254 void AccessibleToolPanelTabBar_Impl::Dying() 255 { 256 m_rAntiImpl.dispose(); 257 } 258 259 //------------------------------------------------------------------------------------------------------------------ IMPL_LINK(AccessibleToolPanelTabBar_Impl,OnWindowEvent,const VclSimpleEvent *,i_pEvent)260 IMPL_LINK( AccessibleToolPanelTabBar_Impl, OnWindowEvent, const VclSimpleEvent*, i_pEvent ) 261 { 262 ENSURE_OR_RETURN( !isDisposed(), "AccessibleToolPanelTabBar_Impl::OnWindowEvent: already disposed!", 0L ); 263 264 const VclWindowEvent* pWindowEvent( dynamic_cast< const VclWindowEvent* >( i_pEvent ) ); 265 if ( !pWindowEvent ) 266 return 0L; 267 268 const bool bForwardButton = ( pWindowEvent->GetWindow() == &m_pTabBar->GetScrollButton( true ) ); 269 const bool bBackwardButton = ( pWindowEvent->GetWindow() == &m_pTabBar->GetScrollButton( false ) ); 270 ENSURE_OR_RETURN( bForwardButton || bBackwardButton, "AccessibleToolPanelTabBar_Impl::OnWindowEvent: where does this come from?", 0L ); 271 272 const bool bShow = ( i_pEvent->GetId() == VCLEVENT_WINDOW_SHOW ); 273 const bool bHide = ( i_pEvent->GetId() == VCLEVENT_WINDOW_HIDE ); 274 if ( !bShow && !bHide ) 275 // not interested in events other than visibility changes 276 return 0L; 277 278 const Reference< XAccessible > xButtonAccessible( m_pTabBar->GetScrollButton( bForwardButton ).GetAccessible() ); 279 const Any aOldChild( bHide ? xButtonAccessible : Reference< XAccessible >() ); 280 const Any aNewChild( bShow ? xButtonAccessible : Reference< XAccessible >() ); 281 m_rAntiImpl.NotifyAccessibleEvent( AccessibleEventId::CHILD, aOldChild, aNewChild ); 282 283 return 1L; 284 } 285 286 //================================================================================================================== 287 //= MethodGuard 288 //================================================================================================================== 289 namespace 290 { 291 class MethodGuard 292 { 293 public: MethodGuard(AccessibleToolPanelTabBar_Impl & i_rImpl)294 MethodGuard( AccessibleToolPanelTabBar_Impl& i_rImpl ) 295 :m_aGuard( Application::GetSolarMutex() ) 296 { 297 i_rImpl.checkDisposed(); 298 } ~MethodGuard()299 ~MethodGuard() 300 { 301 } 302 clear()303 void clear() 304 { 305 m_aGuard.clear(); 306 } 307 308 private: 309 ::vos::OClearableGuard m_aGuard; 310 }; 311 } 312 313 //================================================================================================================== 314 //= AccessibleToolPanelTabBar 315 //================================================================================================================== 316 //------------------------------------------------------------------------------------------------------------------ AccessibleToolPanelTabBar(const Reference<XAccessible> & i_rAccessibleParent,::svt::IToolPanelDeck & i_rPanelDeck,::svt::PanelTabBar & i_rTabBar)317 AccessibleToolPanelTabBar::AccessibleToolPanelTabBar( const Reference< XAccessible >& i_rAccessibleParent, 318 ::svt::IToolPanelDeck& i_rPanelDeck, ::svt::PanelTabBar& i_rTabBar ) 319 :AccessibleToolPanelTabBar_Base( i_rTabBar.GetWindowPeer() ) 320 ,m_pImpl( new AccessibleToolPanelTabBar_Impl( *this, i_rAccessibleParent, i_rPanelDeck, i_rTabBar ) ) 321 { 322 } 323 324 //------------------------------------------------------------------------------------------------------------------ ~AccessibleToolPanelTabBar()325 AccessibleToolPanelTabBar::~AccessibleToolPanelTabBar() 326 { 327 } 328 329 //------------------------------------------------------------------------------------------------------------------ getAccessibleChildCount()330 sal_Int32 SAL_CALL AccessibleToolPanelTabBar::getAccessibleChildCount( ) throw (RuntimeException) 331 { 332 MethodGuard aGuard( *m_pImpl ); 333 334 const bool bHasScrollBack = m_pImpl->getTabBar()->GetScrollButton( false ).IsVisible(); 335 const bool bHasScrollForward = m_pImpl->getTabBar()->GetScrollButton( true ).IsVisible(); 336 337 return m_pImpl->getPanelDeck()->GetPanelCount() 338 + ( bHasScrollBack ? 1 : 0 ) 339 + ( bHasScrollForward ? 1 : 0 ); 340 } 341 342 //------------------------------------------------------------------------------------------------------------------ getAccessibleChild(sal_Int32 i_nIndex)343 Reference< XAccessible > SAL_CALL AccessibleToolPanelTabBar::getAccessibleChild( sal_Int32 i_nIndex ) throw (IndexOutOfBoundsException, RuntimeException) 344 { 345 MethodGuard aGuard( *m_pImpl ); 346 347 const bool bHasScrollBack = m_pImpl->getTabBar()->GetScrollButton( false ).IsVisible(); 348 const bool bHasScrollForward = m_pImpl->getTabBar()->GetScrollButton( true ).IsVisible(); 349 350 const bool bScrollBackRequested = ( bHasScrollBack && ( i_nIndex == 0 ) ); 351 const bool bScrollForwardRequested = ( bHasScrollForward && ( i_nIndex == getAccessibleChildCount() - 1 ) ); 352 OSL_ENSURE( !( bScrollBackRequested && bScrollForwardRequested ), "AccessibleToolPanelTabBar::getAccessibleChild: ouch!" ); 353 354 if ( bScrollBackRequested || bScrollForwardRequested ) 355 { 356 Reference< XAccessible > xScrollButtonAccessible( m_pImpl->getTabBar()->GetScrollButton( bScrollForwardRequested ).GetAccessible() ); 357 ENSURE_OR_RETURN( xScrollButtonAccessible.is(), "AccessibleToolPanelTabBar::getAccessibleChild: invalid button accessible!", NULL ); 358 #if OSL_DEBUG_LEVEL > 0 359 Reference< XAccessibleContext > xScrollButtonContext( xScrollButtonAccessible->getAccessibleContext() ); 360 ENSURE_OR_RETURN( xScrollButtonContext.is(), "AccessibleToolPanelTabBar::getAccessibleChild: invalid button accessible context!", xScrollButtonAccessible ); 361 OSL_ENSURE( xScrollButtonContext->getAccessibleParent() == m_pImpl->getOwnAccessible(), 362 "AccessibleToolPanelTabBar::getAccessibleChild: wrong parent at the button's accesible!" ); 363 #endif 364 return xScrollButtonAccessible; 365 } 366 367 return m_pImpl->getAccessiblePanelItem( i_nIndex - ( bHasScrollBack ? 1 : 0 ) ); 368 } 369 370 //------------------------------------------------------------------------------------------------------------------ getAccessibleParent()371 Reference< XAccessible > SAL_CALL AccessibleToolPanelTabBar::getAccessibleParent( ) throw (RuntimeException) 372 { 373 MethodGuard aGuard( *m_pImpl ); 374 return m_pImpl->getAccessibleParent(); 375 } 376 377 //------------------------------------------------------------------------------------------------------------------ getAccessibleRole()378 sal_Int16 SAL_CALL AccessibleToolPanelTabBar::getAccessibleRole( ) throw (RuntimeException) 379 { 380 MethodGuard aGuard( *m_pImpl ); 381 return AccessibleRole::PAGE_TAB_LIST; 382 } 383 384 //------------------------------------------------------------------------------------------------------------------ 385 namespace 386 { lcl_covers(const::Window & i_rWindow,const::Point & i_rPoint)387 bool lcl_covers( const ::Window& i_rWindow, const ::Point& i_rPoint ) 388 { 389 const Rectangle aWindowBounds( i_rWindow.GetWindowExtentsRelative( i_rWindow.GetParent() ) ); 390 return aWindowBounds.IsInside( i_rPoint ); 391 } 392 } 393 394 //------------------------------------------------------------------------------------------------------------------ getAccessibleAtPoint(const UnoPoint & i_rPoint)395 Reference< XAccessible > SAL_CALL AccessibleToolPanelTabBar::getAccessibleAtPoint( const UnoPoint& i_rPoint ) throw (RuntimeException) 396 { 397 MethodGuard aGuard( *m_pImpl ); 398 399 // check the tab items 400 const UnoPoint aOwnScreenPos( getLocationOnScreen() ); 401 const ::Point aRequestedScreenPoint( i_rPoint.X + aOwnScreenPos.X, i_rPoint.Y + aOwnScreenPos.Y ); 402 403 for ( size_t i=0; i<m_pImpl->getPanelDeck()->GetPanelCount(); ++i ) 404 { 405 const ::Rectangle aItemScreenRect( m_pImpl->getTabBar()->GetItemScreenRect(i) ); 406 if ( aItemScreenRect.IsInside( aRequestedScreenPoint ) ) 407 return m_pImpl->getAccessiblePanelItem(i); 408 } 409 410 // check the scroll buttons 411 const ::Point aRequestedClientPoint( VCLUnoHelper::ConvertToVCLPoint( i_rPoint ) ); 412 413 const bool bHasScrollBack = m_pImpl->getTabBar()->GetScrollButton( false ).IsVisible(); 414 if ( bHasScrollBack && lcl_covers( m_pImpl->getTabBar()->GetScrollButton( false ), aRequestedClientPoint ) ) 415 return m_pImpl->getTabBar()->GetScrollButton( false ).GetAccessible(); 416 417 const bool bHasScrollForward = m_pImpl->getTabBar()->GetScrollButton( true ).IsVisible(); 418 if ( bHasScrollForward && lcl_covers( m_pImpl->getTabBar()->GetScrollButton( true ), aRequestedClientPoint ) ) 419 return m_pImpl->getTabBar()->GetScrollButton( true ).GetAccessible(); 420 421 // no hit 422 return NULL; 423 } 424 425 //------------------------------------------------------------------------------------------------------------------ disposing()426 void SAL_CALL AccessibleToolPanelTabBar::disposing() 427 { 428 AccessibleToolPanelTabBar_Base::disposing(); 429 m_pImpl->dispose(); 430 } 431 432 //------------------------------------------------------------------------------------------------------------------ GetChildAccessible(const VclWindowEvent & i_rVclWindowEvent)433 Reference< XAccessible > AccessibleToolPanelTabBar::GetChildAccessible( const VclWindowEvent& i_rVclWindowEvent ) 434 { 435 // don't let the base class generate any A11Y events from VclWindowEvent, we completely manage those 436 // A11Y events ourself 437 (void)i_rVclWindowEvent; 438 return NULL; 439 } 440 441 //------------------------------------------------------------------------------------------------------------------ FillAccessibleStateSet(::utl::AccessibleStateSetHelper & i_rStateSet)442 void AccessibleToolPanelTabBar::FillAccessibleStateSet( ::utl::AccessibleStateSetHelper& i_rStateSet ) 443 { 444 AccessibleToolPanelTabBar_Base::FillAccessibleStateSet( i_rStateSet ); 445 i_rStateSet.AddState( AccessibleStateType::FOCUSABLE ); 446 447 ENSURE_OR_RETURN_VOID( !m_pImpl->isDisposed(), "AccessibleToolPanelTabBar::FillAccessibleStateSet: already disposed!" ); 448 if ( m_pImpl->getTabBar()->IsVertical() ) 449 i_rStateSet.AddState( AccessibleStateType::VERTICAL ); 450 else 451 i_rStateSet.AddState( AccessibleStateType::HORIZONTAL ); 452 } 453 454 //...................................................................................................................... 455 } // namespace accessibility 456 //...................................................................................................................... 457