Modified: openoffice/branches/ia2/main/svtools/source/control/valueacc.cxx URL: http://svn.apache.org/viewvc/openoffice/branches/ia2/main/svtools/source/control/valueacc.cxx?rev=1436226&r1=1436225&r2=1436226&view=diff ============================================================================== --- openoffice/branches/ia2/main/svtools/source/control/valueacc.cxx (original) +++ openoffice/branches/ia2/main/svtools/source/control/valueacc.cxx Mon Jan 21 08:47:39 2013 @@ -34,6 +34,15 @@ #include <com/sun/star/accessibility/AccessibleRole.hpp> #include <com/sun/star/accessibility/AccessibleStateType.hpp> +//IAccessibility2 Implementation 2009----- +#include <com/sun/star/accessibility/AccessibleEventId.hpp> +#ifndef _COM_SUN_STAR_ACCESSIBILITY_ACCESSIBLERELATIONTYPE_HPP_ +#include <com/sun/star/accessibility/AccessibleRelationType.hpp> +#endif +#ifndef _UTL_ACCESSIBLERELATIONSETHELPER_HXX_ +#include <unotools/accessiblerelationsethelper.hxx> +#endif +//-----IAccessibility2 Implementation 2009 using namespace ::com::sun::star; // ---------------- @@ -316,6 +325,9 @@ sal_Int16 SAL_CALL ValueSetAcc::getAcces Window* pLabel = mpParent->GetAccessibleRelationLabeledBy(); if ( pLabel && pLabel != mpParent ) aRet = OutputDevice::GetNonMnemonicString( pLabel->GetText() ); + + if ( !aRet.Len() ) + aRet = mpParent->GetQuickHelpText(); } return aRet; @@ -327,7 +339,32 @@ uno::Reference< accessibility::XAccessib throw (uno::RuntimeException) { ThrowIfDisposed(); - return uno::Reference< accessibility::XAccessibleRelationSet >(); +//IAccessibility2 Implementation 2009----- + uno::Reference< accessibility::XAccessibleRelationSet > xRelSet; + Window* pWindow = (Window*)mpParent; + if ( pWindow ) + { + utl::AccessibleRelationSetHelper* pRelationSet = new utl::AccessibleRelationSetHelper; + xRelSet = pRelationSet; + + Window *pLabeledBy = pWindow->GetAccessibleRelationLabeledBy(); + if ( pLabeledBy && pLabeledBy != pWindow ) + { + uno::Sequence< uno::Reference< uno::XInterface > > aSequence(1); + aSequence[0] = pLabeledBy->GetAccessible(); + pRelationSet->AddRelation( accessibility::AccessibleRelation( accessibility::AccessibleRelationType::LABELED_BY, aSequence ) ); + } + + Window* pMemberOf = pWindow->GetAccessibleRelationMemberOf(); + if ( pMemberOf && pMemberOf != pWindow ) + { + uno::Sequence< uno::Reference< uno::XInterface > > aSequence(1); + aSequence[0] = pMemberOf->GetAccessible(); + pRelationSet->AddRelation( accessibility::AccessibleRelation( accessibility::AccessibleRelationType::MEMBER_OF, aSequence ) ); + } + } + return xRelSet; +//-----IAccessibility2 Implementation 2009 } // ----------------------------------------------------------------------------- @@ -755,7 +792,10 @@ ValueSetItem* ValueSetAcc::getItem (sal_ nIndex -= 1; } if (pItem == NULL) - pItem = mpParent->ImplGetVisibleItem (static_cast<sal_uInt16>(nIndex)); +//IAccessibility2 Implementation 2009----- + //pItem = mpParent->ImplGetVisibleItem (static_cast<sal_uInt16>(nIndex)); + pItem = mpParent->ImplGetItem (static_cast<sal_uInt16>(nIndex)); +//-----IAccessibility2 Implementation 2009 return pItem; } @@ -939,7 +979,10 @@ sal_Int32 SAL_CALL ValueItemAcc::getAcce // just in case the number of children changes in the mean time. try { - pItem = mpParent->mrParent.ImplGetVisibleItem (i); +//IAccessibility2 Implementation 2009----- + //pItem = mpParent->mrParent.ImplGetVisibleItem (i); + pItem = mpParent->mrParent.ImplGetItem(i); +//-----IAccessibility2 Implementation 2009 } catch (lang::IndexOutOfBoundsException aException) { @@ -956,6 +999,17 @@ sal_Int32 SAL_CALL ValueItemAcc::getAcce } } +//IAccessibility2 Implementation 2009----- + //if this valueset contain a none field(common value is default), then we should increase the real index and set the noitem index value equal 0. + if ( mpParent && ( (mpParent->mrParent.GetStyle() & WB_NONEFIELD) != 0 ) ) + { + ValueSetItem* pFirstItem = mpParent->mrParent.ImplGetItem (VALUESET_ITEM_NONEITEM); + if( pFirstItem && pFirstItem ->GetAccessible(mbIsTransientChildrenDisabled).get() == this ) + nIndexInParent = 0; + else + nIndexInParent++; + } +//-----IAccessibility2 Implementation 2009 return nIndexInParent; }
Modified: openoffice/branches/ia2/main/svtools/source/control/valueimp.hxx URL: http://svn.apache.org/viewvc/openoffice/branches/ia2/main/svtools/source/control/valueimp.hxx?rev=1436226&r1=1436225&r2=1436226&view=diff ============================================================================== --- openoffice/branches/ia2/main/svtools/source/control/valueimp.hxx (original) +++ openoffice/branches/ia2/main/svtools/source/control/valueimp.hxx Mon Jan 21 08:47:39 2013 @@ -87,6 +87,9 @@ struct ValueSetItem XubString maText; void* mpData; Rectangle maRect; + //IAccessibility2 Implementation 2009----- + sal_Bool bSelected:1; + //-----IAccessibility2 Implementation 2009 ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >* mpxAcc; ValueSetItem( ValueSet& rParent ); Modified: openoffice/branches/ia2/main/svtools/source/control/valueset.cxx URL: http://svn.apache.org/viewvc/openoffice/branches/ia2/main/svtools/source/control/valueset.cxx?rev=1436226&r1=1436225&r2=1436226&view=diff ============================================================================== --- openoffice/branches/ia2/main/svtools/source/control/valueset.cxx (original) +++ openoffice/branches/ia2/main/svtools/source/control/valueset.cxx Mon Jan 21 08:47:39 2013 @@ -1205,7 +1205,9 @@ sal_uInt16 ValueSet::ImplGetVisibleItemC { ValueSetItem* pItem = mpImpl->mpItemList->GetObject( n ); - if( pItem->meType != VALUESETITEM_SPACE && !pItem->maRect.IsEmpty() ) + //IAccessible2 implementation - also count empty rectangles as visible... + // if( pItem->meType != VALUESETITEM_SPACE && !pItem->maRect.IsEmpty() ) + if( pItem->meType != VALUESETITEM_SPACE ) nRet++; } @@ -1891,6 +1893,24 @@ void ValueSet::InsertItem( sal_uInt16 nI Invalidate(); } +//IAccessibility2 Implementation 2009----- +//method to set accessible when the style is user draw. +void ValueSet::InsertItem( sal_uInt16 nItemId, const XubString& rText, sal_uInt16 nPos ) +{ + DBG_ASSERT( nItemId, "ValueSet::InsertItem(): ItemId == 0" ); + DBG_ASSERT( GetItemPos( nItemId ) == VALUESET_ITEM_NOTFOUND, + "ValueSet::InsertItem(): ItemId already exists" ); + ValueSetItem* pItem = new ValueSetItem( *this ); + pItem->mnId = nItemId; + pItem->meType = VALUESETITEM_USERDRAW; + pItem->maText = rText; + mpImpl->mpItemList->Insert( pItem, (sal_uLong)nPos ); + mbFormat = sal_True; + if ( IsReallyVisible() && IsUpdateMode() ) + Invalidate(); +} +//-----IAccessibility2 Implementation 2009 + // ----------------------------------------------------------------------- void ValueSet::InsertItem( sal_uInt16 nItemId, sal_uInt16 nPos ) @@ -2752,3 +2772,57 @@ const Link& ValueSet::GetHighlightHdl() // ----------------------------------------------------------------------- +//IAccessibility2 Implementation 2009----- +//For sending out the focused event on the first focused item when this valueset is first focused. +// MT: Focus notifications changed in DEV300 meanwhile, so this is not used for now. +// Just keeping it here for reference, in case something in out implementation doesn't work as expected... +/* +void ValueSet::SetFocusedItem(sal_Bool bFocused) +{ + if( ImplHasAccessibleListeners() ) + { + // selection event + ::com::sun::star::uno::Any aSelOldAny, aSelNewAny; + if ( mnSelItemId >= 0) + { + // focus event (select) + sal_uInt16 nPos = GetItemPos( mnSelItemId ); + + ValueSetItem* pItem; + if ((GetStyle() & WB_NONEFIELD) != 0 + && nPos == VALUESET_ITEM_NOTFOUND + && mnSelItemId == 0) + { + // When present the first item is the then allways visible none field. + pItem = ImplGetItem (VALUESET_ITEM_NONEITEM); + } + else + { + if (nPos == VALUESET_ITEM_NOTFOUND) + nPos = 0; + pItem = mpImpl->mpItemList->GetObject(nPos); + } + ValueItemAcc* pItemAcc = NULL; + if (pItem != NULL) + pItemAcc = ValueItemAcc::getImplementation(pItem->GetAccessible(mpImpl->mbIsTransientChildrenDisabled) ); + if( pItemAcc ) + { + if (bFocused) + aSelNewAny <<= pItem->GetAccessible(mpImpl->mbIsTransientChildrenDisabled); + else + aSelOldAny <<= pItem->GetAccessible(mpImpl->mbIsTransientChildrenDisabled); + } + ImplFireAccessibleEvent( ::com::sun::star::accessibility::AccessibleEventId::ACTIVE_DESCENDANT_CHANGED, aSelOldAny, aSelNewAny ); + if (pItemAcc && bFocused) + { + pItemAcc->FireAccessibleEvent( + ::com::sun::star::accessibility::AccessibleEventId::SELECTION_CHANGED, + ::com::sun::star::uno::Any(),::com::sun::star::uno::Any()); + } + } + } +} +*/ +//end +//-----IAccessibility2 Implementation 2009 + Added: openoffice/branches/ia2/main/svtools/source/control/vclxaccessibleheaderbar.cxx URL: http://svn.apache.org/viewvc/openoffice/branches/ia2/main/svtools/source/control/vclxaccessibleheaderbar.cxx?rev=1436226&view=auto ============================================================================== --- openoffice/branches/ia2/main/svtools/source/control/vclxaccessibleheaderbar.cxx (added) +++ openoffice/branches/ia2/main/svtools/source/control/vclxaccessibleheaderbar.cxx Mon Jan 21 08:47:39 2013 @@ -0,0 +1,200 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright IBM Corporation 2010. + * 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. + * + ************************************************************************/ + +//IAccessibility2 Implementation 2009----- + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_svtools.hxx" + +#ifndef _SVTOOLS_VCLXACCESSIBLEHEADERBAR_HXX_ +#include <svtools/vclxaccessibleheaderbar.hxx> +#endif +#ifndef _SVTOOLS_VCLACCESSIBLEHEADBARITEM_HXX_ +#include <svtools/vclxaccessibleheaderbaritem.hxx> +#endif + +#ifndef _TOOLKIT_AWT_VCLXWINDOWS_HXX_ +#include <toolkit/awt/vclxwindows.hxx> +#endif +#ifndef _HEADBAR_HXX +#include <headbar.hxx> +#endif +#ifndef _UTL_ACCESSIBLESTATESETHELPER_HXX_ +#include <unotools/accessiblestatesethelper.hxx> +#endif +#ifndef _COM_SUN_STAR_ACCESSIBILITY_ACCESSIBLESTATETYPE_HPP_ +#include <com/sun/star/accessibility/AccessibleStateType.hpp> +#endif +#ifndef _COM_SUN_STAR_ACCESSIBILITY_ACCESSIBLEEVENTID_HPP_ +#include <com/sun/star/accessibility/AccessibleEventId.hpp> +#endif +#ifndef _CPPUHELPER_TYPEPROVIDER_HXX_ +#include <cppuhelper/typeprovider.hxx> +#endif +#ifndef _COMPHELPER_SEQUENCE_HXX_ +#include <comphelper/sequence.hxx> +#endif +#ifndef _COM_SUN_STAR_ACCESSIBILITY_ACCESSIBLEROLE_HPP_ +#include <com/sun/star/accessibility/AccessibleRole.hpp> +#endif + +using namespace ::com::sun::star; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::awt; +using namespace ::com::sun::star::lang; +using namespace ::com::sun::star::beans; +using namespace ::com::sun::star::accessibility; +using namespace ::comphelper; + +VCLXHeaderBar::VCLXHeaderBar(Window* pHeaderBar) +{ + SetWindow(pHeaderBar); +} + +VCLXHeaderBar::~VCLXHeaderBar() +{ +} + +::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext > VCLXHeaderBar::CreateAccessibleContext() +{ + return new VCLXAccessibleHeaderBar(this); +} + + +VCLXAccessibleHeaderBar::VCLXAccessibleHeaderBar( VCLXWindow* pVCLWindow ) + :VCLXAccessibleComponent( pVCLWindow ) + ,m_pHeadBar(NULL) +{ + m_pHeadBar = static_cast< HeaderBar* >( GetWindow() ); +} + +// ----------------------------------------------------------------------------- + +VCLXAccessibleHeaderBar::~VCLXAccessibleHeaderBar() +{ +} + +// ----------------------------------------------------------------------------- + +void VCLXAccessibleHeaderBar::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent ) +{ + VCLXAccessibleComponent::ProcessWindowEvent( rVclWindowEvent ); +} + +// ----------------------------------------------------------------------------- + +void VCLXAccessibleHeaderBar::FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet ) +{ + VCLXAccessibleComponent::FillAccessibleStateSet( rStateSet ); +} + +// ----------------------------------------------------------------------------- +// XServiceInfo +// ----------------------------------------------------------------------------- + +::rtl::OUString VCLXAccessibleHeaderBar::getImplementationName() throw (RuntimeException) +{ + return ::rtl::OUString::createFromAscii( "com.sun.star.comp.toolkit.AccessibleHeaderBar" ); +} + +// ----------------------------------------------------------------------------- + +Sequence< ::rtl::OUString > VCLXAccessibleHeaderBar::getSupportedServiceNames() throw (RuntimeException) +{ + Sequence< ::rtl::OUString > aNames(1); + aNames[0] = ::rtl::OUString::createFromAscii( "com.sun.star.awt.AccessibleHeaderBar" ); + return aNames; +} + +// =======XAccessibleContext======= + +sal_Int32 SAL_CALL VCLXAccessibleHeaderBar::getAccessibleChildCount( ) + throw (::com::sun::star::uno::RuntimeException) +{ + sal_Int32 nCount = 0; + if ( m_pHeadBar ) + nCount = m_pHeadBar->GetItemCount(); + + return nCount; +} +::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL + VCLXAccessibleHeaderBar::getAccessibleChild( sal_Int32 i ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException) +{ + if ( i < 0 || i >= getAccessibleChildCount() ) + throw IndexOutOfBoundsException(); + + Reference< XAccessible > xChild; + // search for the child + if ( static_cast<sal_uInt16>(i) >= m_aAccessibleChildren.size() ) + xChild = CreateChild (i); + else + { + xChild = m_aAccessibleChildren[i]; + if ( !xChild.is() ) + xChild = CreateChild (i); + } + return xChild; +} + +sal_Int16 SAL_CALL VCLXAccessibleHeaderBar::getAccessibleRole( ) throw (::com::sun::star::uno::RuntimeException) +{ + return com::sun::star::accessibility::AccessibleRole::LIST; +} + +void SAL_CALL VCLXAccessibleHeaderBar::disposing (void) +{ + ListItems().swap(m_aAccessibleChildren); + VCLXAccessibleComponent::disposing(); +} + +::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > VCLXAccessibleHeaderBar::CreateChild (sal_Int32 i) +{ + Reference<XAccessible> xChild; + + sal_uInt16 nPos = static_cast<sal_uInt16>(i); + if ( nPos >= m_aAccessibleChildren.size() ) + { + m_aAccessibleChildren.resize(nPos + 1); + + // insert into the container + xChild = new VCLXAccessibleHeaderBarItem(m_pHeadBar, i); + m_aAccessibleChildren[nPos] = xChild; + } + else + { + xChild = m_aAccessibleChildren[nPos]; + // check if position is empty and can be used else we have to adjust all entries behind this + if ( !xChild.is() ) + { + xChild = new VCLXAccessibleHeaderBarItem(m_pHeadBar, i); + m_aAccessibleChildren[nPos] = xChild; + } + } + return xChild; +} +//-----IAccessibility2 Implementation 2009 Added: openoffice/branches/ia2/main/svtools/source/control/vclxaccessibleheaderbaritem.cxx URL: http://svn.apache.org/viewvc/openoffice/branches/ia2/main/svtools/source/control/vclxaccessibleheaderbaritem.cxx?rev=1436226&view=auto ============================================================================== --- openoffice/branches/ia2/main/svtools/source/control/vclxaccessibleheaderbaritem.cxx (added) +++ openoffice/branches/ia2/main/svtools/source/control/vclxaccessibleheaderbaritem.cxx Mon Jan 21 08:47:39 2013 @@ -0,0 +1,410 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright IBM Corporation 2010. + * 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. + * + ************************************************************************/ + +//IAccessibility2 Implementation 2009----- + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_svtools.hxx" + +#ifndef _SVTOOLS_VCLXACCESSIBLEHEADERBAR_HXX_ +#include <svtools/vclxaccessibleheaderbaritem.hxx> +#endif + +#ifndef _HEADBAR_HXX +#include <svtools/headbar.hxx> +#endif + +#ifndef _COM_SUN_STAR_ACCESSIBILITY_ACCESSIBLEEVENTID_HPP_ +#include <com/sun/star/accessibility/AccessibleEventId.hpp> +#endif +#ifndef _COM_SUN_STAR_ACCESSIBILITY_ACCESSIBLEROLE_HPP_ +#include <com/sun/star/accessibility/AccessibleRole.hpp> +#endif +#ifndef _COM_SUN_STAR_ACCESSIBILITY_ACCESSIBLESTATETYPE_HPP_ +#include <com/sun/star/accessibility/AccessibleStateType.hpp> +#endif + +#ifndef _UTL_ACCESSIBLESTATESETHELPER_HXX_ +#include <unotools/accessiblestatesethelper.hxx> +#endif +#ifndef _UTL_ACCESSIBLERELATIONSETHELPER_HXX_ +#include <unotools/accessiblerelationsethelper.hxx> +#endif +#ifndef _SV_SVAPP_HXX +#include <vcl/svapp.hxx> +#endif +#ifndef _TOOLKIT_AWT_VCLXFONT_HXX_ +#include <toolkit/awt/vclxfont.hxx> +#endif +#ifndef _TOOLKIT_HELPER_EXTERNALLOCK_HXX_ +#include <toolkit/helper/externallock.hxx> +#endif +#ifndef _TOOLKIT_HELPER_CONVERT_HXX_ +#include <toolkit/helper/convert.hxx> +#endif + +#include <vector> + + +using namespace ::com::sun::star; +using namespace ::com::sun::star::uno; +using namespace ::com::sun::star::lang; +using namespace ::com::sun::star::accessibility; +using namespace ::comphelper; + +DBG_NAME( VCLXAccessibleHeaderBarItem ) + +// ---------------------------------------------------- +// class AccessibleTabBar +// ---------------------------------------------------- + +VCLXAccessibleHeaderBarItem::VCLXAccessibleHeaderBarItem( HeaderBar* pHeadBar, sal_Int32 _nIndexInParent ) + :AccessibleExtendedComponentHelper_BASE( new VCLExternalSolarLock() ) + ,m_pHeadBar( pHeadBar ) + ,m_nIndexInParent(_nIndexInParent + 1) + +{ + DBG_CTOR( VCLXAccessibleHeaderBarItem, NULL ); + m_pExternalLock = static_cast< VCLExternalSolarLock* >( getExternalLock() ); +} + +// ----------------------------------------------------------------------------- + +VCLXAccessibleHeaderBarItem::~VCLXAccessibleHeaderBarItem() +{ + delete m_pExternalLock; + m_pExternalLock = NULL; +} + +// ----------------------------------------------------------------------------- + +IMPL_LINK( VCLXAccessibleHeaderBarItem, WindowEventListener, VclSimpleEvent*, pEvent ) +{ + DBG_CHKTHIS( VCLXAccessibleHeaderBarItem, 0 ); + DBG_ASSERT( pEvent && pEvent->ISA( VclWindowEvent ), "VCLXAccessibleHeaderBarItem::WindowEventListener: unknown window event!" ); + + if ( pEvent && pEvent->ISA( VclWindowEvent ) ) + { + DBG_ASSERT( ((VclWindowEvent*)pEvent)->GetWindow(), "VCLXAccessibleHeaderBarItem::WindowEventListener: no window!" ); + if ( !((VclWindowEvent*)pEvent)->GetWindow()->IsAccessibilityEventsSuppressed() || ( pEvent->GetId() == VCLEVENT_OBJECT_DYING ) ) + { + ProcessWindowEvent( *(VclWindowEvent*)pEvent ); + } + } + + return 0; +} + +// ----------------------------------------------------------------------------- + +void VCLXAccessibleHeaderBarItem::ProcessWindowEvent( const VclWindowEvent& ) +{ + Any aOldValue, aNewValue; +} + +// ----------------------------------------------------------------------------- + +void VCLXAccessibleHeaderBarItem::FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet ) +{ + if ( m_pHeadBar ) + { + if ( m_pHeadBar->IsEnabled() ) + rStateSet.AddState( AccessibleStateType::ENABLED ); + + if ( m_pHeadBar->IsVisible() ) + { + rStateSet.AddState( AccessibleStateType::VISIBLE ); + } + rStateSet.AddState( AccessibleStateType::SELECTABLE ); + rStateSet.AddState( AccessibleStateType::RESIZABLE ); + } +} + +// ----------------------------------------------------------------------------- +// OCommonAccessibleComponent +// ----------------------------------------------------------------------------- + +awt::Rectangle VCLXAccessibleHeaderBarItem::implGetBounds() throw (RuntimeException) +{ + awt::Rectangle aBounds; + OExternalLockGuard aGuard( this ); + + ::com::sun::star::awt::Size aSize; + + if ( m_pHeadBar ) + aBounds = AWTRectangle( m_pHeadBar->GetItemRect( sal_uInt16( m_nIndexInParent ) ) ); + + return aBounds; +} + +// ----------------------------------------------------------------------------- +// XInterface +// ----------------------------------------------------------------------------- + +IMPLEMENT_FORWARD_XINTERFACE2( VCLXAccessibleHeaderBarItem, AccessibleExtendedComponentHelper_BASE, VCLXAccessibleHeaderBarItem_BASE ) + +// ----------------------------------------------------------------------------- +// XTypeProvider +// ----------------------------------------------------------------------------- + +IMPLEMENT_FORWARD_XTYPEPROVIDER2( VCLXAccessibleHeaderBarItem, AccessibleExtendedComponentHelper_BASE, VCLXAccessibleHeaderBarItem_BASE ) + +// ----------------------------------------------------------------------------- +// XComponent +// ----------------------------------------------------------------------------- + +void VCLXAccessibleHeaderBarItem::disposing() +{ + AccessibleExtendedComponentHelper_BASE::disposing(); +} + +// ----------------------------------------------------------------------------- +// XServiceInfo +// ----------------------------------------------------------------------------- + +::rtl::OUString VCLXAccessibleHeaderBarItem::getImplementationName() throw (RuntimeException) +{ + return ::rtl::OUString::createFromAscii( "com.sun.star.comp.svtools.AccessibleHeaderBarItem" ); +} + +// ----------------------------------------------------------------------------- + +sal_Bool VCLXAccessibleHeaderBarItem::supportsService( const ::rtl::OUString& rServiceName ) throw (RuntimeException) +{ + Sequence< ::rtl::OUString > aNames( getSupportedServiceNames() ); + const ::rtl::OUString* pNames = aNames.getConstArray(); + const ::rtl::OUString* pEnd = pNames + aNames.getLength(); + for ( ; pNames != pEnd && !pNames->equals( rServiceName ); ++pNames ) + ; + + return pNames != pEnd; +} + +// ----------------------------------------------------------------------------- + +Sequence< ::rtl::OUString > VCLXAccessibleHeaderBarItem::getSupportedServiceNames() throw (RuntimeException) +{ + Sequence< ::rtl::OUString > aNames(1); + aNames[0] = ::rtl::OUString::createFromAscii( "com.sun.star.awt.AccessibleHeaderBarItem" ); + return aNames; +} + +// ----------------------------------------------------------------------------- +// XAccessible +// ----------------------------------------------------------------------------- + +Reference< XAccessibleContext > VCLXAccessibleHeaderBarItem::getAccessibleContext() throw (RuntimeException) +{ + OExternalLockGuard aGuard( this ); + + return this; +} + +// ----------------------------------------------------------------------------- +// XAccessibleContext +// ----------------------------------------------------------------------------- + +sal_Int32 VCLXAccessibleHeaderBarItem::getAccessibleChildCount() throw (RuntimeException) +{ + OExternalLockGuard aGuard( this ); + + return 0; +} + +// ----------------------------------------------------------------------------- + +Reference< XAccessible > VCLXAccessibleHeaderBarItem::getAccessibleChild( sal_Int32 i ) throw (IndexOutOfBoundsException, RuntimeException) +{ + OExternalLockGuard aGuard( this ); + + if ( i < 0 || i >= getAccessibleChildCount() ) + throw IndexOutOfBoundsException(); + + return Reference< XAccessible >(); +} + +// ----------------------------------------------------------------------------- + +Reference< XAccessible > VCLXAccessibleHeaderBarItem::getAccessibleParent() throw (RuntimeException) +{ + OExternalLockGuard aGuard( this ); + + Reference< XAccessible > xParent; + if ( m_pHeadBar ) + { + xParent = m_pHeadBar->GetAccessible(); + } + + return xParent; +} + +// ----------------------------------------------------------------------------- + +sal_Int32 VCLXAccessibleHeaderBarItem::getAccessibleIndexInParent() throw (RuntimeException) +{ + OExternalLockGuard aGuard( this ); + return m_nIndexInParent - 1; +} + +// ----------------------------------------------------------------------------- + +sal_Int16 VCLXAccessibleHeaderBarItem::getAccessibleRole() throw (RuntimeException) +{ + OExternalLockGuard aGuard( this ); + + return AccessibleRole::COLUMN_HEADER; +} + +// ----------------------------------------------------------------------------- + +::rtl::OUString VCLXAccessibleHeaderBarItem::getAccessibleDescription() throw (RuntimeException) +{ + OExternalLockGuard aGuard( this ); + ::rtl::OUString sDescription; + return sDescription; +} + +// ----------------------------------------------------------------------------- + +::rtl::OUString VCLXAccessibleHeaderBarItem::getAccessibleName() throw (RuntimeException) +{ + OExternalLockGuard aGuard( this ); + + ::rtl::OUString sName; + if(m_pHeadBar) + sName = m_pHeadBar->GetItemText( sal_uInt16( m_nIndexInParent ) ); + return sName; +} + +// ----------------------------------------------------------------------------- + +Reference< XAccessibleRelationSet > VCLXAccessibleHeaderBarItem::getAccessibleRelationSet( ) throw (RuntimeException) +{ + OExternalLockGuard aGuard( this ); + + utl::AccessibleRelationSetHelper* pRelationSetHelper = new utl::AccessibleRelationSetHelper; + Reference< XAccessibleRelationSet > xSet = pRelationSetHelper; + return xSet; +} + +// ----------------------------------------------------------------------------- + +Reference< XAccessibleStateSet > VCLXAccessibleHeaderBarItem::getAccessibleStateSet( ) throw (RuntimeException) +{ + OExternalLockGuard aGuard( this ); + + utl::AccessibleStateSetHelper* pStateSetHelper = new utl::AccessibleStateSetHelper; + Reference< XAccessibleStateSet > xSet = pStateSetHelper; + + if ( !rBHelper.bDisposed && !rBHelper.bInDispose ) + { + FillAccessibleStateSet( *pStateSetHelper ); + } + else + { + pStateSetHelper->AddState( AccessibleStateType::DEFUNC ); + } + + return xSet; +} + +// ----------------------------------------------------------------------------- + +com::sun::star::lang::Locale VCLXAccessibleHeaderBarItem::getLocale() throw (IllegalAccessibleComponentStateException, RuntimeException) +{ + OExternalLockGuard aGuard( this ); + + return Application::GetSettings().GetLocale(); +} + +// ----------------------------------------------------------------------------- +// XAccessibleComponent +// ----------------------------------------------------------------------------- + +Reference< XAccessible > VCLXAccessibleHeaderBarItem::getAccessibleAtPoint( const awt::Point& ) throw (RuntimeException) +{ + OExternalLockGuard aGuard( this ); + + return Reference< XAccessible >(); +} + +// ----------------------------------------------------------------------------- + +sal_Int32 VCLXAccessibleHeaderBarItem::getForeground() throw (RuntimeException) +{ + OExternalLockGuard aGuard( this ); + + sal_Int32 nColor = 0; + return nColor; +} + +// ----------------------------------------------------------------------------- + +sal_Int32 VCLXAccessibleHeaderBarItem::getBackground() throw (RuntimeException) +{ + OExternalLockGuard aGuard( this ); + + sal_Int32 nColor = 0; + return nColor; +} + +// ----------------------------------------------------------------------------- +// XAccessibleExtendedComponent +// ----------------------------------------------------------------------------- + +Reference< awt::XFont > VCLXAccessibleHeaderBarItem::getFont() throw (RuntimeException) +{ + OExternalLockGuard aGuard( this ); + + Reference< awt::XFont > xFont; + return xFont; +} + +// ----------------------------------------------------------------------------- + +::rtl::OUString VCLXAccessibleHeaderBarItem::getTitledBorderText() throw (RuntimeException) +{ + OExternalLockGuard aGuard( this ); + + ::rtl::OUString sText; + return sText; +} + +// ----------------------------------------------------------------------------- + +::rtl::OUString VCLXAccessibleHeaderBarItem::getToolTipText() throw (RuntimeException) +{ + OExternalLockGuard aGuard( this ); + + ::rtl::OUString sText; + if ( m_pHeadBar ) + sText = m_pHeadBar->GetQuickHelpText(); + + return sText; +} +//-----IAccessibility2 Implementation 2009 Modified: openoffice/branches/ia2/main/svtools/source/edit/svmedit.cxx URL: http://svn.apache.org/viewvc/openoffice/branches/ia2/main/svtools/source/edit/svmedit.cxx?rev=1436226&r1=1436225&r2=1436226&view=diff ============================================================================== --- openoffice/branches/ia2/main/svtools/source/edit/svmedit.cxx (original) +++ openoffice/branches/ia2/main/svtools/source/edit/svmedit.cxx Mon Jan 21 08:47:39 2013 @@ -941,7 +941,9 @@ void TextWindow::Command( const CommandE void TextWindow::GetFocus() { - Window::GetFocus(); +//IAccessibility2 Implementation 2009----- + //Window::GetFocus(); +//-----IAccessibility2 Implementation 2009 if ( !mbActivePopup ) { sal_Bool bGotoCursor = !mpExtTextView->IsReadOnly(); @@ -1248,8 +1250,10 @@ void MultiLineEdit::GetFocus() { if ( !pImpSvMEdit ) // might be called from within the dtor, when pImpSvMEdit == NULL is a valid state return; - - Edit::GetFocus(); + //IAccessibility2 Implementation 2009----- + //Disable the focused event on scroll pane + //Edit::GetFocus(); + //-----IAccessibility2 Implementation 2009 pImpSvMEdit->GetFocus(); } Modified: openoffice/branches/ia2/main/svtools/source/misc/acceleratorexecute.cxx URL: http://svn.apache.org/viewvc/openoffice/branches/ia2/main/svtools/source/misc/acceleratorexecute.cxx?rev=1436226&r1=1436225&r2=1436226&view=diff ============================================================================== --- openoffice/branches/ia2/main/svtools/source/misc/acceleratorexecute.cxx (original) +++ openoffice/branches/ia2/main/svtools/source/misc/acceleratorexecute.cxx Mon Jan 21 08:47:39 2013 @@ -72,6 +72,9 @@ #include <vcl/window.hxx> #include <vcl/svapp.hxx> #include <vos/mutex.hxx> +//IAccessibility2 Implementation 2009----- +#include <comphelper/uieventslogger.hxx> +//-----IAccessibility2 Implementation 2009 //=============================================== // namespace @@ -249,6 +252,24 @@ sal_Bool AcceleratorExecute::execute(con sal_Bool bRet = xDispatch.is(); if ( bRet ) { +//IAccessibility2 Implementation 2009----- + if(::comphelper::UiEventsLogger::isEnabled() && m_xSMGR.is() && m_xDispatcher.is()) //#i88653# + { + try + { + css::uno::Reference< css::frame::XModuleManager > xModuleDetection( + m_xSMGR->createInstance(::rtl::OUString::createFromAscii("com.sun.star.frame.ModuleManager")), + css::uno::UNO_QUERY_THROW); + + const ::rtl::OUString sModule = xModuleDetection->identify(m_xDispatcher); + css::uno::Sequence<css::beans::PropertyValue> source; + ::comphelper::UiEventsLogger::appendDispatchOrigin(source, sModule, ::rtl::OUString::createFromAscii("AcceleratorExecute")); + ::comphelper::UiEventsLogger::logDispatch(aURL, source); + } + catch(const css::uno::Exception&) + { } + } +//-----IAccessibility2 Implementation 2009 // Note: Such instance can be used one times only and destroy itself afterwards .-) AsyncAccelExec* pExec = AsyncAccelExec::createOnShotInstance(xDispatch, aURL); pExec->execAsync(); Modified: openoffice/branches/ia2/main/svtools/source/misc/embedhlp.cxx URL: http://svn.apache.org/viewvc/openoffice/branches/ia2/main/svtools/source/misc/embedhlp.cxx?rev=1436226&r1=1436225&r2=1436226&view=diff ============================================================================== --- openoffice/branches/ia2/main/svtools/source/misc/embedhlp.cxx (original) +++ openoffice/branches/ia2/main/svtools/source/misc/embedhlp.cxx Mon Jan 21 08:47:39 2013 @@ -34,7 +34,14 @@ #include <toolkit/helper/vclunohelper.hxx> #include <unotools/ucbstreamhelper.hxx> #include <unotools/streamwrap.hxx> - +//IAccessibility2 Implementation 2009----- +#include <com/sun/star/chart2/XChartDocument.hpp> +#include <com/sun/star/chart2/XCoordinateSystem.hpp> +#include <com/sun/star/chart2/XCoordinateSystemContainer.hpp> +#include <com/sun/star/chart2/XDiagram.hpp> +#include <com/sun/star/chart2/XChartTypeContainer.hpp> +#include <com/sun/star/chart2/XChartType.hpp> +//-----IAccessibility2 Implementation 2009 #include <tools/globname.hxx> #include <sot/clsids.hxx> #include <com/sun/star/util/XModifyListener.hpp> @@ -937,6 +944,102 @@ sal_Bool EmbeddedObjectRef::IsChart() co return sal_False; } +//IAccessibility2 Implementation 2009----- +// MT: Only used for getting accessible attributes, which are not localized +rtl::OUString EmbeddedObjectRef::GetChartType() +{ + rtl::OUString Style; + if ( mxObj.is() ) + { + if ( IsChart() ) + { + if ( svt::EmbeddedObjectRef::TryRunningState( mxObj ) ) + { + uno::Reference< chart2::XChartDocument > xChart( mxObj->getComponent(), uno::UNO_QUERY ); + if (xChart.is()) + { + uno::Reference< chart2::XDiagram > xDiagram( xChart->getFirstDiagram()); + if( ! xDiagram.is()) + return String(); + uno::Reference< chart2::XCoordinateSystemContainer > xCooSysCnt( xDiagram, uno::UNO_QUERY_THROW ); + uno::Sequence< uno::Reference< chart2::XCoordinateSystem > > aCooSysSeq( xCooSysCnt->getCoordinateSystems()); + // IA2 CWS. Unused: int nCoordinateCount = aCooSysSeq.getLength(); + sal_Bool bGetChartType = sal_False; + for( sal_Int32 nCooSysIdx=0; nCooSysIdx<aCooSysSeq.getLength(); ++nCooSysIdx ) + { + uno::Reference< chart2::XChartTypeContainer > xCTCnt( aCooSysSeq[nCooSysIdx], uno::UNO_QUERY_THROW ); + uno::Sequence< uno::Reference< chart2::XChartType > > aChartTypes( xCTCnt->getChartTypes()); + int nDimesionCount = aCooSysSeq[nCooSysIdx]->getDimension(); + if( nDimesionCount == 3 ) + Style += rtl::OUString::createFromAscii("3D "); + else + Style += rtl::OUString::createFromAscii("2D "); + for( sal_Int32 nCTIdx=0; nCTIdx<aChartTypes.getLength(); ++nCTIdx ) + { + rtl::OUString strChartType = aChartTypes[nCTIdx]->getChartType(); + if (strChartType.equals(::rtl::OUString::createFromAscii("com.sun.star.chart2.AreaChartType"))) + { + Style += rtl::OUString::createFromAscii("Areas"); + bGetChartType = sal_True; + } + else if (strChartType.equals(::rtl::OUString::createFromAscii("com.sun.star.chart2.BarChartType"))) + { + Style += rtl::OUString::createFromAscii("Bars"); + bGetChartType = sal_True; + } + else if (strChartType.equals(::rtl::OUString::createFromAscii("com.sun.star.chart2.ColumnChartType"))) + { + uno::Reference< beans::XPropertySet > xProp( aCooSysSeq[nCooSysIdx], uno::UNO_QUERY ); + if( xProp.is()) + { + bool bCurrent = false; + if( xProp->getPropertyValue( rtl::OUString::createFromAscii("SwapXAndYAxis") ) >>= bCurrent ) + { + if (bCurrent) + Style += rtl::OUString::createFromAscii("Bars"); + else + Style += rtl::OUString::createFromAscii("Columns"); + bGetChartType = sal_True; + } + } + } + else if (strChartType.equals(::rtl::OUString::createFromAscii("com.sun.star.chart2.LineChartType"))) + { + Style += rtl::OUString::createFromAscii("Lines"); + bGetChartType = sal_True; + } + else if (strChartType.equals(::rtl::OUString::createFromAscii("com.sun.star.chart2.ScatterChartType"))) + { + Style += rtl::OUString::createFromAscii("XY Chart"); + bGetChartType = sal_True; + } + else if (strChartType.equals(::rtl::OUString::createFromAscii("com.sun.star.chart2.PieChartType"))) + { + Style += rtl::OUString::createFromAscii("Pies"); + bGetChartType = sal_True; + } + else if (strChartType.equals(::rtl::OUString::createFromAscii("com.sun.star.chart2.NetChartType"))) + { + Style += rtl::OUString::createFromAscii("Radar"); + bGetChartType = sal_True; + } + else if (strChartType.equals(::rtl::OUString::createFromAscii("com.sun.star.chart2.CandleStickChartType"))) + { + Style += rtl::OUString::createFromAscii("Candle Stick Chart"); + bGetChartType = sal_True; + } + if (bGetChartType) + return Style; + } + } + } + } + } + } + return Style; +} +//-----IAccessibility2 Implementation 2009 + // #i104867# sal_uInt32 EmbeddedObjectRef::getGraphicVersion() const {
