1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #include "thumbnailviewacc.hxx"
22 #include <comphelper/servicehelper.hxx>
23 #include <sfx2/thumbnailview.hxx>
24 #include <sfx2/thumbnailviewitem.hxx>
25 #include <vcl/svapp.hxx>
26 #include <vcl/settings.hxx>
27 #include <sal/log.hxx>
28 #include <tools/debug.hxx>
29 #include <comphelper/diagnose_ex.hxx>
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>
36 using namespace ::com::sun::star
;
38 ThumbnailViewAcc::ThumbnailViewAcc( ThumbnailView
* pParent
) :
43 ThumbnailViewAcc::~ThumbnailViewAcc()
47 uno::Reference
< accessibility::XAccessibleContext
> SAL_CALL
ThumbnailViewAcc::getAccessibleContext()
53 sal_Int64 SAL_CALL
ThumbnailViewAcc::getAccessibleChildCount()
55 const SolarMutexGuard aSolarGuard
;
58 return mpParent
->ImplGetVisibleItemCount();
61 uno::Reference
< accessibility::XAccessible
> SAL_CALL
ThumbnailViewAcc::getAccessibleChild( sal_Int64 i
)
64 const SolarMutexGuard aSolarGuard
;
66 if (i
< 0 || i
>= getAccessibleChildCount())
67 throw lang::IndexOutOfBoundsException();
69 ThumbnailViewItem
* pItem
= getItem (sal::static_int_cast
< sal_uInt16
>(i
));
72 throw lang::IndexOutOfBoundsException();
74 uno::Reference
< accessibility::XAccessible
> xRet
= pItem
->GetAccessible( /*bIsTransientChildrenDisabled*/false );
78 uno::Reference
< accessibility::XAccessible
> SAL_CALL
ThumbnailViewAcc::getAccessibleParent()
81 const SolarMutexGuard aSolarGuard
;
82 return mpParent
->GetDrawingArea()->get_accessible_parent();
85 sal_Int64 SAL_CALL
ThumbnailViewAcc::getAccessibleIndexInParent()
88 const SolarMutexGuard aSolarGuard
;
90 // -1 for child not found/no parent (according to specification)
93 uno::Reference
<accessibility::XAccessible
> xParent(getAccessibleParent());
99 uno::Reference
<accessibility::XAccessibleContext
> xParentContext(xParent
->getAccessibleContext());
101 // iterate over parent's children and search for this object
102 if ( xParentContext
.is() )
104 sal_Int64 nChildCount
= xParentContext
->getAccessibleChildCount();
105 for ( sal_Int64 nChild
= 0; ( nChild
< nChildCount
) && ( -1 == nRet
); ++nChild
)
107 uno::Reference
<XAccessible
> xChild(xParentContext
->getAccessibleChild(nChild
));
108 if ( xChild
.get() == this )
113 catch (const uno::Exception
&)
115 TOOLS_WARN_EXCEPTION( "sfx", "ThumbnailViewAcc::getAccessibleIndexInParent" );
121 sal_Int16 SAL_CALL
ThumbnailViewAcc::getAccessibleRole()
124 // #i73746# As the Java Access Bridge (v 2.0.1) uses "managesDescendants"
125 // always if the role is LIST, we need a different role in this case
126 return accessibility::AccessibleRole::LIST
;
129 OUString SAL_CALL
ThumbnailViewAcc::getAccessibleDescription()
132 return "ThumbnailView";
135 OUString SAL_CALL
ThumbnailViewAcc::getAccessibleName()
138 const SolarMutexGuard aSolarGuard
;
143 aRet
= mpParent
->GetAccessibleName();
149 uno::Reference
< accessibility::XAccessibleRelationSet
> SAL_CALL
ThumbnailViewAcc::getAccessibleRelationSet()
152 return uno::Reference
< accessibility::XAccessibleRelationSet
>();
155 sal_Int64 SAL_CALL
ThumbnailViewAcc::getAccessibleStateSet()
158 sal_Int64 nStateSet
= 0;
161 nStateSet
|= accessibility::AccessibleStateType::ENABLED
;
162 nStateSet
|= accessibility::AccessibleStateType::SENSITIVE
;
163 nStateSet
|= accessibility::AccessibleStateType::SHOWING
;
164 nStateSet
|= accessibility::AccessibleStateType::VISIBLE
;
165 nStateSet
|= accessibility::AccessibleStateType::MANAGES_DESCENDANTS
;
166 nStateSet
|= accessibility::AccessibleStateType::FOCUSABLE
;
171 lang::Locale SAL_CALL
ThumbnailViewAcc::getLocale()
174 const SolarMutexGuard aSolarGuard
;
175 uno::Reference
< accessibility::XAccessible
> xParent( getAccessibleParent() );
176 lang::Locale
aRet( "", "", "" );
180 uno::Reference
< accessibility::XAccessibleContext
> xParentContext( xParent
->getAccessibleContext() );
182 if( xParentContext
.is() )
183 aRet
= xParentContext
->getLocale ();
189 void SAL_CALL
ThumbnailViewAcc::addAccessibleEventListener( const uno::Reference
< accessibility::XAccessibleEventListener
>& rxListener
)
192 std::unique_lock
aGuard (m_aMutex
);
194 if( !rxListener
.is() )
199 for (auto const& eventListener
: mxEventListeners
)
201 if( eventListener
== rxListener
)
209 mxEventListeners
.push_back( rxListener
);
212 void SAL_CALL
ThumbnailViewAcc::removeAccessibleEventListener( const uno::Reference
< accessibility::XAccessibleEventListener
>& rxListener
)
215 std::unique_lock
aGuard (m_aMutex
);
217 if( rxListener
.is() )
219 std::vector
< uno::Reference
< accessibility::XAccessibleEventListener
> >::iterator aIter
=
220 std::find(mxEventListeners
.begin(), mxEventListeners
.end(), rxListener
);
222 if (aIter
!= mxEventListeners
.end())
223 mxEventListeners
.erase( aIter
);
227 sal_Bool SAL_CALL
ThumbnailViewAcc::containsPoint( const awt::Point
& aPoint
)
230 const awt::Rectangle
aRect( getBounds() );
231 const Point
aSize( aRect
.Width
, aRect
.Height
);
232 const Point aNullPoint
, aTestPoint( aPoint
.X
, aPoint
.Y
);
234 return tools::Rectangle( aNullPoint
, aSize
).Contains( aTestPoint
);
237 uno::Reference
< accessibility::XAccessible
> SAL_CALL
ThumbnailViewAcc::getAccessibleAtPoint( const awt::Point
& aPoint
)
240 const SolarMutexGuard aSolarGuard
;
241 const sal_uInt16 nItemId
= mpParent
->GetItemId( Point( aPoint
.X
, aPoint
.Y
) );
242 uno::Reference
< accessibility::XAccessible
> xRet
;
246 const size_t nItemPos
= mpParent
->GetItemPos( nItemId
);
248 if( THUMBNAILVIEW_ITEM_NONEITEM
!= nItemPos
)
250 ThumbnailViewItem
*const pItem
= mpParent
->mFilteredItemList
[nItemPos
];
251 xRet
= pItem
->GetAccessible( /*bIsTransientChildrenDisabled*/false );
258 awt::Rectangle SAL_CALL
ThumbnailViewAcc::getBounds()
261 const SolarMutexGuard aSolarGuard
;
263 const Size
aOutSize( mpParent
->GetOutputSizePixel() );
266 aRet
.X
= aOutPos
.X();
267 aRet
.Y
= aOutPos
.Y();
268 aRet
.Width
= aOutSize
.Width();
269 aRet
.Height
= aOutSize
.Height();
274 awt::Point SAL_CALL
ThumbnailViewAcc::getLocation()
277 const awt::Rectangle
aRect( getBounds() );
286 awt::Point SAL_CALL
ThumbnailViewAcc::getLocationOnScreen()
289 const SolarMutexGuard aSolarGuard
;
290 awt::Point
aScreenLoc(0, 0);
292 uno::Reference
<accessibility::XAccessible
> xParent(getAccessibleParent());
295 uno::Reference
<accessibility::XAccessibleContext
> xParentContext(xParent
->getAccessibleContext());
296 uno::Reference
<accessibility::XAccessibleComponent
> xParentComponent(xParentContext
, css::uno::UNO_QUERY
);
297 OSL_ENSURE( xParentComponent
.is(), "ThumbnailViewAcc::getLocationOnScreen: no parent component!" );
298 if ( xParentComponent
.is() )
300 awt::Point
aParentScreenLoc( xParentComponent
->getLocationOnScreen() );
301 awt::Point
aOwnRelativeLoc( getLocation() );
302 aScreenLoc
.X
= aParentScreenLoc
.X
+ aOwnRelativeLoc
.X
;
303 aScreenLoc
.Y
= aParentScreenLoc
.Y
+ aOwnRelativeLoc
.Y
;
310 awt::Size SAL_CALL
ThumbnailViewAcc::getSize()
313 const awt::Rectangle
aRect( getBounds() );
316 aRet
.Width
= aRect
.Width
;
317 aRet
.Height
= aRect
.Height
;
322 void SAL_CALL
ThumbnailViewAcc::grabFocus()
325 const SolarMutexGuard aSolarGuard
;
326 mpParent
->GrabFocus();
329 sal_Int32 SAL_CALL
ThumbnailViewAcc::getForeground( )
332 Color nColor
= Application::GetSettings().GetStyleSettings().GetWindowTextColor();
333 return static_cast<sal_Int32
>(nColor
);
336 sal_Int32 SAL_CALL
ThumbnailViewAcc::getBackground( )
339 Color nColor
= Application::GetSettings().GetStyleSettings().GetWindowColor();
340 return static_cast<sal_Int32
>(nColor
);
343 void SAL_CALL
ThumbnailViewAcc::selectAccessibleChild( sal_Int64 nChildIndex
)
346 const SolarMutexGuard aSolarGuard
;
348 if (nChildIndex
< 0 || nChildIndex
>= getAccessibleChildCount())
349 throw lang::IndexOutOfBoundsException();
351 ThumbnailViewItem
* pItem
= getItem (sal::static_int_cast
< sal_uInt16
>(nChildIndex
));
354 throw lang::IndexOutOfBoundsException();
356 mpParent
->SelectItem( pItem
->mnId
);
359 sal_Bool SAL_CALL
ThumbnailViewAcc::isAccessibleChildSelected( sal_Int64 nChildIndex
)
362 const SolarMutexGuard aSolarGuard
;
364 if (nChildIndex
< 0 || nChildIndex
>= getAccessibleChildCount())
365 throw lang::IndexOutOfBoundsException();
367 ThumbnailViewItem
* pItem
= getItem (sal::static_int_cast
< sal_uInt16
>(nChildIndex
));
369 if (pItem
== nullptr)
370 throw lang::IndexOutOfBoundsException();
372 return mpParent
->IsItemSelected( pItem
->mnId
);
375 void SAL_CALL
ThumbnailViewAcc::clearAccessibleSelection()
380 void SAL_CALL
ThumbnailViewAcc::selectAllAccessibleChildren()
383 // unsupported due to single selection only
386 sal_Int64 SAL_CALL
ThumbnailViewAcc::getSelectedAccessibleChildCount()
389 const SolarMutexGuard aSolarGuard
;
392 for( sal_uInt16 i
= 0, nCount
= getItemCount(); i
< nCount
; i
++ )
394 ThumbnailViewItem
* pItem
= getItem (i
);
396 if( pItem
&& mpParent
->IsItemSelected( pItem
->mnId
) )
403 uno::Reference
< accessibility::XAccessible
> SAL_CALL
ThumbnailViewAcc::getSelectedAccessibleChild( sal_Int64 nSelectedChildIndex
)
406 const SolarMutexGuard aSolarGuard
;
407 uno::Reference
< accessibility::XAccessible
> xRet
;
409 for( sal_uInt16 i
= 0, nCount
= getItemCount(), nSel
= 0; ( i
< nCount
) && !xRet
.is(); i
++ )
411 ThumbnailViewItem
* pItem
= getItem(i
);
413 if( pItem
&& mpParent
->IsItemSelected( pItem
->mnId
) && ( nSelectedChildIndex
== static_cast< sal_Int32
>( nSel
++ ) ) )
414 xRet
= pItem
->GetAccessible( /*bIsTransientChildrenDisabled*/false );
420 void SAL_CALL
ThumbnailViewAcc::deselectAccessibleChild( sal_Int64 nChildIndex
)
423 const SolarMutexGuard aSolarGuard
;
425 if (nChildIndex
< 0 || nChildIndex
>= getAccessibleChildCount())
426 throw lang::IndexOutOfBoundsException();
428 // Because of the single selection we can reset the whole selection when
429 // the specified child is currently selected.
430 //FIXME TODO if (isAccessibleChildSelected(nChildIndex))
434 void ThumbnailViewAcc::disposing(std::unique_lock
<std::mutex
>& rGuard
)
436 ::std::vector
<uno::Reference
<accessibility::XAccessibleEventListener
> > aListenerListCopy
;
438 // unlock because we need to take solar and the lock mutex in the correct order
441 const SolarMutexGuard aSolarGuard
;
442 std::unique_lock
aGuard (m_aMutex
);
444 // Reset the pointer to the parent. It has to be the one who has
445 // disposed us because he is dying.
448 if (mxEventListeners
.empty())
451 // Make a copy of the list and clear the original.
452 aListenerListCopy
= std::move(mxEventListeners
);
455 // Inform all listeners that this objects is disposing.
456 lang::EventObject
aEvent (static_cast<accessibility::XAccessible
*>(this));
457 for (auto const& listener
: aListenerListCopy
)
461 listener
->disposing (aEvent
);
463 catch(const uno::Exception
&)
465 // Ignore exceptions.
470 sal_uInt16
ThumbnailViewAcc::getItemCount() const
472 return mpParent
->ImplGetVisibleItemCount();
475 ThumbnailViewItem
* ThumbnailViewAcc::getItem (sal_uInt16 nIndex
) const
477 return mpParent
->ImplGetVisibleItem (nIndex
);
480 void ThumbnailViewAcc::ThrowIfDisposed()
484 SAL_WARN("sfx", "Calling disposed object. Throwing exception:");
485 throw lang::DisposedException (
486 "object has been already disposed",
491 DBG_ASSERT (mpParent
!=nullptr, "ValueSetAcc not disposed but mpParent == NULL");
495 ThumbnailViewItemAcc::ThumbnailViewItemAcc( ThumbnailViewItem
* pParent
, bool bIsTransientChildrenDisabled
) :
497 mbIsTransientChildrenDisabled( bIsTransientChildrenDisabled
)
501 ThumbnailViewItemAcc::~ThumbnailViewItemAcc()
505 void ThumbnailViewItemAcc::ParentDestroyed()
507 std::scoped_lock
aGuard( maMutex
);
511 void ThumbnailViewAcc::FireAccessibleEvent( short nEventId
, const uno::Any
& rOldValue
, const uno::Any
& rNewValue
)
516 ::std::vector
< uno::Reference
< accessibility::XAccessibleEventListener
> > aTmpListeners( mxEventListeners
);
517 accessibility::AccessibleEventObject aEvtObject
;
519 aEvtObject
.EventId
= nEventId
;
520 aEvtObject
.Source
= getXWeak();
521 aEvtObject
.NewValue
= rNewValue
;
522 aEvtObject
.OldValue
= rOldValue
;
523 aEvtObject
.IndexHint
= -1;
525 for (auto const& tmpListener
: aTmpListeners
)
529 tmpListener
->notifyEvent( aEvtObject
);
531 catch(const uno::Exception
&)
537 void ThumbnailViewAcc::GetFocus()
539 // Broadcast the state change.
540 css::uno::Any aOldState
, aNewState
;
541 aNewState
<<= css::accessibility::AccessibleStateType::FOCUSED
;
543 css::accessibility::AccessibleEventId::STATE_CHANGED
,
544 aOldState
, aNewState
);
547 void ThumbnailViewAcc::LoseFocus()
549 // Broadcast the state change.
550 css::uno::Any aOldState
, aNewState
;
551 aOldState
<<= css::accessibility::AccessibleStateType::FOCUSED
;
553 css::accessibility::AccessibleEventId::STATE_CHANGED
,
554 aOldState
, aNewState
);
557 uno::Reference
< accessibility::XAccessibleContext
> SAL_CALL
ThumbnailViewItemAcc::getAccessibleContext()
562 sal_Int64 SAL_CALL
ThumbnailViewItemAcc::getAccessibleChildCount()
567 uno::Reference
< accessibility::XAccessible
> SAL_CALL
ThumbnailViewItemAcc::getAccessibleChild( sal_Int64
)
569 throw lang::IndexOutOfBoundsException();
572 uno::Reference
< accessibility::XAccessible
> SAL_CALL
ThumbnailViewItemAcc::getAccessibleParent()
574 const SolarMutexGuard aSolarGuard
;
575 uno::Reference
< accessibility::XAccessible
> xRet
;
578 xRet
= mpParent
->mrParent
.getAccessible();
583 sal_Int64 SAL_CALL
ThumbnailViewItemAcc::getAccessibleIndexInParent()
585 const SolarMutexGuard aSolarGuard
;
586 // The index defaults to -1 to indicate the child does not belong to its
588 sal_Int64 nIndexInParent
= -1;
594 sal_uInt16 nCount
= mpParent
->mrParent
.ImplGetVisibleItemCount();
595 ThumbnailViewItem
* pItem
;
596 for (sal_uInt16 i
=0; i
<nCount
&& !bDone
; i
++)
598 // Guard the retrieval of the i-th child with a try/catch block
599 // just in case the number of children changes in the meantime.
602 pItem
= mpParent
->mrParent
.ImplGetVisibleItem (i
);
604 catch (const lang::IndexOutOfBoundsException
&)
609 // Do not create an accessible object for the test.
610 if (pItem
!= nullptr && pItem
->mxAcc
.is())
611 if (pItem
->GetAccessible( mbIsTransientChildrenDisabled
).get() == this )
619 return nIndexInParent
;
622 sal_Int16 SAL_CALL
ThumbnailViewItemAcc::getAccessibleRole()
624 return accessibility::AccessibleRole::LIST_ITEM
;
627 OUString SAL_CALL
ThumbnailViewItemAcc::getAccessibleDescription()
632 OUString SAL_CALL
ThumbnailViewItemAcc::getAccessibleName()
634 const SolarMutexGuard aSolarGuard
;
639 aRet
= mpParent
->maTitle
;
643 aRet
= "Item " + OUString::number(static_cast<sal_Int32
>(mpParent
->mnId
));
650 uno::Reference
< accessibility::XAccessibleRelationSet
> SAL_CALL
ThumbnailViewItemAcc::getAccessibleRelationSet()
652 return uno::Reference
< accessibility::XAccessibleRelationSet
>();
655 sal_Int64 SAL_CALL
ThumbnailViewItemAcc::getAccessibleStateSet()
657 const SolarMutexGuard aSolarGuard
;
658 sal_Int64 nStateSet
= 0;
662 nStateSet
|= accessibility::AccessibleStateType::ENABLED
;
663 nStateSet
|= accessibility::AccessibleStateType::SENSITIVE
;
664 nStateSet
|= accessibility::AccessibleStateType::SHOWING
;
665 nStateSet
|= accessibility::AccessibleStateType::VISIBLE
;
666 if ( !mbIsTransientChildrenDisabled
)
667 nStateSet
|= accessibility::AccessibleStateType::TRANSIENT
;
669 nStateSet
|= accessibility::AccessibleStateType::SELECTABLE
;
670 nStateSet
|= accessibility::AccessibleStateType::FOCUSABLE
;
672 if( mpParent
->isSelected() )
674 nStateSet
|= accessibility::AccessibleStateType::SELECTED
;
675 if (mpParent
->mrParent
.HasChildFocus())
676 nStateSet
|= accessibility::AccessibleStateType::FOCUSED
;
683 lang::Locale SAL_CALL
ThumbnailViewItemAcc::getLocale()
685 const SolarMutexGuard aSolarGuard
;
686 uno::Reference
< accessibility::XAccessible
> xParent( getAccessibleParent() );
687 lang::Locale
aRet( "", "", "" );
691 uno::Reference
< accessibility::XAccessibleContext
> xParentContext( xParent
->getAccessibleContext() );
693 if( xParentContext
.is() )
694 aRet
= xParentContext
->getLocale();
700 void SAL_CALL
ThumbnailViewItemAcc::addAccessibleEventListener( const uno::Reference
< accessibility::XAccessibleEventListener
>& rxListener
)
702 std::scoped_lock
aGuard( maMutex
);
704 if( !rxListener
.is() )
709 for (auto const& eventListener
: mxEventListeners
)
711 if( eventListener
== rxListener
)
719 mxEventListeners
.push_back( rxListener
);
722 void SAL_CALL
ThumbnailViewItemAcc::removeAccessibleEventListener( const uno::Reference
< accessibility::XAccessibleEventListener
>& rxListener
)
724 std::scoped_lock
aGuard( maMutex
);
726 if( rxListener
.is() )
728 std::vector
< uno::Reference
< accessibility::XAccessibleEventListener
> >::iterator aIter
=
729 std::find(mxEventListeners
.begin(), mxEventListeners
.end(), rxListener
);
731 if (aIter
!= mxEventListeners
.end())
732 mxEventListeners
.erase( aIter
);
736 sal_Bool SAL_CALL
ThumbnailViewItemAcc::containsPoint( const awt::Point
& aPoint
)
738 const awt::Rectangle
aRect( getBounds() );
739 const Point
aSize( aRect
.Width
, aRect
.Height
);
740 const Point aNullPoint
, aTestPoint( aPoint
.X
, aPoint
.Y
);
742 return tools::Rectangle( aNullPoint
, aSize
).Contains( aTestPoint
);
745 uno::Reference
< accessibility::XAccessible
> SAL_CALL
ThumbnailViewItemAcc::getAccessibleAtPoint( const awt::Point
& )
747 uno::Reference
< accessibility::XAccessible
> xRet
;
751 awt::Rectangle SAL_CALL
ThumbnailViewItemAcc::getBounds()
753 const SolarMutexGuard aSolarGuard
;
758 tools::Rectangle
aRect( mpParent
->getDrawArea() );
759 tools::Rectangle aParentRect
;
761 // get position of the accessible parent in screen coordinates
762 uno::Reference
< XAccessible
> xParent
= getAccessibleParent();
765 uno::Reference
<XAccessibleComponent
> xParentComponent(xParent
->getAccessibleContext(), uno::UNO_QUERY
);
766 if (xParentComponent
.is())
768 awt::Size aParentSize
= xParentComponent
->getSize();
769 aParentRect
= tools::Rectangle(0, 0, aParentSize
.Width
, aParentSize
.Height
);
773 aRect
.Intersection( aParentRect
);
775 aRet
.X
= aRect
.Left();
776 aRet
.Y
= aRect
.Top();
777 aRet
.Width
= aRect
.GetWidth();
778 aRet
.Height
= aRect
.GetHeight();
784 awt::Point SAL_CALL
ThumbnailViewItemAcc::getLocation()
786 const awt::Rectangle
aRect( getBounds() );
795 // get position of the accessible parent in screen coordinates
796 awt::Point SAL_CALL
ThumbnailViewItemAcc::getLocationOnScreen()
798 const SolarMutexGuard aSolarGuard
;
803 const Point aPos
= mpParent
->getDrawArea().TopLeft();
804 const Point
aScreenPos(mpParent
->mrParent
.GetDrawingArea()->get_accessible_location_on_screen());
806 aRet
.X
= aPos
.X() + aScreenPos
.X();
807 aRet
.Y
= aPos
.Y() + aScreenPos
.X();
813 awt::Size SAL_CALL
ThumbnailViewItemAcc::getSize()
815 const awt::Rectangle
aRect( getBounds() );
818 aRet
.Width
= aRect
.Width
;
819 aRet
.Height
= aRect
.Height
;
824 void SAL_CALL
ThumbnailViewItemAcc::grabFocus()
829 sal_Int32 SAL_CALL
ThumbnailViewItemAcc::getForeground( )
831 Color nColor
= Application::GetSettings().GetStyleSettings().GetWindowTextColor();
832 return static_cast<sal_Int32
>(nColor
);
835 sal_Int32 SAL_CALL
ThumbnailViewItemAcc::getBackground( )
837 return static_cast<sal_Int32
>(Application::GetSettings().GetStyleSettings().GetWindowColor());
840 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */