25#include <com/sun/star/accessibility/AccessibleStateType.hpp>
26#include <com/sun/star/accessibility/AccessibleEventId.hpp>
27#include <com/sun/star/accessibility/AccessibleRelationType.hpp>
28#include <com/sun/star/accessibility/AccessibleRole.hpp>
29#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
46 void checkSelection_Impl( sal_Int64 _nIndex,
const IComboListBoxHelper& _rListBox,
bool bSelected )
48 sal_Int32
nCount = bSelected ? _rListBox.GetSelectedEntryCount()
49 : _rListBox.GetEntryCount();
50 if ( _nIndex < 0 || _nIndex >= nCount )
51 throw css::lang::IndexOutOfBoundsException();
57 : ImplInheritanceHelper (pVCLWindow),
58 m_aBoxType (aBoxType),
59 m_nVisibleLineCount (0),
61 m_nLastTopEntry ( 0 ),
63 m_bDisableProcessEvent ( false ),
66 m_xParent ( _xParent )
107 VCLXAccessibleComponent::disposing();
120 VCLXAccessibleComponent::FillAccessibleStateSet( rStateSet );
126 rStateSet &= ~AccessibleStateType::VISIBLE;
127 rStateSet &= ~AccessibleStateType::SHOWING;
137 rStateSet |= AccessibleStateType::MULTI_SELECTABLE;
138 rStateSet |= AccessibleStateType::FOCUSABLE;
140 rStateSet |= AccessibleStateType::MANAGES_DESCENDANTS;
147 Any aOldValue, aNewValue;
148 (_bSetNew ? aNewValue : aOldValue ) <<= AccessibleStateType::VISIBLE;
149 NotifyAccessibleEvent( AccessibleEventId::STATE_CHANGED, aOldValue, aNewValue );
150 (_bSetNew ? aNewValue : aOldValue ) <<= AccessibleStateType::SHOWING;
151 NotifyAccessibleEvent( AccessibleEventId::STATE_CHANGED, aOldValue, aNewValue );
202 ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
222 aNewValue <<= xNewAcc;
241 if ( xNewAcc.is() && GetWindow()->HasFocus() )
245 aNewValue <<= xNewAcc;
258 NotifyAccessibleEvent(
259 AccessibleEventId::ACTIVE_DESCENDANT_CHANGED,
269 NotifyAccessibleEvent( AccessibleEventId::SELECTION_CHANGED,
uno::Any(),
uno::Any() );
276 NotifyAccessibleEvent(
277 AccessibleEventId::ACTIVE_DESCENDANT_CHANGED,
302 switch ( rVclWindowEvent.
GetId() )
304 case VclEventId::DropdownSelect:
305 case VclEventId::ListboxSelect:
309 case VclEventId::WindowGetFocus:
311 case VclEventId::ControlGetFocus:
313 VCLXAccessibleComponent::ProcessWindowEvent (rVclWindowEvent);
333 NotifyAccessibleEvent( AccessibleEventId::ACTIVE_DESCENDANT_CHANGED,
352 switch ( rVclWindowEvent.
GetId() )
354 case VclEventId::DropdownOpen:
357 case VclEventId::DropdownClose:
360 case VclEventId::ListboxScrolled:
369 case VclEventId::ObjectDying:
373 VCLXAccessibleComponent::ProcessWindowEvent (rVclWindowEvent);
377 case VclEventId::ListboxItemRemoved:
378 case VclEventId::ComboboxItemRemoved:
379 case VclEventId::ListboxItemAdded:
380 case VclEventId::ComboboxItemAdded:
383 case VclEventId::ControlGetFocus:
385 VCLXAccessibleComponent::ProcessWindowEvent (rVclWindowEvent);
387 bool b_IsDropDownList =
true;
402 NotifyAccessibleEvent( AccessibleEventId::ACTIVE_DESCENDANT_CHANGED,
411 VCLXAccessibleComponent::ProcessWindowEvent (rVclWindowEvent);
423 rRelationSet.
AddRelation( com::sun::star::accessibility::AccessibleRelation( com::sun::star::accessibility::AccessibleRelationType::MEMBER_OF, aSequence ) );
428 VCLXAccessibleComponent::FillAccessibleRelationSet(rRelationSet);
446 sal_Int32
nIndex = pBox->GetEntryPos(sTextOfSelectedItem);
457 Reference<XAccessible> xChild;
481 bool bNowSelected =
false;
503 NotifyAccessibleEvent (
504 AccessibleEventId::INVALIDATE_ALL_CHILDREN,
510Reference<XAccessibleContext> SAL_CALL
522 ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
538 ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
541 throw IndexOutOfBoundsException();
553 OSL_ENSURE( xChild.is(),
"VCLXAccessibleList::getAccessibleChild: returning empty child!" );
559 ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
569 return VCLXAccessibleComponent::getAccessibleIndexInParent();
574 return AccessibleRole::LIST;
580 return "com.sun.star.comp.toolkit.AccessibleList";
586 Sequence<OUString>{
"com.sun.star.accessibility.AccessibleList"});
597 sal_uInt16 nCols = 0,
608 ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
619 for (sal_Int32
i = nBegin; (
i <= nEnd); ++
i)
639 bool bNowSelected =
false;
646 _rNewValue <<= _rxNewAcc;
659 ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
680 aNewValue <<= xNewAcc;
699 if ( xNewAcc.is() && GetWindow()->HasFocus() )
703 aNewValue <<= xNewAcc;
708 NotifyAccessibleEvent(
709 AccessibleEventId::ACTIVE_DESCENDANT_CHANGED,
724 bool bNotify =
false;
728 ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
750 ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
757 bRet =
m_pListBoxHelper->IsEntryPosSelected(
static_cast<sal_uInt16
>(nChildIndex) );
764 bool bNotify =
false;
768 ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
783 bool bNotify =
false;
787 ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
809 ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
820 ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
833 bool bNotify =
false;
837 ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
843 m_pListBoxHelper->SelectEntryPos(
static_cast<sal_uInt16
>(nSelectedChildIndex),
false );
858 awt::Rectangle aBounds ( 0, 0, 0, 0 );
868 aBounds = VCLXAccessibleComponent::implGetBounds();
876 Size aSize = pBox->GetSubEdit()->GetSizePixel();
877 aBounds.Y += aSize.
Height();
878 aBounds.Height -= aSize.
Height();
889 ::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
900 aPos = VCLXAccessibleComponent::getLocationOnScreen();
906 aPos.Y += pBox->GetSubEdit()->GetSizePixel().Height();
931 aNewValue <<= xChild;
932 NotifyAccessibleEvent(AccessibleEventId::ACTIVE_DESCENDANT_CHANGED,
uno::Any(), aNewValue );
constexpr tools::Long Height() const
the class OAccessibleListBoxEntry represents the base class for an accessible object of a listbox ent...
void NotifyAccessibleEvent(sal_Int16 _nEventId, const css::uno::Any &_aOldValue, const css::uno::Any &_aNewValue)
void SetVisible(bool _bVisible)
void SetSelected(bool _bSelected)
bool IsInDropDown() const
void UpdateEntryRange_Impl()
virtual void FillAccessibleStateSet(sal_Int64 &rStateSet) override
This method adds the states AccessibleStateType::FOCUSABLE and possibly AccessibleStateType::MULTI_SE...
virtual void SAL_CALL selectAccessibleChild(sal_Int64 nChildIndex) override
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getSelectedAccessibleChild(sal_Int64 nSelectedChildIndex) override
virtual sal_Int16 SAL_CALL getAccessibleRole() override
static void NotifyListItem(css::uno::Any const &val)
sal_Int32 m_nVisibleLineCount
void notifyVisibleStates(bool _bSetNew)
virtual void FillAccessibleRelationSet(utl::AccessibleRelationSetHelper &rRelationSet) override
sal_Int32 m_nLastTopEntry
void UpdateSelection(std::u16string_view sTextOfSelectedItem)
Called on reception of selection events this method checks all known list items for a possible change...
css::uno::Reference< css::accessibility::XAccessible > m_xParent
We need to save the accessible parent to return it in getAccessibleParent(), because this method of t...
virtual void SAL_CALL deselectAccessibleChild(sal_Int64 nSelectedChildIndex) override
virtual void SAL_CALL disposing() override
This function is called from the implementation helper during a XComponent::dispose call.
sal_Int32 m_nIndexInParent
Index in parent. This is settable from the outside.
void UpdateSelection_Impl_Acc(bool b_IsDropDownList)
void HandleChangedItemList()
Call this method when the item list has been changed, i.e.
void UpdateSelection_Impl(sal_Int32 nPos=0)
virtual sal_Int64 SAL_CALL getSelectedAccessibleChildCount() override
bool checkEntrySelected(sal_Int32 _nPos, css::uno::Any &_rNewValue, css::uno::Reference< css::accessibility::XAccessible > &_rxNewAcc)
void UpdateVisibleLineCount()
virtual sal_Bool SAL_CALL isAccessibleChildSelected(sal_Int64 nChildIndex) override
virtual css::awt::Rectangle implGetBounds() override
void SetIndexInParent(sal_Int32 nIndex)
The index that is passed to this method is returned on following calls to getAccessibleIndexInParent.
bool m_bDisableProcessEvent
virtual sal_Int64 SAL_CALL getAccessibleChildCount() override final
virtual void SAL_CALL selectAllAccessibleChildren() override
std::unique_ptr<::accessibility::IComboListBoxHelper > m_pListBoxHelper
css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild(sal_Int64 i) override
virtual OUString SAL_CALL getImplementationName() override
css::uno::Reference< css::accessibility::XAccessible > CreateChild(sal_Int32 i)
Create the specified child and insert it into the list of children.
virtual sal_Int64 SAL_CALL getAccessibleIndexInParent() override
The index returned as index in parent is always the one set with the SetIndexInParent() method.
void UpdateSelection_Acc(std::u16string_view sTextOfSelectedItem, bool b_IsDropDownList)
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent() override
virtual void SAL_CALL clearAccessibleSelection() override
VCLXAccessibleList(VCLXWindow *pVCLXindow, BoxType aBoxType, const css::uno::Reference< css::accessibility::XAccessible > &_xParent)
ListItems m_aAccessibleChildren
virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext() override
sal_Int32 m_nCurSelectedPos
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual css::awt::Point SAL_CALL getLocationOnScreen() override
sal_Int64 implGetAccessibleChildCount()
virtual void ProcessWindowEvent(const VclWindowEvent &rVclWindowEvent) override
Process some of the events and delegate the rest to the base classes.
sal_Int32 m_nLastSelectedPos
void AddRelation(const css::accessibility::AccessibleRelation &rRelation)
css::awt::Point AWTPoint(const ::Point &rVCLPoint)
css::awt::Rectangle AWTRectangle(const ::tools::Rectangle &rVCLRect)
const sal_Int32 DEFAULT_INDEX_IN_PARENT
#define LISTBOX_ENTRY_NOTFOUND
css::uno::Sequence< T > concatSequences(const css::uno::Sequence< T > &rS1, const Ss &... rSn)
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)
WinBits const WB_DROPDOWN