LCOV - code coverage report
Current view: top level - libreoffice/accessibility/source/extended - AccessibleToolPanelDeckTabBar.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 0 149 0.0 %
Date: 2012-12-27 Functions: 0 36 0.0 %
Legend: Lines: hit not hit

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

Generated by: LCOV version 1.10