LibreOffice Module sfx2 (master) 1
thumbnailviewacc.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#include "thumbnailviewacc.hxx"
21
25#include <vcl/svapp.hxx>
26#include <vcl/settings.hxx>
27#include <sal/log.hxx>
28#include <tools/debug.hxx>
30
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>
35
36using namespace ::com::sun::star;
37
39 mpParent( pParent )
40{
41}
42
44{
45}
46
47ThumbnailViewAcc* ThumbnailViewAcc::getImplementation( const uno::Reference< uno::XInterface >& rxData )
48 noexcept
49{
50 return dynamic_cast<ThumbnailViewAcc*>(rxData.get());
51}
52
53uno::Reference< accessibility::XAccessibleContext > SAL_CALL ThumbnailViewAcc::getAccessibleContext()
54{
56 return this;
57}
58
60{
61 const SolarMutexGuard aSolarGuard;
63
65}
66
67uno::Reference< accessibility::XAccessible > SAL_CALL ThumbnailViewAcc::getAccessibleChild( sal_Int64 i )
68{
70 const SolarMutexGuard aSolarGuard;
71
72 if (i < 0 || i >= getAccessibleChildCount())
73 throw lang::IndexOutOfBoundsException();
74
75 ThumbnailViewItem* pItem = getItem (sal::static_int_cast< sal_uInt16 >(i));
76
77 if( !pItem )
78 throw lang::IndexOutOfBoundsException();
79
80 uno::Reference< accessibility::XAccessible > xRet = pItem->GetAccessible( /*bIsTransientChildrenDisabled*/false );
81 return xRet;
82}
83
84uno::Reference< accessibility::XAccessible > SAL_CALL ThumbnailViewAcc::getAccessibleParent()
85{
87 const SolarMutexGuard aSolarGuard;
89}
90
92{
94 const SolarMutexGuard aSolarGuard;
95
96 // -1 for child not found/no parent (according to specification)
97 sal_Int64 nRet = -1;
98
99 uno::Reference<accessibility::XAccessible> xParent(getAccessibleParent());
100 if (!xParent)
101 return nRet;
102
103 try
104 {
105 uno::Reference<accessibility::XAccessibleContext> xParentContext(xParent->getAccessibleContext());
106
107 // iterate over parent's children and search for this object
108 if ( xParentContext.is() )
109 {
110 sal_Int64 nChildCount = xParentContext->getAccessibleChildCount();
111 for ( sal_Int64 nChild = 0; ( nChild < nChildCount ) && ( -1 == nRet ); ++nChild )
112 {
113 uno::Reference<XAccessible> xChild(xParentContext->getAccessibleChild(nChild));
114 if ( xChild.get() == this )
115 nRet = nChild;
116 }
117 }
118 }
119 catch (const uno::Exception&)
120 {
121 TOOLS_WARN_EXCEPTION( "sfx", "ThumbnailViewAcc::getAccessibleIndexInParent" );
122 }
123
124 return nRet;
125}
126
128{
130 // #i73746# As the Java Access Bridge (v 2.0.1) uses "managesDescendants"
131 // always if the role is LIST, we need a different role in this case
132 return accessibility::AccessibleRole::LIST;
133}
134
136{
138 return "ThumbnailView";
139}
140
142{
144 const SolarMutexGuard aSolarGuard;
145 OUString aRet;
146
147 if (mpParent)
148 {
149 aRet = mpParent->GetAccessibleName();
150 }
151
152 return aRet;
153}
154
155uno::Reference< accessibility::XAccessibleRelationSet > SAL_CALL ThumbnailViewAcc::getAccessibleRelationSet()
156{
158 return uno::Reference< accessibility::XAccessibleRelationSet >();
159}
160
162{
164 sal_Int64 nStateSet = 0;
165
166 // Set some states.
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;
173
174 return nStateSet;
175}
176
177lang::Locale SAL_CALL ThumbnailViewAcc::getLocale()
178{
180 const SolarMutexGuard aSolarGuard;
181 uno::Reference< accessibility::XAccessible > xParent( getAccessibleParent() );
182 lang::Locale aRet( "", "", "" );
183
184 if( xParent.is() )
185 {
186 uno::Reference< accessibility::XAccessibleContext > xParentContext( xParent->getAccessibleContext() );
187
188 if( xParentContext.is() )
189 aRet = xParentContext->getLocale ();
190 }
191
192 return aRet;
193}
194
195void SAL_CALL ThumbnailViewAcc::addAccessibleEventListener( const uno::Reference< accessibility::XAccessibleEventListener >& rxListener )
196{
198 std::unique_lock aGuard (m_aMutex);
199
200 if( !rxListener.is() )
201 return;
202
203 bool bFound = false;
204
205 for (auto const& eventListener : mxEventListeners)
206 {
207 if( eventListener == rxListener )
208 {
209 bFound = true;
210 break;
211 }
212 }
213
214 if (!bFound)
215 mxEventListeners.push_back( rxListener );
216}
217
218void SAL_CALL ThumbnailViewAcc::removeAccessibleEventListener( const uno::Reference< accessibility::XAccessibleEventListener >& rxListener )
219{
221 std::unique_lock aGuard (m_aMutex);
222
223 if( rxListener.is() )
224 {
225 std::vector< uno::Reference< accessibility::XAccessibleEventListener > >::iterator aIter =
226 std::find(mxEventListeners.begin(), mxEventListeners.end(), rxListener);
227
228 if (aIter != mxEventListeners.end())
229 mxEventListeners.erase( aIter );
230 }
231}
232
233sal_Bool SAL_CALL ThumbnailViewAcc::containsPoint( const awt::Point& aPoint )
234{
236 const awt::Rectangle aRect( getBounds() );
237 const Point aSize( aRect.Width, aRect.Height );
238 const Point aNullPoint, aTestPoint( aPoint.X, aPoint.Y );
239
240 return tools::Rectangle( aNullPoint, aSize ).Contains( aTestPoint );
241}
242
243uno::Reference< accessibility::XAccessible > SAL_CALL ThumbnailViewAcc::getAccessibleAtPoint( const awt::Point& aPoint )
244{
246 const SolarMutexGuard aSolarGuard;
247 const sal_uInt16 nItemId = mpParent->GetItemId( Point( aPoint.X, aPoint.Y ) );
248 uno::Reference< accessibility::XAccessible > xRet;
249
250 if ( nItemId )
251 {
252 const size_t nItemPos = mpParent->GetItemPos( nItemId );
253
254 if( THUMBNAILVIEW_ITEM_NONEITEM != nItemPos )
255 {
256 ThumbnailViewItem *const pItem = mpParent->mFilteredItemList[nItemPos];
257 xRet = pItem->GetAccessible( /*bIsTransientChildrenDisabled*/false );
258 }
259 }
260
261 return xRet;
262}
263
264awt::Rectangle SAL_CALL ThumbnailViewAcc::getBounds()
265{
267 const SolarMutexGuard aSolarGuard;
268 const Point aOutPos;
269 const Size aOutSize( mpParent->GetOutputSizePixel() );
270 awt::Rectangle aRet;
271
272 aRet.X = aOutPos.X();
273 aRet.Y = aOutPos.Y();
274 aRet.Width = aOutSize.Width();
275 aRet.Height = aOutSize.Height();
276
277 return aRet;
278}
279
280awt::Point SAL_CALL ThumbnailViewAcc::getLocation()
281{
283 const awt::Rectangle aRect( getBounds() );
284 awt::Point aRet;
285
286 aRet.X = aRect.X;
287 aRet.Y = aRect.Y;
288
289 return aRet;
290}
291
293{
295 const SolarMutexGuard aSolarGuard;
296 awt::Point aScreenLoc(0, 0);
297
298 uno::Reference<accessibility::XAccessible> xParent(getAccessibleParent());
299 if (xParent)
300 {
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() )
305 {
306 awt::Point aParentScreenLoc( xParentComponent->getLocationOnScreen() );
307 awt::Point aOwnRelativeLoc( getLocation() );
308 aScreenLoc.X = aParentScreenLoc.X + aOwnRelativeLoc.X;
309 aScreenLoc.Y = aParentScreenLoc.Y + aOwnRelativeLoc.Y;
310 }
311 }
312
313 return aScreenLoc;
314}
315
316awt::Size SAL_CALL ThumbnailViewAcc::getSize()
317{
319 const awt::Rectangle aRect( getBounds() );
320 awt::Size aRet;
321
322 aRet.Width = aRect.Width;
323 aRet.Height = aRect.Height;
324
325 return aRet;
326}
327
329{
331 const SolarMutexGuard aSolarGuard;
333}
334
336{
339 return static_cast<sal_Int32>(nColor);
340}
341
343{
346 return static_cast<sal_Int32>(nColor);
347}
348
349void SAL_CALL ThumbnailViewAcc::selectAccessibleChild( sal_Int64 nChildIndex )
350{
352 const SolarMutexGuard aSolarGuard;
353
354 if (nChildIndex < 0 || nChildIndex >= getAccessibleChildCount())
355 throw lang::IndexOutOfBoundsException();
356
357 ThumbnailViewItem* pItem = getItem (sal::static_int_cast< sal_uInt16 >(nChildIndex));
358
359 if(pItem == nullptr)
360 throw lang::IndexOutOfBoundsException();
361
362 mpParent->SelectItem( pItem->mnId );
363}
364
366{
368 const SolarMutexGuard aSolarGuard;
369
370 if (nChildIndex < 0 || nChildIndex >= getAccessibleChildCount())
371 throw lang::IndexOutOfBoundsException();
372
373 ThumbnailViewItem* pItem = getItem (sal::static_int_cast< sal_uInt16 >(nChildIndex));
374
375 if (pItem == nullptr)
376 throw lang::IndexOutOfBoundsException();
377
378 return mpParent->IsItemSelected( pItem->mnId );
379}
380
382{
384}
385
387{
389 // unsupported due to single selection only
390}
391
393{
395 const SolarMutexGuard aSolarGuard;
396 sal_Int64 nRet = 0;
397
398 for( sal_uInt16 i = 0, nCount = getItemCount(); i < nCount; i++ )
399 {
400 ThumbnailViewItem* pItem = getItem (i);
401
402 if( pItem && mpParent->IsItemSelected( pItem->mnId ) )
403 ++nRet;
404 }
405
406 return nRet;
407}
408
409uno::Reference< accessibility::XAccessible > SAL_CALL ThumbnailViewAcc::getSelectedAccessibleChild( sal_Int64 nSelectedChildIndex )
410{
412 const SolarMutexGuard aSolarGuard;
413 uno::Reference< accessibility::XAccessible > xRet;
414
415 for( sal_uInt16 i = 0, nCount = getItemCount(), nSel = 0; ( i < nCount ) && !xRet.is(); i++ )
416 {
417 ThumbnailViewItem* pItem = getItem(i);
418
419 if( pItem && mpParent->IsItemSelected( pItem->mnId ) && ( nSelectedChildIndex == static_cast< sal_Int32 >( nSel++ ) ) )
420 xRet = pItem->GetAccessible( /*bIsTransientChildrenDisabled*/false );
421 }
422
423 return xRet;
424}
425
426void SAL_CALL ThumbnailViewAcc::deselectAccessibleChild( sal_Int64 nChildIndex)
427{
429 const SolarMutexGuard aSolarGuard;
430
431 if (nChildIndex < 0 || nChildIndex >= getAccessibleChildCount())
432 throw lang::IndexOutOfBoundsException();
433
434 // Because of the single selection we can reset the whole selection when
435 // the specified child is currently selected.
436//FIXME TODO if (isAccessibleChildSelected(nChildIndex))
437//FIXME TODO ;
438}
439
440void ThumbnailViewAcc::disposing(std::unique_lock<std::mutex>& rGuard)
441{
442 ::std::vector<uno::Reference<accessibility::XAccessibleEventListener> > aListenerListCopy;
443
444 // unlock because we need to take solar and the lock mutex in the correct order
445 rGuard.unlock();
446 {
447 const SolarMutexGuard aSolarGuard;
448 std::unique_lock aGuard (m_aMutex);
449
450 // Reset the pointer to the parent. It has to be the one who has
451 // disposed us because he is dying.
452 mpParent = nullptr;
453
454 if (mxEventListeners.empty())
455 return;
456
457 // Make a copy of the list and clear the original.
458 aListenerListCopy = std::move(mxEventListeners);
459 }
460
461 // Inform all listeners that this objects is disposing.
462 lang::EventObject aEvent (static_cast<accessibility::XAccessible*>(this));
463 for (auto const& listener : aListenerListCopy)
464 {
465 try
466 {
467 listener->disposing (aEvent);
468 }
469 catch(const uno::Exception&)
470 {
471 // Ignore exceptions.
472 }
473 }
474}
475
477{
479}
480
482{
484}
485
487{
488 if (m_bDisposed)
489 {
490 SAL_WARN("sfx", "Calling disposed object. Throwing exception:");
491 throw lang::DisposedException (
492 "object has been already disposed",
493 getXWeak());
494 }
495 else
496 {
497 DBG_ASSERT (mpParent!=nullptr, "ValueSetAcc not disposed but mpParent == NULL");
498 }
499}
500
501ThumbnailViewItemAcc::ThumbnailViewItemAcc( ThumbnailViewItem* pParent, bool bIsTransientChildrenDisabled ) :
502 mpParent( pParent ),
503 mbIsTransientChildrenDisabled( bIsTransientChildrenDisabled )
504{
505}
506
508{
509}
510
512{
513 std::scoped_lock aGuard( maMutex );
514 mpParent = nullptr;
515}
516
517void ThumbnailViewAcc::FireAccessibleEvent( short nEventId, const uno::Any& rOldValue, const uno::Any& rNewValue )
518{
519 if( !nEventId )
520 return;
521
522 ::std::vector< uno::Reference< accessibility::XAccessibleEventListener > > aTmpListeners( mxEventListeners );
523 accessibility::AccessibleEventObject aEvtObject;
524
525 aEvtObject.EventId = nEventId;
526 aEvtObject.Source = getXWeak();
527 aEvtObject.NewValue = rNewValue;
528 aEvtObject.OldValue = rOldValue;
529
530 for (auto const& tmpListener : aTmpListeners)
531 {
532 try
533 {
534 tmpListener->notifyEvent( aEvtObject );
535 }
536 catch(const uno::Exception&)
537 {
538 }
539 }
540}
541
542ThumbnailViewItemAcc* ThumbnailViewItemAcc::getImplementation( const uno::Reference< uno::XInterface >& rxData )
543 noexcept
544{
545 return dynamic_cast<ThumbnailViewItemAcc*>(rxData.get());
546}
547
549{
550 // Broadcast the state change.
551 css::uno::Any aOldState, aNewState;
552 aNewState <<= css::accessibility::AccessibleStateType::FOCUSED;
554 css::accessibility::AccessibleEventId::STATE_CHANGED,
555 aOldState, aNewState);
556}
557
559{
560 // Broadcast the state change.
561 css::uno::Any aOldState, aNewState;
562 aOldState <<= css::accessibility::AccessibleStateType::FOCUSED;
564 css::accessibility::AccessibleEventId::STATE_CHANGED,
565 aOldState, aNewState);
566}
567
568uno::Reference< accessibility::XAccessibleContext > SAL_CALL ThumbnailViewItemAcc::getAccessibleContext()
569{
570 return this;
571}
572
574{
575 return 0;
576}
577
578uno::Reference< accessibility::XAccessible > SAL_CALL ThumbnailViewItemAcc::getAccessibleChild( sal_Int64 )
579{
580 throw lang::IndexOutOfBoundsException();
581}
582
583uno::Reference< accessibility::XAccessible > SAL_CALL ThumbnailViewItemAcc::getAccessibleParent()
584{
585 const SolarMutexGuard aSolarGuard;
586 uno::Reference< accessibility::XAccessible > xRet;
587
588 if( mpParent )
590
591 return xRet;
592}
593
595{
596 const SolarMutexGuard aSolarGuard;
597 // The index defaults to -1 to indicate the child does not belong to its
598 // parent.
599 sal_Int64 nIndexInParent = -1;
600
601 if( mpParent )
602 {
603 bool bDone = false;
604
606 ThumbnailViewItem* pItem;
607 for (sal_uInt16 i=0; i<nCount && !bDone; i++)
608 {
609 // Guard the retrieval of the i-th child with a try/catch block
610 // just in case the number of children changes in the meantime.
611 try
612 {
614 }
615 catch (const lang::IndexOutOfBoundsException&)
616 {
617 pItem = nullptr;
618 }
619
620 // Do not create an accessible object for the test.
621 if (pItem != nullptr && pItem->mxAcc.is())
622 if (pItem->GetAccessible( mbIsTransientChildrenDisabled ).get() == this )
623 {
624 nIndexInParent = i;
625 bDone = true;
626 }
627 }
628 }
629
630 return nIndexInParent;
631}
632
634{
635 return accessibility::AccessibleRole::LIST_ITEM;
636}
637
639{
640 return OUString();
641}
642
644{
645 const SolarMutexGuard aSolarGuard;
646 OUString aRet;
647
648 if( mpParent )
649 {
650 aRet = mpParent->maTitle;
651
652 if( aRet.isEmpty() )
653 {
654 aRet = "Item " + OUString::number(static_cast<sal_Int32>(mpParent->mnId));
655 }
656 }
657
658 return aRet;
659}
660
661uno::Reference< accessibility::XAccessibleRelationSet > SAL_CALL ThumbnailViewItemAcc::getAccessibleRelationSet()
662{
663 return uno::Reference< accessibility::XAccessibleRelationSet >();
664}
665
667{
668 const SolarMutexGuard aSolarGuard;
669 sal_Int64 nStateSet = 0;
670
671 if( mpParent )
672 {
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;
679
680 nStateSet |= accessibility::AccessibleStateType::SELECTABLE;
681 nStateSet |= accessibility::AccessibleStateType::FOCUSABLE;
682
683 if( mpParent->isSelected() )
684 {
685 nStateSet |= accessibility::AccessibleStateType::SELECTED;
687 nStateSet |= accessibility::AccessibleStateType::FOCUSED;
688 }
689 }
690
691 return nStateSet;
692}
693
694lang::Locale SAL_CALL ThumbnailViewItemAcc::getLocale()
695{
696 const SolarMutexGuard aSolarGuard;
697 uno::Reference< accessibility::XAccessible > xParent( getAccessibleParent() );
698 lang::Locale aRet( "", "", "" );
699
700 if( xParent.is() )
701 {
702 uno::Reference< accessibility::XAccessibleContext > xParentContext( xParent->getAccessibleContext() );
703
704 if( xParentContext.is() )
705 aRet = xParentContext->getLocale();
706 }
707
708 return aRet;
709}
710
711void SAL_CALL ThumbnailViewItemAcc::addAccessibleEventListener( const uno::Reference< accessibility::XAccessibleEventListener >& rxListener )
712{
713 std::scoped_lock aGuard( maMutex );
714
715 if( !rxListener.is() )
716 return;
717
718 bool bFound = false;
719
720 for (auto const& eventListener : mxEventListeners)
721 {
722 if( eventListener == rxListener )
723 {
724 bFound = true;
725 break;
726 }
727 }
728
729 if (!bFound)
730 mxEventListeners.push_back( rxListener );
731}
732
733void SAL_CALL ThumbnailViewItemAcc::removeAccessibleEventListener( const uno::Reference< accessibility::XAccessibleEventListener >& rxListener )
734{
735 std::scoped_lock aGuard( maMutex );
736
737 if( rxListener.is() )
738 {
739 std::vector< uno::Reference< accessibility::XAccessibleEventListener > >::iterator aIter =
740 std::find(mxEventListeners.begin(), mxEventListeners.end(), rxListener);
741
742 if (aIter != mxEventListeners.end())
743 mxEventListeners.erase( aIter );
744 }
745}
746
747sal_Bool SAL_CALL ThumbnailViewItemAcc::containsPoint( const awt::Point& aPoint )
748{
749 const awt::Rectangle aRect( getBounds() );
750 const Point aSize( aRect.Width, aRect.Height );
751 const Point aNullPoint, aTestPoint( aPoint.X, aPoint.Y );
752
753 return tools::Rectangle( aNullPoint, aSize ).Contains( aTestPoint );
754}
755
756uno::Reference< accessibility::XAccessible > SAL_CALL ThumbnailViewItemAcc::getAccessibleAtPoint( const awt::Point& )
757{
758 uno::Reference< accessibility::XAccessible > xRet;
759 return xRet;
760}
761
762awt::Rectangle SAL_CALL ThumbnailViewItemAcc::getBounds()
763{
764 const SolarMutexGuard aSolarGuard;
765 awt::Rectangle aRet;
766
767 if( mpParent )
768 {
770 tools::Rectangle aParentRect;
771
772 // get position of the accessible parent in screen coordinates
773 uno::Reference< XAccessible > xParent = getAccessibleParent();
774 if ( xParent.is() )
775 {
776 uno::Reference<XAccessibleComponent> xParentComponent(xParent->getAccessibleContext(), uno::UNO_QUERY);
777 if (xParentComponent.is())
778 {
779 awt::Size aParentSize = xParentComponent->getSize();
780 aParentRect = tools::Rectangle(0, 0, aParentSize.Width, aParentSize.Height);
781 }
782 }
783
784 aRect.Intersection( aParentRect );
785
786 aRet.X = aRect.Left();
787 aRet.Y = aRect.Top();
788 aRet.Width = aRect.GetWidth();
789 aRet.Height = aRect.GetHeight();
790 }
791
792 return aRet;
793}
794
796{
797 const awt::Rectangle aRect( getBounds() );
798 awt::Point aRet;
799
800 aRet.X = aRect.X;
801 aRet.Y = aRect.Y;
802
803 return aRet;
804}
805
806// get position of the accessible parent in screen coordinates
808{
809 const SolarMutexGuard aSolarGuard;
810 awt::Point aRet;
811
812 if (mpParent)
813 {
814 const Point aPos = mpParent->getDrawArea().TopLeft();
816
817 aRet.X = aPos.X() + aScreenPos.X();
818 aRet.Y = aPos.Y() + aScreenPos.X();
819 }
820
821 return aRet;
822}
823
825{
826 const awt::Rectangle aRect( getBounds() );
827 awt::Size aRet;
828
829 aRet.Width = aRect.Width;
830 aRet.Height = aRect.Height;
831
832 return aRet;
833}
834
836{
837 // nothing to do
838}
839
841{
843 return static_cast<sal_Int32>(nColor);
844}
845
847{
848 return static_cast<sal_Int32>(Application::GetSettings().GetStyleSettings().GetWindowColor());
849}
850
851/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
AnyEventRef aEvent
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
ThumbnailView * mpParent
::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
css::uno::Reference< css::accessibility::XAccessible > const & GetAccessible(bool bIsTransientChildrenDisabled)
css::uno::Reference< css::accessibility::XAccessible > mxAcc
ThumbnailView & mrParent
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.
constexpr tools::Long GetWidth() const
bool Contains(const Point &rPOINT) const
constexpr tools::Long Top() const
constexpr Point TopLeft() const
constexpr tools::Long GetHeight() const
tools::Rectangle & Intersection(const tools::Rectangle &rRect)
constexpr tools::Long Left() const
OUString GetAccessibleName() const
weld::DrawingArea * GetDrawingArea() const
Size const & GetOutputSizePixel() const
virtual a11yref get_accessible_parent()=0
virtual Point get_accessible_location_on_screen()=0
int nCount
#define DBG_ASSERT(sCon, aError)
#define TOOLS_WARN_EXCEPTION(area, stream)
RegionData_Impl * mpParent
Definition: doctempl.cxx:102
sal_Int32 nIndex
#define SAL_WARN(area, stream)
int i
#define THUMBNAILVIEW_ITEM_NONEITEM
unsigned char sal_Bool