diff options
author | Malte Timmermann <mt@openoffice.org> | 2002-02-08 07:59:48 +0000 |
---|---|---|
committer | Malte Timmermann <mt@openoffice.org> | 2002-02-08 07:59:48 +0000 |
commit | cedf042a9d03b13dbaa704403bb00ba36b36412c (patch) | |
tree | c095ac73a5d5044e1bb832da80689037d10c24ca /toolkit | |
parent | 24d9327d60e5b6511333cf9289ac2216bc4bdb65 (diff) |
#97034# Improved accessibility
Diffstat (limited to 'toolkit')
-rw-r--r-- | toolkit/source/awt/vclxwindow.cxx | 61 |
1 files changed, 32 insertions, 29 deletions
diff --git a/toolkit/source/awt/vclxwindow.cxx b/toolkit/source/awt/vclxwindow.cxx index a413739cae5a..3d4aaf9a3e80 100644 --- a/toolkit/source/awt/vclxwindow.cxx +++ b/toolkit/source/awt/vclxwindow.cxx @@ -2,9 +2,9 @@ * * $RCSfile: vclxwindow.cxx,v $ * - * $Revision: 1.17 $ + * $Revision: 1.18 $ * - * last change: $Author: mt $ $Date: 2002-01-29 12:54:27 $ + * last change: $Author: mt $ $Date: 2002-02-08 08:59:48 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -102,6 +102,8 @@ #include <vcl/window.hxx> #include <tools/color.hxx> +#include <unotools/accessiblestatesethelper.hxx> + struct AccessibilityInfos { String aAccName; @@ -110,28 +112,6 @@ struct AccessibilityInfos // Mit Out-Parameter besser als Rueckgabewert, wegen Ref-Objekt... -Window* ImplGetAccessibleParentWindow( Window* pWindow ) -{ - Window* pParent = pWindow->GetParent(); - if ( pParent && ( pParent->GetType() == WINDOW_BORDERWINDOW ) ) - { - DBG_ASSERT( pParent->GetChildCount() == 1, "BorderWindow with more than 1 child?" ); - pParent = pParent->GetParent(); - } - return pParent; -} - -Window* ImplGetAccessibleChildWindow( Window* pWindow, USHORT n ) -{ - Window* pChild = pWindow->GetChild( n ); - if ( pChild && ( pChild->GetType() == WINDOW_BORDERWINDOW ) ) - { - DBG_ASSERT( pChild->GetChildCount() == 1, "BorderWindow with more than 1 child?" ); - pChild = pChild->GetChild( 0 ); - } - return pChild; -} - void ImplInitWindowEvent( ::com::sun::star::awt::WindowEvent& rEvent, Window* pWindow ) { Point aPos = pWindow->GetPosPixel(); @@ -493,6 +473,12 @@ void VCLXWindow::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ) } } +/* +void VCLXWindow::FillAccessibleStateSet( AccessibleStateSetHelper& rStateSet ) +{ +} +*/ + Size VCLXWindow::ImplCalcWindowSize( const Size& rOutSz ) const { Size aSz = rOutSz; @@ -1429,7 +1415,7 @@ sal_Int32 VCLXWindow::getAccessibleChildCount() throw (::com::sun::star::uno::Ru ::com::sun::star::uno::Reference< ::drafts::com::sun::star::accessibility::XAccessible > xAcc; if ( GetWindow() ) { - Window* pChild = ImplGetAccessibleChildWindow( GetWindow(), (USHORT)i ); + Window* pChild = GetWindow()->GetAccessibleChildWindow( (USHORT)i ); if ( pChild ) xAcc = pChild->GetAccessible(); } @@ -1444,7 +1430,7 @@ sal_Int32 VCLXWindow::getAccessibleChildCount() throw (::com::sun::star::uno::Ru ::com::sun::star::uno::Reference< ::drafts::com::sun::star::accessibility::XAccessible > xAcc; if ( GetWindow() ) { - Window* pParent = ImplGetAccessibleParentWindow( GetWindow() ); + Window* pParent = GetWindow()->GetAccessibleParentWindow(); if ( pParent ) xAcc = GetWindow()->GetParent()->GetAccessible(); } @@ -1459,7 +1445,7 @@ sal_Int32 VCLXWindow::getAccessibleIndexInParent( ) throw (::com::sun::star::un sal_Int32 nIndex = 0; if ( GetWindow() ) { - Window* pParent = ImplGetAccessibleParentWindow( GetWindow() ); + Window* pParent = GetWindow()->GetAccessibleParentWindow(); if ( pParent ) { for ( USHORT n = pParent->GetChildCount(); n; ) @@ -1625,6 +1611,11 @@ sal_Int16 VCLXWindow::getAccessibleRole( ) throw (::com::sun::star::uno::Runtim ::com::sun::star::uno::Reference< ::drafts::com::sun::star::accessibility::XAccessibleStateSet > VCLXWindow::getAccessibleStateSet( ) throw (::com::sun::star::uno::RuntimeException) { ::vos::OGuard aGuard( GetMutex() ); + +// AccessibleStateSetHelper* pStateSetHelper = new AccessibleStateSetHelper; +// ::com::sun::star::uno::Reference< ::drafts::com::sun::star::accessibility::XAccessibleStateSet > xSet = pStateSetHelper; +// ... +// FillStateSet( *pStateSetHelper ); return NULL; } @@ -1656,10 +1647,22 @@ sal_Bool VCLXWindow::contains( const ::com::sun::star::awt::Point& aPoint ) thro return sal_False; } -::com::sun::star::uno::Reference< ::drafts::com::sun::star::accessibility::XAccessible > VCLXWindow::getAccessibleAt( const ::com::sun::star::awt::Point& aPoint ) throw (::com::sun::star::uno::RuntimeException) +::com::sun::star::uno::Reference< ::drafts::com::sun::star::accessibility::XAccessible > VCLXWindow::getAccessibleAt( const ::com::sun::star::awt::Point& rPoint ) throw (::com::sun::star::uno::RuntimeException) { ::vos::OGuard aGuard( GetMutex() ); - return NULL; + + ::com::sun::star::uno::Reference< ::drafts::com::sun::star::accessibility::XAccessible > xAcc; + + if ( GetWindow() ) + { + Window* pWindow = GetWindow()->FindWindow( VCLPoint( rPoint ) ); + if ( !pWindow ) + pWindow = GetWindow(); + + xAcc = pWindow->GetAccessible(); + + } + return xAcc; } ::com::sun::star::awt::Rectangle VCLXWindow::getBounds() throw (::com::sun::star::uno::RuntimeException) |