summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorMatthew J. Francis <mjay.francis@gmail.com>2015-07-05 20:37:40 +0800
committerMatthew Francis <mjay.francis@gmail.com>2015-07-10 01:47:03 +0000
commit83b53164b096b4cba94a2e1ee8b620228bee8a3a (patch)
treee3b8a7da41bf02d6d43a96d8554fdc96184404bc /svx
parent122a15f4a6c09d35db58fe3a7b943b5ea79cbe65 (diff)
Add an a11y action for items in the Special Characters dialog
Change-Id: I53fef3f151f66be775655ceef623a7d564c66f1a Reviewed-on: https://gerrit.libreoffice.org/16771 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Matthew Francis <mjay.francis@gmail.com>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/accessibility/charmapacc.cxx45
-rw-r--r--svx/source/dialog/charmap.cxx9
-rw-r--r--svx/source/inc/charmapacc.hxx14
3 files changed, 65 insertions, 3 deletions
diff --git a/svx/source/accessibility/charmapacc.cxx b/svx/source/accessibility/charmapacc.cxx
index 69aff5d6feb8..a959ce60f151 100644
--- a/svx/source/accessibility/charmapacc.cxx
+++ b/svx/source/accessibility/charmapacc.cxx
@@ -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)
{
diff --git a/svx/source/dialog/charmap.cxx b/svx/source/dialog/charmap.cxx
index b7923ac61e8c..2972dbe04feb 100644
--- a/svx/source/dialog/charmap.cxx
+++ b/svx/source/dialog/charmap.cxx
@@ -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)
diff --git a/svx/source/inc/charmapacc.hxx b/svx/source/inc/charmapacc.hxx
index 1c09cfcd1ffd..7616ee88aa3f 100644
--- a/svx/source/inc/charmapacc.hxx
+++ b/svx/source/inc/charmapacc.hxx
@@ -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,