Kaydet (Commit) 968a7681 authored tarafından Steve Yin's avatar Steve Yin Kaydeden (comit) Caolán McNamara

Integrate branch of IAccessible2

Change-Id: I95b681a7aa171c321a876e6a38392e30583d7a5b
üst 22029c7e
...@@ -961,6 +961,8 @@ public: ...@@ -961,6 +961,8 @@ public:
class TOOLKIT_DLLPUBLIC VCLXDateField : public ::com::sun::star::awt::XDateField, class TOOLKIT_DLLPUBLIC VCLXDateField : public ::com::sun::star::awt::XDateField,
public VCLXFormattedSpinField public VCLXFormattedSpinField
{ {
protected:
virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext > CreateAccessibleContext();
public: public:
VCLXDateField(); VCLXDateField();
~VCLXDateField(); ~VCLXDateField();
...@@ -1007,6 +1009,8 @@ public: ...@@ -1007,6 +1009,8 @@ public:
class VCLXTimeField : public ::com::sun::star::awt::XTimeField, class VCLXTimeField : public ::com::sun::star::awt::XTimeField,
public VCLXFormattedSpinField public VCLXFormattedSpinField
{ {
protected:
virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext > CreateAccessibleContext();
public: public:
VCLXTimeField(); VCLXTimeField();
~VCLXTimeField(); ~VCLXTimeField();
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#include <vcl/dialog.hxx> #include <vcl/dialog.hxx>
#include <vcl/vclevent.hxx> #include <vcl/vclevent.hxx>
#include <vcl/window.hxx> #include <vcl/window.hxx>
#include <vcl/edit.hxx>
#include <tools/debug.hxx> #include <tools/debug.hxx>
#include <unotools/accessiblestatesethelper.hxx> #include <unotools/accessiblestatesethelper.hxx>
#include <unotools/accessiblerelationsethelper.hxx> #include <unotools/accessiblerelationsethelper.hxx>
...@@ -436,13 +437,46 @@ void VCLXAccessibleComponent::FillAccessibleStateSet( utl::AccessibleStateSetHel ...@@ -436,13 +437,46 @@ void VCLXAccessibleComponent::FillAccessibleStateSet( utl::AccessibleStateSetHel
if ( pWindow->GetStyle() & WB_SIZEABLE ) if ( pWindow->GetStyle() & WB_SIZEABLE )
rStateSet.AddState( accessibility::AccessibleStateType::RESIZABLE ); rStateSet.AddState( accessibility::AccessibleStateType::RESIZABLE );
// 6. frame doesn't have MOVABLE state
// 10. for password text, where is the sensitive state?
if( ( getAccessibleRole() == accessibility::AccessibleRole::FRAME ||getAccessibleRole() == accessibility::AccessibleRole::DIALOG )&& pWindow->GetStyle() & WB_MOVEABLE )
rStateSet.AddState( accessibility::AccessibleStateType::MOVEABLE );
if( pWindow->IsDialog() ) if( pWindow->IsDialog() )
{ {
Dialog *pDlg = static_cast< Dialog* >( pWindow ); Dialog *pDlg = static_cast< Dialog* >( pWindow );
if( pDlg->IsInExecute() ) if( pDlg->IsInExecute() )
rStateSet.AddState( accessibility::AccessibleStateType::MODAL ); rStateSet.AddState( accessibility::AccessibleStateType::MODAL );
} }
//If a combobox or list's edit child isn't read-only,EDITABLE state
//should be set.
if( pWindow && pWindow->GetType() == WINDOW_COMBOBOX )
{
if( !( pWindow->GetStyle() & WB_READONLY) ||
!((Edit*)pWindow)->IsReadOnly() )
rStateSet.AddState( accessibility::AccessibleStateType::EDITABLE );
}
Window* pChild = pWindow->GetWindow( WINDOW_FIRSTCHILD );
while( pWindow && pChild )
{
Window* pWinTemp = pChild->GetWindow( WINDOW_FIRSTCHILD );
if( pWinTemp && pWinTemp->GetType() == WINDOW_EDIT )
{
if( !( pWinTemp->GetStyle() & WB_READONLY) ||
!((Edit*)pWinTemp)->IsReadOnly() )
rStateSet.AddState( accessibility::AccessibleStateType::EDITABLE );
break;
}
if( pChild->GetType() == WINDOW_EDIT )
{
if( !( pChild->GetStyle() & WB_READONLY) ||
!((Edit*)pChild)->IsReadOnly())
rStateSet.AddState( accessibility::AccessibleStateType::EDITABLE );
break;
}
pChild = pChild->GetWindow( WINDOW_NEXT );
}
} }
else else
{ {
...@@ -767,6 +801,9 @@ sal_Int32 SAL_CALL VCLXAccessibleComponent::getForeground( ) throw (uno::Runtim ...@@ -767,6 +801,9 @@ sal_Int32 SAL_CALL VCLXAccessibleComponent::getForeground( ) throw (uno::Runtim
else else
aFont = pWindow->GetFont(); aFont = pWindow->GetFont();
nColor = aFont.GetColor().GetColor(); nColor = aFont.GetColor().GetColor();
// COL_AUTO is not very meaningful for AT
if ( nColor == (sal_Int32)COL_AUTO)
nColor = pWindow->GetTextColor().GetColor();
} }
} }
......
...@@ -4798,6 +4798,17 @@ VCLXDateField::~VCLXDateField() ...@@ -4798,6 +4798,17 @@ VCLXDateField::~VCLXDateField()
{ {
} }
//change the window type here to match the role
::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext > VCLXDateField::CreateAccessibleContext()
{
Window* pWindow = GetWindow();
if ( pWindow )
{
pWindow->SetType( WINDOW_DATEFIELD );
}
return getAccessibleFactory().createAccessibleContext( this );
}
// ::com::sun::star::uno::XInterface // ::com::sun::star::uno::XInterface
::com::sun::star::uno::Any VCLXDateField::queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) ::com::sun::star::uno::Any VCLXDateField::queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException)
{ {
...@@ -5135,6 +5146,17 @@ VCLXTimeField::~VCLXTimeField() ...@@ -5135,6 +5146,17 @@ VCLXTimeField::~VCLXTimeField()
{ {
} }
//change the window type here to match the role
::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleContext > VCLXTimeField::CreateAccessibleContext()
{
Window* pWindow = GetWindow();
if ( pWindow )
{
pWindow->SetType( WINDOW_TIMEFIELD );
}
return getAccessibleFactory().createAccessibleContext( this );
}
// ::com::sun::star::uno::XInterface // ::com::sun::star::uno::XInterface
::com::sun::star::uno::Any VCLXTimeField::queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException) ::com::sun::star::uno::Any VCLXTimeField::queryInterface( const ::com::sun::star::uno::Type & rType ) throw(::com::sun::star::uno::RuntimeException)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment