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

Integrate branch of IAccessible2

(cherry picked from commit e2f90c93)

Change-Id: I44ce0d69f3e7364038b00b1ba0f0d27e60132a37

WaE: Prevent uninitialized variable warnings.

(cherry picked from commit b989f407)
üst 1d648282
......@@ -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 );
};
//........................................................................
......
......@@ -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();
};
//........................................................................
......
......@@ -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* );
......
......@@ -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 );
......
......@@ -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;
......
......@@ -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 )
......
......@@ -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();
......
......@@ -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 );
......
......@@ -49,6 +49,8 @@ protected:
void SetItemText( const OUString& sItemText );
OUString GetItemText();
virtual sal_Bool IsMenuHideDisabledEntries();
virtual void FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet );
// OCommonAccessibleComponent
......
......@@ -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.
......
......@@ -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.
......
......@@ -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 );
......
......@@ -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
......
......@@ -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
......
......@@ -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 );
......
......@@ -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());
......
......@@ -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)
......
......@@ -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)
......
......@@ -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 :
{
......
......@@ -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";
......
......@@ -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() ) ) );
}
......
......@@ -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: */
......@@ -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: */
......@@ -95,6 +95,16 @@ void VCLXAccessibleButton::FillAccessibleStateSet( utl::AccessibleStateSetHelper
if ( pButton->IsPressed() )
rStateSet.AddState( AccessibleStateType::PRESSED );