[Libreoffice-commits] core.git: 2 commits - accessibility/inc accessibility/source
Caolán McNamara
caolanm at redhat.com
Tue Nov 26 02:45:54 PST 2013
accessibility/inc/accessibility/extended/accessiblelistbox.hxx | 19
accessibility/inc/accessibility/extended/accessiblelistboxentry.hxx | 31
accessibility/inc/accessibility/extended/accessibletablistboxtable.hxx | 2
accessibility/inc/accessibility/extended/textwindowaccessibility.hxx | 13
accessibility/inc/accessibility/helper/IComboListBoxHelper.hxx | 1
accessibility/inc/accessibility/helper/accessiblestrings.hrc | 13
accessibility/inc/accessibility/helper/listboxhelper.hxx | 5
accessibility/inc/accessibility/standard/accessiblemenubasecomponent.hxx | 2
accessibility/inc/accessibility/standard/accessiblemenuitemcomponent.hxx | 2
accessibility/inc/accessibility/standard/vclxaccessiblebox.hxx | 22
accessibility/inc/accessibility/standard/vclxaccessiblelist.hxx | 12
accessibility/inc/accessibility/standard/vclxaccessiblelistitem.hxx | 5
accessibility/inc/accessibility/standard/vclxaccessiblemenu.hxx | 3
accessibility/inc/accessibility/standard/vclxaccessiblescrollbar.hxx | 4
accessibility/source/extended/AccessibleBrowseBoxHeaderCell.cxx | 1
accessibility/source/extended/accessibleeditbrowseboxcell.cxx | 9
accessibility/source/extended/accessibleiconchoicectrl.cxx | 31
accessibility/source/extended/accessibleiconchoicectrlentry.cxx | 3
accessibility/source/extended/accessiblelistbox.cxx | 254 +++++
accessibility/source/extended/accessiblelistboxentry.cxx | 347 +++++++-
accessibility/source/extended/accessibletablistboxtable.cxx | 57 +
accessibility/source/extended/textwindowaccessibility.cxx | 425 +++++++++-
accessibility/source/helper/accessiblestrings.src | 50 +
accessibility/source/helper/characterattributeshelper.cxx | 1
accessibility/source/standard/accessiblemenubasecomponent.cxx | 14
accessibility/source/standard/accessiblemenuitemcomponent.cxx | 19
accessibility/source/standard/vclxaccessiblebox.cxx | 235 +++++
accessibility/source/standard/vclxaccessiblebutton.cxx | 10
accessibility/source/standard/vclxaccessiblecheckbox.cxx | 5
accessibility/source/standard/vclxaccessiblelist.cxx | 356 +++++++-
accessibility/source/standard/vclxaccessiblelistitem.cxx | 11
accessibility/source/standard/vclxaccessiblemenu.cxx | 10
accessibility/source/standard/vclxaccessiblemenuitem.cxx | 17
accessibility/source/standard/vclxaccessibleradiobutton.cxx | 2
accessibility/source/standard/vclxaccessiblescrollbar.cxx | 20
accessibility/source/standard/vclxaccessibletabcontrol.cxx | 2
accessibility/source/standard/vclxaccessibletextcomponent.cxx | 52 +
accessibility/source/standard/vclxaccessibletoolbox.cxx | 45 -
accessibility/source/standard/vclxaccessibletoolboxitem.cxx | 40
39 files changed, 1943 insertions(+), 207 deletions(-)
New commits:
commit e579d453545c4fb00126c6d41636d3960785a166
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Nov 26 09:28:31 2013 +0000
Document::ProcessWindowEvent now just forwards to baseclass
Change-Id: Ia4c224105e15c8eea90a9c98161981ff10661044
diff --git a/accessibility/inc/accessibility/extended/textwindowaccessibility.hxx b/accessibility/inc/accessibility/extended/textwindowaccessibility.hxx
index a4d4ec7..72bb304 100644
--- a/accessibility/inc/accessibility/extended/textwindowaccessibility.hxx
+++ b/accessibility/inc/accessibility/extended/textwindowaccessibility.hxx
@@ -555,10 +555,6 @@ public:
css::uno::Reference< css::accessibility::XAccessibleRelationSet >
retrieveParagraphRelationSet( ParagraphImpl const * pParagraph );
-protected:
- // window event listener from base class
- virtual void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent );
-
private:
virtual ::sal_Int32 SAL_CALL getAccessibleChildCount()
throw (css::uno::RuntimeException);
diff --git a/accessibility/source/extended/textwindowaccessibility.cxx b/accessibility/source/extended/textwindowaccessibility.cxx
index 1278248..43782f7 100644
--- a/accessibility/source/extended/textwindowaccessibility.cxx
+++ b/accessibility/source/extended/textwindowaccessibility.cxx
@@ -1503,25 +1503,6 @@ Document::retrieveParagraphRelationSet( ParagraphImpl const * pParagraph )
return xSet;
}
-void Document::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent )
-{
- switch ( rVclWindowEvent.GetId() )
- {
- case VCLEVENT_WINDOW_GETFOCUS:
- case VCLEVENT_WINDOW_LOSEFOCUS:
- {
- // #107179# if our parent is a compound control (e.g. MultiLineEdit),
- // suppress the window focus events here
-// IAccessible2 implementation 2009
- //if ( !m_bCompoundControlChild )
- VCLXAccessibleComponent::ProcessWindowEvent( rVclWindowEvent );
- }
- break;
- default:
- VCLXAccessibleComponent::ProcessWindowEvent( rVclWindowEvent );
- }
-}
-
// virtual
::sal_Int32 SAL_CALL Document::getAccessibleChildCount()
throw (css::uno::RuntimeException)
commit efb23f29983f87104a684e7fab00b84fc59d131d
Author: Steve Yin <steve_y at apache.org>
Date: Mon Nov 25 15:24:55 2013 +0000
Integrate branch of IAccessible2
(cherry picked from commit e2f90c93c97f3cf137c348ed302c6470f398aa70)
Change-Id: I44ce0d69f3e7364038b00b1ba0f0d27e60132a37
WaE: Prevent uninitialized variable warnings.
(cherry picked from commit b989f4074ea70729d527b307bfbe49e01a0d3646)
diff --git a/accessibility/inc/accessibility/extended/accessiblelistbox.hxx b/accessibility/inc/accessibility/extended/accessiblelistbox.hxx
index 33147ad..9354e48 100644
--- a/accessibility/inc/accessibility/extended/accessiblelistbox.hxx
+++ b/accessibility/inc/accessibility/extended/accessiblelistbox.hxx
@@ -26,14 +26,16 @@
#include <vcl/vclevent.hxx>
#include <toolkit/awt/vclxaccessiblecomponent.hxx>
+#include <map>
// class AccessibleListBox -----------------------------------------------
class SvTreeListBox;
-
+class SvTreeListEntry;
//........................................................................
namespace accessibility
{
+ class AccessibleListBoxEntry;
//........................................................................
typedef ::cppu::ImplHelper2< ::com::sun::star::accessibility::XAccessible
@@ -62,6 +64,8 @@ namespace accessibility
SvTreeListBox* getListBox() const;
+ void RemoveChildEntries(SvTreeListEntry*);
+
public:
/** OAccessibleBase needs a valid view
@param _rListBox
@@ -107,6 +111,19 @@ namespace accessibility
sal_Int32 SAL_CALL getSelectedAccessibleChildCount( ) throw (::com::sun::star::uno::RuntimeException);
::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getSelectedAccessibleChild( sal_Int32 nSelectedChildIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
void SAL_CALL deselectAccessibleChild( sal_Int32 nSelectedChildIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+
+ // IA2 CWS
+ sal_Int32 SAL_CALL getRoleType();
+
+private:
+
+ typedef std::map< SvTreeListEntry*, ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > > MAP_ENTRY;
+ MAP_ENTRY m_mapEntry;
+
+ ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > m_xFocusedChild;
+
+ accessibility::AccessibleListBoxEntry* GetCurEventEntry( const VclWindowEvent& rVclWindowEvent );
+
};
//........................................................................
diff --git a/accessibility/inc/accessibility/extended/accessiblelistboxentry.hxx b/accessibility/inc/accessibility/extended/accessiblelistboxentry.hxx
index 0ff3de3..4eff637 100644
--- a/accessibility/inc/accessibility/extended/accessiblelistboxentry.hxx
+++ b/accessibility/inc/accessibility/extended/accessiblelistboxentry.hxx
@@ -31,9 +31,11 @@
#include <com/sun/star/lang/DisposedException.hpp>
#include <com/sun/star/lang/XEventListener.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
-#include <cppuhelper/compbase8.hxx>
+#include <com/sun/star/accessibility/XAccessibleValue.hpp>
+#include <cppuhelper/compbase9.hxx>
#include <comphelper/broadcasthelper.hxx>
#include <comphelper/accessibletexthelper.hxx>
+#include <svtools/treelistentry.hxx>
#include <tools/gen.hxx>
#include "accessibility/extended/listboxaccessible.hxx"
@@ -55,7 +57,7 @@ namespace accessibility
//........................................................................
// class AccessibleListBoxEntry ------------------------------------------
-
+/*
typedef ::cppu::WeakAggComponentImplHelper8< ::com::sun::star::accessibility::XAccessible
, ::com::sun::star::accessibility::XAccessibleContext
, ::com::sun::star::accessibility::XAccessibleComponent
@@ -64,6 +66,16 @@ namespace accessibility
, ::com::sun::star::accessibility::XAccessibleSelection
, ::com::sun::star::accessibility::XAccessibleText
, ::com::sun::star::lang::XServiceInfo > AccessibleListBoxEntry_BASE;
+*/
+ typedef ::cppu::WeakAggComponentImplHelper9< ::com::sun::star::accessibility::XAccessible
+ , ::com::sun::star::accessibility::XAccessibleContext
+ , ::com::sun::star::accessibility::XAccessibleComponent
+ , ::com::sun::star::accessibility::XAccessibleEventBroadcaster
+ , ::com::sun::star::accessibility::XAccessibleAction
+ , ::com::sun::star::accessibility::XAccessibleSelection
+ , ::com::sun::star::accessibility::XAccessibleText
+ , ::com::sun::star::accessibility::XAccessibleValue
+ , ::com::sun::star::lang::XServiceInfo > AccessibleListBoxEntry_BASE;
/** the class AccessibleListBoxEntry represents the class for an accessible object of a listbox entry */
class AccessibleListBoxEntry:public ::comphelper::OBaseMutex
@@ -76,6 +88,8 @@ namespace accessibility
private:
/** The treelistbox control */
::std::deque< sal_Int32 > m_aEntryPath;
+ SvTreeListEntry* m_pSvLBoxEntry; // Needed for a11y focused item...
+
protected:
/// client id in the AccessibleEventNotifier queue
@@ -94,6 +108,8 @@ namespace accessibility
Rectangle GetBoundingBoxOnScreen() throw ( ::com::sun::star::lang::DisposedException );
void EnsureIsAlive() const throw ( ::com::sun::star::lang::DisposedException );
+ void NotifyAccessibleEvent( sal_Int16 _nEventId, const ::com::sun::star::uno::Any& _aOldValue, const ::com::sun::star::uno::Any& _aNewValue );
+
protected:
virtual ~AccessibleListBoxEntry();
@@ -122,6 +138,9 @@ namespace accessibility
const ::com::sun::star::uno::Reference<
::com::sun::star::accessibility::XAccessible >& _xParent );
+ SvTreeListEntry* GetSvLBoxEntry() const { return m_pSvLBoxEntry; }
+
+
protected:
// XTypeProvider
virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() throw (::com::sun::star::uno::RuntimeException);
@@ -199,9 +218,15 @@ namespace accessibility
sal_Int32 SAL_CALL getSelectedAccessibleChildCount( ) throw (::com::sun::star::uno::RuntimeException);
::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getSelectedAccessibleChild( sal_Int32 nSelectedChildIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
void SAL_CALL deselectAccessibleChild( sal_Int32 nSelectedChildIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
-
+ virtual ::com::sun::star::uno::Any SAL_CALL getCurrentValue( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual sal_Bool SAL_CALL setCurrentValue( const ::com::sun::star::uno::Any& aNumber ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Any SAL_CALL getMaximumValue( ) throw (::com::sun::star::uno::RuntimeException);
+ virtual ::com::sun::star::uno::Any SAL_CALL getMinimumValue( ) throw (::com::sun::star::uno::RuntimeException);
private:
::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > implGetParentAccessible( ) const;
+ SvTreeListEntry* GetRealChild(sal_Int32 nIndex);
+ public:
+ sal_Int32 SAL_CALL getRoleType();
};
//........................................................................
diff --git a/accessibility/inc/accessibility/extended/accessibletablistboxtable.hxx b/accessibility/inc/accessibility/extended/accessibletablistboxtable.hxx
index 7b84cea..7d97b77 100644
--- a/accessibility/inc/accessibility/extended/accessibletablistboxtable.hxx
+++ b/accessibility/inc/accessibility/extended/accessibletablistboxtable.hxx
@@ -39,6 +39,8 @@ class AccessibleTabListBoxTable : public AccessibleBrowseBoxTable, public Access
private:
SvHeaderTabListBox* m_pTabListBox;
+ ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > m_xCurChild;
+
void ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent );
DECL_LINK( WindowEventListener, VclSimpleEvent* );
diff --git a/accessibility/inc/accessibility/extended/textwindowaccessibility.hxx b/accessibility/inc/accessibility/extended/textwindowaccessibility.hxx
index b707c8c..a4d4ec7 100644
--- a/accessibility/inc/accessibility/extended/textwindowaccessibility.hxx
+++ b/accessibility/inc/accessibility/extended/textwindowaccessibility.hxx
@@ -48,6 +48,10 @@
#include <comphelper/accessibletexthelper.hxx>
#include <rtl/ref.hxx>
+#include "svtools/svtools.hrc"
+#include <vcl/svapp.hxx>
+#include <unotools/accessiblerelationsethelper.hxx>
+#include <com/sun/star/accessibility/AccessibleRelationType.hpp>
#include <memory>
#include <queue>
#include <boost/unordered_map.hpp>
@@ -571,6 +575,9 @@ private:
SAL_CALL getAccessibleAtPoint(css::awt::Point const & rPoint)
throw (css::uno::RuntimeException);
+ virtual void FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet );
+ virtual void FillAccessibleRelationSet( utl::AccessibleRelationSetHelper& rRelationSet );
+
// ??? Will be called with both the external (Solar) and internal mutex
// locked:
virtual void SAL_CALL disposing();
@@ -622,6 +629,8 @@ private:
void handleSelectionChangeNotification();
void notifySelectionChange( sal_Int32 nFirst, sal_Int32 nLast );
+ ::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);
void justifySelection( TextPaM& rTextStart, TextPaM& rTextEnd );
diff --git a/accessibility/inc/accessibility/helper/IComboListBoxHelper.hxx b/accessibility/inc/accessibility/helper/IComboListBoxHelper.hxx
index 357166c..a4a88e6 100644
--- a/accessibility/inc/accessibility/helper/IComboListBoxHelper.hxx
+++ b/accessibility/inc/accessibility/helper/IComboListBoxHelper.hxx
@@ -43,6 +43,7 @@ namespace accessibility
virtual Rectangle GetBoundingRectangle( sal_uInt16 nItem ) const = 0;
virtual Rectangle GetWindowExtentsRelative( Window* pRelativeWindow ) = 0;
virtual bool IsActive() const = 0;
+ virtual bool IsEnabled() const = 0;
virtual bool IsEntryVisible( sal_uInt16 nPos ) const = 0;
virtual sal_uInt16 GetDisplayLineCount() const = 0;
virtual void GetMaxVisColumnsAndLines( sal_uInt16& rnCols, sal_uInt16& rnLines ) const = 0;
diff --git a/accessibility/inc/accessibility/helper/accessiblestrings.hrc b/accessibility/inc/accessibility/helper/accessiblestrings.hrc
index 4df9a81..03815d8 100644
--- a/accessibility/inc/accessibility/helper/accessiblestrings.hrc
+++ b/accessibility/inc/accessibility/helper/accessiblestrings.hrc
@@ -35,7 +35,18 @@
#define RID_STR_ACC_ACTION_DECLINE ( RID_TK_ACC_START + 4 )
#define RID_STR_ACC_ACTION_INCBLOCK ( RID_TK_ACC_START + 5 )
#define RID_STR_ACC_ACTION_DECBLOCK ( RID_TK_ACC_START + 6 )
-
+#define RID_STR_ACC_NAME_PREVIEW ( RID_TK_ACC_START + 7 )
+
+#define STR_SVT_ACC_ACTION_EXPAND ( RID_TK_ACC_START + 8 )
+#define STR_SVT_ACC_ACTION_COLLAPSE ( RID_TK_ACC_START + 9 )
+#define STR_SVT_ACC_LISTENTRY_SELCTED_STATE ( RID_TK_ACC_START + 10 )
+
+#define RID_STR_ACC_ACTION_CHECK ( RID_TK_ACC_START + 11 )
+#define RID_STR_ACC_ACTION_UNCHECK ( RID_TK_ACC_START + 12 )
+#define RID_STR_ACC_ACTION_DOUBLE_CLICK ( RID_TK_ACC_START + 13 )
+#define RID_STR_ACC_SCROLLBAR_NAME_VERTICAL ( RID_TK_ACC_START + 14 )
+#define RID_STR_ACC_SCROLLBAR_NAME_HORIZONTAL ( RID_TK_ACC_START + 15 )
+#define RID_STR_ACC_PANEL_DESCRIPTION ( RID_TK_ACC_START + 16 )
#define RID_STR_ACC_NAME_BROWSEBUTTON ( RID_TK_ACC_START + 100 )
#define RID_STR_ACC_DESC_PANELDECL_TABBAR ( RID_TK_ACC_START + 101 )
diff --git a/accessibility/inc/accessibility/helper/listboxhelper.hxx b/accessibility/inc/accessibility/helper/listboxhelper.hxx
index 8da885d..f42bc26 100644
--- a/accessibility/inc/accessibility/helper/listboxhelper.hxx
+++ b/accessibility/inc/accessibility/helper/listboxhelper.hxx
@@ -86,6 +86,11 @@ public:
return m_aComboListBox.IsActive();
}
// -----------------------------------------------------------------------------
+ virtual bool IsEnabled() const
+ {
+ return m_aComboListBox.IsEnabled();
+ }
+ // -----------------------------------------------------------------------------
virtual bool IsEntryVisible( sal_uInt16 nPos ) const
{
sal_uInt16 nTopEntry = m_aComboListBox.GetTopEntry();
diff --git a/accessibility/inc/accessibility/standard/accessiblemenubasecomponent.hxx b/accessibility/inc/accessibility/standard/accessiblemenubasecomponent.hxx
index fbc1a62..e9e745a 100644
--- a/accessibility/inc/accessibility/standard/accessiblemenubasecomponent.hxx
+++ b/accessibility/inc/accessibility/standard/accessiblemenubasecomponent.hxx
@@ -103,6 +103,8 @@ protected:
virtual sal_Bool IsHighlighted();
sal_Bool IsChildHighlighted();
+ virtual sal_Bool IsMenuHideDisabledEntries();
+
void SelectChild( sal_Int32 i );
void DeSelectAll();
sal_Bool IsChildSelected( sal_Int32 i );
diff --git a/accessibility/inc/accessibility/standard/accessiblemenuitemcomponent.hxx b/accessibility/inc/accessibility/standard/accessiblemenuitemcomponent.hxx
index b70b537..830532a 100644
--- a/accessibility/inc/accessibility/standard/accessiblemenuitemcomponent.hxx
+++ b/accessibility/inc/accessibility/standard/accessiblemenuitemcomponent.hxx
@@ -49,6 +49,8 @@ protected:
void SetItemText( const OUString& sItemText );
OUString GetItemText();
+ virtual sal_Bool IsMenuHideDisabledEntries();
+
virtual void FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet );
// OCommonAccessibleComponent
diff --git a/accessibility/inc/accessibility/standard/vclxaccessiblebox.hxx b/accessibility/inc/accessibility/standard/vclxaccessiblebox.hxx
index 9b8e37f..9e6cfa8 100644
--- a/accessibility/inc/accessibility/standard/vclxaccessiblebox.hxx
+++ b/accessibility/inc/accessibility/standard/vclxaccessiblebox.hxx
@@ -24,11 +24,13 @@
#include <accessibility/standard/vclxaccessibleedit.hxx>
#include <com/sun/star/accessibility/AccessibleRole.hpp>
#include <com/sun/star/accessibility/XAccessibleKeyBinding.hpp>
-#include <cppuhelper/implbase2.hxx>
+#include <com/sun/star/accessibility/XAccessibleValue.hpp>
+#include <cppuhelper/implbase3.hxx>
-typedef ::cppu::ImplHelper2<
+typedef ::cppu::ImplHelper3<
::com::sun::star::accessibility::XAccessible,
+ ::com::sun::star::accessibility::XAccessibleValue,
::com::sun::star::accessibility::XAccessibleAction
> VCLXAccessibleBox_BASE;
@@ -121,7 +123,22 @@ public:
*/
virtual void SAL_CALL disposing (void);
+ //===== XAccessibleValue ================================================
+ virtual ::com::sun::star::uno::Any SAL_CALL getCurrentValue( )
+ throw (::com::sun::star::uno::RuntimeException);
+
+ virtual sal_Bool SAL_CALL setCurrentValue(
+ const ::com::sun::star::uno::Any& aNumber )
+ throw (::com::sun::star::uno::RuntimeException);
+
+ virtual ::com::sun::star::uno::Any SAL_CALL getMaximumValue( )
+ throw (::com::sun::star::uno::RuntimeException);
+
+ virtual ::com::sun::star::uno::Any SAL_CALL getMinimumValue( )
+ throw (::com::sun::star::uno::RuntimeException);
+ bool IsDropDownBox() {return m_bIsDropDownBox;};
+ BoxType GetBoxType() { return m_aBoxType;};
protected:
/** Specifies whether the box is a combo box or a list box. List boxes
have multi selection.
@@ -162,6 +179,7 @@ protected:
virtual void ProcessWindowChildEvent (const VclWindowEvent& rVclWindowEvent);
virtual void ProcessWindowEvent (const VclWindowEvent& rVclWindowEvent);
+ virtual void FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet );
private:
/// Index in parent. This is settable from the outside.
diff --git a/accessibility/inc/accessibility/standard/vclxaccessiblelist.hxx b/accessibility/inc/accessibility/standard/vclxaccessiblelist.hxx
index 29a8f10..ba0f2b7 100644
--- a/accessibility/inc/accessibility/standard/vclxaccessiblelist.hxx
+++ b/accessibility/inc/accessibility/standard/vclxaccessiblelist.hxx
@@ -68,6 +68,7 @@ public:
/** Process some of the events and delegate the rest to the base classes.
*/
virtual void ProcessWindowEvent (const VclWindowEvent& rVclWindowEvent);
+ virtual void FillAccessibleRelationSet( utl::AccessibleRelationSetHelper& rRelationSet );
/** Called on reception of selection events this method checks all known
list items for a possible change in their selection state and
@@ -135,7 +136,14 @@ public:
virtual void SAL_CALL deselectAccessibleChild( sal_Int32 nSelectedChildIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::awt::Point SAL_CALL getLocationOnScreen( ) throw (::com::sun::star::uno::RuntimeException);
-
+ sal_Bool IsInDropDown();
+ void HandleDropOpen();
+ virtual void ProcessWindowEvent (const VclWindowEvent& rVclWindowEvent, bool b_IsDropDownList);
+ void UpdateSelection_Acc (::rtl::OUString sTextOfSelectedItem, bool b_IsDropDownList);
+ void UpdateSelection_Impl_Acc (bool b_IsDropDownList);
+
+ void UpdateFocus_Impl_Acc ( sal_uInt16 nPos, bool b_IsDropDownList) ;
+ void NotifyListItem(::com::sun::star::uno::Any& val);
protected:
BoxType m_aBoxType;
::accessibility::IComboListBoxHelper* m_pListBoxHelper;
@@ -147,7 +155,7 @@ protected:
sal_uInt16 m_nLastSelectedPos;
bool m_bDisableProcessEvent;
bool m_bVisible;
-
+ sal_uInt16 m_nCurSelectedPos;
/// The currently selected item.
diff --git a/accessibility/inc/accessibility/standard/vclxaccessiblelistitem.hxx b/accessibility/inc/accessibility/standard/vclxaccessiblelistitem.hxx
index 885d3e4..1bd28d7 100644
--- a/accessibility/inc/accessibility/standard/vclxaccessiblelistitem.hxx
+++ b/accessibility/inc/accessibility/standard/vclxaccessiblelistitem.hxx
@@ -83,9 +83,9 @@ private:
@param _aNewValue
is the new value
*/
- void NotifyAccessibleEvent( sal_Int16 _nEventId,
+ /*void NotifyAccessibleEvent( sal_Int16 _nEventId,
const ::com::sun::star::uno::Any& _aOldValue,
- const ::com::sun::star::uno::Any& _aNewValue );
+ const ::com::sun::star::uno::Any& _aNewValue );*/
protected:
virtual ~VCLXAccessibleListItem();
@@ -111,6 +111,7 @@ public:
sal_Int32 _nIndexInParent,
const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& _xParent );
+ void NotifyAccessibleEvent( sal_Int16 _nEventId, const ::com::sun::star::uno::Any& _aOldValue, const ::com::sun::star::uno::Any& _aNewValue );
inline sal_Bool IsSelected() const { return m_bSelected; }
void SetSelected( sal_Bool _bSelected );
diff --git a/accessibility/inc/accessibility/standard/vclxaccessiblemenu.hxx b/accessibility/inc/accessibility/standard/vclxaccessiblemenu.hxx
index 5f1bc4b..9e017ec 100644
--- a/accessibility/inc/accessibility/standard/vclxaccessiblemenu.hxx
+++ b/accessibility/inc/accessibility/standard/vclxaccessiblemenu.hxx
@@ -70,6 +70,9 @@ public:
virtual sal_Int32 SAL_CALL getSelectedAccessibleChildCount( ) throw (::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > SAL_CALL getSelectedAccessibleChild( sal_Int32 nSelectedChildIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL deselectAccessibleChild( sal_Int32 nChildIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
+
+ // XAccessibleAction
+ virtual ::rtl::OUString SAL_CALL getAccessibleActionDescription ( sal_Int32 nIndex ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::uno::RuntimeException);
};
#endif // ACCESSIBILITY_STANDARD_VCLXACCESSIBLEMENU_HXX
diff --git a/accessibility/inc/accessibility/standard/vclxaccessiblescrollbar.hxx b/accessibility/inc/accessibility/standard/vclxaccessiblescrollbar.hxx
index f8396a3..f26ef23 100644
--- a/accessibility/inc/accessibility/standard/vclxaccessiblescrollbar.hxx
+++ b/accessibility/inc/accessibility/standard/vclxaccessiblescrollbar.hxx
@@ -69,6 +69,10 @@ public:
virtual sal_Bool SAL_CALL setCurrentValue( const ::com::sun::star::uno::Any& aNumber ) throw (::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Any SAL_CALL getMaximumValue( ) throw (::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Any SAL_CALL getMinimumValue( ) throw (::com::sun::star::uno::RuntimeException);
+
+ // XAccessibleContext
+ ::rtl::OUString SAL_CALL getAccessibleName( ) throw (::com::sun::star::uno::RuntimeException);
+
};
#endif // ACCESSIBILITY_STANDARD_VCLXACCESSIBLESCROLLBAR_HXX
diff --git a/accessibility/source/extended/AccessibleBrowseBoxHeaderCell.cxx b/accessibility/source/extended/AccessibleBrowseBoxHeaderCell.cxx
index 925aa55..270f057 100644
--- a/accessibility/source/extended/AccessibleBrowseBoxHeaderCell.cxx
+++ b/accessibility/source/extended/AccessibleBrowseBoxHeaderCell.cxx
@@ -61,6 +61,7 @@ AccessibleBrowseBoxHeaderCell::AccessibleBrowseBoxHeaderCell(sal_Int32 _nColumnR
pStateSetHelper->AddState( AccessibleStateType::SHOWING );
SolarMutexGuard aSolarGuard;
+ mpBrowseBox->FillAccessibleStateSet( *pStateSetHelper, getType() );
pStateSetHelper->AddState( AccessibleStateType::VISIBLE );
pStateSetHelper->AddState( AccessibleStateType::FOCUSABLE );
pStateSetHelper->AddState( AccessibleStateType::TRANSIENT );
diff --git a/accessibility/source/extended/accessibleeditbrowseboxcell.cxx b/accessibility/source/extended/accessibleeditbrowseboxcell.cxx
index 3c601c6..5adf32b8 100644
--- a/accessibility/source/extended/accessibleeditbrowseboxcell.cxx
+++ b/accessibility/source/extended/accessibleeditbrowseboxcell.cxx
@@ -119,12 +119,9 @@ namespace accessibility
SolarMethodGuard aGuard( *this );
// TODO: localize this!
- OUStringBuffer sName(mpBrowseBox->GetColumnDescription( ::sal::static_int_cast< sal_uInt16 >( getColumnPos() ) ));
- if ( sName.isEmpty() )
- {
- sName.appendAscii("Column ");
- sName.append(getColumnPos());
- }
+ OUStringBuffer sName;
+ sName.appendAscii("Column ");
+ sName.append(getColumnPos()-1);
sName.appendAscii(", Row ");
sName.append(getRowPos());
diff --git a/accessibility/source/extended/accessibleiconchoicectrl.cxx b/accessibility/source/extended/accessibleiconchoicectrl.cxx
index 869ec89..460ee4d 100644
--- a/accessibility/source/extended/accessibleiconchoicectrl.cxx
+++ b/accessibility/source/extended/accessibleiconchoicectrl.cxx
@@ -69,11 +69,36 @@ namespace accessibility
// modified selection. The active descendant event is
// send after that so that the receiving AT has time to
// read the text or name of the active child.
- NotifyAccessibleEvent( AccessibleEventId::SELECTION_CHANGED, Any(), Any() );
+// NotifyAccessibleEvent( AccessibleEventId::SELECTION_CHANGED, Any(), Any() );
+
+ if ( getCtrl() && getCtrl()->HasFocus() )
+ {
+ SvxIconChoiceCtrlEntry* pEntry = static_cast< SvxIconChoiceCtrlEntry* >( rVclWindowEvent.GetData() );
+ if ( pEntry )
+ {
+ sal_uLong nPos = getCtrl()->GetEntryListPos( pEntry );
+ Reference< XAccessible > xChild = new AccessibleIconChoiceCtrlEntry( *getCtrl(), nPos, this );
+ uno::Any aOldValue, aNewValue;
+ aNewValue <<= xChild;
+ NotifyAccessibleEvent( AccessibleEventId::ACTIVE_DESCENDANT_CHANGED, aOldValue, aNewValue );
+
+ NotifyAccessibleEvent( AccessibleEventId::SELECTION_CHANGED, aOldValue, aNewValue );
+
+ }
+ }
+ break;
+ }
+ case VCLEVENT_WINDOW_GETFOCUS :
+ {
SvtIconChoiceCtrl* pCtrl = getCtrl();
if ( pCtrl && pCtrl->HasFocus() )
{
SvxIconChoiceCtrlEntry* pEntry = static_cast< SvxIconChoiceCtrlEntry* >( rVclWindowEvent.GetData() );
+ if ( pEntry == NULL )
+ {
+ sal_uLong nPos=0;
+ pEntry = getCtrl()->GetSelectedEntry ( nPos );
+ }
if ( pEntry )
{
sal_uLong nPos = pCtrl->GetEntryListPos( pEntry );
@@ -81,6 +106,7 @@ namespace accessibility
uno::Any aOldValue, aNewValue;
aNewValue <<= xChild;
NotifyAccessibleEvent( AccessibleEventId::ACTIVE_DESCENDANT_CHANGED, aOldValue, aNewValue );
+ NotifyAccessibleEvent( AccessibleEventId::SELECTION_CHANGED, aOldValue, aNewValue );
}
}
break;
@@ -174,7 +200,8 @@ namespace accessibility
// -----------------------------------------------------------------------------
sal_Int16 SAL_CALL AccessibleIconChoiceCtrl::getAccessibleRole( ) throw (RuntimeException)
{
- return AccessibleRole::TREE;
+ //return AccessibleRole::TREE;
+ return AccessibleRole::LIST;
}
// -----------------------------------------------------------------------------
OUString SAL_CALL AccessibleIconChoiceCtrl::getAccessibleDescription( ) throw (RuntimeException)
diff --git a/accessibility/source/extended/accessibleiconchoicectrlentry.cxx b/accessibility/source/extended/accessibleiconchoicectrlentry.cxx
index d36c8a9..2217d82 100644
--- a/accessibility/source/extended/accessibleiconchoicectrlentry.cxx
+++ b/accessibility/source/extended/accessibleiconchoicectrlentry.cxx
@@ -307,7 +307,8 @@ throw(RuntimeException)
// -----------------------------------------------------------------------------
sal_Int16 SAL_CALL AccessibleIconChoiceCtrlEntry::getAccessibleRole( ) throw (RuntimeException)
{
- return AccessibleRole::LABEL;
+ //return AccessibleRole::LABEL;
+ return AccessibleRole::LIST_ITEM;
}
// -----------------------------------------------------------------------------
OUString SAL_CALL AccessibleIconChoiceCtrlEntry::getAccessibleDescription( ) throw (RuntimeException)
diff --git a/accessibility/source/extended/accessiblelistbox.cxx b/accessibility/source/extended/accessiblelistbox.cxx
index 63dc7add..2ebeb9d 100644
--- a/accessibility/source/extended/accessiblelistbox.cxx
+++ b/accessibility/source/extended/accessiblelistbox.cxx
@@ -20,6 +20,7 @@
#include <accessibility/extended/accessiblelistbox.hxx>
#include <accessibility/extended/accessiblelistboxentry.hxx>
#include <svtools/treelistbox.hxx>
+#include <svtools/treelistentry.hxx>
#include <com/sun/star/awt/Point.hpp>
#include <com/sun/star/awt/Rectangle.hpp>
#include <com/sun/star/awt/Size.hpp>
@@ -79,19 +80,25 @@ namespace accessibility
{
case VCLEVENT_CHECKBOX_TOGGLE :
{
- if ( getListBox() && getListBox()->HasFocus() )
+ if ( !getListBox() || !getListBox()->HasFocus() )
{
- SvTreeListEntry* pEntry = static_cast< SvTreeListEntry* >( rVclWindowEvent.GetData() );
- if ( !pEntry )
- pEntry = getListBox()->GetCurEntry();
+ return;
+ }
+ AccessibleListBoxEntry* pCurOpEntry = GetCurEventEntry(rVclWindowEvent);
+ if(!pCurOpEntry)
+ {
+ return ;
+ }
+ uno::Any aValue;
+ aValue <<= AccessibleStateType::CHECKED;
- if ( pEntry )
- {
- Reference< XAccessible > xChild = new AccessibleListBoxEntry( *getListBox(), pEntry, this );
- uno::Any aOldValue, aNewValue;
- aNewValue <<= xChild;
- NotifyAccessibleEvent( AccessibleEventId::ACTIVE_DESCENDANT_CHANGED, aOldValue, aNewValue );
- }
+ if ( getListBox()->GetCheckButtonState( pCurOpEntry->GetSvLBoxEntry() ) == SV_BUTTON_CHECKED )
+ {
+ pCurOpEntry->NotifyAccessibleEvent( AccessibleEventId::STATE_CHANGED, uno::Any(), aValue );
+ }
+ else
+ {
+ pCurOpEntry->NotifyAccessibleEvent( AccessibleEventId::STATE_CHANGED, aValue,uno::Any() );
}
break;
}
@@ -102,16 +109,101 @@ namespace accessibility
// modified selection. The active descendant event is
// send after that so that the receiving AT has time to
// read the text or name of the active child.
- NotifyAccessibleEvent( AccessibleEventId::SELECTION_CHANGED, Any(), Any() );
- if ( getListBox() && getListBox()->HasFocus() )
+ OSL_ASSERT(0 && "Debug: Treelist shouldn't use VCLEVENT_LISTBOX_SELECT");
+ }
+
+ case VCLEVENT_LISTBOX_TREESELECT:
+ {
+ if ( getListBox() && getListBox()->HasFocus() )
+ {
+ AccessibleListBoxEntry* pEntry =static_cast< AccessibleListBoxEntry* >(m_xFocusedChild.get());
+ if (pEntry)
+ {
+ pEntry->NotifyAccessibleEvent( AccessibleEventId::SELECTION_CHANGED, Any(), Any() );
+ }
+ }
+ }
+ break;
+ case VCLEVENT_LISTBOX_TREEFOCUS:
+ {
+ SvTreeListBox* pBox = getListBox();
+ sal_Bool bNeedFocus = sal_False;
+ if (pBox)
+ {
+ Window* pParent = ((Window*)pBox)->GetParent();
+ if (pParent && pParent->GetType() == WINDOW_FLOATINGWINDOW)
+ {
+ // MT: ImplGetAppSVData shouldn't be exported from VCL.
+ // In which scenario is this needed?
+ // If needed, we need to find an other solution
+ /*
+ ImplSVData* pSVData = ImplGetAppSVData();
+ if (pSVData && pSVData->maWinData.mpFirstFloat == (FloatingWindow*)pParent)
+ bNeedFocus = sal_True;
+ */
+ }
+ }
+ if( pBox && (pBox->HasFocus() || bNeedFocus) )
+ {
+ uno::Any aOldValue, aNewValue;
+ SvTreeListEntry* pEntry = static_cast< SvTreeListEntry* >( rVclWindowEvent.GetData() );
+ if ( pEntry )
+ {
+ AccessibleListBoxEntry* pEntryFocus =static_cast< AccessibleListBoxEntry* >(m_xFocusedChild.get());
+ if (pEntryFocus && pEntryFocus->GetSvLBoxEntry() == pEntry)
+ {
+ aOldValue <<= uno::Any();
+ aNewValue <<= m_xFocusedChild;
+ NotifyAccessibleEvent( AccessibleEventId::ACTIVE_DESCENDANT_CHANGED, aOldValue, aNewValue );
+ return ;
+ }
+
+ aOldValue <<= m_xFocusedChild;
+
+ MAP_ENTRY::iterator mi = m_mapEntry.find(pEntry);
+ if(mi != m_mapEntry.end())
+ {
+ OSL_ASSERT(mi->second.get() != NULL);
+ m_xFocusedChild = mi->second;
+ }
+ else
+ {
+ AccessibleListBoxEntry *pEntNew = new AccessibleListBoxEntry( *getListBox(), pEntry, NULL );
+ m_xFocusedChild = pEntNew;
+ m_mapEntry.insert(MAP_ENTRY::value_type(pEntry,pEntNew));
+ }
+
+ aNewValue <<= m_xFocusedChild;
+ NotifyAccessibleEvent( AccessibleEventId::ACTIVE_DESCENDANT_CHANGED, aOldValue, aNewValue );
+ }
+ else
+ {
+ aOldValue <<= uno::Any();
+ aNewValue <<= AccessibleStateType::FOCUSED;
+ NotifyAccessibleEvent( AccessibleEventId::STATE_CHANGED, aOldValue, aNewValue );
+ }
+ }
+ }
+ break;
+ case VCLEVENT_LISTBOX_ITEMREMOVED:
{
SvTreeListEntry* pEntry = static_cast< SvTreeListEntry* >( rVclWindowEvent.GetData() );
if ( pEntry )
{
- Reference< XAccessible > xChild = new AccessibleListBoxEntry( *getListBox(), pEntry, this );
- uno::Any aOldValue, aNewValue;
- aNewValue <<= xChild;
- NotifyAccessibleEvent( AccessibleEventId::ACTIVE_DESCENDANT_CHANGED, aOldValue, aNewValue );
+ RemoveChildEntries(pEntry);
+ }
+ else
+ {
+ // NULL means Clear()
+ MAP_ENTRY::iterator mi = m_mapEntry.begin();
+ for ( ; mi != m_mapEntry.end() ; ++mi)
+ {
+ uno::Any aNewValue;
+ uno::Any aOldValue;
+ aOldValue <<= mi->second;
+ NotifyAccessibleEvent( AccessibleEventId::CHILD, aOldValue, aNewValue );
+ }
+ m_mapEntry.clear();
}
}
break;
@@ -138,14 +230,71 @@ namespace accessibility
NotifyAccessibleEvent( AccessibleEventId::ACTIVE_DESCENDANT_CHANGED, Any(), aListBoxEntry );
}
}
- break;
- }
}
+ break;
default:
VCLXAccessibleComponent::ProcessWindowEvent (rVclWindowEvent);
}
}
}
+
+ AccessibleListBoxEntry* AccessibleListBox::GetCurEventEntry( const VclWindowEvent& rVclWindowEvent )
+ {
+ SvTreeListEntry* pEntry = static_cast< SvTreeListEntry* >( rVclWindowEvent.GetData() );
+ if ( !pEntry )
+ pEntry = getListBox()->GetCurEntry();
+
+ AccessibleListBoxEntry* pEntryFocus =static_cast< AccessibleListBoxEntry* >(m_xFocusedChild.get());
+ if (pEntryFocus && pEntry && pEntry != pEntryFocus->GetSvLBoxEntry())
+ {
+ AccessibleListBoxEntry *pAccCurOptionEntry =NULL;
+ MAP_ENTRY::iterator mi = m_mapEntry.find(pEntry);
+ if (mi != m_mapEntry.end())
+ {
+ pAccCurOptionEntry= static_cast< AccessibleListBoxEntry* >(mi->second.get());
+ }
+ else
+ {
+ pAccCurOptionEntry =new AccessibleListBoxEntry( *getListBox(), pEntry, NULL );
+ std::pair<MAP_ENTRY::iterator, bool> pairMi = m_mapEntry.insert(MAP_ENTRY::value_type(pAccCurOptionEntry->GetSvLBoxEntry(),pAccCurOptionEntry));
+ mi = pairMi.first;
+ }
+
+ uno::Any aNewValue;
+ aNewValue <<= mi->second;//xAcc
+ NotifyAccessibleEvent( AccessibleEventId::CHILD, uno::Any(), aNewValue );//Add
+
+ return pAccCurOptionEntry;
+ }
+ else
+ {
+ return pEntryFocus;
+ }
+ return NULL;
+ }
+
+ void AccessibleListBox::RemoveChildEntries(SvTreeListEntry* pEntry)
+ {
+ MAP_ENTRY::iterator mi = m_mapEntry.find(pEntry);
+ if ( mi != m_mapEntry.end() )
+ {
+ uno::Any aNewValue;
+ uno::Any aOldValue;
+ aOldValue <<= mi->second;
+ NotifyAccessibleEvent( AccessibleEventId::CHILD, aOldValue, aNewValue );
+
+ m_mapEntry.erase(mi);
+ }
+
+ SvTreeListBox* pBox = getListBox();
+ SvTreeListEntry* pEntryChild = pBox->FirstChild(pEntry);
+ while (pEntryChild)
+ {
+ RemoveChildEntries(pEntryChild);
+ pEntryChild = pBox->NextSibling(pEntryChild);
+ }
+ }
+
// -----------------------------------------------------------------------------
void AccessibleListBox::ProcessWindowChildEvent( const VclWindowEvent& rVclWindowEvent )
{
@@ -171,6 +320,7 @@ namespace accessibility
{
::osl::MutexGuard aGuard( m_aMutex );
+ m_mapEntry.clear();
VCLXAccessibleComponent::disposing();
m_xParent = NULL;
}
@@ -241,7 +391,9 @@ namespace accessibility
if ( !pEntry )
throw IndexOutOfBoundsException();
- return new AccessibleListBoxEntry( *getListBox(), pEntry, this );
+ // Solution: Set the parameter of the parent to null to let entry determine the parent by itself
+ //return new AccessibleListBoxEntry( *getListBox(), pEntry, this );
+ return new AccessibleListBoxEntry( *getListBox(), pEntry, NULL );
}
// -----------------------------------------------------------------------------
Reference< XAccessible > SAL_CALL AccessibleListBox::getAccessibleParent( ) throw (RuntimeException)
@@ -252,9 +404,54 @@ namespace accessibility
return m_xParent;
}
// -----------------------------------------------------------------------------
+ sal_Int32 SAL_CALL AccessibleListBox::getRoleType()
+ {
+ sal_Int32 nCase = 0;
+ SvTreeListEntry* pEntry = getListBox()->GetEntry(0);
+ if ( pEntry )
+ {
+ if( pEntry->HasChildrenOnDemand() || 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 AccessibleListBox::getAccessibleRole( ) throw (RuntimeException)
{
- return AccessibleRole::TREE;
+ if(getListBox())
+ {
+ short nType = getListBox()->GetAllEntriesAccessibleRoleType();
+ if( nType == TREEBOX_ALLITEM_ACCROLE_TYPE_TREE)
+ return AccessibleRole::TREE;
+ else if( nType == TREEBOX_ALLITEM_ACCROLE_TYPE_LIST)
+ return AccessibleRole::LIST;
+ }
+
+ //o is: return AccessibleRole::TREE;
+ sal_Bool bHasButtons = (getListBox()->GetStyle() & WB_HASBUTTONS)!=0;
+ if(!bHasButtons && (getListBox()->GetTreeFlags() & TREEFLAG_CHKBTN))
+ return AccessibleRole::LIST;
+ else
+ if(getRoleType() == 0)
+ return AccessibleRole::LIST;
+ else
+ return AccessibleRole::TREE;
}
// -----------------------------------------------------------------------------
OUString SAL_CALL AccessibleListBox::getAccessibleDescription( ) throw (RuntimeException)
@@ -337,16 +534,7 @@ namespace accessibility
ensureAlive();
- sal_Int32 nSelCount = 0;
- sal_Int32 nCount = getListBox()->GetLevelChildCount( NULL );
- for ( sal_Int32 i = 0; i < nCount; ++i )
- {
- SvTreeListEntry* pEntry = getListBox()->GetEntry( i );
- if ( getListBox()->IsSelected( pEntry ) )
- ++nSelCount;
- }
-
- return nSelCount;
+ return getListBox()->GetSelectionCount();
}
// -----------------------------------------------------------------------------
Reference< XAccessible > SAL_CALL AccessibleListBox::getSelectedAccessibleChild( sal_Int32 nSelectedChildIndex ) throw (IndexOutOfBoundsException, RuntimeException)
@@ -369,7 +557,9 @@ namespace accessibility
if ( nSelCount == ( nSelectedChildIndex + 1 ) )
{
- xChild = new AccessibleListBoxEntry( *getListBox(), pEntry, this );
+ // Solution: Set the parameter of the parent to null to let entry determine the parent by itself
+ //xChild = new AccessibleListBoxEntry( *getListBox(), pEntry, this );
+ xChild = new AccessibleListBoxEntry( *getListBox(), pEntry, NULL );
break;
}
}
diff --git a/accessibility/source/extended/accessiblelistboxentry.cxx b/accessibility/source/extended/accessiblelistboxentry.cxx
index 6bc4baa..851158f 100644
--- a/accessibility/source/extended/accessiblelistboxentry.cxx
+++ b/accessibility/source/extended/accessiblelistboxentry.cxx
@@ -20,6 +20,7 @@
#include "accessibility/extended/accessiblelistboxentry.hxx"
#include <svtools/treelistbox.hxx>
#include <svtools/stringtransfer.hxx>
+#include <svtools/svlbitm.hxx>
#include <com/sun/star/awt/Point.hpp>
#include <com/sun/star/awt/Rectangle.hpp>
#include <com/sun/star/awt/Size.hpp>
@@ -38,7 +39,9 @@
#include <comphelper/sequence.hxx>
#include <comphelper/accessibleeventnotifier.hxx>
#include <toolkit/helper/vclunohelper.hxx>
-
+#include <accessibility/helper/accresmgr.hxx>
+#include <accessibility/helper/accessiblestrings.hrc>
+#include <com/sun/star/accessibility/XAccessibleValue.hpp>
#define ACCESSIBLE_ACTION_COUNT 1
namespace
@@ -60,6 +63,7 @@ namespace accessibility
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star;
+ using namespace ::comphelper;
// -----------------------------------------------------------------------------
// Ctor() and Dtor()
@@ -71,6 +75,7 @@ namespace accessibility
AccessibleListBoxEntry_BASE ( m_aMutex ),
ListBoxAccessibleBase( _rListBox ),
+ m_pSvLBoxEntry ( _pEntry ),
m_nClientId ( 0 ),
m_aParent ( _xParent )
@@ -88,6 +93,19 @@ namespace accessibility
}
}
+ // 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
{
@@ -175,7 +193,7 @@ namespace accessibility
OUString sRet;
SvTreeListEntry* pEntry = getListBox()->GetEntryFromPath( m_aEntryPath );
if ( pEntry )
- sRet = getListBox()->SearchEntryText( pEntry );
+ sRet = getListBox()->SearchEntryTextWithHeadTitle( pEntry );
return sRet;
}
// -----------------------------------------------------------------------------
@@ -309,8 +327,7 @@ namespace accessibility
::osl::MutexGuard aGuard( m_aMutex );
EnsureIsAlive();
- SvTreeListEntry* pParent = getListBox()->GetEntryFromPath( m_aEntryPath );
- SvTreeListEntry* pEntry = pParent ? getListBox()->GetEntry( pParent, i ) : NULL;
+ SvTreeListEntry* pEntry = GetRealChild(i);
if ( !pEntry )
throw IndexOutOfBoundsException();
@@ -342,6 +359,8 @@ namespace accessibility
OSL_ENSURE( pParentEntry, "AccessibleListBoxEntry::implGetParentAccessible: could not obtain a parent entry!" );
if ( pParentEntry )
+ pParentEntry = getListBox()->GetParent(pParentEntry);
+ if ( pParentEntry )
xParent = new AccessibleListBoxEntry( *getListBox(), pParentEntry, NULL );
// note that we pass NULL here as parent-accessible:
// this is allowed, as the AccessibleListBoxEntry class will create it's parent
@@ -370,15 +389,103 @@ namespace accessibility
return m_aEntryPath.empty() ? -1 : m_aEntryPath.back();
}
// -----------------------------------------------------------------------------
+ sal_Int32 SAL_CALL AccessibleListBoxEntry::getRoleType()
+ {
+ sal_Int32 nCase = 0;
+ SvTreeListEntry* pEntry = getListBox()->GetEntry(0);
+ if ( pEntry )
+ {
+ if( pEntry->HasChildrenOnDemand() || 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 )
+ {
+ SvTreeListEntry* 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;
+ }
}
// -----------------------------------------------------------------------------
OUString SAL_CALL AccessibleListBoxEntry::getAccessibleDescription( ) throw (RuntimeException)
{
- // no description for every item
- return OUString();
+ SvTreeListEntry* 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->GetType() == SV_ITEM_ID_LBOXSTRING &&
+ !static_cast<SvLBoxString*>( pItem )->GetText().isEmpty() )
+ {
+ iRealItemCount++;
+ }
+ iCount++;
+ }
+ if(iRealItemCount<=1 )
+ {
+ return OUString();
+ }
+ else
+ {
+ return getListBox()->SearchEntryTextWithHeadTitle( pEntry );
+ }
}
// -----------------------------------------------------------------------------
OUString SAL_CALL AccessibleListBoxEntry::getAccessibleName( ) throw (RuntimeException)
@@ -386,7 +493,19 @@ namespace accessibility
::osl::MutexGuard aGuard( m_aMutex );
EnsureIsAlive();
- return implGetText();
+
+ OUString sRet(implGetText());
+
+ SvTreeListEntry* pEntry = getListBox()->GetEntryFromPath( m_aEntryPath );
+
+ OUString altText = getListBox()->GetEntryAltText( pEntry );
+ if (!altText.isEmpty())
+ {
+ sRet += " ";
+ sRet += altText;
+ }
+
+ return sRet;
}
// -----------------------------------------------------------------------------
Reference< XAccessibleRelationSet > SAL_CALL AccessibleListBoxEntry::getAccessibleRelationSet( ) throw (RuntimeException)
@@ -416,14 +535,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 );
}
@@ -558,6 +688,7 @@ namespace accessibility
SolarMutexGuard aSolarGuard;
::osl::MutexGuard aGuard( m_aMutex );
EnsureIsAlive();
+ if(aPoint.X==0 && aPoint.Y==0) return 0;
sal_Int32 nIndex = -1;
SvTreeListEntry* pEntry = getListBox()->GetEntryFromPath( m_aEntryPath );
@@ -632,7 +763,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)
@@ -644,14 +788,30 @@ namespace accessibility
checkActionIndex_Impl( nIndex );
EnsureIsAlive();
- SvTreeListEntry* 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)
+ {
+ SvTreeListEntry* 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) )
+ {
+ SvTreeListEntry* pEntry = getListBox()->GetEntryFromPath( m_aEntryPath );
+ if ( pEntry )
+ {
+ if ( getListBox()->IsExpanded( pEntry ) )
+ getListBox()->Collapse( pEntry );
+ else
+ getListBox()->Expand( pEntry );
+ bRet = sal_True;
+ }
}
return bRet;
@@ -666,7 +826,36 @@ namespace accessibility
EnsureIsAlive();
static const OUString sActionDesc( "toggleExpand" );
- return sActionDesc;
+ static const OUString sActionDesc1( "Check" );
+ static const OUString sActionDesc2( "UnCheck" );
+ // sal_Bool bHasButtons = (getListBox()->GetStyle() & WB_HASBUTTONS)!=0;
+ SvTreeListEntry* 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 OUString();
+ }
+ }else if( (nIndex == 1 && (treeFlag & TREEFLAG_CHKBTN)) || nIndex == 0 )
+ {
+ if( pEntry->HasChildren() || pEntry->HasChildrenOnDemand() )
+ return getListBox()->IsExpanded( pEntry ) ? \
+ OUString(TK_RES_STRING(STR_SVT_ACC_ACTION_COLLAPSE)) :
+ OUString(TK_RES_STRING(STR_SVT_ACC_ACTION_EXPAND));
+ return OUString();
+
+ }
+ throw IndexOutOfBoundsException();
}
// -----------------------------------------------------------------------------
Reference< XAccessibleKeyBinding > AccessibleListBoxEntry::getAccessibleActionKeyBinding( sal_Int32 nIndex ) throw (IndexOutOfBoundsException, RuntimeException)
@@ -688,8 +877,7 @@ namespace accessibility
EnsureIsAlive();
- SvTreeListEntry* pParent = getListBox()->GetEntryFromPath( m_aEntryPath );
- SvTreeListEntry* pEntry = getListBox()->GetEntry( pParent, nChildIndex );
+ SvTreeListEntry* pEntry = GetRealChild(nChildIndex);
if ( !pEntry )
throw IndexOutOfBoundsException();
@@ -930,6 +1118,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)
+ {
+ SvTreeListEntry* pEntry = pBox->GetEntryFromPath( m_aEntryPath );
+ if ( pEntry )
+ {
+ sal_Int32 nValue(0), nValueMin(0), nValueMax(0);
+ 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;
+ }
+
+ // -----------------------------------------------------------------------------
+
+ SvTreeListEntry* AccessibleListBoxEntry::GetRealChild(sal_Int32 nIndex)
+ {
+ SvTreeListEntry* pEntry = NULL;
+ SvTreeListEntry* pParent = getListBox()->GetEntryFromPath( m_aEntryPath );
+ if (pParent)
+ {
+ pEntry = getListBox()->GetEntry( pParent, nIndex );
+ if ( !pEntry && getAccessibleChildCount() > 0 )
+ {
+ getListBox()->RequestingChildren(pParent);
+ pEntry = getListBox()->GetEntry( pParent, nIndex );
+ }
+ }
+ return pEntry;
+ }
//........................................................................
}// namespace accessibility
//........................................................................
diff --git a/accessibility/source/extended/accessibletablistboxtable.cxx b/accessibility/source/extended/accessibletablistboxtable.cxx
index a33c9f1..a61e37a 100644
--- a/accessibility/source/extended/accessibletablistboxtable.cxx
+++ b/accessibility/source/extended/accessibletablistboxtable.cxx
@@ -131,6 +131,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:
+ {
+ SvTreeListEntry* pEntry = static_cast< SvTreeListEntry* >( 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;
+ SvTreeListEntry* pEntry = static_cast< SvTreeListEntry* >( 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 :
{
diff --git a/accessibility/source/extended/textwindowaccessibility.cxx b/accessibility/source/extended/textwindowaccessibility.cxx
index 171204a..1278248 100644
--- a/accessibility/source/extended/textwindowaccessibility.cxx
+++ b/accessibility/source/extended/textwindowaccessibility.cxx
@@ -30,6 +30,8 @@
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
@@ -1002,16 +1004,114 @@ Document::retrieveCharacterBounds(ParagraphImpl const * pParagraph,
// 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< 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).getLength())
+ // nIndex can be equal to getLength();
+ if (nIndex < 0 || nIndex > m_rEngine.GetText(nNumber).getLength())
throw css::lang::IndexOutOfBoundsException(
"textwindowaccessibility.cxx:"
" Document::retrieveCharacterAttributes",
@@ -1033,7 +1133,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(
@@ -1388,7 +1512,8 @@ void Document::ProcessWindowEvent( const VclWindowEvent& rVclWindowEvent )
{
// #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;
@@ -1453,7 +1578,26 @@ Document::getAccessibleAtPoint(css::awt::Point const & rPoint)
}
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()
{
@@ -1596,9 +1740,25 @@ IMPL_LINK(Document, WindowEventHandler, ::VclSimpleEvent *, pEvent)
::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())
@@ -1609,7 +1769,7 @@ IMPL_LINK(Document, WindowEventHandler, ::VclSimpleEvent *, pEvent)
css::uno::makeAny(
css::accessibility::AccessibleStateType::
FOCUSED));
- }
+ */
break;
}
case VCLEVENT_WINDOW_LOSEFOCUS:
@@ -1617,7 +1777,24 @@ IMPL_LINK(Document, WindowEventHandler, ::VclSimpleEvent *, pEvent)
::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(
@@ -1631,6 +1808,7 @@ IMPL_LINK(Document, WindowEventHandler, ::VclSimpleEvent *, pEvent)
FOCUSED),
css::uno::Any());
}
+ */
break;
}
}
@@ -1987,6 +2165,124 @@ void Document::handleParagraphNotifications()
}
}
+::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();
@@ -2028,7 +2324,11 @@ void Document::handleSelectionChangeNotification()
::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,
@@ -2048,6 +2348,100 @@ void Document::handleSelectionChangeNotification()
}
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
@@ -2123,7 +2517,7 @@ void Document::handleSelectionChangeNotification()
// notify selection changes
notifySelectionChange( nFirst1, nLast1 );
notifySelectionChange( nFirst2, nLast2 );
-
+ */
m_nSelectionFirstPara = nNewFirstPara;
m_nSelectionFirstPos = nNewFirstPos;
m_nSelectionLastPara = nNewLastPara;
diff --git a/accessibility/source/helper/accessiblestrings.src b/accessibility/source/helper/accessiblestrings.src
index df426ad..f112af3 100644
--- a/accessibility/source/helper/accessiblestrings.src
+++ b/accessibility/source/helper/accessiblestrings.src
@@ -19,10 +19,9 @@
#include <accessibility/helper/accessiblestrings.hrc>
-
String RID_STR_ACC_ACTION_CLICK
{
- Text = "click";
+ Text = "press";
};
String RID_STR_ACC_ACTION_TOGGLEPOPUP
@@ -60,6 +59,53 @@ 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";
diff --git a/accessibility/source/helper/characterattributeshelper.cxx b/accessibility/source/helper/characterattributeshelper.cxx
index 8180cd9..9f40168 100644
--- a/accessibility/source/helper/characterattributeshelper.cxx
+++ b/accessibility/source/helper/characterattributeshelper.cxx
@@ -38,6 +38,7 @@ CharacterAttributesHelper::CharacterAttributesHelper( const Font& rFont, sal_Int
m_aAttributeMap.insert( AttributeMap::value_type( OUString( "CharStrikeout" ), makeAny( (sal_Int16) rFont.GetStrikeout() ) ) );
m_aAttributeMap.insert( AttributeMap::value_type( OUString( "CharUnderline" ), makeAny( (sal_Int16) rFont.GetUnderline() ) ) );
m_aAttributeMap.insert( AttributeMap::value_type( OUString( "CharWeight" ), makeAny( (float) rFont.GetWeight() ) ) );
+ m_aAttributeMap.insert( AttributeMap::value_type( OUString( "CharPosture" ), makeAny( (sal_Int16)rFont.GetItalic() ) ) );
}
diff --git a/accessibility/source/standard/accessiblemenubasecomponent.cxx b/accessibility/source/standard/accessiblemenubasecomponent.cxx
index 48118ed..b4d4dd9 100644
--- a/accessibility/source/standard/accessiblemenubasecomponent.cxx
+++ b/accessibility/source/standard/accessiblemenubasecomponent.cxx
@@ -125,15 +125,20 @@ void OAccessibleMenuBaseComponent::SetEnabled( sal_Bool bEnabled )
{
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;
@@ -763,4 +768,9 @@ Reference< XAccessibleStateSet > OAccessibleMenuBaseComponent::getAccessibleStat
// -----------------------------------------------------------------------------
+sal_Bool OAccessibleMenuBaseComponent::IsMenuHideDisabledEntries()
+{
+ return sal_False;
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/accessibility/source/standard/accessiblemenuitemcomponent.cxx b/accessibility/source/standard/accessiblemenuitemcomponent.cxx
index e458e95..04f531e 100644
--- a/accessibility/source/standard/accessiblemenuitemcomponent.cxx
+++ b/accessibility/source/standard/accessiblemenuitemcomponent.cxx
@@ -234,7 +234,8 @@ OUString OAccessibleMenuItemComponent::GetItemText()
void OAccessibleMenuItemComponent::FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet )
{
- if ( IsEnabled() )
+ sal_Bool bEnabled = IsEnabled();
+ if ( bEnabled )
{
rStateSet.AddState( AccessibleStateType::ENABLED );
rStateSet.AddState( AccessibleStateType::SENSITIVE );
@@ -242,10 +243,10 @@ void OAccessibleMenuItemComponent::FillAccessibleStateSet( utl::AccessibleStateS
if ( IsVisible() )
{
- rStateSet.AddState( AccessibleStateType::VISIBLE );
rStateSet.AddState( AccessibleStateType::SHOWING );
+ if( !IsMenuHideDisabledEntries() || bEnabled )
+ rStateSet.AddState( AccessibleStateType::VISIBLE );
}
-
rStateSet.AddState( AccessibleStateType::OPAQUE );
}
@@ -492,4 +493,16 @@ OUString OAccessibleMenuItemComponent::getToolTipText( ) throw (RuntimeExceptio
// -----------------------------------------------------------------------------
+sal_Bool OAccessibleMenuItemComponent::IsMenuHideDisabledEntries()
+{
+ if (m_pParent )
+ {
+ if( m_pParent->GetMenuFlags() & MENU_FLAG_HIDEDISABLEDENTRIES)
+ {
+ return sal_True;
+ }
+ }
+ return sal_False;
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/accessibility/source/standard/vclxaccessiblebox.cxx b/accessibility/source/standard/vclxaccessiblebox.cxx
index 6676b15..2f40002 100644
--- a/accessibility/source/standard/vclxaccessiblebox.cxx
+++ b/accessibility/source/standard/vclxaccessiblebox.cxx
@@ -110,11 +110,98 @@ void VCLXAccessibleBox::ProcessWindowEvent (const VclWindowEvent& rVclWindowEven
{
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:
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list