diff options
author | Frank Schoenheit [fs] <frank.schoenheit@sun.com> | 2010-04-01 17:52:36 +0200 |
---|---|---|
committer | Frank Schoenheit [fs] <frank.schoenheit@sun.com> | 2010-04-01 17:52:36 +0200 |
commit | f03f19853e394f46e40814abcee0c00d6297e7c6 (patch) | |
tree | 114bd1c14ad0b295d96a7718e0d20f8cd1c86538 /accessibility | |
parent | 93c3ff235afc52b048f808dede4f7c8c07f57252 (diff) |
slidecopy: improved A11Y API implementations for the ToolPanelDeck
items left:
- A11Y representation of the scroll buttons of the PanelTabBar
- AccessibleToolPanelTabBar event notifications
- consolidate AccessibleToolPanelDeck/TabBar/Item?
Diffstat (limited to 'accessibility')
9 files changed, 577 insertions, 173 deletions
diff --git a/accessibility/inc/accessibility/extended/AccessibleToolPanelDeckTabBar.hxx b/accessibility/inc/accessibility/extended/AccessibleToolPanelDeckTabBar.hxx new file mode 100644 index 000000000000..cc2d39c5acbf --- /dev/null +++ b/accessibility/inc/accessibility/extended/AccessibleToolPanelDeckTabBar.hxx @@ -0,0 +1,92 @@ +/************************************************************************* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef ACC_ACCESSIBLETOOLPANELTABBAR_HXX +#define ACC_ACCESSIBLETOOLPANELTABBAR_HXX + +/** === begin UNO includes === **/ +/** === end UNO includes === **/ + +#include <cppuhelper/implbase1.hxx> +#include <toolkit/awt/vclxaccessiblecomponent.hxx> + +#include <boost/scoped_ptr.hpp> + +namespace svt +{ + class IToolPanelDeck; + class PanelTabBar; +} + +//...................................................................................................................... +namespace accessibility +{ +//...................................................................................................................... + + //================================================================================================================== + //= AccessibleToolPanelTabBar + //================================================================================================================== + class AccessibleToolPanelTabBar_Impl; + typedef VCLXAccessibleComponent AccessibleToolPanelTabBar_Base; + class AccessibleToolPanelTabBar : public AccessibleToolPanelTabBar_Base + { + public: + AccessibleToolPanelTabBar( + const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& i_rAccessibleParent, + ::svt::IToolPanelDeck& i_rPanelDeck, + ::svt::PanelTabBar& i_rTabBar + ); + + using AccessibleToolPanelTabBar_Base::NotifyAccessibleEvent; + + protected: + virtual ~AccessibleToolPanelTabBar(); + + // XAccessibleContext + virtual sal_Int32 SAL_CALL getAccessibleChildCount( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleChild( sal_Int32 i ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleParent( ) throw (::com::sun::star::uno::RuntimeException); + virtual sal_Int16 SAL_CALL getAccessibleRole( ) throw (::com::sun::star::uno::RuntimeException); + + // XAccessibleComponent + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint( const ::com::sun::star::awt::Point& aPoint ) throw (::com::sun::star::uno::RuntimeException); + + // OComponentHelper + virtual void SAL_CALL disposing(); + + // VCLXAccessibleComponent + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > GetChildAccessible( const VclWindowEvent& i_rVclWindowEvent ); + virtual void FillAccessibleStateSet( ::utl::AccessibleStateSetHelper& i_rStateSet ); + + private: + ::boost::scoped_ptr< AccessibleToolPanelTabBar_Impl > m_pImpl; + }; + +//...................................................................................................................... +} // namespace accessibility +//...................................................................................................................... + +#endif // ACC_ACCESSIBLETOOLPANELTABBAR_HXX diff --git a/accessibility/inc/accessibility/extended/AccessibleToolPanelDeckTabBarItem.hxx b/accessibility/inc/accessibility/extended/AccessibleToolPanelDeckTabBarItem.hxx index e52397fb7db1..80b2ccaaf104 100644 --- a/accessibility/inc/accessibility/extended/AccessibleToolPanelDeckTabBarItem.hxx +++ b/accessibility/inc/accessibility/extended/AccessibleToolPanelDeckTabBarItem.hxx @@ -32,13 +32,13 @@ #include <comphelper/accessiblecomponenthelper.hxx> #include <cppuhelper/implbase1.hxx> -#include <rtl/ref.hxx> #include <boost/scoped_ptr.hpp> namespace svt { - class TabDeckLayouter; + class IToolPanelDeck; + class PanelTabBar; } //...................................................................................................................... @@ -56,7 +56,8 @@ namespace accessibility public: AccessibleToolPanelDeckTabBarItem( const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& i_rAccessibleParent, - const ::rtl::Reference< ::svt::TabDeckLayouter >& i_pLayouter, + ::svt::IToolPanelDeck& i_rPanelDeck, + ::svt::PanelTabBar& i_rTabBar, const size_t i_nItemPos ); diff --git a/accessibility/inc/accessibility/helper/accessiblestrings.hrc b/accessibility/inc/accessibility/helper/accessiblestrings.hrc index 8f0ce9e390e3..dd629772d6ff 100644 --- a/accessibility/inc/accessibility/helper/accessiblestrings.hrc +++ b/accessibility/inc/accessibility/helper/accessiblestrings.hrc @@ -48,7 +48,8 @@ #define RID_STR_ACC_ACTION_DECBLOCK ( RID_TK_ACC_START + 6 ) -#define RID_STR_ACC_NAME_BROWSEBUTTON ( RID_TK_ACC_START + 1000 ) +#define RID_STR_ACC_NAME_BROWSEBUTTON ( RID_TK_ACC_START + 100 ) +#define RID_STR_ACC_DESC_PANELDECL_TABBAR ( RID_TK_ACC_START + 101 ) // ----------------------------------------------------------------------------- diff --git a/accessibility/source/extended/AccessibleToolPanelDeck.cxx b/accessibility/source/extended/AccessibleToolPanelDeck.cxx index 753c4ba20efe..14739b7777ff 100755 --- a/accessibility/source/extended/AccessibleToolPanelDeck.cxx +++ b/accessibility/source/extended/AccessibleToolPanelDeck.cxx @@ -36,10 +36,8 @@ /** === end UNO includes === **/ #include <svtools/toolpanel/toolpaneldeck.hxx> -#include <comphelper/sharedmutex.hxx> -#include <toolkit/helper/externallock.hxx> -#include <toolkit/helper/vclunohelper.hxx> #include <toolkit/awt/vclxwindow.hxx> +#include <toolkit/helper/vclunohelper.hxx> #include <vcl/svapp.hxx> #include <vos/mutex.hxx> #include <unotools/accessiblestatesethelper.hxx> @@ -102,7 +100,6 @@ namespace accessibility ~AccessibleToolPanelDeck_Impl(); Reference< XAccessible > getOwnAccessible() const; - Reference< XAccessible > getPanelItemAccessible( const size_t i_nPosition, const bool i_bCreate ); Reference< XAccessible > getActivePanelAccessible(); protected: @@ -114,38 +111,40 @@ namespace accessibility virtual void Dying(); public: - AccessibleToolPanelDeck& m_rAntiImpl; - const Reference< XAccessible > m_xAccessibleParent; - ::svt::ToolPanelDeck* m_pPanelDeck; + AccessibleToolPanelDeck& m_rAntiImpl; + Reference< XAccessible > m_xAccessibleParent; + ::svt::ToolPanelDeck* m_pPanelDeck; typedef ::std::vector< Reference< XAccessible > > AccessibleChildren; - AccessibleChildren m_aPanelItemCache; Reference< XAccessible > m_xActivePanelAccessible; }; //================================================================================================================== //= MethodGuard //================================================================================================================== - class MethodGuard + namespace { - public: - MethodGuard( AccessibleToolPanelDeck_Impl& i_rImpl ) - :m_aGuard( Application::GetSolarMutex() ) + class MethodGuard { - i_rImpl.checkDisposed(); - } - ~MethodGuard() - { - } + public: + MethodGuard( AccessibleToolPanelDeck_Impl& i_rImpl ) + :m_aGuard( Application::GetSolarMutex() ) + { + i_rImpl.checkDisposed(); + } + ~MethodGuard() + { + } - void clear() - { - m_aGuard.clear(); - } + void clear() + { + m_aGuard.clear(); + } - private: - ::vos::OClearableGuard m_aGuard; - }; + private: + ::vos::OClearableGuard m_aGuard; + }; + } //================================================================================================================== //= AccessibleToolPanelDeck_Impl - implementation @@ -159,7 +158,6 @@ namespace accessibility ,m_xActivePanelAccessible() { m_pPanelDeck->AddListener( *this ); - m_aPanelItemCache.resize( m_pPanelDeck->GetPanelCount() ); } //------------------------------------------------------------------------------------------------------------------ @@ -175,6 +173,7 @@ namespace accessibility ENSURE_OR_RETURN_VOID( !isDisposed(), "disposed twice" ); m_pPanelDeck->RemoveListener( *this ); m_pPanelDeck = NULL; + m_xAccessibleParent.clear(); } //------------------------------------------------------------------------------------------------------------------ @@ -194,27 +193,6 @@ namespace accessibility } //------------------------------------------------------------------------------------------------------------------ - Reference< XAccessible > AccessibleToolPanelDeck_Impl::getPanelItemAccessible( const size_t i_nPosition, const bool i_bCreate ) - { - ENSURE_OR_RETURN( !isDisposed(), "AccessibleToolPanelDeck_Impl::getPanelItemAccessible: already disposed!", NULL ); - ENSURE_OR_RETURN( i_nPosition < m_pPanelDeck->GetPanelCount(), "AccessibleToolPanelDeck_Impl::getPanelItemAccessible: invalid position!", NULL ); - ENSURE_OR_RETURN( i_nPosition < m_aPanelItemCache.size(), "AccessibleToolPanelDeck_Impl::getPanelItemAccessible: invalid cache!", NULL ); - - Reference< XAccessible >& rxChildAccessible( m_aPanelItemCache[ i_nPosition ] ); - if ( !rxChildAccessible.is() && i_bCreate ) - { - ::svt::PDeckLayouter pLayouter( m_pPanelDeck->GetLayouter() ); - ENSURE_OR_THROW( pLayouter.get() != NULL, "unexpected NULL layouter for the panel deck" ); - - rxChildAccessible.set( - pLayouter->GetPanelItemAccessible( i_nPosition, getOwnAccessible() ) - ); - OSL_ENSURE( rxChildAccessible.is(), "AccessibleToolPanelDeck_Impl::getPanelItemAccessible: illegal accessible returned by the deck layouter!" ); - } - return rxChildAccessible; - } - - //------------------------------------------------------------------------------------------------------------------ Reference< XAccessible > AccessibleToolPanelDeck_Impl::getActivePanelAccessible() { ENSURE_OR_RETURN( !isDisposed(), "AccessibleToolPanelDeck_Impl::getActivePanelAccessible: already disposed!", NULL ); @@ -235,43 +213,13 @@ namespace accessibility void AccessibleToolPanelDeck_Impl::PanelInserted( const ::svt::PToolPanel& i_pPanel, const size_t i_nPosition ) { (void)i_pPanel; - - MethodGuard aGuard( *this ); - - // reserve some space in our cache - m_aPanelItemCache.insert( m_aPanelItemCache.begin() + i_nPosition, NULL ); - const Reference< XAccessible > xNewPanelItemChild( getPanelItemAccessible( i_nPosition, true ) ); - - aGuard.clear(); - m_rAntiImpl.NotifyAccessibleEvent( AccessibleEventId::CHILD, Any(), makeAny( xNewPanelItemChild ) ); + (void)i_nPosition; } //------------------------------------------------------------------------------------------------------------------ void AccessibleToolPanelDeck_Impl::PanelRemoved( const size_t i_nPosition ) { - MethodGuard aGuard( *this ); - - ENSURE_OR_RETURN_VOID( i_nPosition < m_aPanelItemCache.size(), "AccessibleToolPanelDeck_Impl::PanelRemoved: invalid cache!" ); - - // *first* obtain the cached XAccessible of the child - const Reference< XAccessible > xOldPanelItemChild( getPanelItemAccessible( i_nPosition, false ) ); - // *then* update the cache - m_aPanelItemCache.erase( m_aPanelItemCache.begin() + i_nPosition ); - - // finally notify - aGuard.clear(); - - OSL_ENSURE( xOldPanelItemChild.is(), "AccessibleToolPanelDeck_Impl::PanelRemoved: hmmm ..." ); - if ( !xOldPanelItemChild.is() ) - { - // this might, in theory, happen when the respective child has never been accessed before. Since we do - // not have *any* chance of retrieving the child, we broadcast a ... more generic event - m_rAntiImpl.NotifyAccessibleEvent( AccessibleEventId::INVALIDATE_ALL_CHILDREN, Any(), Any() ); - } - else - { - m_rAntiImpl.NotifyAccessibleEvent( AccessibleEventId::CHILD, makeAny( xOldPanelItemChild ), Any() ); - } + (void)i_nPosition; } //------------------------------------------------------------------------------------------------------------------ @@ -336,12 +284,13 @@ namespace accessibility { MethodGuard aGuard( *m_pImpl ); - const sal_Int32 nPanelCount( m_pImpl->m_pPanelDeck->GetPanelCount() ); + sal_Int32 nChildCount( m_pImpl->m_pPanelDeck->GetLayouter()->GetAccessibleChildCount() ); + ::boost::optional< size_t > aActivePanel( m_pImpl->m_pPanelDeck->GetActivePanel() ); - if ( !aActivePanel ) - return nPanelCount; + if ( !!aActivePanel ) + return ++nChildCount; - return nPanelCount + 1; + return nChildCount; } //------------------------------------------------------------------------------------------------------------------ @@ -349,12 +298,19 @@ namespace accessibility { MethodGuard aGuard( *m_pImpl ); - if ( ( i_nIndex < 0 ) || ( size_t( i_nIndex ) > m_pImpl->m_pPanelDeck->GetPanelCount() ) ) + const sal_Int32 nChildCount( getAccessibleChildCount() ); + if ( ( i_nIndex < 0 ) || ( i_nIndex >= nChildCount ) ) throw IndexOutOfBoundsException( ::rtl::OUString(), *this ); - if ( size_t( i_nIndex ) < m_pImpl->m_pPanelDeck->GetPanelCount() ) - return m_pImpl->getPanelItemAccessible( i_nIndex, true ); + // first "n" children are provided by the layouter + const size_t nLayouterCount( m_pImpl->m_pPanelDeck->GetLayouter()->GetAccessibleChildCount() ); + if ( size_t( i_nIndex ) < nLayouterCount ) + return m_pImpl->m_pPanelDeck->GetLayouter()->GetAccessibleChild( + size_t( i_nIndex ), + m_pImpl->getOwnAccessible() + ); + // the last child is the XAccessible of the active panel return m_pImpl->getActivePanelAccessible(); } @@ -377,25 +333,36 @@ namespace accessibility { MethodGuard aGuard( *m_pImpl ); - // check whether the given point contains a panel item - ::svt::PDeckLayouter pLayouter( m_pImpl->m_pPanelDeck->GetLayouter() ); - ENSURE_OR_THROW( pLayouter.get() != NULL, "unexpected NULL layouter for the panel deck" ); - - const UnoPoint aLocation( getLocationOnScreen() ); - const ::Point aRequestedScreenLocation( i_rPoint.X + aLocation.X, i_rPoint.Y + aLocation.Y ); - - ::boost::optional< size_t > aPanelItemPos( pLayouter->GetPanelItemFromScreenPos( aRequestedScreenLocation ) ); - if ( !!aPanelItemPos ) - return getAccessibleChild( *aPanelItemPos ); - + const ::Point aRequestedPoint( VCLUnoHelper::ConvertToVCLPoint( i_rPoint ) ); // check the panel window itself const ::Window& rActivePanelAnchor( m_pImpl->m_pPanelDeck->GetPanelWindowAnchor() ); const Rectangle aPanelAnchorArea( rActivePanelAnchor.GetPosPixel(), rActivePanelAnchor.GetOutputSizePixel() ); - if ( aPanelAnchorArea.IsInside( VCLUnoHelper::ConvertToVCLPoint( i_rPoint ) ) ) + if ( aPanelAnchorArea.IsInside( aRequestedPoint ) ) // note that this assumes that the Window which actually implements the concrete panel covers // the complete area of its "anchor" Window. But this is ensured by the ToolPanelDeck implementation. return m_pImpl->getActivePanelAccessible(); + // check the XAccessible instances provided by the layouter + try + { + const ::svt::PDeckLayouter pLayouter( m_pImpl->m_pPanelDeck->GetLayouter() ); + ENSURE_OR_THROW( pLayouter.get() != NULL, "invalid layouter" ); + + const size_t nLayouterChildren = pLayouter->GetAccessibleChildCount(); + for ( size_t i=0; i<nLayouterChildren; ++i ) + { + const Reference< XAccessible > xLayoutItemAccessible( pLayouter->GetAccessibleChild( i, m_pImpl->getOwnAccessible() ), UNO_SET_THROW ); + const Reference< XAccessibleComponent > xLayoutItemComponent( xLayoutItemAccessible->getAccessibleContext(), UNO_QUERY_THROW ); + const ::Rectangle aLayoutItemBounds( VCLUnoHelper::ConvertToVCLRect( xLayoutItemComponent->getBounds() ) ); + if ( aLayoutItemBounds.IsInside( aRequestedPoint ) ) + return xLayoutItemAccessible; + } + } + catch( const Exception& ) + { + DBG_UNHANDLED_EXCEPTION(); + } + return NULL; } diff --git a/accessibility/source/extended/AccessibleToolPanelDeckTabBar.cxx b/accessibility/source/extended/AccessibleToolPanelDeckTabBar.cxx new file mode 100644 index 000000000000..ab110d2f47e0 --- /dev/null +++ b/accessibility/source/extended/AccessibleToolPanelDeckTabBar.cxx @@ -0,0 +1,368 @@ +/************************************************************************* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "precompiled_accessibility.hxx" + +#include "accessibility/extended/AccessibleToolPanelDeckTabBar.hxx" +#include "accessibility/extended/AccessibleToolPanelDeckTabBarItem.hxx" +#include "accessibility/helper/accresmgr.hxx" +#include "accessibility/helper/accessiblestrings.hrc" + +/** === begin UNO includes === **/ +#include <com/sun/star/accessibility/AccessibleRole.hpp> +#include <com/sun/star/accessibility/AccessibleEventId.hpp> +#include <com/sun/star/accessibility/AccessibleStateType.hpp> +#include <com/sun/star/lang/DisposedException.hpp> +/** === end UNO includes === **/ + +#include <svtools/toolpanel/toolpaneldeck.hxx> +#include <svtools/toolpanel/paneltabbar.hxx> +#include <unotools/accessiblestatesethelper.hxx> +#include <toolkit/awt/vclxwindow.hxx> +#include <vcl/svapp.hxx> +#include <vos/mutex.hxx> +#include <tools/diagnose_ex.h> + +#include <vector> + +//...................................................................................................................... +namespace accessibility +{ +//...................................................................................................................... + + /** === begin UNO using === **/ + using ::com::sun::star::uno::Reference; + using ::com::sun::star::uno::XInterface; + using ::com::sun::star::uno::UNO_QUERY; + using ::com::sun::star::uno::UNO_QUERY_THROW; + using ::com::sun::star::uno::UNO_SET_THROW; + using ::com::sun::star::uno::Exception; + using ::com::sun::star::uno::RuntimeException; + using ::com::sun::star::uno::Any; + using ::com::sun::star::uno::makeAny; + using ::com::sun::star::uno::Sequence; + using ::com::sun::star::uno::Type; + using ::com::sun::star::accessibility::XAccessible; + using ::com::sun::star::lang::DisposedException; + using ::com::sun::star::lang::IndexOutOfBoundsException; + using ::com::sun::star::accessibility::XAccessibleContext; + /** === end UNO using === **/ + + namespace AccessibleRole = ::com::sun::star::accessibility::AccessibleRole; + namespace AccessibleEventId = ::com::sun::star::accessibility::AccessibleEventId; + namespace AccessibleStateType = ::com::sun::star::accessibility::AccessibleStateType; + + typedef ::com::sun::star::awt::Point UnoPoint; + typedef ::com::sun::star::awt::Size UnoSize; + typedef ::com::sun::star::awt::Rectangle UnoRectangle; + + //================================================================================================================== + //= AccessibleWrapper + //================================================================================================================== + typedef ::cppu::WeakImplHelper1< XAccessible > AccessibleWrapper_Base; + class AccessibleWrapper : public AccessibleWrapper_Base + { + public: + AccessibleWrapper( const Reference< XAccessibleContext >& i_rContext ) + :m_xContext( i_rContext ) + { + } + + // XAccessible + virtual Reference< XAccessibleContext > SAL_CALL getAccessibleContext( ) throw (RuntimeException) + { + return m_xContext; + } + + private: + const Reference< XAccessibleContext > m_xContext; + }; + + //================================================================================================================== + //= AccessibleToolPanelTabBar_Impl + //================================================================================================================== + class AccessibleToolPanelTabBar_Impl :public ::boost::noncopyable + ,public ::svt::IToolPanelDeckListener + { + public: + AccessibleToolPanelTabBar_Impl( + AccessibleToolPanelTabBar& i_rAntiImpl, + const Reference< XAccessible >& i_rAccessibleParent, + ::svt::IToolPanelDeck& i_rPanelDeck, + ::svt::PanelTabBar& i_rTabBar + ); + ~AccessibleToolPanelTabBar_Impl(); + + void checkDisposed(); + bool isDisposed() const { return m_pPanelDeck == NULL; } + void dispose(); + + ::svt::IToolPanelDeck* getPanelDeck() const { return m_pPanelDeck; } + ::svt::PanelTabBar* getTabBar() const { return m_pTabBar; } + const Reference< XAccessible >& getAccessibleParent() const { return m_xAccessibleParent; } + Reference< XAccessible > getAccessibleChild( size_t i_nPosition ); + Reference< XAccessible > getOwnAccessible() const; + + // IToolPanelDeckListener + virtual void PanelInserted( const ::svt::PToolPanel& i_pPanel, const size_t i_nPosition ); + virtual void PanelRemoved( const size_t i_nPosition ); + virtual void ActivePanelChanged( const ::boost::optional< size_t >& i_rOldActive, const ::boost::optional< size_t >& i_rNewActive ); + virtual void LayouterChanged( const ::svt::PDeckLayouter& i_rNewLayouter ); + virtual void Dying(); + + private: + AccessibleToolPanelTabBar& m_rAntiImpl; + Reference< XAccessible > m_xAccessibleParent; + ::svt::IToolPanelDeck* m_pPanelDeck; + ::svt::PanelTabBar* m_pTabBar; + ::std::vector< Reference< XAccessible > > m_aChildren; + }; + + //------------------------------------------------------------------------------------------------------------------ + AccessibleToolPanelTabBar_Impl::AccessibleToolPanelTabBar_Impl( AccessibleToolPanelTabBar& i_rAntiImpl, + const Reference< XAccessible >& i_rAccessibleParent, ::svt::IToolPanelDeck& i_rPanelDeck, ::svt::PanelTabBar& i_rTabBar ) + :m_rAntiImpl( i_rAntiImpl ) + ,m_xAccessibleParent( i_rAccessibleParent ) + ,m_pPanelDeck( &i_rPanelDeck ) + ,m_pTabBar( &i_rTabBar ) + ,m_aChildren() + { + m_pPanelDeck->AddListener( *this ); + m_aChildren.resize( m_pPanelDeck->GetPanelCount() ); + + const String sAccessibleDescription( TK_RES_STRING( RID_STR_ACC_DESC_PANELDECL_TABBAR ) ); + i_rTabBar.SetAccessibleName( sAccessibleDescription ); + i_rTabBar.SetAccessibleDescription( sAccessibleDescription ); + } + + //------------------------------------------------------------------------------------------------------------------ + void AccessibleToolPanelTabBar_Impl::checkDisposed() + { + if ( isDisposed() ) + throw DisposedException( ::rtl::OUString(), *&m_rAntiImpl ); + } + + //------------------------------------------------------------------------------------------------------------------ + AccessibleToolPanelTabBar_Impl::~AccessibleToolPanelTabBar_Impl() + { + if ( !isDisposed() ) + dispose(); + } + + //------------------------------------------------------------------------------------------------------------------ + void AccessibleToolPanelTabBar_Impl::dispose() + { + ENSURE_OR_RETURN_VOID( !isDisposed(), "disposed twice" ); + m_pPanelDeck->RemoveListener( *this ); + m_pPanelDeck = NULL; + m_xAccessibleParent.clear(); + } + + //------------------------------------------------------------------------------------------------------------------ + Reference< XAccessible > AccessibleToolPanelTabBar_Impl::getAccessibleChild( size_t i_nPosition ) + { + ENSURE_OR_RETURN( !isDisposed(), "AccessibleToolPanelTabBar_Impl::getAccessibleChild: already disposed!", NULL ); + ENSURE_OR_RETURN( i_nPosition < m_aChildren.size(), "AccessibleToolPanelTabBar_Impl::getAccessibleChild: invalid index!", NULL ); + + Reference< XAccessible >& rAccessibleChild( m_aChildren[ i_nPosition ] ); + if ( !rAccessibleChild.is() ) + { + ::rtl::Reference< AccessibleToolPanelDeckTabBarItem > pAccesibleItemContext( new AccessibleToolPanelDeckTabBarItem( + getOwnAccessible(), *m_pPanelDeck, *m_pTabBar, i_nPosition ) ); + rAccessibleChild.set( new AccessibleWrapper( pAccesibleItemContext.get() ) ); + pAccesibleItemContext->lateInit( rAccessibleChild ); + } + return rAccessibleChild; + } + + //------------------------------------------------------------------------------------------------------------------ + Reference< XAccessible > AccessibleToolPanelTabBar_Impl::getOwnAccessible() const + { + Reference< XAccessible > xOwnAccessible( static_cast< XAccessible* >( m_rAntiImpl.GetVCLXWindow() ) ); + OSL_ENSURE( xOwnAccessible->getAccessibleContext() == Reference< XAccessibleContext >( &m_rAntiImpl ), + "AccessibleToolPanelTabBar_Impl::getOwnAccessible: could not retrieve proper XAccessible for /myself!" ); + return xOwnAccessible; + } + + //------------------------------------------------------------------------------------------------------------------ + void AccessibleToolPanelTabBar_Impl::PanelInserted( const ::svt::PToolPanel& i_pPanel, const size_t i_nPosition ) + { + ENSURE_OR_RETURN_VOID( i_nPosition <= m_aChildren.size(), "AccessibleToolPanelTabBar_Impl::PanelInserted: illegal position (or invalid cache!)" ); + m_aChildren.insert( m_aChildren.begin() + i_nPosition, NULL ); + // TODO: notify the event + } + + //------------------------------------------------------------------------------------------------------------------ + void AccessibleToolPanelTabBar_Impl::PanelRemoved( const size_t i_nPosition ) + { + ENSURE_OR_RETURN_VOID( i_nPosition < m_aChildren.size(), "AccessibleToolPanelTabBar_Impl::PanelInserted: illegal position (or invalid cache!)" ); + m_aChildren.erase( m_aChildren.begin() + i_nPosition ); + // TODO: notify the event + } + + //------------------------------------------------------------------------------------------------------------------ + void AccessibleToolPanelTabBar_Impl::ActivePanelChanged( const ::boost::optional< size_t >& i_rOldActive, const ::boost::optional< size_t >& i_rNewActive ) + { + // TODO: state changes for the active descendant? + // TODO: state changes for the items themself (assuming that they don't do this on their own) + (void)i_rOldActive; + (void)i_rNewActive; + } + + //------------------------------------------------------------------------------------------------------------------ + void AccessibleToolPanelTabBar_Impl::LayouterChanged( const ::svt::PDeckLayouter& i_rNewLayouter ) + { + m_rAntiImpl.dispose(); + } + + //------------------------------------------------------------------------------------------------------------------ + void AccessibleToolPanelTabBar_Impl::Dying() + { + m_rAntiImpl.dispose(); + } + + //================================================================================================================== + //= MethodGuard + //================================================================================================================== + namespace + { + class MethodGuard + { + public: + MethodGuard( AccessibleToolPanelTabBar_Impl& i_rImpl ) + :m_aGuard( Application::GetSolarMutex() ) + { + i_rImpl.checkDisposed(); + } + ~MethodGuard() + { + } + + void clear() + { + m_aGuard.clear(); + } + + private: + ::vos::OClearableGuard m_aGuard; + }; + } + + //================================================================================================================== + //= AccessibleToolPanelTabBar + //================================================================================================================== + //------------------------------------------------------------------------------------------------------------------ + AccessibleToolPanelTabBar::AccessibleToolPanelTabBar( const Reference< XAccessible >& i_rAccessibleParent, + ::svt::IToolPanelDeck& i_rPanelDeck, ::svt::PanelTabBar& i_rTabBar ) + :AccessibleToolPanelTabBar_Base( i_rTabBar.GetWindowPeer() ) + ,m_pImpl( new AccessibleToolPanelTabBar_Impl( *this, i_rAccessibleParent, i_rPanelDeck, i_rTabBar ) ) + { + } + + //------------------------------------------------------------------------------------------------------------------ + AccessibleToolPanelTabBar::~AccessibleToolPanelTabBar() + { + } + + //------------------------------------------------------------------------------------------------------------------ + sal_Int32 SAL_CALL AccessibleToolPanelTabBar::getAccessibleChildCount( ) throw (RuntimeException) + { + MethodGuard aGuard( *m_pImpl ); + return m_pImpl->getPanelDeck()->GetPanelCount(); + } + + //------------------------------------------------------------------------------------------------------------------ + Reference< XAccessible > SAL_CALL AccessibleToolPanelTabBar::getAccessibleChild( sal_Int32 i_nIndex ) throw (IndexOutOfBoundsException, RuntimeException) + { + MethodGuard aGuard( *m_pImpl ); + return m_pImpl->getAccessibleChild( i_nIndex ); + } + + //------------------------------------------------------------------------------------------------------------------ + Reference< XAccessible > SAL_CALL AccessibleToolPanelTabBar::getAccessibleParent( ) throw (RuntimeException) + { + MethodGuard aGuard( *m_pImpl ); + return m_pImpl->getAccessibleParent(); + } + + //------------------------------------------------------------------------------------------------------------------ + sal_Int16 SAL_CALL AccessibleToolPanelTabBar::getAccessibleRole( ) throw (RuntimeException) + { + MethodGuard aGuard( *m_pImpl ); + return AccessibleRole::PAGE_TAB_LIST; + } + + //------------------------------------------------------------------------------------------------------------------ + Reference< XAccessible > SAL_CALL AccessibleToolPanelTabBar::getAccessibleAtPoint( const UnoPoint& i_rPoint ) throw (RuntimeException) + { + MethodGuard aGuard( *m_pImpl ); + + const UnoPoint aOwnScreenPos( getLocationOnScreen() ); + const ::Point aRequestedPoint( i_rPoint.X + aOwnScreenPos.X, i_rPoint.Y + aOwnScreenPos.Y ); + + + for ( size_t i=0; i<m_pImpl->getPanelDeck()->GetPanelCount(); ++i ) + { + const ::Rectangle aItemScreenRect( m_pImpl->getTabBar()->GetItemScreenRect(i) ); + if ( aItemScreenRect.IsInside( aRequestedPoint ) ) + return m_pImpl->getAccessibleChild(i); + } + + // TODO: the buttons + return NULL; + } + + //------------------------------------------------------------------------------------------------------------------ + void SAL_CALL AccessibleToolPanelTabBar::disposing() + { + AccessibleToolPanelTabBar_Base::disposing(); + m_pImpl->dispose(); + } + + //------------------------------------------------------------------------------------------------------------------ + Reference< XAccessible > AccessibleToolPanelTabBar::GetChildAccessible( const VclWindowEvent& i_rVclWindowEvent ) + { + // don't let the base class generate any A11Y events from VclWindowEvent, we completely manage those + // A11Y events ourself + return NULL; + } + + //------------------------------------------------------------------------------------------------------------------ + void AccessibleToolPanelTabBar::FillAccessibleStateSet( ::utl::AccessibleStateSetHelper& i_rStateSet ) + { + AccessibleToolPanelTabBar_Base::FillAccessibleStateSet( i_rStateSet ); + i_rStateSet.AddState( AccessibleStateType::FOCUSABLE ); + + ENSURE_OR_RETURN_VOID( !m_pImpl->isDisposed(), "AccessibleToolPanelTabBar::FillAccessibleStateSet: already disposed!" ); + if ( m_pImpl->getTabBar()->IsVertical() ) + i_rStateSet.AddState( AccessibleStateType::VERTICAL ); + else + i_rStateSet.AddState( AccessibleStateType::HORIZONTAL ); + } + +//...................................................................................................................... +} // namespace accessibility +//...................................................................................................................... diff --git a/accessibility/source/extended/AccessibleToolPanelDeckTabBarItem.cxx b/accessibility/source/extended/AccessibleToolPanelDeckTabBarItem.cxx index bf43ce660cf4..4da6a3e6fe2e 100644 --- a/accessibility/source/extended/AccessibleToolPanelDeckTabBarItem.cxx +++ b/accessibility/source/extended/AccessibleToolPanelDeckTabBarItem.cxx @@ -36,7 +36,7 @@ /** === end UNO includes === **/ #include <svtools/toolpanel/toolpaneldeck.hxx> -#include <svtools/toolpanel/tablayouter.hxx> +#include <svtools/toolpanel/paneltabbar.hxx> #include <unotools/accessiblestatesethelper.hxx> #include <unotools/accessiblerelationsethelper.hxx> #include <tools/diagnose_ex.h> @@ -72,6 +72,7 @@ namespace accessibility using ::com::sun::star::accessibility::XAccessibleExtendedComponent; using ::com::sun::star::awt::XFont; /** === end UNO using === **/ + namespace AccessibleRole = ::com::sun::star::accessibility::AccessibleRole; namespace AccessibleStateType = ::com::sun::star::accessibility::AccessibleStateType; namespace AccessibleEventId = ::com::sun::star::accessibility::AccessibleEventId; @@ -85,11 +86,14 @@ namespace accessibility AccessibleToolPanelDeckTabBarItem_Impl( AccessibleToolPanelDeckTabBarItem& i_rAntiImpl, const Reference< XAccessible >& i_rAccessibleParent, - const ::rtl::Reference< ::svt::TabDeckLayouter >& i_pLayouter, + ::svt::IToolPanelDeck& i_rPanelDeck, + ::svt::PanelTabBar& i_rTabBar, const size_t i_nItemPos ); ~AccessibleToolPanelDeckTabBarItem_Impl(); + ::svt::PanelTabBar* getTabBar() const { return m_pTabBar; } + // IToolPanelDeckListener virtual void PanelInserted( const ::svt::PToolPanel& i_pPanel, const size_t i_nPosition ); virtual void PanelRemoved( const size_t i_nPosition ); @@ -98,30 +102,28 @@ namespace accessibility virtual void Dying(); public: - bool isDisposed() const { return m_pLayouter == NULL; } + bool isDisposed() const { return m_pPanelDeck == NULL; } void checkDisposed() const; void dispose(); const Reference< XAccessible >& getAccessibleParent() const { return m_xAccessibleParent; } - const ::rtl::Reference< ::svt::TabDeckLayouter >& - getLayouter() const { return m_pLayouter; } size_t getItemPos() const { return m_nItemPos; } - Reference< XAccessibleComponent > - getParentAccessibleComponent() const; - ::rtl::OUString - getPanelDisplayName(); + Reference< XAccessibleComponent > getParentAccessibleComponent() const; + ::svt::IToolPanelDeck* getPanelDeck() const { return m_pPanelDeck; } + ::rtl::OUString getPanelDisplayName(); private: void impl_notifyBoundRectChanges(); void impl_notifyStateChange( const sal_Int16 i_nLostState, const sal_Int16 i_nGainedState ); private: - AccessibleToolPanelDeckTabBarItem& m_rAntiImpl; - const Reference< XAccessible > m_xAccessibleParent; - ::rtl::Reference< ::svt::TabDeckLayouter > m_pLayouter; - size_t m_nItemPos; + AccessibleToolPanelDeckTabBarItem& m_rAntiImpl; + Reference< XAccessible > m_xAccessibleParent; + ::svt::IToolPanelDeck* m_pPanelDeck; + ::svt::PanelTabBar* m_pTabBar; + size_t m_nItemPos; }; //================================================================================================================== @@ -129,17 +131,15 @@ namespace accessibility //================================================================================================================== //------------------------------------------------------------------------------------------------------------------ AccessibleToolPanelDeckTabBarItem_Impl::AccessibleToolPanelDeckTabBarItem_Impl( AccessibleToolPanelDeckTabBarItem& i_rAntiImpl, - const Reference< XAccessible >& i_rAccessibleParent, const ::rtl::Reference< ::svt::TabDeckLayouter >& i_pLayouter, + const Reference< XAccessible >& i_rAccessibleParent, ::svt::IToolPanelDeck& i_rPanelDeck, ::svt::PanelTabBar& i_rTabBar, const size_t i_nItemPos ) :m_rAntiImpl( i_rAntiImpl ) ,m_xAccessibleParent( i_rAccessibleParent ) - ,m_pLayouter( i_pLayouter ) + ,m_pPanelDeck( &i_rPanelDeck ) + ,m_pTabBar( &i_rTabBar ) ,m_nItemPos( i_nItemPos ) { - ENSURE_OR_THROW( m_pLayouter.get() != NULL, "illegal layouter!" ); - - ::svt::IToolPanelDeck& rPanels( m_pLayouter->GetPanelDeck() ); - rPanels.AddListener( *this ); + m_pPanelDeck->AddListener( *this ); } //------------------------------------------------------------------------------------------------------------------ @@ -159,10 +159,10 @@ namespace accessibility { ENSURE_OR_RETURN_VOID( !isDisposed(), "AccessibleToolPanelDeckTabBarItem_Impl::dispose: disposed twice!" ); - ::svt::IToolPanelDeck& rPanels( m_pLayouter->GetPanelDeck() ); - rPanels.RemoveListener( *this ); - - m_pLayouter = NULL; + m_xAccessibleParent.clear(); + m_pPanelDeck->RemoveListener( *this ); + m_pPanelDeck = NULL; + m_pTabBar = NULL; } //------------------------------------------------------------------------------------------------------------------ @@ -175,9 +175,7 @@ namespace accessibility //------------------------------------------------------------------------------------------------------------------ ::rtl::OUString AccessibleToolPanelDeckTabBarItem_Impl::getPanelDisplayName() { - const ::rtl::Reference< ::svt::TabDeckLayouter > pLayouter( getLayouter() ); - const ::svt::IToolPanelDeck& rPanels( pLayouter->GetPanelDeck() ); - const ::svt::PToolPanel pPanel( rPanels.GetPanel( getItemPos() ) ); + const ::svt::PToolPanel pPanel( m_pPanelDeck->GetPanel( getItemPos() ) ); if ( pPanel.get() == NULL ) throw DisposedException(); return pPanel->GetDisplayName(); @@ -279,8 +277,8 @@ namespace accessibility //================================================================================================================== //------------------------------------------------------------------------------------------------------------------ AccessibleToolPanelDeckTabBarItem::AccessibleToolPanelDeckTabBarItem( const Reference< XAccessible >& i_rAccessibleParent, - const ::rtl::Reference< ::svt::TabDeckLayouter >& i_pLayouter, const size_t i_nItemPos ) - :m_pImpl( new AccessibleToolPanelDeckTabBarItem_Impl( *this, i_rAccessibleParent, i_pLayouter, i_nItemPos ) ) + ::svt::IToolPanelDeck& i_rPanelDeck, ::svt::PanelTabBar& i_rTabBar, const size_t i_nItemPos ) + :m_pImpl( new AccessibleToolPanelDeckTabBarItem_Impl( *this, i_rAccessibleParent, i_rPanelDeck, i_rTabBar, i_nItemPos ) ) { } @@ -311,7 +309,7 @@ namespace accessibility //-------------------------------------------------------------------- sal_Int16 SAL_CALL AccessibleToolPanelDeckTabBarItem::getAccessibleRole( ) throw (RuntimeException) { - return AccessibleRole::LIST_ITEM; + return AccessibleRole::PAGE_TAB; } //-------------------------------------------------------------------- @@ -341,27 +339,24 @@ namespace accessibility { ItemMethodGuard aGuard( *m_pImpl ); - const ::rtl::Reference< ::svt::TabDeckLayouter > pLayouter( m_pImpl->getLayouter() ); - const ::svt::IToolPanelDeck& rPanels( pLayouter->GetPanelDeck() ); - ::utl::AccessibleStateSetHelper* pStateSet( new ::utl::AccessibleStateSetHelper ); pStateSet->AddState( AccessibleStateType::FOCUSABLE ); pStateSet->AddState( AccessibleStateType::SELECTABLE ); pStateSet->AddState( AccessibleStateType::ICONIFIED ); - if ( m_pImpl->getItemPos() == rPanels.GetActivePanel() ) + if ( m_pImpl->getItemPos() == m_pImpl->getPanelDeck()->GetActivePanel() ) { pStateSet->AddState( AccessibleStateType::ACTIVE ); pStateSet->AddState( AccessibleStateType::SELECTED ); } - if ( m_pImpl->getItemPos() == pLayouter->GetFocusedPanelItem() ) + if ( m_pImpl->getItemPos() == m_pImpl->getTabBar()->GetFocusedPanelItem() ) pStateSet->AddState( AccessibleStateType::FOCUSED ); - if ( pLayouter->IsPanelSelectorEnabled() ) + if ( m_pImpl->getTabBar()->IsEnabled() ) pStateSet->AddState( AccessibleStateType::ENABLED ); - if ( pLayouter->IsPanelSelectorVisible() ) + if ( m_pImpl->getTabBar()->IsVisible() ) { pStateSet->AddState( AccessibleStateType::SHOWING ); pStateSet->AddState( AccessibleStateType::VISIBLE ); @@ -383,7 +378,7 @@ namespace accessibility void SAL_CALL AccessibleToolPanelDeckTabBarItem::grabFocus( ) throw (RuntimeException) { ItemMethodGuard aGuard( *m_pImpl ); - m_pImpl->getLayouter()->FocusPanelItem( m_pImpl->getItemPos() ); + m_pImpl->getTabBar()->FocusPanelItem( m_pImpl->getItemPos() ); } //-------------------------------------------------------------------- @@ -431,9 +426,8 @@ namespace accessibility UnoRectangle SAL_CALL AccessibleToolPanelDeckTabBarItem::implGetBounds() throw (RuntimeException) { ItemMethodGuard aGuard( *m_pImpl ); - ::rtl::Reference< ::svt::TabDeckLayouter > pLayouter( m_pImpl->getLayouter() ); - const ::Rectangle aItemScreenRect( pLayouter->GetItemScreenRect( m_pImpl->getItemPos() ) ); + const ::Rectangle aItemScreenRect( m_pImpl->getTabBar()->GetItemScreenRect( m_pImpl->getItemPos() ) ); Reference< XAccessibleComponent > xParentComponent( m_pImpl->getParentAccessibleComponent(), UNO_SET_THROW ); const UnoPoint aParentLocation( xParentComponent->getLocationOnScreen() ); @@ -443,6 +437,7 @@ namespace accessibility aItemScreenRect.GetWidth(), aItemScreenRect.GetHeight() ); + return UnoRectangle(); } //-------------------------------------------------------------------- diff --git a/accessibility/source/extended/makefile.mk b/accessibility/source/extended/makefile.mk index 81bdabe530ae..abd62e3228af 100755 --- a/accessibility/source/extended/makefile.mk +++ b/accessibility/source/extended/makefile.mk @@ -73,6 +73,7 @@ SLOFILES=\ $(SLO)$/AccessibleGridControlHeaderCell.obj \ $(SLO)$/AccessibleGridControlTable.obj \ $(SLO)$/AccessibleToolPanelDeck.obj \ + $(SLO)$/AccessibleToolPanelDeckTabBar.obj \ $(SLO)$/AccessibleToolPanelDeckTabBarItem.obj # --- Targets ------------------------------------------------------- diff --git a/accessibility/source/helper/acc_factory.cxx b/accessibility/source/helper/acc_factory.cxx index 69b0d7ec0954..f9be917a6cfa 100755 --- a/accessibility/source/helper/acc_factory.cxx +++ b/accessibility/source/helper/acc_factory.cxx @@ -65,6 +65,7 @@ #include <accessibility/extended/AccessibleBrowseBoxCheckBoxCell.hxx> #include <accessibility/extended/accessibleeditbrowseboxcell.hxx> #include <accessibility/extended/AccessibleToolPanelDeck.hxx> +#include <accessibility/extended/AccessibleToolPanelDeckTabBar.hxx> #include <accessibility/extended/AccessibleToolPanelDeckTabBarItem.hxx> #include <vcl/lstbox.hxx> #include <vcl/combobox.hxx> @@ -97,28 +98,6 @@ inline bool hasFloatingChild(Window *pWindow) using namespace ::svt::table; //================================================================ - //= AccessibleWrapper - //================================================================ - typedef ::cppu::WeakImplHelper1< XAccessible > AccessibleWrapper_Base; - class AccessibleWrapper : public AccessibleWrapper_Base - { - public: - AccessibleWrapper( const Reference< XAccessibleContext >& i_rContext ) - :m_xContext( i_rContext ) - { - } - - // XAccessible - virtual Reference< XAccessibleContext > SAL_CALL getAccessibleContext( ) throw (RuntimeException) - { - return m_xContext; - } - - private: - const Reference< XAccessibleContext > m_xContext; - }; - - //================================================================ //= IAccessibleFactory //================================================================ class AccessibleFactory :public ::toolkit::IAccessibleFactory @@ -254,11 +233,11 @@ inline bool hasFloatingChild(Window *pWindow) const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& i_rAccessibleParent, ::svt::ToolPanelDeck& i_rPanelDeck ); - virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > - createAccessibleToolPanelDeckTabBarItem( + virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext > + createAccessibleToolPanelTabBar( const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& i_rAccessibleParent, - const ::rtl::Reference< ::svt::TabDeckLayouter >& i_pLayouter, - const size_t i_nItemPos + ::svt::IToolPanelDeck& i_rPanelDeck, + ::svt::PanelTabBar& i_rTabBar ); protected: @@ -550,14 +529,10 @@ inline bool hasFloatingChild(Window *pWindow) } //-------------------------------------------------------------------- - Reference< XAccessible > AccessibleFactory::createAccessibleToolPanelDeckTabBarItem( - const Reference< XAccessible >& i_rAccessibleParent, const ::rtl::Reference< ::svt::TabDeckLayouter >& i_pLayouter, const size_t i_nItemPos ) + Reference< XAccessibleContext > AccessibleFactory::createAccessibleToolPanelTabBar( + const Reference< XAccessible >& i_rAccessibleParent, ::svt::IToolPanelDeck& i_rPanelDeck, ::svt::PanelTabBar& i_rTabBar ) { - ::rtl::Reference< AccessibleToolPanelDeckTabBarItem > pItemContext( new AccessibleToolPanelDeckTabBarItem( - i_rAccessibleParent, i_pLayouter, i_nItemPos ) ); - Reference< XAccessible > xItemAccessible( new AccessibleWrapper( pItemContext.get() ) ); - pItemContext->lateInit( xItemAccessible ); - return xItemAccessible; + return new AccessibleToolPanelTabBar( i_rAccessibleParent, i_rPanelDeck, i_rTabBar ); } //........................................................................ diff --git a/accessibility/source/helper/accessiblestrings.src b/accessibility/source/helper/accessiblestrings.src index 06b0e7a0edba..f5738f5f2613 100644 --- a/accessibility/source/helper/accessiblestrings.src +++ b/accessibility/source/helper/accessiblestrings.src @@ -73,3 +73,7 @@ String RID_STR_ACC_NAME_BROWSEBUTTON Text [ en-US ] = "Browse"; }; +String RID_STR_ACC_DESC_PANELDECL_TABBAR +{ + Text [ en-US ] = "Panel Deck Tab Bar"; +}; |