31#include <com/sun/star/accessibility/AccessibleEventId.hpp>
32#include <com/sun/star/accessibility/AccessibleRole.hpp>
33#include <com/sun/star/accessibility/AccessibleStateType.hpp>
34#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
73 throw lang::IndexOutOfBoundsException();
78 throw lang::IndexOutOfBoundsException();
80 uno::Reference< accessibility::XAccessible > xRet = pItem->
GetAccessible(
false );
105 uno::Reference<accessibility::XAccessibleContext> xParentContext(xParent->getAccessibleContext());
108 if ( xParentContext.is() )
110 sal_Int64 nChildCount = xParentContext->getAccessibleChildCount();
111 for ( sal_Int64 nChild = 0; ( nChild < nChildCount ) && ( -1 == nRet ); ++nChild )
113 uno::Reference<XAccessible> xChild(xParentContext->getAccessibleChild(nChild));
114 if ( xChild.get() ==
this )
119 catch (
const uno::Exception&)
132 return accessibility::AccessibleRole::LIST;
138 return "ThumbnailView";
158 return uno::Reference< accessibility::XAccessibleRelationSet >();
164 sal_Int64 nStateSet = 0;
167 nStateSet |= accessibility::AccessibleStateType::ENABLED;
168 nStateSet |= accessibility::AccessibleStateType::SENSITIVE;
169 nStateSet |= accessibility::AccessibleStateType::SHOWING;
170 nStateSet |= accessibility::AccessibleStateType::VISIBLE;
171 nStateSet |= accessibility::AccessibleStateType::MANAGES_DESCENDANTS;
172 nStateSet |= accessibility::AccessibleStateType::FOCUSABLE;
182 lang::Locale aRet(
"",
"",
"" );
186 uno::Reference< accessibility::XAccessibleContext > xParentContext( xParent->getAccessibleContext() );
188 if( xParentContext.is() )
189 aRet = xParentContext->getLocale ();
200 if( !rxListener.is() )
207 if( eventListener == rxListener )
223 if( rxListener.is() )
225 std::vector< uno::Reference< accessibility::XAccessibleEventListener > >::iterator aIter =
236 const awt::Rectangle aRect(
getBounds() );
237 const Point aSize( aRect.Width, aRect.Height );
238 const Point aNullPoint, aTestPoint( aPoint.X, aPoint.Y );
248 uno::Reference< accessibility::XAccessible > xRet;
272 aRet.X = aOutPos.
X();
273 aRet.Y = aOutPos.
Y();
274 aRet.Width = aOutSize.
Width();
275 aRet.Height = aOutSize.
Height();
283 const awt::Rectangle aRect(
getBounds() );
296 awt::Point aScreenLoc(0, 0);
301 uno::Reference<accessibility::XAccessibleContext> xParentContext(xParent->getAccessibleContext());
302 uno::Reference<accessibility::XAccessibleComponent> xParentComponent(xParentContext, css::uno::UNO_QUERY);
303 OSL_ENSURE( xParentComponent.is(),
"ThumbnailViewAcc::getLocationOnScreen: no parent component!" );
304 if ( xParentComponent.is() )
306 awt::Point aParentScreenLoc( xParentComponent->getLocationOnScreen() );
308 aScreenLoc.X = aParentScreenLoc.X + aOwnRelativeLoc.X;
309 aScreenLoc.Y = aParentScreenLoc.Y + aOwnRelativeLoc.Y;
319 const awt::Rectangle aRect(
getBounds() );
322 aRet.Width = aRect.Width;
323 aRet.Height = aRect.Height;
339 return static_cast<sal_Int32
>(nColor);
346 return static_cast<sal_Int32
>(nColor);
355 throw lang::IndexOutOfBoundsException();
360 throw lang::IndexOutOfBoundsException();
371 throw lang::IndexOutOfBoundsException();
375 if (pItem ==
nullptr)
376 throw lang::IndexOutOfBoundsException();
413 uno::Reference< accessibility::XAccessible > xRet;
432 throw lang::IndexOutOfBoundsException();
442 ::std::vector<uno::Reference<accessibility::XAccessibleEventListener> > aListenerListCopy;
462 lang::EventObject
aEvent (
static_cast<accessibility::XAccessible*
>(
this));
463 for (
auto const& listener : aListenerListCopy)
467 listener->disposing (
aEvent);
469 catch(
const uno::Exception&)
490 SAL_WARN(
"sfx",
"Calling disposed object. Throwing exception:");
491 throw lang::DisposedException (
492 "object has been already disposed",
503 mbIsTransientChildrenDisabled( bIsTransientChildrenDisabled )
513 std::scoped_lock aGuard(
maMutex );
522 ::std::vector< uno::Reference< accessibility::XAccessibleEventListener > > aTmpListeners(
mxEventListeners );
523 accessibility::AccessibleEventObject aEvtObject;
525 aEvtObject.EventId = nEventId;
526 aEvtObject.Source = getXWeak();
527 aEvtObject.NewValue = rNewValue;
528 aEvtObject.OldValue = rOldValue;
530 for (
auto const& tmpListener : aTmpListeners)
534 tmpListener->notifyEvent( aEvtObject );
536 catch(
const uno::Exception&)
551 css::uno::Any aOldState, aNewState;
552 aNewState <<= css::accessibility::AccessibleStateType::FOCUSED;
554 css::accessibility::AccessibleEventId::STATE_CHANGED,
555 aOldState, aNewState);
561 css::uno::Any aOldState, aNewState;
562 aOldState <<= css::accessibility::AccessibleStateType::FOCUSED;
564 css::accessibility::AccessibleEventId::STATE_CHANGED,
565 aOldState, aNewState);
580 throw lang::IndexOutOfBoundsException();
586 uno::Reference< accessibility::XAccessible > xRet;
599 sal_Int64 nIndexInParent = -1;
607 for (sal_uInt16
i=0;
i<
nCount && !bDone;
i++)
615 catch (
const lang::IndexOutOfBoundsException&)
621 if (pItem !=
nullptr && pItem->
mxAcc.is())
630 return nIndexInParent;
635 return accessibility::AccessibleRole::LIST_ITEM;
654 aRet =
"Item " + OUString::number(
static_cast<sal_Int32
>(
mpParent->
mnId));
663 return uno::Reference< accessibility::XAccessibleRelationSet >();
669 sal_Int64 nStateSet = 0;
673 nStateSet |= accessibility::AccessibleStateType::ENABLED;
674 nStateSet |= accessibility::AccessibleStateType::SENSITIVE;
675 nStateSet |= accessibility::AccessibleStateType::SHOWING;
676 nStateSet |= accessibility::AccessibleStateType::VISIBLE;
678 nStateSet |= accessibility::AccessibleStateType::TRANSIENT;
680 nStateSet |= accessibility::AccessibleStateType::SELECTABLE;
681 nStateSet |= accessibility::AccessibleStateType::FOCUSABLE;
685 nStateSet |= accessibility::AccessibleStateType::SELECTED;
687 nStateSet |= accessibility::AccessibleStateType::FOCUSED;
698 lang::Locale aRet(
"",
"",
"" );
702 uno::Reference< accessibility::XAccessibleContext > xParentContext( xParent->getAccessibleContext() );
704 if( xParentContext.is() )
705 aRet = xParentContext->getLocale();
713 std::scoped_lock aGuard(
maMutex );
715 if( !rxListener.is() )
722 if( eventListener == rxListener )
735 std::scoped_lock aGuard(
maMutex );
737 if( rxListener.is() )
739 std::vector< uno::Reference< accessibility::XAccessibleEventListener > >::iterator aIter =
749 const awt::Rectangle aRect(
getBounds() );
750 const Point aSize( aRect.Width, aRect.Height );
751 const Point aNullPoint, aTestPoint( aPoint.X, aPoint.Y );
758 uno::Reference< accessibility::XAccessible > xRet;
776 uno::Reference<XAccessibleComponent> xParentComponent(xParent->getAccessibleContext(), uno::UNO_QUERY);
777 if (xParentComponent.is())
779 awt::Size aParentSize = xParentComponent->getSize();
780 aParentRect =
tools::Rectangle(0, 0, aParentSize.Width, aParentSize.Height);
786 aRet.X = aRect.
Left();
787 aRet.Y = aRect.
Top();
797 const awt::Rectangle aRect(
getBounds() );
817 aRet.X = aPos.
X() + aScreenPos.
X();
818 aRet.Y = aPos.
Y() + aScreenPos.
X();
826 const awt::Rectangle aRect(
getBounds() );
829 aRet.Width = aRect.Width;
830 aRet.Height = aRect.Height;
843 return static_cast<sal_Int32
>(nColor);
const StyleSettings & GetStyleSettings() const
static const AllSettings & GetSettings()
constexpr tools::Long Y() const
constexpr tools::Long X() const
constexpr tools::Long Height() const
constexpr tools::Long Width() const
const Color & GetWindowColor() const
const Color & GetWindowTextColor() const
void FireAccessibleEvent(short nEventId, const css::uno::Any &rOldValue, const css::uno::Any &rNewValue)
virtual sal_Int64 SAL_CALL getAccessibleIndexInParent() override
static ThumbnailViewAcc * getImplementation(const css::uno::Reference< css::uno::XInterface > &rxData) noexcept
::std::vector< css::uno::Reference< css::accessibility::XAccessibleEventListener > > mxEventListeners
virtual sal_Int64 SAL_CALL getAccessibleChildCount() override
virtual sal_Bool SAL_CALL isAccessibleChildSelected(sal_Int64 nChildIndex) override
virtual void disposing(std::unique_lock< std::mutex > &) override
Tell all listeners that the object is dying.
virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet() override
virtual sal_Int32 SAL_CALL getBackground() override
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent() override
virtual css::awt::Point SAL_CALL getLocationOnScreen() override
virtual css::awt::Size SAL_CALL getSize() override
virtual void SAL_CALL clearAccessibleSelection() override
virtual ~ThumbnailViewAcc() override
virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext() override
virtual OUString SAL_CALL getAccessibleName() override
virtual css::lang::Locale SAL_CALL getLocale() override
void ThrowIfDisposed()
Check whether or not the object has been disposed (or is in the state of being disposed).
virtual void SAL_CALL selectAllAccessibleChildren() override
virtual void SAL_CALL addAccessibleEventListener(const css::uno::Reference< css::accessibility::XAccessibleEventListener > &xListener) override
ThumbnailViewItem * getItem(sal_uInt16 nIndex) const
Return the item associated with the given index.
virtual void SAL_CALL deselectAccessibleChild(sal_Int64 nSelectedChildIndex) override
virtual sal_Int16 SAL_CALL getAccessibleRole() override
virtual void SAL_CALL removeAccessibleEventListener(const css::uno::Reference< css::accessibility::XAccessibleEventListener > &xListener) override
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint(const css::awt::Point &aPoint) override
virtual void SAL_CALL grabFocus() override
sal_uInt16 getItemCount() const
Return the number of items.
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getSelectedAccessibleChild(sal_Int64 nSelectedChildIndex) override
virtual css::awt::Rectangle SAL_CALL getBounds() override
virtual css::awt::Point SAL_CALL getLocation() override
virtual sal_Bool SAL_CALL containsPoint(const css::awt::Point &aPoint) override
void GetFocus()
Called by the corresponding ValueSet when it gets the focus.
ThumbnailViewAcc(ThumbnailView *pParent)
virtual sal_Int64 SAL_CALL getSelectedAccessibleChildCount() override
virtual OUString SAL_CALL getAccessibleDescription() override
void LoseFocus()
Called by the corresponding ValueSet when it loses the focus.
virtual void SAL_CALL selectAccessibleChild(sal_Int64 nChildIndex) override
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild(sal_Int64 i) override
virtual sal_Int64 SAL_CALL getAccessibleStateSet() override
virtual sal_Int32 SAL_CALL getForeground() override
ThumbnailViewItem * mpParent
virtual OUString SAL_CALL getAccessibleDescription() override
virtual sal_Int64 SAL_CALL getAccessibleChildCount() override
::std::vector< css::uno::Reference< css::accessibility::XAccessibleEventListener > > mxEventListeners
virtual sal_Int64 SAL_CALL getAccessibleIndexInParent() override
virtual css::uno::Reference< css::accessibility::XAccessibleContext > SAL_CALL getAccessibleContext() override
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleChild(sal_Int64 i) override
virtual sal_Int32 SAL_CALL getForeground() override
virtual void SAL_CALL grabFocus() override
virtual sal_Int16 SAL_CALL getAccessibleRole() override
virtual css::lang::Locale SAL_CALL getLocale() override
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleParent() override
virtual css::awt::Size SAL_CALL getSize() override
virtual sal_Int64 SAL_CALL getAccessibleStateSet() override
virtual OUString SAL_CALL getAccessibleName() override
virtual void SAL_CALL removeAccessibleEventListener(const css::uno::Reference< css::accessibility::XAccessibleEventListener > &xListener) override
ThumbnailViewItemAcc(ThumbnailViewItem *pParent, bool bIsTransientChildrenDisabled)
virtual void SAL_CALL addAccessibleEventListener(const css::uno::Reference< css::accessibility::XAccessibleEventListener > &xListener) override
virtual sal_Bool SAL_CALL containsPoint(const css::awt::Point &aPoint) override
virtual css::uno::Reference< css::accessibility::XAccessibleRelationSet > SAL_CALL getAccessibleRelationSet() override
virtual css::awt::Rectangle SAL_CALL getBounds() override
virtual ~ThumbnailViewItemAcc() override
virtual sal_Int32 SAL_CALL getBackground() override
virtual css::awt::Point SAL_CALL getLocationOnScreen() override
virtual css::uno::Reference< css::accessibility::XAccessible > SAL_CALL getAccessibleAtPoint(const css::awt::Point &aPoint) override
static ThumbnailViewItemAcc * getImplementation(const css::uno::Reference< css::uno::XInterface > &rxData) noexcept
virtual css::awt::Point SAL_CALL getLocation() override
bool mbIsTransientChildrenDisabled
css::uno::Reference< css::accessibility::XAccessible > const & GetAccessible(bool bIsTransientChildrenDisabled)
css::uno::Reference< css::accessibility::XAccessible > mxAcc
const tools::Rectangle & getDrawArea() const
Class to display thumbnails with their names below their respective icons.
size_t GetItemPos(sal_uInt16 nItemId) const
sal_uInt16 GetItemId(size_t nPos) const
const css::uno::Reference< css::accessibility::XAccessible > & getAccessible() const
sal_uInt16 ImplGetVisibleItemCount() const
bool IsItemSelected(sal_uInt16 nItemId) const
ThumbnailViewItem * ImplGetVisibleItem(sal_uInt16 nVisiblePos)
void SelectItem(sal_uInt16 nItemId)
ThumbnailValueItemList mFilteredItemList
Cache to store the filtered items.
virtual a11yref get_accessible_parent()=0
virtual Point get_accessible_location_on_screen()=0
#define DBG_ASSERT(sCon, aError)
#define TOOLS_WARN_EXCEPTION(area, stream)
RegionData_Impl * mpParent
#define SAL_WARN(area, stream)
#define THUMBNAILVIEW_ITEM_NONEITEM