Kaydet (Commit) 83b53164 authored tarafından Matthew J. Francis's avatar Matthew J. Francis Kaydeden (comit) Matthew Francis

Add an a11y action for items in the Special Characters dialog

Change-Id: I53fef3f151f66be775655ceef623a7d564c66f1a
Reviewed-on: https://gerrit.libreoffice.org/16771Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarMatthew Francis <mjay.francis@gmail.com>
üst 122a15f4
......@@ -65,6 +65,7 @@ public:
int LastInView() const;
int PixelToMapIndex( const Point&) const;
void SelectIndex( int index, bool bFocus = false );
void OutputIndex( int index );
void DeSelect();
inline bool IsSelected(sal_uInt16 _nPos) const { return _nPos == nSelectedIndex; }
inline sal_uInt16 GetSelectIndexId() const { return sal::static_int_cast<sal_uInt16>(nSelectedIndex); }
......
......@@ -625,8 +625,8 @@ SvxShowCharSetItemAcc::~SvxShowCharSetItemAcc()
delete getExternalLock();
}
IMPLEMENT_FORWARD_XINTERFACE2( SvxShowCharSetItemAcc, OAccessibleComponentHelper, OAccessibleHelper_Base_2 )
IMPLEMENT_FORWARD_XTYPEPROVIDER2( SvxShowCharSetItemAcc, OAccessibleComponentHelper, OAccessibleHelper_Base_2 )
IMPLEMENT_FORWARD_XINTERFACE2( SvxShowCharSetItemAcc, OAccessibleComponentHelper, OAccessibleHelper_Base_3 )
IMPLEMENT_FORWARD_XTYPEPROVIDER2( SvxShowCharSetItemAcc, OAccessibleComponentHelper, OAccessibleHelper_Base_3 )
void SvxShowCharSetItemAcc::ParentDestroyed()
......@@ -762,6 +762,47 @@ uno::Reference< css::accessibility::XAccessibleStateSet > SAL_CALL SvxShowCharSe
return pStateSet;
}
sal_Int32 SvxShowCharSetItemAcc::getAccessibleActionCount() throw (RuntimeException, std::exception)
{
return 1;
}
sal_Bool SvxShowCharSetItemAcc::doAccessibleAction ( sal_Int32 nIndex ) throw (IndexOutOfBoundsException, RuntimeException, std::exception)
{
OExternalLockGuard aGuard( this );
if( nIndex == 0 )
{
mpParent->mrParent.OutputIndex( mpParent->mnId );
return 1;
}
throw IndexOutOfBoundsException();
}
OUString SvxShowCharSetItemAcc::getAccessibleActionDescription ( sal_Int32 nIndex ) throw (IndexOutOfBoundsException, RuntimeException, std::exception)
{
if( nIndex == 0 )
return OUString( "press" );
throw IndexOutOfBoundsException();
}
Reference< css::accessibility::XAccessibleKeyBinding > SvxShowCharSetItemAcc::getAccessibleActionKeyBinding( sal_Int32 nIndex ) throw (css::lang::IndexOutOfBoundsException, uno::RuntimeException, std::exception)
{
if( nIndex == 0 )
return Reference< css::accessibility::XAccessibleKeyBinding >();
throw IndexOutOfBoundsException();
}
void SAL_CALL SvxShowCharSetItemAcc::grabFocus()
throw (uno::RuntimeException, std::exception)
{
......
......@@ -662,6 +662,15 @@ void SvxShowCharSet::SelectIndex( int nNewIndex, bool bFocus )
void SvxShowCharSet::OutputIndex( int nNewIndex )
{
SelectIndex( nNewIndex, true );
aSelectHdl.Call( this );
}
void SvxShowCharSet::SelectCharacter( sal_UCS4 cNew, bool bFocus )
{
if (mpFontCharMap == nullptr)
......
......@@ -23,6 +23,7 @@
#include <osl/mutex.hxx>
#include <vcl/image.hxx>
#include <comphelper/accessibleselectionhelper.hxx>
#include <com/sun/star/accessibility/XAccessibleAction.hpp>
#include <com/sun/star/accessibility/XAccessibleTable.hpp>
#include <vector>
......@@ -209,10 +210,14 @@ namespace svx
// - SvxShowCharSetItemAcc -
typedef ::cppu::ImplHelper2 < ::com::sun::star::accessibility::XAccessible,
::com::sun::star::accessibility::XAccessibleAction
> OAccessibleHelper_Base_3;
/** The child implementation of the table.
*/
class SvxShowCharSetItemAcc : public ::comphelper::OAccessibleComponentHelper,
public OAccessibleHelper_Base_2
public OAccessibleHelper_Base_3
{
private:
SvxShowCharSetItem* mpParent;
......@@ -252,6 +257,13 @@ namespace svx
virtual sal_Int32 SAL_CALL getForeground( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE { return mpParent->m_pParent->getForeground(); }
virtual sal_Int32 SAL_CALL getBackground( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE { return mpParent->m_pParent->getBackground(); }
// XAccessibleAction
virtual sal_Int32 SAL_CALL getAccessibleActionCount( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
virtual sal_Bool SAL_CALL doAccessibleAction ( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
virtual ::rtl::OUString SAL_CALL getAccessibleActionDescription ( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessibleKeyBinding > SAL_CALL getAccessibleActionKeyBinding( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
inline void SAL_CALL fireEvent(
const sal_Int16 _nEventId,
const ::com::sun::star::uno::Any& _rOldValue,
......
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