You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by st...@apache.org on 2013/11/14 09:18:14 UTC
svn commit: r1541847 [2/18] - in /openoffice/trunk: ./
main/accessibility/inc/accessibility/extended/
main/accessibility/inc/accessibility/helper/
main/accessibility/inc/accessibility/standard/
main/accessibility/source/extended/ main/accessibility/sou...
Modified: openoffice/trunk/main/accessibility/source/extended/accessiblelistboxentry.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/accessibility/source/extended/accessiblelistboxentry.cxx?rev=1541847&r1=1541846&r2=1541847&view=diff
==============================================================================
--- openoffice/trunk/main/accessibility/source/extended/accessiblelistboxentry.cxx (original)
+++ openoffice/trunk/main/accessibility/source/extended/accessiblelistboxentry.cxx Thu Nov 14 08:18:05 2013
@@ -25,6 +25,7 @@
#include "precompiled_accessibility.hxx"
#include "accessibility/extended/accessiblelistboxentry.hxx"
#include <svtools/svtreebx.hxx>
+#include <accessibility/helper/accresmgr.hxx>
#include <svtools/stringtransfer.hxx>
#include <com/sun/star/awt/Point.hpp>
#include <com/sun/star/awt/Rectangle.hpp>
@@ -44,7 +45,10 @@
#include <comphelper/sequence.hxx>
#include <comphelper/accessibleeventnotifier.hxx>
#include <toolkit/helper/vclunohelper.hxx>
-
+#include <accessibility/helper/accessiblestrings.hrc>
+#ifndef _COM_SUN_STAR_ACCESSIBILITY_XACCESSIBLEVALUE_HPP_
+#include <com/sun/star/accessibility/XAccessibleValue.hpp>
+#endif
#define ACCESSIBLE_ACTION_COUNT 1
namespace
@@ -76,7 +80,7 @@ namespace accessibility
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star;
-
+ using namespace ::comphelper;
DBG_NAME(AccessibleListBoxEntry)
// -----------------------------------------------------------------------------
@@ -89,6 +93,7 @@ namespace accessibility
AccessibleListBoxEntry_BASE ( m_aMutex ),
ListBoxAccessibleBase( _rListBox ),
+ m_pSvLBoxEntry ( _pEntry ),
m_nClientId ( 0 ),
m_aParent ( _xParent )
@@ -109,6 +114,19 @@ namespace accessibility
dispose();
}
}
+
+ // IA2 CWS
+ void AccessibleListBoxEntry::NotifyAccessibleEvent( sal_Int16 _nEventId,
+ const ::com::sun::star::uno::Any& _aOldValue,
+ const ::com::sun::star::uno::Any& _aNewValue )
+ {
+ Reference< uno::XInterface > xSource( *this );
+ AccessibleEventObject aEventObj( xSource, _nEventId, _aNewValue, _aOldValue );
+
+ if (m_nClientId)
+ comphelper::AccessibleEventNotifier::addEvent( m_nClientId, aEventObj );
+ }
+
// -----------------------------------------------------------------------------
Rectangle AccessibleListBoxEntry::GetBoundingBox_Impl() const
@@ -196,8 +214,10 @@ namespace accessibility
{
::rtl::OUString sRet;
SvLBoxEntry* pEntry = getListBox()->GetEntryFromPath( m_aEntryPath );
+ //IAccessibility2 Implementation 2009-----
if ( pEntry )
- sRet = getListBox()->SearchEntryText( pEntry );
+ sRet = getListBox()->SearchEntryTextWithHeadTitle( pEntry );
+ //-----IAccessibility2 Implementation 2009
return sRet;
}
// -----------------------------------------------------------------------------
@@ -337,8 +357,9 @@ namespace accessibility
::osl::MutexGuard aGuard( m_aMutex );
EnsureIsAlive();
- SvLBoxEntry* pParent = getListBox()->GetEntryFromPath( m_aEntryPath );
- SvLBoxEntry* pEntry = pParent ? getListBox()->GetEntry( pParent, i ) : NULL;
+// SvLBoxEntry* pParent = getListBox()->GetEntryFromPath( m_aEntryPath );
+// SvLBoxEntry* pEntry = pParent ? getListBox()->GetEntry( pParent, i ) : NULL;
+ SvLBoxEntry* pEntry =GetRealChild(i);
if ( !pEntry )
throw IndexOutOfBoundsException();
@@ -369,6 +390,10 @@ namespace accessibility
SvLBoxEntry* pParentEntry = getListBox()->GetEntryFromPath( m_aEntryPath );
DBG_ASSERT( pParentEntry, "AccessibleListBoxEntry::implGetParentAccessible: could not obtain a parent entry!" );
+ //IAccessibility2 Implementation 2009-----
+ if ( pParentEntry )
+ pParentEntry = getListBox()->GetParent(pParentEntry);
+ //-----IAccessibility2 Implementation 2009
if ( pParentEntry )
xParent = new AccessibleListBoxEntry( *getListBox(), pParentEntry, NULL );
// note that we pass NULL here as parent-accessible:
@@ -398,15 +423,104 @@ namespace accessibility
return m_aEntryPath.empty() ? -1 : m_aEntryPath.back();
}
// -----------------------------------------------------------------------------
+ sal_Int32 SAL_CALL AccessibleListBoxEntry::getRoleType()
+ {
+ sal_Int32 nCase = 0;
+ SvLBoxEntry* pEntry = getListBox()->GetEntry(0);
+ if ( pEntry )
+ {
+ if( pEntry->HasChildsOnDemand() || getListBox()->GetChildCount(pEntry) > 0 )
+ {
+ nCase = 1;
+ return nCase;
+ }
+ }
+
+ sal_Bool bHasButtons = (getListBox()->GetStyle() & WB_HASBUTTONS)!=0;
+ if( !(getListBox()->GetTreeFlags() & TREEFLAG_CHKBTN) )
+ {
+ if( bHasButtons )
+ nCase = 1;
+ }
+ else
+ {
+ if( bHasButtons )
+ nCase = 2;
+ else
+ nCase = 3;
+ }
+ return nCase;
+ }
sal_Int16 SAL_CALL AccessibleListBoxEntry::getAccessibleRole( ) throw (RuntimeException)
{
- return AccessibleRole::LABEL;
+ SvTreeListBox* pBox = getListBox();
+ if(pBox)
+ {
+ short nType = pBox->GetAllEntriesAccessibleRoleType();
+ if( nType == TREEBOX_ALLITEM_ACCROLE_TYPE_TREE)
+ return AccessibleRole::TREE_ITEM;
+ else if( nType == TREEBOX_ALLITEM_ACCROLE_TYPE_LIST)
+ return AccessibleRole::LIST_ITEM;
+ }
+
+ sal_uInt16 treeFlag = pBox->GetTreeFlags();
+ if(treeFlag & TREEFLAG_CHKBTN )
+ {
+ SvLBoxEntry* pEntry = pBox->GetEntryFromPath( m_aEntryPath );
+ SvButtonState eState = pBox->GetCheckButtonState( pEntry );
+ switch( eState )
+ {
+ case SV_BUTTON_CHECKED:
+ case SV_BUTTON_UNCHECKED:
+ return AccessibleRole::CHECK_BOX;
+ case SV_BUTTON_TRISTATE:
+ default:
+ return AccessibleRole::LABEL;
+ }
+ }
+ else
+ {
+
+ if(getRoleType() == 0)
+ return AccessibleRole::LIST_ITEM;
+ else
+ //o is: return AccessibleRole::LABEL;
+ return AccessibleRole::TREE_ITEM;
+ }
}
// -----------------------------------------------------------------------------
::rtl::OUString SAL_CALL AccessibleListBoxEntry::getAccessibleDescription( ) throw (RuntimeException)
{
// no description for every item
- return ::rtl::OUString();
+ SvLBoxEntry* pEntry = getListBox()->GetEntryFromPath( m_aEntryPath );
+ if( getAccessibleRole() == AccessibleRole::TREE_ITEM )
+ {
+ return getListBox()->GetEntryLongDescription( pEntry );
+ }
+ //want to cout the real column nubmer in the list box.
+ sal_uInt16 iRealItemCount = 0;
+ sal_uInt16 iCount = 0;
+ sal_uInt16 iTotleItemCount = pEntry->ItemCount();
+ SvLBoxItem* pItem;
+ while( iCount < iTotleItemCount )
+ {
+ pItem = pEntry->GetItem( iCount );
+ if ( pItem->IsA() == SV_ITEM_ID_LBOXSTRING &&
+ static_cast<SvLBoxString*>( pItem )->GetText().Len() > 0 )
+ {
+ iRealItemCount++;
+ }
+ iCount++;
+ }
+ if(iRealItemCount<=1 )
+ {
+ return ::rtl::OUString();
+ }
+ else
+ {
+ return getListBox()->SearchEntryTextWithHeadTitle( pEntry );
+ }
+
}
// -----------------------------------------------------------------------------
::rtl::OUString SAL_CALL AccessibleListBoxEntry::getAccessibleName( ) throw (RuntimeException)
@@ -414,7 +528,24 @@ namespace accessibility
::osl::MutexGuard aGuard( m_aMutex );
EnsureIsAlive();
- return implGetText();
+
+ ::rtl::OUString sRet;
+ sRet = implGetText();
+
+ SvLBoxEntry* pEntry = getListBox()->GetEntryFromPath( m_aEntryPath );
+
+ String altText = getListBox()->GetEntryAltText( pEntry );
+ if( altText.Len() > 0 )
+ {
+ sRet += ::rtl::OUString(' ');
+ sRet += altText;
+ }
+
+ // IA2 CWS. Removed for now - only used in Sw/Sd/ScContentLBoxString, they should decide if they need this
+ // if ( pEntry && pEntry->IsMarked())
+ // sRet = sRet + ::rtl::OUString(TK_RES_STRING(STR_SVT_ACC_LISTENTRY_SELCTED_STATE));
+
+ return sRet;
}
// -----------------------------------------------------------------------------
Reference< XAccessibleRelationSet > SAL_CALL AccessibleListBoxEntry::getAccessibleRelationSet( ) throw (RuntimeException)
@@ -444,14 +575,25 @@ namespace accessibility
if ( IsAlive_Impl() )
{
- pStateSetHelper->AddState( AccessibleStateType::TRANSIENT );
- pStateSetHelper->AddState( AccessibleStateType::SELECTABLE );
- pStateSetHelper->AddState( AccessibleStateType::ENABLED );
- pStateSetHelper->AddState( AccessibleStateType::SENSITIVE );
- if ( getListBox()->IsInplaceEditingEnabled() )
- pStateSetHelper->AddState( AccessibleStateType::EDITABLE );
- if ( IsShowing_Impl() )
- pStateSetHelper->AddState( AccessibleStateType::SHOWING );
+ switch(getAccessibleRole())
+ {
+ case AccessibleRole::LABEL:
+ pStateSetHelper->AddState( AccessibleStateType::TRANSIENT );
+ pStateSetHelper->AddState( AccessibleStateType::SELECTABLE );
+ pStateSetHelper->AddState( AccessibleStateType::ENABLED );
+ if ( getListBox()->IsInplaceEditingEnabled() )
+ pStateSetHelper->AddState( AccessibleStateType::EDITABLE );
+ if ( IsShowing_Impl() )
+ pStateSetHelper->AddState( AccessibleStateType::SHOWING );
+ break;
+ case AccessibleRole::CHECK_BOX:
+ pStateSetHelper->AddState( AccessibleStateType::TRANSIENT );
+ pStateSetHelper->AddState( AccessibleStateType::SELECTABLE );
+ pStateSetHelper->AddState( AccessibleStateType::ENABLED );
+ if ( IsShowing_Impl() )
+ pStateSetHelper->AddState( AccessibleStateType::SHOWING );
+ break;
+ }
getListBox()->FillAccessibleEntryStateSet(
getListBox()->GetEntryFromPath( m_aEntryPath ), *pStateSetHelper );
}
@@ -586,6 +728,7 @@ namespace accessibility
ALBSolarGuard aSolarGuard;
::osl::MutexGuard aGuard( m_aMutex );
EnsureIsAlive();
+ if(aPoint.X==0 && aPoint.Y==0) return 0;
sal_Int32 nIndex = -1;
SvLBoxEntry* pEntry = getListBox()->GetEntryFromPath( m_aEntryPath );
@@ -660,7 +803,20 @@ namespace accessibility
::osl::MutexGuard aGuard( m_aMutex );
// three actions supported
- return ACCESSIBLE_ACTION_COUNT;
+ SvTreeListBox* pBox = getListBox();
+ sal_uInt16 treeFlag = pBox->GetTreeFlags();
+ sal_Bool bHasButtons = (getListBox()->GetStyle() & WB_HASBUTTONS)!=0;
+ if( (treeFlag & TREEFLAG_CHKBTN) && !bHasButtons)
+ {
+ sal_Int16 role = getAccessibleRole();
+ if ( role == AccessibleRole::CHECK_BOX )
+ return 2;
+ else if ( role == AccessibleRole::LABEL )
+ return 0;
+ }
+ else
+ return ACCESSIBLE_ACTION_COUNT;
+ return 0;
}
// -----------------------------------------------------------------------------
sal_Bool SAL_CALL AccessibleListBoxEntry::doAccessibleAction( sal_Int32 nIndex ) throw (IndexOutOfBoundsException, RuntimeException)
@@ -671,17 +827,30 @@ namespace accessibility
sal_Bool bRet = sal_False;
checkActionIndex_Impl( nIndex );
EnsureIsAlive();
-
- SvLBoxEntry* pEntry = getListBox()->GetEntryFromPath( m_aEntryPath );
- if ( pEntry )
+ sal_uInt16 treeFlag = getListBox()->GetTreeFlags();
+ if( nIndex == 0 && (treeFlag & TREEFLAG_CHKBTN) )
{
- if ( getListBox()->IsExpanded( pEntry ) )
- getListBox()->Collapse( pEntry );
- else
- getListBox()->Expand( pEntry );
- bRet = sal_True;
+ if(getAccessibleRole() == AccessibleRole::CHECK_BOX)
+ {
+ SvLBoxEntry* pEntry = getListBox()->GetEntryFromPath( m_aEntryPath );
+ SvButtonState state = getListBox()->GetCheckButtonState( pEntry );
+ if ( state == SV_BUTTON_CHECKED )
+ getListBox()->SetCheckButtonState(pEntry, (SvButtonState)SV_BMP_UNCHECKED);
+ else if (state == SV_BMP_UNCHECKED)
+ getListBox()->SetCheckButtonState(pEntry, (SvButtonState)SV_BUTTON_CHECKED);
+ }
+ }else if( (nIndex == 1 && (treeFlag & TREEFLAG_CHKBTN) ) || (nIndex == 0) )
+ {
+ SvLBoxEntry* pEntry = getListBox()->GetEntryFromPath( m_aEntryPath );
+ if ( pEntry )
+ {
+ if ( getListBox()->IsExpanded( pEntry ) )
+ getListBox()->Collapse( pEntry );
+ else
+ getListBox()->Expand( pEntry );
+ bRet = sal_True;
+ }
}
-
return bRet;
}
// -----------------------------------------------------------------------------
@@ -694,7 +863,38 @@ namespace accessibility
EnsureIsAlive();
static const ::rtl::OUString sActionDesc( RTL_CONSTASCII_USTRINGPARAM( "toggleExpand" ) );
- return sActionDesc;
+ static const ::rtl::OUString sActionDesc1( RTL_CONSTASCII_USTRINGPARAM( "Check" ) );
+ static const ::rtl::OUString sActionDesc2( RTL_CONSTASCII_USTRINGPARAM( "UnCheck" ) );
+ // sal_Bool bHasButtons = (getListBox()->GetStyle() & WB_HASBUTTONS)!=0;
+ SvLBoxEntry* pEntry = getListBox()->GetEntryFromPath( m_aEntryPath );
+ SvButtonState state = getListBox()->GetCheckButtonState( pEntry );
+ sal_uInt16 treeFlag = getListBox()->GetTreeFlags();
+ if(nIndex == 0 && (treeFlag & TREEFLAG_CHKBTN))
+ {
+ if(getAccessibleRole() == AccessibleRole::CHECK_BOX)
+ {
+ if ( state == SV_BUTTON_CHECKED )
+ return sActionDesc2;
+ else if (state == SV_BMP_UNCHECKED)
+ return sActionDesc1;
+ }
+ else
+ {
+ //Sometimes, a List or Tree may have both checkbox and label at the same time
+ return ::rtl::OUString();
+ }
+ }else if( (nIndex == 1 && (treeFlag & TREEFLAG_CHKBTN)) || nIndex == 0 )
+ {
+ //IAccessibility2 Implementation 2009-----
+ if( pEntry->HasChilds() || pEntry->HasChildsOnDemand() )
+ //-----IAccessibility2 Implementation 2009
+ return getListBox()->IsExpanded( pEntry ) ? \
+ ::rtl::OUString(TK_RES_STRING(STR_SVT_ACC_ACTION_COLLAPSE)) :
+ ::rtl::OUString(TK_RES_STRING(STR_SVT_ACC_ACTION_EXPAND));
+ return ::rtl::OUString();
+
+ }
+ throw IndexOutOfBoundsException();
}
// -----------------------------------------------------------------------------
Reference< XAccessibleKeyBinding > AccessibleListBoxEntry::getAccessibleActionKeyBinding( sal_Int32 nIndex ) throw (IndexOutOfBoundsException, RuntimeException)
@@ -715,9 +915,11 @@ namespace accessibility
::osl::MutexGuard aGuard( m_aMutex );
EnsureIsAlive();
+// IAccessible2 implementation, 2009
+// SvLBoxEntry* pParent = getListBox()->GetEntryFromPath( m_aEntryPath );
+// SvLBoxEntry* pEntry = getListBox()->GetEntry( pParent, nChildIndex );
- SvLBoxEntry* pParent = getListBox()->GetEntryFromPath( m_aEntryPath );
- SvLBoxEntry* pEntry = getListBox()->GetEntry( pParent, nChildIndex );
+ SvLBoxEntry* pEntry =GetRealChild(nChildIndex);
if ( !pEntry )
throw IndexOutOfBoundsException();
@@ -960,6 +1162,111 @@ namespace accessibility
return OCommonAccessibleText::getTextBehindIndex( nIndex ,aTextType);
}
+ // -----------------------------------------------------------------------------
+ // XAccessibleValue
+ // -----------------------------------------------------------------------------
+
+ Any AccessibleListBoxEntry::getCurrentValue( ) throw (RuntimeException)
+ {
+ ::osl::MutexGuard aGuard( m_aMutex );
+ Any aValue;
+ sal_Int32 level = ((sal_Int32) m_aEntryPath.size() - 1);
+ level = level < 0 ? 0: level;
+ aValue <<= level;
+ return aValue;
+ }
+
+ // -----------------------------------------------------------------------------
+
+ sal_Bool AccessibleListBoxEntry::setCurrentValue( const Any& aNumber ) throw (RuntimeException)
+ {
+ ::osl::MutexGuard aGuard( m_aMutex );
+
+
+ sal_Bool bReturn = sal_False;
+ SvTreeListBox* pBox = getListBox();
+ if(getAccessibleRole() == AccessibleRole::CHECK_BOX)
+ {
+ SvLBoxEntry* pEntry = pBox->GetEntryFromPath( m_aEntryPath );
+ if ( pEntry )
+ {
+ sal_Int32 nValue, nValueMin, nValueMax;
+ aNumber >>= nValue;
+ getMinimumValue() >>= nValueMin;
+ getMaximumValue() >>= nValueMax;
+
+ if ( nValue < nValueMin )
+ nValue = nValueMin;
+ else if ( nValue > nValueMax )
+ nValue = nValueMax;
+
+ pBox->SetCheckButtonState(pEntry, (SvButtonState) nValue );
+ bReturn = sal_True;
+ }
+ }
+
+ return bReturn;
+ }
+
+ // -----------------------------------------------------------------------------
+
+ Any AccessibleListBoxEntry::getMaximumValue( ) throw (RuntimeException)
+ {
+ ::osl::MutexGuard aGuard( m_aMutex );
+
+ Any aValue;
+ // SvTreeListBox* pBox = getListBox();
+ switch(getAccessibleRole())
+ {
+ case AccessibleRole::CHECK_BOX:
+ aValue <<= (sal_Int32)1;
+ break;
+ case AccessibleRole::LABEL:
+ default:
+ break;
+ }
+
+ return aValue;
+ }
+
+ // -----------------------------------------------------------------------------
+
+ Any AccessibleListBoxEntry::getMinimumValue( ) throw (RuntimeException)
+ {
+ ::osl::MutexGuard aGuard( m_aMutex );
+
+ Any aValue;
+ // SvTreeListBox* pBox = getListBox();
+ switch(getAccessibleRole())
+ {
+ case AccessibleRole::CHECK_BOX:
+ aValue <<= (sal_Int32)0;
+ break;
+ case AccessibleRole::LABEL:
+ default:
+ break;
+ }
+
+ return aValue;
+ }
+
+ // -----------------------------------------------------------------------------
+
+ SvLBoxEntry * AccessibleListBoxEntry::GetRealChild(sal_Int32 nIndex)
+ {
+ SvLBoxEntry* pEntry =NULL;
+ SvLBoxEntry* pParent = getListBox()->GetEntryFromPath( m_aEntryPath );
+ if (pParent)
+ {
+ pEntry = getListBox()->GetEntry( pParent, nIndex );
+ if ( !pEntry && getAccessibleChildCount() > 0 )
+ {
+ getListBox()->RequestingChilds(pParent);
+ pEntry = getListBox()->GetEntry( pParent, nIndex );
+ }
+ }
+ return pEntry;
+ }
//........................................................................
}// namespace accessibility
//........................................................................
Modified: openoffice/trunk/main/accessibility/source/extended/accessibletablistboxtable.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/accessibility/source/extended/accessibletablistboxtable.cxx?rev=1541847&r1=1541846&r2=1541847&view=diff
==============================================================================
--- openoffice/trunk/main/accessibility/source/extended/accessibletablistboxtable.cxx (original)
+++ openoffice/trunk/main/accessibility/source/extended/accessibletablistboxtable.cxx Thu Nov 14 08:18:05 2013
@@ -32,6 +32,9 @@
#include <svtools/svtabbx.hxx>
#include <com/sun/star/accessibility/AccessibleEventId.hpp>
+#ifndef _SVTOOLS_ACCESSIBILEBROWSEBOXTABLECELL_HXX
+#include "accessibility/extended/AccessibleBrowseBoxTableCell.hxx"
+#endif
//........................................................................
namespace accessibility
{
@@ -154,6 +157,63 @@ namespace accessibility
}
break;
}
+ case VCLEVENT_WINDOW_GETFOCUS :
+ {
+ uno::Any aOldValue, aNewValue;
+ aNewValue <<= AccessibleStateType::FOCUSED;
+ commitEvent( AccessibleEventId::STATE_CHANGED, aNewValue, aOldValue );
+ break;
+
+ }
+ case VCLEVENT_WINDOW_LOSEFOCUS :
+ {
+ uno::Any aOldValue, aNewValue;
+ aOldValue <<= AccessibleStateType::FOCUSED;
+ commitEvent( AccessibleEventId::STATE_CHANGED, aNewValue, aOldValue );
+ break;
+ }
+ case VCLEVENT_LISTBOX_TREESELECT:
+ {
+ SvLBoxEntry* pEntry = static_cast< SvLBoxEntry* >( rVclWindowEvent.GetData() );
+ if (pEntry)
+ {
+ sal_Int32 nRow = m_pTabListBox->GetEntryPos( pEntry );
+ Reference< XAccessible > xChild = m_pTabListBox->CreateAccessibleCell( nRow, m_pTabListBox->GetCurrColumn() );
+ TriState eState = STATE_DONTKNOW;
+ if ( m_pTabListBox->IsCellCheckBox( nRow, m_pTabListBox->GetCurrColumn(), eState ) )
+ {
+ AccessibleCheckBoxCell* pCell = static_cast< AccessibleCheckBoxCell* >( xChild.get() );
+ pCell->commitEvent( AccessibleEventId::SELECTION_CHANGED, Any(), Any() );
+ }
+ else
+ {
+ AccessibleBrowseBoxTableCell* pCell = static_cast< AccessibleBrowseBoxTableCell* >( xChild.get() );
+ pCell->commitEvent( AccessibleEventId::SELECTION_CHANGED, Any(), Any() );
+ }
+ }
+ }
+ break;
+ case VCLEVENT_LISTBOX_TREEFOCUS:
+ {
+ if ( m_pTabListBox && m_pTabListBox->HasFocus() )
+ {
+ uno::Any aOldValue, aNewValue;
+ SvLBoxEntry* pEntry = static_cast< SvLBoxEntry* >( rVclWindowEvent.GetData() );
+ if ( pEntry )
+ {
+ sal_Int32 nRow = m_pTabListBox->GetEntryPos( pEntry );
+ m_xCurChild = m_pTabListBox->CreateAccessibleCell( nRow, m_pTabListBox->GetCurrColumn() );
+ aNewValue <<= m_xCurChild;
+ commitEvent( AccessibleEventId::ACTIVE_DESCENDANT_CHANGED, aNewValue ,aOldValue);
+ }
+ else
+ {
+ aNewValue <<= AccessibleStateType::FOCUSED;
+ commitEvent( AccessibleEventId::STATE_CHANGED, aNewValue ,aOldValue);
+ }
+ }
+ }
+ break;
case VCLEVENT_CHECKBOX_TOGGLE :
{
Modified: openoffice/trunk/main/accessibility/source/extended/textwindowaccessibility.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/accessibility/source/extended/textwindowaccessibility.cxx?rev=1541847&r1=1541846&r2=1541847&view=diff
==============================================================================
--- openoffice/trunk/main/accessibility/source/extended/textwindowaccessibility.cxx (original)
+++ openoffice/trunk/main/accessibility/source/extended/textwindowaccessibility.cxx Thu Nov 14 08:18:05 2013
@@ -41,6 +41,8 @@ namespace css = ::com::sun::star;
namespace accessibility
{
+ ::sal_Int32 getSelectionType(::sal_Int32 nNewFirstPara, ::sal_Int32 nNewFirstPos, ::sal_Int32 nNewLastPara, ::sal_Int32 nNewLastPos);
+ void sendEvent(::sal_Int32 start, ::sal_Int32 end, ::sal_Int16 nEventId);
// Both ::osl::Mutex and ParagraphBase implement acquire and release, and thus
// ::rtl::Reference< Paragraph > does not work. So ParagraphImpl was factored
@@ -1012,16 +1014,114 @@ Document::retrieveCharacterBounds(Paragr
// XXX numeric overflow
}
+struct IndexCompare
+{
+ const ::css::beans::PropertyValue* pValues;
+ IndexCompare( const ::css::beans::PropertyValue* pVals ) : pValues(pVals) {}
+ bool operator() ( const sal_Int32& a, const sal_Int32& b ) const
+ {
+ return (pValues[a].Name < pValues[b].Name) ? true : false;
+ }
+};
+
::css::uno::Sequence< ::css::beans::PropertyValue >
Document::retrieveCharacterAttributes(
ParagraphImpl const * pParagraph, ::sal_Int32 nIndex,
const ::css::uno::Sequence< ::rtl::OUString >& aRequestedAttributes)
{
::osl::Guard< ::comphelper::IMutex > aExternalGuard(getExternalLock());
+
+ Font aFont = m_rEngine.GetFont();
+ const sal_Int32 AttributeCount = 9;
+ sal_Int32 i = 0;
+ ::css::uno::Sequence< ::css::beans::PropertyValue > aAttribs( AttributeCount );
+ //character background color
+ {
+ aAttribs[i].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CharBackColor"));
+ aAttribs[i].Handle = -1;
+ aAttribs[i].Value = mapFontColor( aFont.GetFillColor() );
+ aAttribs[i].State = ::css::beans::PropertyState_DIRECT_VALUE;
+ i++;
+ }
+ //character color
+ {
+ aAttribs[i].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CharColor"));
+ aAttribs[i].Handle = -1;
+ //aAttribs[i].Value = mapFontColor( aFont.GetColor() );
+ aAttribs[i].Value = mapFontColor( m_rEngine.GetTextColor() );
+ aAttribs[i].State = ::css::beans::PropertyState_DIRECT_VALUE;
+ i++;
+ }
+ //character font name
+ {
+ aAttribs[i].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CharFontName"));
+ aAttribs[i].Handle = -1;
+ aAttribs[i].Value = ::css::uno::makeAny( (::rtl::OUString)aFont.GetName() );
+ aAttribs[i].State = ::css::beans::PropertyState_DIRECT_VALUE;
+ i++;
+ }
+ //character height
+ {
+ aAttribs[i].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CharHeight"));
+ aAttribs[i].Handle = -1;
+ aAttribs[i].Value = ::css::uno::makeAny( (sal_Int16)aFont.GetHeight() );
+ aAttribs[i].State = ::css::beans::PropertyState_DIRECT_VALUE;
+ i++;
+ }
+ //character posture
+ {
+ aAttribs[i].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CharPosture"));
+ aAttribs[i].Handle = -1;
+ aAttribs[i].Value = ::css::uno::makeAny( (sal_Int16)aFont.GetItalic() );
+ aAttribs[i].State = ::css::beans::PropertyState_DIRECT_VALUE;
+ i++;
+ }
+ //character relief
+ /*{
+ aAttribs[i].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CharRelief"));
+ aAttribs[i].Handle = -1;
+ aAttribs[i].Value = ::css::uno::makeAny( (sal_Int16)aFont.GetRelief() );
+ aAttribs[i].State = ::css::beans::PropertyState_DIRECT_VALUE;
+ i++;
+ }*/
+ //character strikeout
+ {
+ aAttribs[i].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CharStrikeout"));
+ aAttribs[i].Handle = -1;
+ aAttribs[i].Value = ::css::uno::makeAny( (sal_Int16)aFont.GetStrikeout() );
+ aAttribs[i].State = ::css::beans::PropertyState_DIRECT_VALUE;
+ i++;
+ }
+ //character underline
+ {
+ aAttribs[i].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CharUnderline"));
+ aAttribs[i].Handle = -1;
+ aAttribs[i].Value = ::css::uno::makeAny( (sal_Int16)aFont.GetUnderline() );
+ aAttribs[i].State = ::css::beans::PropertyState_DIRECT_VALUE;
+ i++;
+ }
+ //character weight
+ {
+ aAttribs[i].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("CharWeight"));
+ aAttribs[i].Handle = -1;
+ aAttribs[i].Value = ::css::uno::makeAny( (float)aFont.GetWeight() );
+ aAttribs[i].State = ::css::beans::PropertyState_DIRECT_VALUE;
+ i++;
+ }
+ //character alignment
+ {
+ aAttribs[i].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ParaAdjust"));
+ aAttribs[i].Handle = -1;
+ aAttribs[i].Value = ::css::uno::makeAny( (sal_Int16)m_rEngine.GetTextAlign() );
+ aAttribs[i].State = ::css::beans::PropertyState_DIRECT_VALUE;
+ i++;
+ }
::osl::MutexGuard aInternalGuard(GetMutex());
::sal_uLong nNumber = static_cast< ::sal_uLong >(pParagraph->getNumber());
// XXX numeric overflow
- if (nIndex < 0 || nIndex >= m_rEngine.GetText(nNumber).Len())
+ // nIndex can be equal to Len();
+ //if (nIndex < 0 || nIndex >= m_rEngine.GetText(nNumber).Len())
+ if (nIndex < 0 || nIndex > m_rEngine.GetText(nNumber).Len())
throw ::css::lang::IndexOutOfBoundsException(
::rtl::OUString(
RTL_CONSTASCII_USTRINGPARAM(
@@ -1045,7 +1145,31 @@ Document::retrieveCharacterAttributes(
aCharAttrSeq[ aRunIter->first ] = aRunIter->second;
}
- return convertHashMapToSequence( aCharAttrSeq );
+ ::css::beans::PropertyValue* pValues = aAttribs.getArray();
+ for (i = 0; i < AttributeCount; i++,pValues++)
+ {
+ aCharAttrSeq[ pValues->Name ] = *pValues;
+ }
+
+ ::css::uno::Sequence< ::css::beans::PropertyValue > aRes = convertHashMapToSequence( aCharAttrSeq );
+
+ // sort the attributes
+ sal_Int32 nLength = aRes.getLength();
+ const ::css::beans::PropertyValue* pPairs = aRes.getConstArray();
+ sal_Int32* pIndices = new sal_Int32[nLength];
+ for( i = 0; i < nLength; i++ )
+ pIndices[i] = i;
+ std::sort( &pIndices[0], &pIndices[nLength], IndexCompare(pPairs) );
+ // create sorted sequences accoring to index array
+ ::css::uno::Sequence< ::css::beans::PropertyValue > aNewValues( nLength );
+ ::css::beans::PropertyValue* pNewValues = aNewValues.getArray();
+ for( i = 0; i < nLength; i++ )
+ {
+ pNewValues[i] = pPairs[pIndices[i]];
+ }
+ delete[] pIndices;
+
+ return aNewValues;
}
void Document::retrieveDefaultAttributesImpl(
@@ -1416,7 +1540,8 @@ void Document::ProcessWindowEvent( const
{
// #107179# if our parent is a compound control (e.g. MultiLineEdit),
// suppress the window focus events here
- if ( !m_bCompoundControlChild )
+// IAccessible2 implementation 2009
+ //if ( !m_bCompoundControlChild )
VCLXAccessibleComponent::ProcessWindowEvent( rVclWindowEvent );
}
break;
@@ -1483,7 +1608,26 @@ Document::getAccessibleAtPoint(::css::aw
}
return 0;
}
+void Document::FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet )
+{
+ VCLXAccessibleComponent::FillAccessibleStateSet( rStateSet );
+ if (!m_rView.IsReadOnly())
+ rStateSet.AddState( ::css::accessibility::AccessibleStateType::EDITABLE );
+}
+void Document::FillAccessibleRelationSet( utl::AccessibleRelationSetHelper& rRelationSet )
+{
+ if( getAccessibleParent()->getAccessibleContext()->getAccessibleRole() == ::css::accessibility::AccessibleRole::SCROLL_PANE )
+ {
+ ::css::uno::Sequence< ::css::uno::Reference< ::css::uno::XInterface > > aSequence(1);
+ aSequence[0] = getAccessibleParent();
+ rRelationSet.AddRelation( ::css::accessibility::AccessibleRelation( ::css::accessibility::AccessibleRelationType::MEMBER_OF, aSequence ) );
+ }
+ else
+ {
+ VCLXAccessibleComponent::FillAccessibleRelationSet(rRelationSet);
+ }
+}
// virtual
void SAL_CALL Document::disposing()
{
@@ -1626,9 +1770,25 @@ IMPL_LINK(Document, WindowEventHandler,
::osl::MutexGuard aInternalGuard(GetMutex());
if (!isAlive())
break;
-
- if (m_aFocused >= m_aVisibleBegin && m_aFocused < m_aVisibleEnd)
+ //to enable the PARAGRAPH to get focus for multiline edit
+ ::sal_Int32 count = getAccessibleChildCount();
+ ::sal_Bool bEmpty = m_aFocused == m_aVisibleEnd && count == 1;
+ if ((m_aFocused >= m_aVisibleBegin && m_aFocused < m_aVisibleEnd) || bEmpty)
{
+ Paragraphs::iterator m_aTemp = bEmpty ? m_aVisibleBegin : m_aFocused;
+ ::rtl::Reference< ParagraphImpl > xParagraph(getParagraph(m_aTemp));
+ if (xParagraph.is())
+ {
+ xParagraph->notifyEvent(
+ ::css::accessibility::AccessibleEventId::
+ STATE_CHANGED,
+ ::css::uno::Any(),
+ ::css::uno::makeAny(
+ ::css::accessibility::AccessibleStateType::
+ FOCUSED));
+ }
+ }
+ /*
::rtl::Reference< ParagraphImpl > xParagraph(
getParagraph(m_aFocused));
if (xParagraph.is())
@@ -1639,7 +1799,7 @@ IMPL_LINK(Document, WindowEventHandler,
::css::uno::makeAny(
::css::accessibility::AccessibleStateType::
FOCUSED));
- }
+ */
break;
}
case VCLEVENT_WINDOW_LOSEFOCUS:
@@ -1647,7 +1807,24 @@ IMPL_LINK(Document, WindowEventHandler,
::osl::MutexGuard aInternalGuard(GetMutex());
if (!isAlive())
break;
+ //to enable the PARAGRAPH to get focus for multiline edit
+ ::sal_Int32 count = getAccessibleChildCount();
+ ::sal_Bool bEmpty = m_aFocused == m_aVisibleEnd && count == 1;
+ if ((m_aFocused >= m_aVisibleBegin && m_aFocused < m_aVisibleEnd) || bEmpty)
+ {
+ Paragraphs::iterator m_aTemp = bEmpty ? m_aVisibleBegin : m_aFocused;
+ ::rtl::Reference< ParagraphImpl > xParagraph(getParagraph(m_aTemp));
+ if (xParagraph.is())
+ xParagraph->notifyEvent(
+ ::css::accessibility::AccessibleEventId::
+ STATE_CHANGED,
+ ::css::uno::makeAny(
+ ::css::accessibility::AccessibleStateType::
+ FOCUSED),
+ ::css::uno::Any());
+ }
+ /*
if (m_aFocused >= m_aVisibleBegin && m_aFocused < m_aVisibleEnd)
{
::rtl::Reference< ParagraphImpl > xParagraph(
@@ -1661,6 +1838,7 @@ IMPL_LINK(Document, WindowEventHandler,
FOCUSED),
::css::uno::Any());
}
+ */
break;
}
}
@@ -2007,6 +2185,124 @@ void Document::handleParagraphNotificati
}
}
+::sal_Int32 Document::getSelectionType(::sal_Int32 nNewFirstPara, ::sal_Int32 nNewFirstPos, ::sal_Int32 nNewLastPara, ::sal_Int32 nNewLastPos)
+{
+ if (m_nSelectionFirstPara == -1)
+ return -1;
+ ::sal_Int32 Osp = m_nSelectionFirstPara, Osl = m_nSelectionFirstPos, Oep = m_nSelectionLastPara, Oel = m_nSelectionLastPos;
+ ::sal_Int32 Nsp = nNewFirstPara, Nsl = nNewFirstPos, Nep = nNewLastPara, Nel = nNewLastPos;
+ TextPaM Ns(Nsp, sal_uInt16(Nsl));
+ TextPaM Ne(Nep, sal_uInt16(Nel));
+ TextPaM Os(Osp, sal_uInt16(Osl));
+ TextPaM Oe(Oep, sal_uInt16(Oel));
+
+ if (Os == Oe && Ns == Ne)
+ {
+ //only caret moves.
+ return 1;
+ }
+ else if (Os == Oe && Ns != Ne)
+ {
+ //old has no selection but new has selection
+ return 2;
+ }
+ else if (Os != Oe && Ns == Ne)
+ {
+ //old has selection but new has no selection.
+ return 3;
+ }
+ else if (Os != Oe && Ns != Ne && Osp == Nsp && Osl == Nsl)
+ {
+ //both old and new have selections.
+ if (Oep == Nep )
+ {
+ //Send text_selection_change event on Nep
+
+ return 4;
+ }
+ else if (Oep < Nep)
+ {
+ //all the following examples like 1,2->1,3 means that old start select para is 1, old end select para is 2,
+ // then press shift up, the new start select para is 1, new end select para is 3;
+ //for example, 1, 2 -> 1, 3; 4,1 -> 4, 7; 4,1 -> 4, 2; 4,4->4,5
+ if (Nep >= Nsp)
+ {
+ // 1, 2 -> 1, 3; 4, 1 -> 4, 7; 4,4->4,5;
+ if (Oep < Osp)
+ {
+ // 4,1 -> 4,7;
+ return 5;
+ }
+ else if (Oep >= Osp)
+ {
+ // 1, 2 -> 1, 3; 4,4->4,5;
+ return 6;
+ }
+ }
+ else
+ {
+ // 4,1 -> 4,2,
+ if (Oep < Osp)
+ {
+ // 4,1 -> 4,2,
+ return 7;
+ }
+ else if (Oep >= Osp)
+ {
+ // no such condition. Oep > Osp = Nsp > Nep
+ }
+ }
+ }
+ else if (Oep > Nep)
+ {
+ // 3,2 -> 3,1; 4,7 -> 4,1; 4, 7 -> 4,6; 4,4 -> 4,3
+ if (Nep >= Nsp)
+ {
+ // 4,7 -> 4,6
+ if (Oep <= Osp)
+ {
+ //no such condition, Oep<Osp=Nsp <= Nep
+ }
+ else if (Oep > Osp)
+ {
+ // 4,7 ->4,6
+ return 8;
+ }
+ }
+ else
+ {
+ // 3,2 -> 3,1, 4,7 -> 4,1; 4,4->4,3
+ if (Oep <= Osp)
+ {
+ // 3,2 -> 3,1; 4,4->4,3
+ return 9;
+ }
+ else if (Oep > Osp)
+ {
+ // 4,7 -> 4,1
+ return 10;
+ }
+ }
+ }
+ }
+ return -1;
+}
+
+
+void Document::sendEvent(::sal_Int32 start, ::sal_Int32 end, ::sal_Int16 nEventId)
+{
+ Paragraphs::iterator aEnd = ::std::min(m_xParagraphs->begin() + end + 1, m_aVisibleEnd);
+ for (Paragraphs::iterator aIt = ::std::max(m_xParagraphs->begin() + start, m_aVisibleBegin);
+ aIt < aEnd; ++aIt)
+ {
+ ::rtl::Reference< ParagraphImpl > xParagraph(getParagraph(aIt));
+ if (xParagraph.is())
+ xParagraph->notifyEvent(
+ nEventId,
+ ::css::uno::Any(), ::css::uno::Any());
+ }
+}
+
void Document::handleSelectionChangeNotification()
{
::TextSelection const & rSelection = m_rView.GetSelection();
@@ -2048,7 +2344,11 @@ void Document::handleSelectionChangeNoti
::rtl::Reference< ParagraphImpl > xParagraph(getParagraph(aIt));
if (xParagraph.is())
{
- if (aIt != m_aFocused)
+ //disable the first event when user types in empty field.
+ ::sal_Int32 count = getAccessibleChildCount();
+ ::sal_Bool bEmpty = count > 1;
+ //if (aIt != m_aFocused)
+ if (aIt != m_aFocused && bEmpty)
xParagraph->notifyEvent(
::css::accessibility::AccessibleEventId::
STATE_CHANGED,
@@ -2068,6 +2368,100 @@ void Document::handleSelectionChangeNoti
}
m_aFocused = aIt;
+ ::sal_Int32 nMin;
+ ::sal_Int32 nMax;
+ ::sal_Int32 ret = getSelectionType(nNewFirstPara, nNewFirstPos, nNewLastPara, nNewLastPos);
+ switch (ret)
+ {
+ case -1:
+ {
+ //no event
+ }
+ break;
+ case 1:
+ {
+ //only caret moved, already handled in above
+ }
+ break;
+ case 2:
+ {
+ //old has no selection but new has selection
+ nMin = ::std::min(nNewFirstPara, nNewLastPara);
+ nMax = ::std::max(nNewFirstPara, nNewLastPara);
+ sendEvent(nMin, nMax, ::css::accessibility::AccessibleEventId::SELECTION_CHANGED);
+ sendEvent(nMin, nMax, ::css::accessibility::AccessibleEventId::TEXT_SELECTION_CHANGED);
+ }
+ break;
+ case 3:
+ {
+ //old has selection but new has no selection.
+ nMin = ::std::min(m_nSelectionFirstPara, m_nSelectionLastPara);
+ nMax = ::std::max(m_nSelectionFirstPara, m_nSelectionLastPara);
+ sendEvent(nMin, nMax, ::css::accessibility::AccessibleEventId::SELECTION_CHANGED);
+ sendEvent(nMin, nMax, ::css::accessibility::AccessibleEventId::TEXT_SELECTION_CHANGED);
+ }
+ break;
+ case 4:
+ {
+ //Send text_selection_change event on Nep
+ sendEvent(nNewLastPara, nNewLastPara, ::css::accessibility::AccessibleEventId::TEXT_SELECTION_CHANGED);
+ }
+ break;
+ case 5:
+ {
+ // 4, 1 -> 4, 7
+ sendEvent(m_nSelectionLastPara, m_nSelectionFirstPara-1, ::css::accessibility::AccessibleEventId::SELECTION_CHANGED);
+ sendEvent(nNewFirstPara+1, nNewLastPara, ::css::accessibility::AccessibleEventId::SELECTION_CHANGED);
+
+ sendEvent(m_nSelectionLastPara, nNewLastPara, ::css::accessibility::AccessibleEventId::TEXT_SELECTION_CHANGED);
+ }
+ break;
+ case 6:
+ {
+ // 1, 2 -> 1, 4; 4,4->4,5;
+ sendEvent(m_nSelectionLastPara+1, nNewLastPara, ::css::accessibility::AccessibleEventId::SELECTION_CHANGED);
+
+ sendEvent(m_nSelectionLastPara, nNewLastPara, ::css::accessibility::AccessibleEventId::TEXT_SELECTION_CHANGED);
+ }
+ break;
+ case 7:
+ {
+ // 4,1 -> 4,3,
+ sendEvent(m_nSelectionLastPara +1, nNewLastPara , ::css::accessibility::AccessibleEventId::SELECTION_CHANGED);
+
+ sendEvent(m_nSelectionLastPara, nNewLastPara, ::css::accessibility::AccessibleEventId::TEXT_SELECTION_CHANGED);
+ }
+ break;
+ case 8:
+ {
+ // 4,7 ->4,5;
+ sendEvent(nNewLastPara + 1, m_nSelectionLastPara, ::css::accessibility::AccessibleEventId::SELECTION_CHANGED);
+
+ sendEvent(nNewLastPara, m_nSelectionLastPara, ::css::accessibility::AccessibleEventId::TEXT_SELECTION_CHANGED);
+ }
+ break;
+ case 9:
+ {
+ // 3,2 -> 3,1; 4,4->4,3
+ sendEvent(nNewLastPara, m_nSelectionLastPara - 1, ::css::accessibility::AccessibleEventId::SELECTION_CHANGED);
+
+ sendEvent(nNewLastPara, m_nSelectionLastPara, ::css::accessibility::AccessibleEventId::TEXT_SELECTION_CHANGED);
+ }
+ break;
+ case 10:
+ {
+ // 4,7 -> 4,1
+ sendEvent(m_nSelectionFirstPara + 1, m_nSelectionLastPara, ::css::accessibility::AccessibleEventId::SELECTION_CHANGED);
+ sendEvent(nNewLastPara, nNewFirstPara - 1, ::css::accessibility::AccessibleEventId::SELECTION_CHANGED);
+
+ sendEvent(nNewLastPara, m_nSelectionLastPara, ::css::accessibility::AccessibleEventId::TEXT_SELECTION_CHANGED);
+ }
+ break;
+ default:
+ break;
+ }
+
+ /*
// Update both old and new selection. (Regardless of how the two selections
// look like, there will always be two ranges to the left and right of the
// overlap---the overlap and/or the range to the right of it possibly being
@@ -2143,7 +2537,7 @@ void Document::handleSelectionChangeNoti
// notify selection changes
notifySelectionChange( nFirst1, nLast1 );
notifySelectionChange( nFirst2, nLast2 );
-
+ */
m_nSelectionFirstPara = nNewFirstPara;
m_nSelectionFirstPos = nNewFirstPos;
m_nSelectionLastPara = nNewLastPara;
Modified: openoffice/trunk/main/accessibility/source/helper/accessiblestrings.src
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/accessibility/source/helper/accessiblestrings.src?rev=1541847&r1=1541846&r2=1541847&view=diff
==============================================================================
--- openoffice/trunk/main/accessibility/source/helper/accessiblestrings.src (original)
+++ openoffice/trunk/main/accessibility/source/helper/accessiblestrings.src Thu Nov 14 08:18:05 2013
@@ -25,11 +25,12 @@
#include <accessibility/helper/accessiblestrings.hrc>
#endif
-
+//IAccessibility2 Impplementaton 2009-----
String RID_STR_ACC_ACTION_CLICK
{
- Text = "click";
+ Text = "press";
};
+//-----IAccessibility2 Impplementaton 2009
String RID_STR_ACC_ACTION_TOGGLEPOPUP
{
@@ -66,6 +67,52 @@ String RID_STR_ACC_NAME_BROWSEBUTTON
Text [ en-US ] = "Browse";
};
+String STR_SVT_ACC_ACTION_EXPAND
+{
+ Text [ en-US ] = "Expand" ;
+};
+
+String STR_SVT_ACC_ACTION_COLLAPSE
+{
+ Text [ en-US ] = "Collapse";
+};
+String STR_SVT_ACC_LISTENTRY_SELCTED_STATE
+{
+ Text [ en-US ] = "(Selected)";
+};
+
+String RID_STR_ACC_NAME_PREVIEW
+{
+ Text [ en-US ] = "Preview";
+};
+
+String RID_STR_ACC_ACTION_CHECK
+{
+ Text [ en-US ] = "Check";
+};
+String RID_STR_ACC_ACTION_UNCHECK
+{
+ Text [ en-US ] = "Uncheck";
+};
+String RID_STR_ACC_ACTION_DOUBLE_CLICK
+{
+ Text [ en-US ] = "Double click";
+};
+
+String RID_STR_ACC_SCROLLBAR_NAME_VERTICAL
+{
+ Text [ en-US ] = "Vertical scroll bar";
+};
+String RID_STR_ACC_SCROLLBAR_NAME_HORIZONTAL
+{
+ Text [ en-US ] = "Horizontal scroll bar";
+};
+
+String RID_STR_ACC_PANEL_DESCRIPTION
+{
+ Text [ en-US ] = "Please press enter to go into child control for more operations";
+};
+
String RID_STR_ACC_DESC_PANELDECL_TABBAR
{
Text [ en-US ] = "Panel Deck Tab Bar";
Modified: openoffice/trunk/main/accessibility/source/helper/characterattributeshelper.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/accessibility/source/helper/characterattributeshelper.cxx?rev=1541847&r1=1541846&r2=1541847&view=diff
==============================================================================
--- openoffice/trunk/main/accessibility/source/helper/characterattributeshelper.cxx (original)
+++ openoffice/trunk/main/accessibility/source/helper/characterattributeshelper.cxx Thu Nov 14 08:18:05 2013
@@ -35,6 +35,8 @@ using namespace ::com::sun::star::beans;
CharacterAttributesHelper::CharacterAttributesHelper( const Font& rFont, sal_Int32 nBackColor, sal_Int32 nColor )
{
+ // MT: IA2 CWS commented out CharFontCharSet, CharFontFamily, CharFontPitch, CharFontStyleName, CharScaleWidth - any AT interested in this?
+
m_aAttributeMap.insert( AttributeMap::value_type( ::rtl::OUString::createFromAscii( "CharBackColor" ), makeAny( (sal_Int32) nBackColor ) ) );
m_aAttributeMap.insert( AttributeMap::value_type( ::rtl::OUString::createFromAscii( "CharColor" ), makeAny( (sal_Int32) nColor ) ) );
m_aAttributeMap.insert( AttributeMap::value_type( ::rtl::OUString::createFromAscii( "CharFontCharSet" ), makeAny( (sal_Int16) rFont.GetCharSet() ) ) );
@@ -47,6 +49,9 @@ CharacterAttributesHelper::CharacterAttr
m_aAttributeMap.insert( AttributeMap::value_type( ::rtl::OUString::createFromAscii( "CharStrikeout" ), makeAny( (sal_Int16) rFont.GetStrikeout() ) ) );
m_aAttributeMap.insert( AttributeMap::value_type( ::rtl::OUString::createFromAscii( "CharUnderline" ), makeAny( (sal_Int16) rFont.GetUnderline() ) ) );
m_aAttributeMap.insert( AttributeMap::value_type( ::rtl::OUString::createFromAscii( "CharWeight" ), makeAny( (float) rFont.GetWeight() ) ) );
+ m_aAttributeMap.insert( AttributeMap::value_type( ::rtl::OUString::createFromAscii( "CharPosture" ), makeAny( (sal_Int16)rFont.GetItalic() ) ) );
+ // MT: Introduced with IA2 CWS, but adjustment is not a char attr...
+ // m_aAttributeMap.insert( AttributeMap::value_type( ::rtl::OUString::createFromAscii( "ParaAdjust" ), makeAny( nAjust ) ) );
}
// -----------------------------------------------------------------------------
Modified: openoffice/trunk/main/accessibility/source/standard/accessiblemenubasecomponent.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/accessibility/source/standard/accessiblemenubasecomponent.cxx?rev=1541847&r1=1541846&r2=1541847&view=diff
==============================================================================
--- openoffice/trunk/main/accessibility/source/standard/accessiblemenubasecomponent.cxx (original)
+++ openoffice/trunk/main/accessibility/source/standard/accessiblemenubasecomponent.cxx Thu Nov 14 08:18:05 2013
@@ -134,15 +134,20 @@ void OAccessibleMenuBaseComponent::SetEn
{
if ( m_bEnabled != bEnabled )
{
+ sal_Int16 nStateType=AccessibleStateType::ENABLED;
+ if (IsMenuHideDisabledEntries())
+ {
+ nStateType = AccessibleStateType::VISIBLE;
+ }
Any aOldValue[2], aNewValue[2];
if ( m_bEnabled )
{
aOldValue[0] <<= AccessibleStateType::SENSITIVE;
- aOldValue[1] <<= AccessibleStateType::ENABLED;
+ aOldValue[1] <<= nStateType;
}
else
{
- aNewValue[0] <<= AccessibleStateType::ENABLED;
+ aNewValue[0] <<= nStateType;
aNewValue[1] <<= AccessibleStateType::SENSITIVE;
}
m_bEnabled = bEnabled;
@@ -777,3 +782,9 @@ Reference< XAccessibleStateSet > OAccess
}
// -----------------------------------------------------------------------------
+
+sal_Bool OAccessibleMenuBaseComponent::IsMenuHideDisabledEntries()
+{
+ return sal_False;
+}
+
Modified: openoffice/trunk/main/accessibility/source/standard/accessiblemenuitemcomponent.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/accessibility/source/standard/accessiblemenuitemcomponent.cxx?rev=1541847&r1=1541846&r2=1541847&view=diff
==============================================================================
--- openoffice/trunk/main/accessibility/source/standard/accessiblemenuitemcomponent.cxx (original)
+++ openoffice/trunk/main/accessibility/source/standard/accessiblemenuitemcomponent.cxx Thu Nov 14 08:18:05 2013
@@ -208,6 +208,18 @@ void OAccessibleMenuItemComponent::SetAc
if ( sName.getLength() == 0 )
sName = m_pParent->GetItemText( nItemId );
sName = OutputDevice::GetNonMnemonicString( sName );
+
+ // IA2 CWS, MT: Is adding 5 blanks really before the accelname reasonable? And which Platform / Accessibility API does need it this way? ATK has API for this...
+ // Also, IAccessible2 has IAccessibleAction::keyBinding, so I doubt that this is needed.
+ // But if so, it needs to move to the IA2 bridge.
+ /*
+ ::rtl::OUString sAccName = m_pParent->GetAccelKey( nItemId ).GetName();
+ if ( sAccName.getLength() )
+ {
+ sName += ::rtl::OUString::createFromAscii(" ");
+ sName += aAccelName;
+ }
+ */
}
return sName;
@@ -240,18 +252,19 @@ void OAccessibleMenuItemComponent::SetIt
void OAccessibleMenuItemComponent::FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet )
{
- if ( IsEnabled() )
+ sal_Bool bEnabled = IsEnabled();
+ if ( bEnabled )
{
rStateSet.AddState( AccessibleStateType::ENABLED );
rStateSet.AddState( AccessibleStateType::SENSITIVE );
}
if ( IsVisible() )
- {
- rStateSet.AddState( AccessibleStateType::VISIBLE );
- rStateSet.AddState( AccessibleStateType::SHOWING );
- }
-
+ {
+ rStateSet.AddState( AccessibleStateType::SHOWING );
+ if( !IsMenuHideDisabledEntries() || bEnabled )
+ rStateSet.AddState( AccessibleStateType::VISIBLE );
+ }
rStateSet.AddState( AccessibleStateType::OPAQUE );
}
@@ -497,3 +510,23 @@ Reference< awt::XFont > OAccessibleMenuI
}
// -----------------------------------------------------------------------------
+
+sal_Bool OAccessibleMenuItemComponent::IsMenuHideDisabledEntries()
+{
+ if (m_pParent )
+ {
+ if( m_pParent->GetMenuFlags() & MENU_FLAG_HIDEDISABLEDENTRIES)
+ {
+ return sal_True;
+ }
+ // IA2 CWS, but the menus shouldn't have different flags, and even if so, the GetStartedFromMenu shouldn't matter
+ /*
+ else if (m_pParent->GetStartedFromMenu() &&
+ m_pParent->GetStartedFromMenu()->GetMenuFlags() & MENU_FLAG_HIDEDISABLEDENTRIES)
+ {
+ return sal_True;
+ }
+ */
+ }
+ return sal_False;
+}
Modified: openoffice/trunk/main/accessibility/source/standard/vclxaccessiblebox.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/accessibility/source/standard/vclxaccessiblebox.cxx?rev=1541847&r1=1541846&r2=1541847&view=diff
==============================================================================
--- openoffice/trunk/main/accessibility/source/standard/vclxaccessiblebox.cxx (original)
+++ openoffice/trunk/main/accessibility/source/standard/vclxaccessiblebox.cxx Thu Nov 14 08:18:05 2013
@@ -116,11 +116,98 @@ void VCLXAccessibleBox::ProcessWindowEve
{
switch ( rVclWindowEvent.GetId() )
{
+ case VCLEVENT_LISTBOX_SELECT:
+ case VCLEVENT_LISTBOX_FOCUSITEMCHANGED:
+
+ {
+ // Forward the call to the list child.
+ VCLXAccessibleList* pList = static_cast<VCLXAccessibleList*>(m_xList.get());
+ if ( pList == NULL )
+ {
+ getAccessibleChild ( m_bHasTextChild ? 1 : 0 );
+ pList = static_cast<VCLXAccessibleList*>(m_xList.get());
+ }
+ if ( pList != NULL )
+ {
+ pList->ProcessWindowEvent (rVclWindowEvent, m_bIsDropDownBox);
+ if(m_bIsDropDownBox)
+ {
+ NotifyAccessibleEvent(AccessibleEventId::VALUE_CHANGED, Any(), Any());
+ Any aOldValue;
+ Any aNewValue;
+ aOldValue <<= AccessibleStateType::INDETERMINATE;
+ NotifyAccessibleEvent(AccessibleEventId::STATE_CHANGED, aOldValue, aNewValue);
+
+ }
+ }
+ break;
+ }
case VCLEVENT_DROPDOWN_OPEN:
+ {
+ VCLXAccessibleList* pList = static_cast<VCLXAccessibleList*>(m_xList.get());
+ if ( pList == NULL )
+ {
+ getAccessibleChild ( m_bHasTextChild ? 1 : 0 );
+ pList = static_cast<VCLXAccessibleList*>(m_xList.get());
+ }
+ if ( pList != NULL )
+ {
+ pList->ProcessWindowEvent (rVclWindowEvent);
+ pList->HandleDropOpen();
+ }
+ break;
+ }
case VCLEVENT_DROPDOWN_CLOSE:
+ {
+ VCLXAccessibleList* pList = static_cast<VCLXAccessibleList*>(m_xList.get());
+ if ( pList == NULL )
+ {
+ getAccessibleChild ( m_bHasTextChild ? 1 : 0 );
+ pList = static_cast<VCLXAccessibleList*>(m_xList.get());
+ }
+ if ( pList != NULL )
+ {
+ pList->ProcessWindowEvent (rVclWindowEvent);
+ }
+ Window* pWindow = GetWindow();
+ if( pWindow && (pWindow->HasFocus() || pWindow->HasChildPathFocus()) )
+ {
+ Any aOldValue, aNewValue;
+ aNewValue <<= AccessibleStateType::FOCUSED;
+ NotifyAccessibleEvent( AccessibleEventId::STATE_CHANGED, aOldValue, aNewValue );
+ }
+ break;
+ }
+ case VCLEVENT_COMBOBOX_SELECT:
+ {
+ VCLXAccessibleList* pList = static_cast<VCLXAccessibleList*>(m_xList.get());
+ if (pList != NULL)
+ {
+ Reference<XAccessibleText> xText (m_xText->getAccessibleContext(), UNO_QUERY);
+ if ( xText.is() )
+ {
+ ::rtl::OUString sText = xText->getSelectedText();
+ if ( !sText.getLength() )
+ sText = xText->getText();
+ pList->UpdateSelection_Acc (sText, m_bIsDropDownBox);
+ //if(m_bIsDropDownBox && !pList->IsInDropDown())
+ if (m_bIsDropDownBox || ( !m_bIsDropDownBox && m_aBoxType==COMBOBOX))
+ NotifyAccessibleEvent(AccessibleEventId::VALUE_CHANGED, Any(), Any());
+
+ Any aOldValue;
+ Any aNewValue;
+ aOldValue <<= AccessibleStateType::INDETERMINATE;
+ NotifyAccessibleEvent(AccessibleEventId::STATE_CHANGED, aOldValue, aNewValue);
+
+ }
+ }
+ break;
+ }
+ //case VCLEVENT_DROPDOWN_OPEN:
+ //case VCLEVENT_DROPDOWN_CLOSE:
case VCLEVENT_LISTBOX_DOUBLECLICK:
case VCLEVENT_LISTBOX_SCROLLED:
- case VCLEVENT_LISTBOX_SELECT:
+ //case VCLEVENT_LISTBOX_SELECT:
case VCLEVENT_LISTBOX_ITEMADDED:
case VCLEVENT_LISTBOX_ITEMREMOVED:
case VCLEVENT_COMBOBOX_ITEMADDED:
@@ -139,7 +226,7 @@ void VCLXAccessibleBox::ProcessWindowEve
break;
}
- case VCLEVENT_COMBOBOX_SELECT:
+ //case VCLEVENT_COMBOBOX_SELECT:
case VCLEVENT_COMBOBOX_DESELECT:
{
// Selection is handled by VCLXAccessibleList which operates on
@@ -163,6 +250,7 @@ void VCLXAccessibleBox::ProcessWindowEve
case VCLEVENT_EDIT_MODIFY:
case VCLEVENT_EDIT_SELECTIONCHANGED:
+ // case VCLEVENT_EDIT_CARETCHANGED:
// Modify/Selection events are handled by the combo box instead of
// directly by the edit field (Why?). Therefore, delegate this
// call to the edit field.
@@ -177,7 +265,30 @@ void VCLXAccessibleBox::ProcessWindowEve
}
}
break;
-
+ /*
+ // MT: Not sending VCLEVENT_LISTBOX_STATEUPDATE, see comment in ListBox::SelectEntryPos
+ case VCLEVENT_LISTBOX_STATEUPDATE:
+ {
+ // Need to update the INDETERMINATE state sometimes
+ if (m_bIsDropDownBox && m_aBoxType==LISTBOX)
+ {
+ sal_Int32 nSelectedEntryCount = 0;
+ ListBox* pListBox = static_cast< ListBox* >( GetWindow() );
+ if (pListBox != NULL && pListBox->GetEntryCount() > 0)
+ {
+ nSelectedEntryCount = pListBox->GetSelectEntryCount();
+ Any aOldValue;
+ Any aNewValue;
+ if ( nSelectedEntryCount == 0)
+ aNewValue <<= AccessibleStateType::INDETERMINATE;
+ else
+ aOldValue <<= AccessibleStateType::INDETERMINATE;
+ NotifyAccessibleEvent(AccessibleEventId::STATE_CHANGED, aOldValue, aNewValue);
+ }
+ }
+ break;
+ }
+ */
default:
VCLXAccessibleComponent::ProcessWindowEvent( rVclWindowEvent );
}
@@ -256,7 +367,11 @@ Reference<XAccessible> SAL_CALL VCLXAcce
{
ComboBox* pComboBox = static_cast<ComboBox*>(GetWindow());
if (pComboBox!=NULL && pComboBox->GetSubEdit()!=NULL)
+ //Set the edit's acc name the same as parent
+ {
+ pComboBox->GetSubEdit()->SetAccessibleName(getAccessibleName());
m_xText = pComboBox->GetSubEdit()->GetAccessible();
+ }
}
else if (m_bIsDropDownBox)
m_xText = new VCLXAccessibleTextField (GetVCLXWindow(),this);
@@ -275,7 +390,11 @@ sal_Int16 SAL_CALL VCLXAccessibleBox::ge
// Return the role <const>COMBO_BOX</const> for both VCL combo boxes and
// VCL list boxes in DropDown-Mode else <const>PANEL</const>.
// This way the Java bridge has not to handle both independently.
- return m_bIsDropDownBox ? AccessibleRole::COMBO_BOX : AccessibleRole::PANEL;
+ //return m_bIsDropDownBox ? AccessibleRole::COMBO_BOX : AccessibleRole::PANEL;
+ if (m_bIsDropDownBox || (!m_bIsDropDownBox && m_aBoxType == COMBOBOX ))
+ return AccessibleRole::COMBO_BOX;
+ else
+ return AccessibleRole::PANEL;
}
sal_Int32 SAL_CALL VCLXAccessibleBox::getAccessibleIndexInParent (void)
@@ -296,7 +415,7 @@ sal_Int32 SAL_CALL VCLXAccessibleBox::ge
// There is one action for drop down boxes (toggle popup) and none for
// the other boxes.
- return m_bIsDropDownBox ? 1 : 0;
+ return m_bIsDropDownBox ? 0 : 1;
}
sal_Bool SAL_CALL VCLXAccessibleBox::doAccessibleAction (sal_Int32 nIndex)
@@ -343,7 +462,11 @@ sal_Bool SAL_CALL VCLXAccessibleBox::doA
::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
if (nIndex<0 || nIndex>=getAccessibleActionCount())
throw ::com::sun::star::lang::IndexOutOfBoundsException();
- return TK_RES_STRING( RID_STR_ACC_ACTION_TOGGLEPOPUP);
+ //Solution:When combo_box,it should not has action information.
+ //return TK_RES_STRING( RID_STR_ACC_ACTION_TOGGLEPOPUP);
+ if (m_aBoxType == LISTBOX)
+ return ::rtl::OUString();
+ return m_bIsDropDownBox?::rtl::OUString():TK_RES_STRING( RID_STR_ACC_ACTION_TOGGLEPOPUP);
}
Reference< XAccessibleKeyBinding > VCLXAccessibleBox::getAccessibleActionKeyBinding( sal_Int32 nIndex )
@@ -367,3 +490,102 @@ void SAL_CALL VCLXAccessibleBox::disposi
VCLXAccessibleComponent::disposing();
}
+// ===== XAccessibleValue ===============================================
+Any VCLXAccessibleBox::getCurrentValue( )
+ throw( RuntimeException )
+{
+ vos::OGuard aSolarGuard( Application::GetSolarMutex() );
+ ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
+
+ Any aAny;
+ if( m_xList.is() && m_xText.is())
+ {
+ // VCLXAccessibleList* pList = static_cast<VCLXAccessibleList*>(m_xList.get());
+ Reference<XAccessibleText> xText (m_xText->getAccessibleContext(), UNO_QUERY);
+ if ( xText.is() )
+ {
+ ::rtl::OUString sText = xText->getText();
+ aAny <<= sText;
+ }
+ }
+ if (m_aBoxType == LISTBOX && m_bIsDropDownBox && m_xList.is() )
+ {
+
+ VCLXAccessibleList* pList = static_cast<VCLXAccessibleList*>(m_xList.get());
+ if(pList->IsInDropDown())
+ {
+ if(pList->getSelectedAccessibleChildCount()>0)
+ {
+ Reference<XAccessibleContext> xName (pList->getSelectedAccessibleChild((sal_Int32)(0)), UNO_QUERY);
+ if(xName.is())
+ {
+ aAny <<= xName->getAccessibleName();
+ }
+ }
+ }
+ }
+
+ return aAny;
+}
+
+sal_Bool VCLXAccessibleBox::setCurrentValue( const Any& aNumber )
+ throw( RuntimeException )
+{
+ vos::OGuard aSolarGuard( Application::GetSolarMutex() );
+ ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
+
+ ::rtl::OUString fValue;
+ sal_Bool bValid = (aNumber >>= fValue);
+ if( bValid )
+ {
+
+ }
+ return bValid;
+
+}
+
+Any VCLXAccessibleBox::getMaximumValue( )
+ throw( RuntimeException )
+{
+ Any aAny;
+ return aAny;
+}
+
+Any VCLXAccessibleBox::getMinimumValue( )
+ throw( RuntimeException )
+{
+ Any aAny;
+ return aAny;
+}
+
+// Set the INDETERMINATE state when there is no selected item for combobox
+void VCLXAccessibleBox::FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet )
+{
+ VCLXAccessibleComponent::FillAccessibleStateSet(rStateSet);
+ if (m_aBoxType == COMBOBOX )
+ {
+ ::rtl::OUString sText;
+ sal_Int32 nEntryCount = 0;
+ ComboBox* pComboBox = static_cast<ComboBox*>(GetWindow());
+ if (pComboBox != NULL)
+ {
+ Edit* pSubEdit = pComboBox->GetSubEdit();
+ if ( pSubEdit)
+ sText = pSubEdit->GetText();
+ nEntryCount = pComboBox->GetEntryCount();
+ }
+ if (sText.getLength() == 0 && nEntryCount >0)
+ rStateSet.AddState(AccessibleStateType::INDETERMINATE);
+ }
+ else if (m_aBoxType == LISTBOX && m_bIsDropDownBox == true)
+ {
+ sal_Int32 nSelectedEntryCount = 0;
+ ListBox* pListBox = static_cast< ListBox* >( GetWindow() );
+ if (pListBox != NULL && pListBox->GetEntryCount() > 0)
+ {
+ nSelectedEntryCount = pListBox->GetSelectEntryCount();
+ if ( nSelectedEntryCount == 0)
+ rStateSet.AddState(AccessibleStateType::INDETERMINATE);
+ }
+ }
+}
Modified: openoffice/trunk/main/accessibility/source/standard/vclxaccessiblebutton.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/accessibility/source/standard/vclxaccessiblebutton.cxx?rev=1541847&r1=1541846&r2=1541847&view=diff
==============================================================================
--- openoffice/trunk/main/accessibility/source/standard/vclxaccessiblebutton.cxx (original)
+++ openoffice/trunk/main/accessibility/source/standard/vclxaccessiblebutton.cxx Thu Nov 14 08:18:05 2013
@@ -103,6 +103,16 @@ void VCLXAccessibleButton::FillAccessibl
if ( pButton->IsPressed() )
rStateSet.AddState( AccessibleStateType::PRESSED );
+
+ // IA2 CWS: If the button has a poppup menu,it should has the state EXPANDABLE
+ if( pButton->GetType() == WINDOW_MENUBUTTON )
+ {
+ rStateSet.AddState( AccessibleStateType::EXPANDABLE );
+ }
+ if( pButton->GetStyle() & WB_DEFBUTTON )
+ {
+ rStateSet.AddState( AccessibleStateType::DEFAULT );
+ }
}
}
@@ -145,6 +155,13 @@ Sequence< ::rtl::OUString > VCLXAccessib
OExternalLockGuard aGuard( this );
::rtl::OUString aName( VCLXAccessibleTextComponent::getAccessibleName() );
+
+ // IA2 CWS: Removed special handling for browse/more buttons.
+ // Comment was "the '...' or '<<' or '>>' should be kepted per the requirements from AT"
+ // MT: We did introduce this special handling by intention.
+ // As the original text is still what you get via XAccessibleText,
+ // I think for the accessible name the stuff below is correct.
+
sal_Int32 nLength = aName.getLength();
if ( nLength >= 3 && aName.matchAsciiL( RTL_CONSTASCII_STRINGPARAM("..."), nLength - 3 ) )
Modified: openoffice/trunk/main/accessibility/source/standard/vclxaccessiblecheckbox.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/accessibility/source/standard/vclxaccessiblecheckbox.cxx?rev=1541847&r1=1541846&r2=1541847&view=diff
==============================================================================
--- openoffice/trunk/main/accessibility/source/standard/vclxaccessiblecheckbox.cxx (original)
+++ openoffice/trunk/main/accessibility/source/standard/vclxaccessiblecheckbox.cxx Thu Nov 14 08:18:05 2013
@@ -238,7 +238,13 @@ sal_Bool VCLXAccessibleCheckBox::doAcces
if ( nIndex < 0 || nIndex >= getAccessibleActionCount() )
throw IndexOutOfBoundsException();
- return ::rtl::OUString( TK_RES_STRING( RID_STR_ACC_ACTION_CLICK ) );
+ //IAccessibility2 Implementation 2009-----
+ // return ::rtl::OUString( TK_RES_STRING( RID_STR_ACC_ACTION_CLICK ) );
+ //-----IAccessibility2 Implementation 2009
+ if(IsChecked())
+ return ::rtl::OUString( TK_RES_STRING( RID_STR_ACC_ACTION_UNCHECK ) );
+ else
+ return ::rtl::OUString( TK_RES_STRING( RID_STR_ACC_ACTION_CHECK ) );
}
// -----------------------------------------------------------------------------
Modified: openoffice/trunk/main/accessibility/source/standard/vclxaccessiblelist.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/accessibility/source/standard/vclxaccessiblelist.cxx?rev=1541847&r1=1541846&r2=1541847&view=diff
==============================================================================
--- openoffice/trunk/main/accessibility/source/standard/vclxaccessiblelist.cxx (original)
+++ openoffice/trunk/main/accessibility/source/standard/vclxaccessiblelist.cxx Thu Nov 14 08:18:05 2013
@@ -36,6 +36,12 @@
#include <vcl/lstbox.hxx>
#include <toolkit/helper/convert.hxx>
+#ifndef _UTL_ACCESSIBLERELATIONSETHELPER_HXX_
+#include <unotools/accessiblerelationsethelper.hxx>
+#endif
+#ifndef _COM_SUN_STAR_ACCESSIBILITY_ACCESSIBLERELATIONTYPE_HPP_
+#include <com/sun/star/accessibility/AccessibleRelationType.hpp>
+#endif
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::lang;
@@ -65,6 +71,7 @@ VCLXAccessibleList::VCLXAccessibleList (
m_nLastSelectedPos ( LISTBOX_ENTRY_NOTFOUND ),
m_bDisableProcessEvent ( false ),
m_bVisible ( true ),
+ m_nCurSelectedPos ( LISTBOX_ENTRY_NOTFOUND ),
m_xParent ( _xParent )
{
// Because combo boxes and list boxes have the no common interface for
@@ -89,6 +96,7 @@ VCLXAccessibleList::VCLXAccessibleList (
}
}
UpdateVisibleLineCount();
+ m_nCurSelectedPos=m_pListBoxHelper->GetSelectEntryPos();
sal_uInt16 nCount = static_cast<sal_uInt16>(getAccessibleChildCount());
m_aAccessibleChildren.reserve(nCount);
@@ -188,6 +196,218 @@ void VCLXAccessibleList::notifyVisibleSt
}
}
// -----------------------------------------------------------------------------
+void VCLXAccessibleList::UpdateSelection_Acc (::rtl::OUString sTextOfSelectedItem, bool b_IsDropDownList)
+{
+ if ( m_aBoxType == COMBOBOX )
+ {
+ ComboBox* pBox = static_cast<ComboBox*>(GetWindow());
+ if ( pBox != NULL )
+ {
+ // Find the index of the selected item inside the VCL control...
+ sal_uInt16 nIndex = pBox->GetEntryPos (XubString(sTextOfSelectedItem));
+ // ...and then find the associated accessibility object.
+ if ( nIndex == LISTBOX_ENTRY_NOTFOUND )
+ nIndex = 0;
+ UpdateSelection_Impl_Acc(b_IsDropDownList);
+ }
+ }
+}
+
+// -----------------------------------------------------------------------------
+void VCLXAccessibleList::UpdateSelection_Impl_Acc(bool b_IsDropDownList)
+{
+ uno::Any aOldValue, aNewValue;
+ VCLXAccessibleListItem* pCurItem =NULL;
+
+ {
+ vos::OGuard aSolarGuard( Application::GetSolarMutex() );
+ ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
+ Reference< XAccessible > xNewAcc;
+ if ( m_pListBoxHelper )
+ {
+ sal_uInt16 i=0;
+ m_nCurSelectedPos = LISTBOX_ENTRY_NOTFOUND;
+ for ( ListItems::iterator aIter = m_aAccessibleChildren.begin();
+ aIter != m_aAccessibleChildren.end(); ++aIter,++i)
+ {
+ Reference< XAccessible > xHold = *aIter;
+ if ( xHold.is() )
+ {
+ VCLXAccessibleListItem* pItem = static_cast< VCLXAccessibleListItem* >( xHold.get() );
+ // Retrieve the item's index from the list entry.
+ sal_Bool bNowSelected = m_pListBoxHelper->IsEntryPosSelected (i);
+ if (bNowSelected)
+ m_nCurSelectedPos = i;
+
+ if ( bNowSelected && !pItem->IsSelected() )
+ {
+ xNewAcc = *aIter;
+ aNewValue <<= xNewAcc;
+
+ pCurItem = pItem;
+
+ }
+ else if ( pItem->IsSelected() )
+ m_nLastSelectedPos = i;
+
+ pItem->SetSelected( bNowSelected );
+ }
+ else
+ { // it could happen that a child was not created before
+ checkEntrySelected(i,aNewValue,xNewAcc);
+ }
+ }
+ sal_uInt16 nCount = m_pListBoxHelper->GetEntryCount();
+ if ( i < nCount ) // here we have to check the if any other listbox entry is selected
+ {
+ for (; i < nCount && !checkEntrySelected(i,aNewValue,xNewAcc) ;++i )
+ ;
+ }
+ if ( xNewAcc.is() && GetWindow()->HasFocus() )
+ {
+ if ( m_nLastSelectedPos != LISTBOX_ENTRY_NOTFOUND )
+ aOldValue <<= getAccessibleChild( (sal_Int32)m_nLastSelectedPos );
+ aNewValue <<= xNewAcc;
+ }
+ }
+ }
+ if (m_aBoxType == COMBOBOX && b_IsDropDownList)
+ {
+ //VCLXAccessibleDropDownComboBox
+ //when in list is dropped down, xText = NULL
+ if (m_pListBoxHelper->IsInDropDown())
+ {
+ if ( aNewValue.hasValue() || aOldValue.hasValue() )
+ {
+ NotifyAccessibleEvent(
+ AccessibleEventId::ACTIVE_DESCENDANT_CHANGED,
+ aOldValue,
+ aNewValue );
+
+ NotifyListItem(aNewValue);
+
+ }
+ }
+ }
+ else if (m_aBoxType == COMBOBOX && !b_IsDropDownList)
+ {
+ //VCLXAccessibleComboBox
+ NotifyAccessibleEvent( AccessibleEventId::SELECTION_CHANGED, uno::Any(), uno::Any() );
+ }
+ else if (m_aBoxType == LISTBOX && b_IsDropDownList)
+ {
+ //VCLXAccessibleDropdownListBox
+ //when in list is dropped down, xText = NULL
+ if (m_pListBoxHelper->IsInDropDown())
+ {
+ if ( aNewValue.hasValue() || aOldValue.hasValue() )
+ {
+ NotifyAccessibleEvent(
+ AccessibleEventId::ACTIVE_DESCENDANT_CHANGED,
+ aOldValue,
+ aNewValue );
+
+ NotifyListItem(aNewValue);
+ }
+ }
+ }
+ else if (m_aBoxType == LISTBOX && !b_IsDropDownList)
+ {
+ //VCLXAccessibleListBox, xText = NULL.
+
+
+ if ( aNewValue.hasValue())
+ {
+ NotifyListItem(aNewValue);
+ }
+ }
+}
+void VCLXAccessibleList::NotifyListItem(::com::sun::star::uno::Any& val)
+{
+ Reference< XAccessible > xCurItem;
+ val >>= xCurItem;
+ if (xCurItem.is())
+ {
+ VCLXAccessibleListItem* pCurItem = static_cast< VCLXAccessibleListItem* >(xCurItem.get());
+ if (pCurItem)
+ {
+ pCurItem->NotifyAccessibleEvent(AccessibleEventId::SELECTION_CHANGED,Any(),Any());
+ }
+ }
+}
+
+
+void VCLXAccessibleList::UpdateFocus_Impl_Acc (sal_uInt16 nPos ,bool b_IsDropDownList)
+{
+ if (!(m_aBoxType == LISTBOX && !b_IsDropDownList))
+ {
+ return ;
+ }
+ Reference<XAccessible> xChild= CreateChild(nPos);
+ if ( !xChild.is() )
+ {
+ return ;
+ }
+ m_nCurSelectedPos = nPos;
+ uno::Any aOldValue, aNewValue;
+ aNewValue <<= xChild;
+
+ NotifyAccessibleEvent(
+ AccessibleEventId::ACTIVE_DESCENDANT_CHANGED,
+ aOldValue,
+ aNewValue );
+}
+
+// -----------------------------------------------------------------------------
+void VCLXAccessibleList::ProcessWindowEvent (const VclWindowEvent& rVclWindowEvent, bool b_IsDropDownList)
+{
+ switch ( rVclWindowEvent.GetId() )
+ {
+ case VCLEVENT_LISTBOX_SELECT:
+ if ( !m_bDisableProcessEvent )
+ UpdateSelection_Impl_Acc(b_IsDropDownList);
+ break;
+ case VCLEVENT_LISTBOX_FOCUSITEMCHANGED:
+ if ( !m_bDisableProcessEvent )
+ UpdateFocus_Impl_Acc((sal_uInt16)reinterpret_cast<sal_uInt32>(rVclWindowEvent.GetData()),b_IsDropDownList);
+ break;
+ case VCLEVENT_WINDOW_GETFOCUS:
+ break;
+ case VCLEVENT_CONTROL_GETFOCUS:
+ {
+ VCLXAccessibleComponent::ProcessWindowEvent (rVclWindowEvent);
+ if (m_aBoxType == COMBOBOX && b_IsDropDownList)
+ {
+ //VCLXAccessibleDropDownComboBox
+ }
+ else if (m_aBoxType == LISTBOX && b_IsDropDownList)
+ {
+ }
+ else if ( m_aBoxType == LISTBOX && !b_IsDropDownList)
+ {
+ if ( m_pListBoxHelper )
+ {
+ uno::Any aOldValue,
+ aNewValue;
+ sal_uInt16 nPos = m_nCurSelectedPos; //m_pListBoxHelper->GetSelectEntryPos();
+
+ if ( nPos == LISTBOX_ENTRY_NOTFOUND )
+ nPos = m_pListBoxHelper->GetTopEntry();
+ if ( nPos != LISTBOX_ENTRY_NOTFOUND )
+ aNewValue <<= CreateChild(nPos);
+ NotifyAccessibleEvent( AccessibleEventId::ACTIVE_DESCENDANT_CHANGED,
+ aOldValue,
+ aNewValue );
+ }
+ }
+ }
+ break;
+ default:
+ break;
+ }
+
+}
+// -----------------------------------------------------------------------------
void VCLXAccessibleList::ProcessWindowEvent (const VclWindowEvent& rVclWindowEvent)
{
// Create a reference to this object to prevent an early release of the
@@ -206,11 +426,13 @@ void VCLXAccessibleList::ProcessWindowEv
case VCLEVENT_COMBOBOX_SCROLLED:
UpdateEntryRange_Impl();
break;
-
+ // IAccessible2 implementation, 2009
+ /*
case VCLEVENT_LISTBOX_SELECT:
if ( !m_bDisableProcessEvent )
UpdateSelection_Impl();
break;
+ */
// The selection events VCLEVENT_COMBOBOX_SELECT and
// VCLEVENT_COMBOBOX_DESELECT are not handled here because here we
// have no access to the edit field. Its text is necessary to
@@ -236,20 +458,29 @@ void VCLXAccessibleList::ProcessWindowEv
rVclWindowEvent.GetData()));
break;
case VCLEVENT_CONTROL_GETFOCUS:
- VCLXAccessibleComponent::ProcessWindowEvent (rVclWindowEvent);
- if ( m_pListBoxHelper )
{
- uno::Any aOldValue,
- aNewValue;
- sal_uInt16 nPos = m_pListBoxHelper->GetSelectEntryPos();
- if ( nPos == LISTBOX_ENTRY_NOTFOUND )
- nPos = m_pListBoxHelper->GetTopEntry();
- if ( nPos != LISTBOX_ENTRY_NOTFOUND )
- aNewValue <<= CreateChild(nPos);
-
- NotifyAccessibleEvent( AccessibleEventId::ACTIVE_DESCENDANT_CHANGED,
- aOldValue,
- aNewValue );
+ VCLXAccessibleComponent::ProcessWindowEvent (rVclWindowEvent);
+ // Added by IBM Symphony Acc team to handle the list item focus when List control get focus
+ sal_Bool b_IsDropDownList = sal_True;
+ if (m_pListBoxHelper)
+ b_IsDropDownList = ((m_pListBoxHelper->GetStyle() & WB_DROPDOWN ) == WB_DROPDOWN);
+ if ( m_aBoxType == LISTBOX && !b_IsDropDownList )
+ {
+ if ( m_pListBoxHelper )
+ {
+ uno::Any aOldValue,
+ aNewValue;
+ sal_uInt16 nPos = m_nCurSelectedPos;
+
+ if ( nPos == LISTBOX_ENTRY_NOTFOUND )
+ nPos = m_pListBoxHelper->GetTopEntry();
+ if ( nPos != LISTBOX_ENTRY_NOTFOUND )
+ aNewValue <<= CreateChild(nPos);
+ NotifyAccessibleEvent( AccessibleEventId::ACTIVE_DESCENDANT_CHANGED,
+ aOldValue,
+ aNewValue );
+ }
+ }
}
break;
@@ -257,6 +488,24 @@ void VCLXAccessibleList::ProcessWindowEv
VCLXAccessibleComponent::ProcessWindowEvent (rVclWindowEvent);
}
}
+
+ void VCLXAccessibleList::FillAccessibleRelationSet( utl::AccessibleRelationSetHelper& rRelationSet )
+{
+ ListBox* pBox = static_cast<ListBox*>(GetWindow());
+ if( m_aBoxType == LISTBOX )
+ {
+ if (m_pListBoxHelper && (m_pListBoxHelper->GetStyle() & WB_DROPDOWN ) != WB_DROPDOWN)
+ {
+ uno::Sequence< uno::Reference< uno::XInterface > > aSequence(1);
+ aSequence[0] = pBox->GetAccessible();
+ rRelationSet.AddRelation( com::sun::star::accessibility::AccessibleRelation( com::sun::star::accessibility::AccessibleRelationType::MEMBER_OF, aSequence ) );
+ }
+ }
+ else
+ {
+ VCLXAccessibleComponent::FillAccessibleRelationSet(rRelationSet);
+ }
+}
// -----------------------------------------------------------------------------
/** To find out which item is currently selected and to update the SELECTED
@@ -315,9 +564,12 @@ Reference<XAccessible> VCLXAccessibleLis
// check if position is empty and can be used else we have to adjust all entries behind this
if ( xChild.is() )
{
+ // IAccessible2 implementation, 2009
+ /*
ListItems::iterator aIter = m_aAccessibleChildren.begin() + nPos;
::std::mem_fun_t<bool, VCLXAccessibleListItem> aTemp(&VCLXAccessibleListItem::IncrementIndexInParent);
adjustEntriesIndexInParent( aIter, aTemp);
+ */
}
else
{
@@ -332,6 +584,9 @@ Reference<XAccessible> VCLXAccessibleLis
sal_Bool bNowSelected = sal_False;
if ( m_pListBoxHelper )
bNowSelected = m_pListBoxHelper->IsEntryPosSelected ((sal_uInt16)i);
+ // IAccessible2 implementation 2009
+ if (bNowSelected)
+ m_nCurSelectedPos = sal_uInt16(i);
VCLXAccessibleListItem* pItem = static_cast< VCLXAccessibleListItem* >(xChild.get());
pItem->SetSelected( bNowSelected );
@@ -350,6 +605,8 @@ Reference<XAccessible> VCLXAccessibleLis
void VCLXAccessibleList::HandleChangedItemList (bool bItemInserted, sal_Int32 nIndex)
{
+ // IAccessible2 implementation 2009
+ /*
if ( !bItemInserted )
{
if ( nIndex == -1 ) // special handling here
@@ -368,7 +625,8 @@ void VCLXAccessibleList::HandleChangedIt
}
else
getAccessibleChild(nIndex);
-
+ */
+ clearItems();
NotifyAccessibleEvent (
AccessibleEventId::INVALIDATE_ALL_CHILDREN,
Any(), Any());
@@ -600,6 +858,7 @@ void VCLXAccessibleList::UpdateSelection
if ( m_pListBoxHelper )
{
sal_uInt16 i=0;
+ m_nCurSelectedPos = LISTBOX_ENTRY_NOTFOUND;
for ( ListItems::iterator aIter = m_aAccessibleChildren.begin();
aIter != m_aAccessibleChildren.end(); ++aIter,++i)
{
@@ -609,6 +868,8 @@ void VCLXAccessibleList::UpdateSelection
VCLXAccessibleListItem* pItem = static_cast< VCLXAccessibleListItem* >( xHold.get() );
// Retrieve the item's index from the list entry.
sal_Bool bNowSelected = m_pListBoxHelper->IsEntryPosSelected (i);
+ if (bNowSelected)
+ m_nCurSelectedPos = i;
if ( bNowSelected && !pItem->IsSelected() )
{
@@ -639,14 +900,19 @@ void VCLXAccessibleList::UpdateSelection
}
}
}
-
- if ( aNewValue.hasValue() || aOldValue.hasValue() )
- NotifyAccessibleEvent(
- AccessibleEventId::ACTIVE_DESCENDANT_CHANGED,
- aOldValue,
- aNewValue );
-
- NotifyAccessibleEvent( AccessibleEventId::SELECTION_CHANGED, Any(), Any() );
+ if (!m_pListBoxHelper->IsInDropDown())
+ {
+ }
+ else
+ {
+ if ( aNewValue.hasValue() || aOldValue.hasValue() )
+ NotifyAccessibleEvent(
+ AccessibleEventId::ACTIVE_DESCENDANT_CHANGED,
+ aOldValue,
+ aNewValue );
+ //the SELECTION_CHANGED is not necessary
+ //NotifyAccessibleEvent( AccessibleEventId::SELECTION_CHANGED, Any(), Any() );
+ }
}
// -----------------------------------------------------------------------------
@@ -808,10 +1074,12 @@ awt::Rectangle VCLXAccessibleList::implG
if ( pBox )
{
Size aSize = pBox->GetSubEdit()->GetSizePixel();
- aBounds.X += aSize.Height();
- aBounds.Y += aSize.Width();
+ // IAccessible2 implementation, 2009
+ //aBounds.X += aSize.Height();
+ //aBounds.Y += aSize.Width();
+ aBounds.Y += aSize.Height();
aBounds.Height -= aSize.Height();
- aBounds.Width -= aSize.Width();
+ //aBounds.Width -= aSize.Width();
}
}
}
@@ -839,12 +1107,33 @@ awt::Point VCLXAccessibleList::getLocati
ComboBox* pBox = static_cast<ComboBox*>(GetWindow());
if ( pBox )
{
- aPos.X += pBox->GetSubEdit()->GetSizePixel().Height();
- aPos.Y += pBox->GetSubEdit()->GetSizePixel().Width();
+ //aPos.X += pBox->GetSubEdit()->GetSizePixel().Height();
+ //aPos.Y += pBox->GetSubEdit()->GetSizePixel().Width();
+ aPos.Y += pBox->GetSubEdit()->GetSizePixel().Height();
}
}
}
return aPos;
}
// -----------------------------------------------------------------------------
-
+sal_Bool VCLXAccessibleList::IsInDropDown()
+{
+ return m_pListBoxHelper->IsInDropDown();
+}
+// -----------------------------------------------------------------------------
+void VCLXAccessibleList::HandleDropOpen()
+{
+ if ( !m_bDisableProcessEvent )
+ UpdateSelection_Impl();
+ if (m_nCurSelectedPos != LISTBOX_ENTRY_NOTFOUND &&
+ m_nLastSelectedPos != LISTBOX_ENTRY_NOTFOUND)
+ {
+ Reference< XAccessible > xChild = getAccessibleChild(m_nCurSelectedPos);
+ if(xChild.is())
+ {
+ uno::Any aNewValue;
+ aNewValue <<= xChild;
+ NotifyAccessibleEvent(AccessibleEventId::ACTIVE_DESCENDANT_CHANGED, uno::Any(), aNewValue );
+ }
+ }
+}
Modified: openoffice/trunk/main/accessibility/source/standard/vclxaccessiblelistitem.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/accessibility/source/standard/vclxaccessiblelistitem.cxx?rev=1541847&r1=1541846&r2=1541847&view=diff
==============================================================================
--- openoffice/trunk/main/accessibility/source/standard/vclxaccessiblelistitem.cxx (original)
+++ openoffice/trunk/main/accessibility/source/standard/vclxaccessiblelistitem.cxx Thu Nov 14 08:18:05 2013
@@ -317,9 +317,15 @@ Reference< XAccessibleStateSet > SAL_CAL
if ( !rBHelper.bDisposed && !rBHelper.bInDispose )
{
pStateSetHelper->AddState( AccessibleStateType::TRANSIENT );
- pStateSetHelper->AddState( AccessibleStateType::SELECTABLE );
- pStateSetHelper->AddState( AccessibleStateType::ENABLED );
- pStateSetHelper->AddState( AccessibleStateType::SENSITIVE );
+
+ // IAccessible2 implementation, 2009
+ if(m_pListBoxHelper->IsEnabled())
+ {
+ pStateSetHelper->AddState( AccessibleStateType::SELECTABLE );
+ pStateSetHelper->AddState( AccessibleStateType::ENABLED );
+ pStateSetHelper->AddState( AccessibleStateType::SENSITIVE );
+ }
+
if ( m_bSelected )
pStateSetHelper->AddState( AccessibleStateType::SELECTED );
if ( m_bVisible )
Modified: openoffice/trunk/main/accessibility/source/standard/vclxaccessiblemenu.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/accessibility/source/standard/vclxaccessiblemenu.cxx?rev=1541847&r1=1541846&r2=1541847&view=diff
==============================================================================
--- openoffice/trunk/main/accessibility/source/standard/vclxaccessiblemenu.cxx (original)
+++ openoffice/trunk/main/accessibility/source/standard/vclxaccessiblemenu.cxx Thu Nov 14 08:18:05 2013
@@ -249,3 +249,14 @@ void VCLXAccessibleMenu::deselectAccessi
}
// -----------------------------------------------------------------------------
+
+::rtl::OUString VCLXAccessibleMenu::getAccessibleActionDescription ( sal_Int32 nIndex ) throw (IndexOutOfBoundsException, RuntimeException)
+{
+ OExternalLockGuard aGuard( this );
+
+ if ( nIndex < 0 || nIndex >= getAccessibleActionCount() )
+ throw IndexOutOfBoundsException();
+
+ return ::rtl::OUString( );
+}
+
Modified: openoffice/trunk/main/accessibility/source/standard/vclxaccessiblemenuitem.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/accessibility/source/standard/vclxaccessiblemenuitem.cxx?rev=1541847&r1=1541846&r2=1541847&view=diff
==============================================================================
--- openoffice/trunk/main/accessibility/source/standard/vclxaccessiblemenuitem.cxx (original)
+++ openoffice/trunk/main/accessibility/source/standard/vclxaccessiblemenuitem.cxx Thu Nov 14 08:18:05 2013
@@ -191,8 +191,19 @@ Sequence< ::rtl::OUString > VCLXAccessib
sal_Int16 VCLXAccessibleMenuItem::getAccessibleRole( ) throw (RuntimeException)
{
OExternalLockGuard aGuard( this );
-
- return AccessibleRole::MENU_ITEM;
+ // IA2 CWS. MT: We had the aditional roles in UAA for ever, but never used them anywhere.
+ // Looks reasonable, but need to verify in Orca and VoiceOver.
+ sal_Int16 nRole = AccessibleRole::MENU_ITEM;
+ if ( m_pParent )
+ {
+ sal_uInt16 nItemId = m_pParent->GetItemId( m_nItemPos );
+ MenuItemBits nItemBits = m_pParent->GetItemBits(nItemId);
+ if( nItemBits & MIB_RADIOCHECK)
+ nRole = AccessibleRole::RADIO_MENU_ITEM;
+ else if( nItemBits & MIB_CHECKABLE)
+ nRole = AccessibleRole::CHECK_MENU_ITEM;
+ }
+ return nRole;
}
// -----------------------------------------------------------------------------
@@ -454,8 +465,9 @@ sal_Bool VCLXAccessibleMenuItem::doAcces
if ( nIndex < 0 || nIndex >= getAccessibleActionCount() )
throw IndexOutOfBoundsException();
-
- return ::rtl::OUString( TK_RES_STRING( RID_STR_ACC_ACTION_CLICK ) );
+ //IAccessibility2 Impplementaton 2009-----
+ return ::rtl::OUString( TK_RES_STRING( RID_STR_ACC_ACTION_SELECT ) );
+ //-----IAccessibility2 Impplementaton 2009
}
// -----------------------------------------------------------------------------
Modified: openoffice/trunk/main/accessibility/source/standard/vclxaccessibleradiobutton.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/accessibility/source/standard/vclxaccessibleradiobutton.cxx?rev=1541847&r1=1541846&r2=1541847&view=diff
==============================================================================
--- openoffice/trunk/main/accessibility/source/standard/vclxaccessibleradiobutton.cxx (original)
+++ openoffice/trunk/main/accessibility/source/standard/vclxaccessibleradiobutton.cxx Thu Nov 14 08:18:05 2013
@@ -197,8 +197,7 @@ sal_Bool VCLXAccessibleRadioButton::doAc
if ( nIndex < 0 || nIndex >= getAccessibleActionCount() )
throw IndexOutOfBoundsException();
-
- return ::rtl::OUString( TK_RES_STRING( RID_STR_ACC_ACTION_CLICK ) );
+ return ::rtl::OUString( TK_RES_STRING( RID_STR_ACC_ACTION_SELECT ) );
}
// -----------------------------------------------------------------------------
Modified: openoffice/trunk/main/accessibility/source/standard/vclxaccessiblescrollbar.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/accessibility/source/standard/vclxaccessiblescrollbar.cxx?rev=1541847&r1=1541846&r2=1541847&view=diff
==============================================================================
--- openoffice/trunk/main/accessibility/source/standard/vclxaccessiblescrollbar.cxx (original)
+++ openoffice/trunk/main/accessibility/source/standard/vclxaccessiblescrollbar.cxx Thu Nov 14 08:18:05 2013
@@ -88,7 +88,8 @@ void VCLXAccessibleScrollBar::FillAccess
VCLXScrollBar* pVCLXScrollBar = static_cast< VCLXScrollBar* >( GetVCLXWindow() );
if ( pVCLXScrollBar )
{
- rStateSet.AddState( AccessibleStateType::FOCUSABLE );
+ // IA2 CWS: scroll bar should not have FOCUSABLE state.
+ // rStateSet.AddState( AccessibleStateType::FOCUSABLE );
if ( pVCLXScrollBar->getOrientation() == ScrollBarOrientation::HORIZONTAL )
rStateSet.AddState( AccessibleStateType::HORIZONTAL );
else if ( pVCLXScrollBar->getOrientation() == ScrollBarOrientation::VERTICAL )
@@ -274,3 +275,21 @@ Any VCLXAccessibleScrollBar::getMinimumV
}
// -----------------------------------------------------------------------------
+
+// IAccessible2 implementation, 2009
+::rtl::OUString VCLXAccessibleScrollBar::getAccessibleName( ) throw (uno::RuntimeException)
+{
+ OExternalLockGuard aGuard( this );
+
+ ::rtl::OUString aName;
+ VCLXScrollBar* pVCLXScrollBar = static_cast< VCLXScrollBar* >( GetVCLXWindow() );
+ if ( pVCLXScrollBar )
+ {
+ if ( pVCLXScrollBar->getOrientation() == ScrollBarOrientation::HORIZONTAL )
+ aName = TK_RES_STRING( RID_STR_ACC_SCROLLBAR_NAME_HORIZONTAL );
+ else if ( pVCLXScrollBar->getOrientation() == ScrollBarOrientation::VERTICAL )
+ aName = TK_RES_STRING( RID_STR_ACC_SCROLLBAR_NAME_VERTICAL );
+ }
+ return aName;
+}
+
Modified: openoffice/trunk/main/accessibility/source/standard/vclxaccessibletabcontrol.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/accessibility/source/standard/vclxaccessibletabcontrol.cxx?rev=1541847&r1=1541846&r2=1541847&view=diff
==============================================================================
--- openoffice/trunk/main/accessibility/source/standard/vclxaccessibletabcontrol.cxx (original)
+++ openoffice/trunk/main/accessibility/source/standard/vclxaccessibletabcontrol.cxx Thu Nov 14 08:18:05 2013
@@ -81,7 +81,8 @@ void VCLXAccessibleTabControl::UpdateFoc
void VCLXAccessibleTabControl::UpdateSelected( sal_Int32 i, bool bSelected )
{
- NotifyAccessibleEvent( AccessibleEventId::SELECTION_CHANGED, Any(), Any() );
+ // IAccessible2 implementation, 2009
+ //NotifyAccessibleEvent( AccessibleEventId::SELECTION_CHANGED, Any(), Any() );
if ( i >= 0 && i < (sal_Int32)m_aAccessibleChildren.size() )
{
Modified: openoffice/trunk/main/accessibility/source/standard/vclxaccessibletextcomponent.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/accessibility/source/standard/vclxaccessibletextcomponent.cxx?rev=1541847&r1=1541846&r2=1541847&view=diff
==============================================================================
--- openoffice/trunk/main/accessibility/source/standard/vclxaccessibletextcomponent.cxx (original)
+++ openoffice/trunk/main/accessibility/source/standard/vclxaccessibletextcomponent.cxx Thu Nov 14 08:18:05 2013
@@ -189,10 +189,62 @@ Sequence< PropertyValue > VCLXAccessible
if ( GetWindow() )
{
- Font aFont = GetWindow()->GetControlFont();
- sal_Int32 nBackColor = GetWindow()->GetControlBackground().GetColor();
- sal_Int32 nColor = GetWindow()->GetControlForeground().GetColor();
- ::std::auto_ptr< CharacterAttributesHelper > pHelper( new CharacterAttributesHelper( aFont, nBackColor, nColor ) );
+ Font aFont = GetWindow()->GetControlFont();
+
+ sal_Int32 nBackColor = GetWindow()->GetControlBackground().GetColor();
+ sal_Int32 nColor = GetWindow()->GetControlForeground().GetColor();
+
+ // MT: Code with default font was introduced with the IA2 CWS, but I am not convinced that this is the correct font...
+ // Decide what to do when we have a concrete issue.
+ /*
+ Font aDefaultVCLFont;
+ OutputDevice* pDev = Application::GetDefaultDevice();
+ if ( pDev )
+ {
+ aDefaultVCLFont = pDev->GetSettings().GetStyleSettings().GetAppFont();
+ if ( !aFont.GetName().Len() )
+ {
+ String aDefaultName = aDefaultVCLFont.GetName();
+ aFont.SetName( aDefaultName );
+ }
+ if ( !aFont.GetHeight() )
+ {
+ aFont.SetHeight( aDefaultVCLFont.GetHeight() );
+ }
+ if ( aFont.GetWeight() == WEIGHT_DONTKNOW )
+ {
+ aFont.SetWeight( aDefaultVCLFont.GetWeight() );
+ }
+
+ //if nColor is -1, it may indicate that the default color black is using.
+ if ( nColor == -1)
+ {
+ nColor = aDefaultVCLFont.GetColor().GetColor();
+ }
+ }
+ */
+
+ // MT: Adjustment stuff was introduced with the IA2 CWS, but adjustment is not a character attribute...
+ // In case we reintroduce it, use adjustment as extra parameter for the CharacterAttributesHelper...
+ /*
+ WinBits aBits = GetWindow()->GetStyle();
+ sal_Int16 nAdjust = -1;
+ if ( aBits & WB_LEFT )
+ {
+ nAdjust = style::ParagraphAdjust_LEFT;
+ }
+ else if ( aBits & WB_RIGHT )
+ {
+ nAdjust = style::ParagraphAdjust_RIGHT;
+ }
+ else if ( aBits & WB_CENTER )
+ {
+ nAdjust = style::ParagraphAdjust_CENTER;
+ }
+ */
+
+ ::std::auto_ptr< CharacterAttributesHelper > pHelper( new CharacterAttributesHelper( aFont, nBackColor, nColor ) );
+
aValues = pHelper->GetCharacterAttributes( aRequestedAttributes );
}