LCOV - code coverage report
Current view: top level - sfx2/source/control - thumbnailviewacc.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 0 467 0.0 %
Date: 2012-08-25 Functions: 0 74 0.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 0 666 0.0 %

           Branch data     Line data    Source code
       1                 :            : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2                 :            : /*************************************************************************
       3                 :            :  *
       4                 :            :  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
       5                 :            :  *
       6                 :            :  * Copyright 2000, 2010 Oracle and/or its affiliates.
       7                 :            :  *
       8                 :            :  * OpenOffice.org - a multi-platform office productivity suite
       9                 :            :  *
      10                 :            :  * This file is part of OpenOffice.org.
      11                 :            :  *
      12                 :            :  * OpenOffice.org is free software: you can redistribute it and/or modify
      13                 :            :  * it under the terms of the GNU Lesser General Public License version 3
      14                 :            :  * only, as published by the Free Software Foundation.
      15                 :            :  *
      16                 :            :  * OpenOffice.org is distributed in the hope that it will be useful,
      17                 :            :  * but WITHOUT ANY WARRANTY; without even the implied warranty of
      18                 :            :  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      19                 :            :  * GNU Lesser General Public License version 3 for more details
      20                 :            :  * (a copy is included in the LICENSE file that accompanied this code).
      21                 :            :  *
      22                 :            :  * You should have received a copy of the GNU Lesser General Public License
      23                 :            :  * version 3 along with OpenOffice.org.  If not, see
      24                 :            :  * <http://www.openoffice.org/license.html>
      25                 :            :  * for a copy of the LGPLv3 License.
      26                 :            :  *
      27                 :            :  ************************************************************************/
      28                 :            : 
      29                 :            : #include "thumbnailviewacc.hxx"
      30                 :            : 
      31                 :            : #include <comphelper/servicehelper.hxx>
      32                 :            : #include <sfx2/thumbnailview.hxx>
      33                 :            : #include <sfx2/thumbnailviewitem.hxx>
      34                 :            : #include <unotools/accessiblestatesethelper.hxx>
      35                 :            : #include <vcl/svapp.hxx>
      36                 :            : 
      37                 :            : #include <com/sun/star/accessibility/AccessibleEventId.hpp>
      38                 :            : #include <com/sun/star/accessibility/AccessibleRole.hpp>
      39                 :            : #include <com/sun/star/accessibility/AccessibleStateType.hpp>
      40                 :            : 
      41                 :            : using namespace ::com::sun::star;
      42                 :            : 
      43                 :          0 : ThumbnailViewAcc::ThumbnailViewAcc( ThumbnailView* pParent, bool bIsTransientChildrenDisabled ) :
      44                 :            :     ValueSetAccComponentBase (m_aMutex),
      45                 :            :     mpParent( pParent ),
      46                 :            :     mbIsTransientChildrenDisabled( bIsTransientChildrenDisabled ),
      47         [ #  # ]:          0 :     mbIsFocused(false)
      48                 :            : {
      49                 :          0 : }
      50                 :            : 
      51         [ #  # ]:          0 : ThumbnailViewAcc::~ThumbnailViewAcc()
      52                 :            : {
      53         [ #  # ]:          0 : }
      54                 :            : 
      55                 :          0 : void ThumbnailViewAcc::FireAccessibleEvent( short nEventId, const uno::Any& rOldValue, const uno::Any& rNewValue )
      56                 :            : {
      57         [ #  # ]:          0 :     if( nEventId )
      58                 :            :     {
      59         [ #  # ]:          0 :         ::std::vector< uno::Reference< accessibility::XAccessibleEventListener > > aTmpListeners( mxEventListeners );
      60   [ #  #  #  # ]:          0 :         ::std::vector< uno::Reference< accessibility::XAccessibleEventListener > >::const_iterator aIter( aTmpListeners.begin() );
      61         [ #  # ]:          0 :         accessibility::AccessibleEventObject aEvtObject;
      62                 :            : 
      63                 :          0 :         aEvtObject.EventId = nEventId;
      64         [ #  # ]:          0 :         aEvtObject.Source = static_cast<uno::XWeak*>(this);
      65                 :          0 :         aEvtObject.NewValue = rNewValue;
      66                 :          0 :         aEvtObject.OldValue = rOldValue;
      67                 :            : 
      68 [ #  # ][ #  # ]:          0 :         while( aIter != aTmpListeners.end() )
      69                 :            :         {
      70                 :            :             try
      71                 :            :             {
      72 [ #  # ][ #  # ]:          0 :                 (*aIter)->notifyEvent( aEvtObject );
      73                 :            :             }
      74         [ #  # ]:          0 :             catch(const uno::Exception&)
      75                 :            :             {
      76                 :            :             }
      77                 :            : 
      78         [ #  # ]:          0 :             aIter++;
      79         [ #  # ]:          0 :         }
      80                 :            :     }
      81                 :          0 : }
      82                 :            : 
      83                 :            : namespace
      84                 :            : {
      85                 :            :     class theValueSetAccUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theValueSetAccUnoTunnelId > {};
      86                 :            : }
      87                 :            : 
      88                 :          0 : const uno::Sequence< sal_Int8 >& ThumbnailViewAcc::getUnoTunnelId()
      89                 :            : {
      90                 :          0 :     return theValueSetAccUnoTunnelId::get().getSeq();
      91                 :            : }
      92                 :            : 
      93                 :          0 : ThumbnailViewAcc* ThumbnailViewAcc::getImplementation( const uno::Reference< uno::XInterface >& rxData )
      94                 :            :     throw()
      95                 :            : {
      96                 :            :     try
      97                 :            :     {
      98         [ #  # ]:          0 :         uno::Reference< lang::XUnoTunnel > xUnoTunnel( rxData, uno::UNO_QUERY );
      99 [ #  # ][ #  # ]:          0 :         return( xUnoTunnel.is() ? reinterpret_cast<ThumbnailViewAcc*>(sal::static_int_cast<sal_IntPtr>(xUnoTunnel->getSomething( ThumbnailViewAcc::getUnoTunnelId() ))) : NULL );
         [ #  # ][ #  # ]
                 [ #  # ]
     100                 :            :     }
     101                 :          0 :     catch(const ::com::sun::star::uno::Exception&)
     102                 :            :     {
     103                 :          0 :         return NULL;
     104                 :            :     }
     105                 :            : }
     106                 :            : 
     107                 :          0 : void ThumbnailViewAcc::GetFocus (void)
     108                 :            : {
     109                 :          0 :     mbIsFocused = true;
     110                 :            : 
     111                 :            :     // Boradcast the state change.
     112                 :          0 :     ::com::sun::star::uno::Any aOldState, aNewState;
     113         [ #  # ]:          0 :     aNewState <<= ::com::sun::star::accessibility::AccessibleStateType::FOCUSED;
     114                 :            :     FireAccessibleEvent(
     115                 :            :         ::com::sun::star::accessibility::AccessibleEventId::STATE_CHANGED,
     116         [ #  # ]:          0 :         aOldState, aNewState);
     117                 :          0 : }
     118                 :            : 
     119                 :          0 : void ThumbnailViewAcc::LoseFocus (void)
     120                 :            : {
     121                 :          0 :     mbIsFocused = false;
     122                 :            : 
     123                 :            :     // Boradcast the state change.
     124                 :          0 :     ::com::sun::star::uno::Any aOldState, aNewState;
     125         [ #  # ]:          0 :     aOldState <<= ::com::sun::star::accessibility::AccessibleStateType::FOCUSED;
     126                 :            :     FireAccessibleEvent(
     127                 :            :         ::com::sun::star::accessibility::AccessibleEventId::STATE_CHANGED,
     128         [ #  # ]:          0 :         aOldState, aNewState);
     129                 :          0 : }
     130                 :            : 
     131                 :          0 : uno::Reference< accessibility::XAccessibleContext > SAL_CALL ThumbnailViewAcc::getAccessibleContext()
     132                 :            :     throw (uno::RuntimeException)
     133                 :            : {
     134                 :          0 :     ThrowIfDisposed();
     135                 :          0 :     return this;
     136                 :            : }
     137                 :            : 
     138                 :          0 : sal_Int32 SAL_CALL ThumbnailViewAcc::getAccessibleChildCount()
     139                 :            :     throw (uno::RuntimeException)
     140                 :            : {
     141         [ #  # ]:          0 :     const SolarMutexGuard aSolarGuard;
     142         [ #  # ]:          0 :     ThrowIfDisposed();
     143                 :            : 
     144         [ #  # ]:          0 :     sal_Int32 nCount = mpParent->ImplGetVisibleItemCount();
     145         [ #  # ]:          0 :     return nCount;
     146                 :            : }
     147                 :            : 
     148                 :          0 : uno::Reference< accessibility::XAccessible > SAL_CALL ThumbnailViewAcc::getAccessibleChild( sal_Int32 i )
     149                 :            :     throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
     150                 :            : {
     151         [ #  # ]:          0 :     ThrowIfDisposed();
     152         [ #  # ]:          0 :     const SolarMutexGuard aSolarGuard;
     153                 :          0 :     uno::Reference< accessibility::XAccessible >    xRet;
     154         [ #  # ]:          0 :     ThumbnailViewItem* pItem = getItem (sal::static_int_cast< sal_uInt16 >(i));
     155                 :            : 
     156         [ #  # ]:          0 :     if( pItem )
     157 [ #  # ][ #  # ]:          0 :         xRet = pItem->GetAccessible( mbIsTransientChildrenDisabled );
     158                 :            :     else
     159         [ #  # ]:          0 :         throw lang::IndexOutOfBoundsException();
     160                 :            : 
     161         [ #  # ]:          0 :     return xRet;
     162                 :            : }
     163                 :            : 
     164                 :          0 : uno::Reference< accessibility::XAccessible > SAL_CALL ThumbnailViewAcc::getAccessibleParent()
     165                 :            :     throw (uno::RuntimeException)
     166                 :            : {
     167         [ #  # ]:          0 :     ThrowIfDisposed();
     168         [ #  # ]:          0 :     const SolarMutexGuard aSolarGuard;
     169         [ #  # ]:          0 :     Window*                                         pParent = mpParent->GetParent();
     170                 :          0 :     uno::Reference< accessibility::XAccessible >    xRet;
     171                 :            : 
     172         [ #  # ]:          0 :     if( pParent )
     173 [ #  # ][ #  # ]:          0 :         xRet = pParent->GetAccessible();
     174                 :            : 
     175         [ #  # ]:          0 :     return xRet;
     176                 :            : }
     177                 :            : 
     178                 :          0 : sal_Int32 SAL_CALL ThumbnailViewAcc::getAccessibleIndexInParent()
     179                 :            :     throw (uno::RuntimeException)
     180                 :            : {
     181         [ #  # ]:          0 :     ThrowIfDisposed();
     182         [ #  # ]:          0 :     const SolarMutexGuard aSolarGuard;
     183         [ #  # ]:          0 :     Window*                 pParent = mpParent->GetParent();
     184                 :          0 :     sal_Int32               nRet = 0;
     185                 :            : 
     186         [ #  # ]:          0 :     if( pParent )
     187                 :            :     {
     188                 :          0 :         sal_Bool bFound = sal_False;
     189                 :            : 
     190 [ #  # ][ #  # ]:          0 :         for( sal_uInt16 i = 0, nCount = pParent->GetChildCount(); ( i < nCount ) && !bFound; i++ )
         [ #  # ][ #  # ]
     191                 :            :         {
     192 [ #  # ][ #  # ]:          0 :             if( pParent->GetChild( i ) == mpParent )
     193                 :            :             {
     194                 :          0 :                 nRet = i;
     195                 :          0 :                 bFound = sal_True;
     196                 :            :             }
     197                 :            :         }
     198                 :            :     }
     199                 :            : 
     200         [ #  # ]:          0 :     return nRet;
     201                 :            : }
     202                 :            : 
     203                 :          0 : sal_Int16 SAL_CALL ThumbnailViewAcc::getAccessibleRole()
     204                 :            :     throw (uno::RuntimeException)
     205                 :            : {
     206                 :          0 :     ThrowIfDisposed();
     207                 :            :     // #i73746# As the Java Access Bridge (v 2.0.1) uses "managesDescendants"
     208                 :            :     // always if the role is LIST, we need a different role in this case
     209                 :            :     return (mbIsTransientChildrenDisabled
     210                 :            :             ? accessibility::AccessibleRole::PANEL
     211         [ #  # ]:          0 :             : accessibility::AccessibleRole::LIST );
     212                 :            : }
     213                 :            : 
     214                 :          0 : ::rtl::OUString SAL_CALL ThumbnailViewAcc::getAccessibleDescription()
     215                 :            :     throw (uno::RuntimeException)
     216                 :            : {
     217         [ #  # ]:          0 :     ThrowIfDisposed();
     218         [ #  # ]:          0 :     const SolarMutexGuard aSolarGuard;
     219         [ #  # ]:          0 :     return rtl::OUString("ThumbnailView");
     220                 :            : }
     221                 :            : 
     222                 :          0 : ::rtl::OUString SAL_CALL ThumbnailViewAcc::getAccessibleName()
     223                 :            :     throw (uno::RuntimeException)
     224                 :            : {
     225         [ #  # ]:          0 :     ThrowIfDisposed();
     226         [ #  # ]:          0 :     const SolarMutexGuard aSolarGuard;
     227                 :          0 :     rtl::OUString aRet;
     228                 :            : 
     229         [ #  # ]:          0 :     if ( mpParent )
     230 [ #  # ][ #  # ]:          0 :         aRet = mpParent->GetAccessibleName();
                 [ #  # ]
     231                 :            : 
     232         [ #  # ]:          0 :     if ( aRet.isEmpty() )
     233                 :            :     {
     234         [ #  # ]:          0 :         Window* pLabel = mpParent->GetAccessibleRelationLabeledBy();
     235 [ #  # ][ #  # ]:          0 :         if ( pLabel && pLabel != mpParent )
     236 [ #  # ][ #  # ]:          0 :             aRet = OutputDevice::GetNonMnemonicString( pLabel->GetText() );
         [ #  # ][ #  # ]
                 [ #  # ]
     237                 :            :     }
     238                 :            : 
     239         [ #  # ]:          0 :     return aRet;
     240                 :            : }
     241                 :            : 
     242                 :          0 : uno::Reference< accessibility::XAccessibleRelationSet > SAL_CALL ThumbnailViewAcc::getAccessibleRelationSet()
     243                 :            :     throw (uno::RuntimeException)
     244                 :            : {
     245                 :          0 :     ThrowIfDisposed();
     246                 :          0 :     return uno::Reference< accessibility::XAccessibleRelationSet >();
     247                 :            : }
     248                 :            : 
     249                 :          0 : uno::Reference< accessibility::XAccessibleStateSet > SAL_CALL ThumbnailViewAcc::getAccessibleStateSet()
     250                 :            :     throw (uno::RuntimeException)
     251                 :            : {
     252                 :          0 :     ThrowIfDisposed();
     253         [ #  # ]:          0 :     ::utl::AccessibleStateSetHelper* pStateSet = new ::utl::AccessibleStateSetHelper();
     254                 :            : 
     255                 :            :     // Set some states.
     256                 :          0 :     pStateSet->AddState (accessibility::AccessibleStateType::ENABLED);
     257                 :          0 :     pStateSet->AddState (accessibility::AccessibleStateType::SENSITIVE);
     258                 :          0 :     pStateSet->AddState (accessibility::AccessibleStateType::SHOWING);
     259                 :          0 :     pStateSet->AddState (accessibility::AccessibleStateType::VISIBLE);
     260         [ #  # ]:          0 :     if ( !mbIsTransientChildrenDisabled )
     261                 :          0 :         pStateSet->AddState (accessibility::AccessibleStateType::MANAGES_DESCENDANTS);
     262                 :          0 :     pStateSet->AddState (accessibility::AccessibleStateType::FOCUSABLE);
     263         [ #  # ]:          0 :     if (mbIsFocused)
     264                 :          0 :         pStateSet->AddState (accessibility::AccessibleStateType::FOCUSED);
     265                 :            : 
     266         [ #  # ]:          0 :     return pStateSet;
     267                 :            : }
     268                 :            : 
     269                 :          0 : lang::Locale SAL_CALL ThumbnailViewAcc::getLocale()
     270                 :            :     throw (accessibility::IllegalAccessibleComponentStateException, uno::RuntimeException)
     271                 :            : {
     272         [ #  # ]:          0 :     ThrowIfDisposed();
     273         [ #  # ]:          0 :     const SolarMutexGuard aSolarGuard;
     274                 :          0 :     const ::rtl::OUString                           aEmptyStr;
     275         [ #  # ]:          0 :     uno::Reference< accessibility::XAccessible >    xParent( getAccessibleParent() );
     276                 :          0 :     lang::Locale                                    aRet( aEmptyStr, aEmptyStr, aEmptyStr );
     277                 :            : 
     278         [ #  # ]:          0 :     if( xParent.is() )
     279                 :            :     {
     280 [ #  # ][ #  # ]:          0 :         uno::Reference< accessibility::XAccessibleContext > xParentContext( xParent->getAccessibleContext() );
     281                 :            : 
     282         [ #  # ]:          0 :         if( xParentContext.is() )
     283 [ #  # ][ #  # ]:          0 :             aRet = xParentContext->getLocale ();
     284                 :            :     }
     285                 :            : 
     286         [ #  # ]:          0 :     return aRet;
     287                 :            : }
     288                 :            : 
     289                 :          0 : void SAL_CALL ThumbnailViewAcc::addEventListener( const uno::Reference< accessibility::XAccessibleEventListener >& rxListener )
     290                 :            :     throw (uno::RuntimeException)
     291                 :            : {
     292         [ #  # ]:          0 :     ThrowIfDisposed();
     293         [ #  # ]:          0 :     ::osl::MutexGuard aGuard (m_aMutex);
     294                 :            : 
     295         [ #  # ]:          0 :     if( rxListener.is() )
     296                 :            :     {
     297         [ #  # ]:          0 :         std::vector< uno::Reference< accessibility::XAccessibleEventListener > >::const_iterator aIter = mxEventListeners.begin();
     298                 :          0 :         bool bFound = false;
     299                 :            : 
     300 [ #  # ][ #  # ]:          0 :         while( !bFound && ( aIter != mxEventListeners.end() ) )
         [ #  # ][ #  # ]
           [ #  #  #  # ]
     301                 :            :         {
     302 [ #  # ][ #  # ]:          0 :             if( *aIter == rxListener )
     303                 :          0 :                 bFound = true;
     304                 :            :             else
     305                 :          0 :                 ++aIter;
     306                 :            :         }
     307                 :            : 
     308         [ #  # ]:          0 :         if (!bFound)
     309         [ #  # ]:          0 :             mxEventListeners.push_back( rxListener );
     310         [ #  # ]:          0 :     }
     311                 :          0 : }
     312                 :            : 
     313                 :          0 : void SAL_CALL ThumbnailViewAcc::removeEventListener( const uno::Reference< accessibility::XAccessibleEventListener >& rxListener )
     314                 :            :     throw (uno::RuntimeException)
     315                 :            : {
     316         [ #  # ]:          0 :     ThrowIfDisposed();
     317         [ #  # ]:          0 :     ::osl::MutexGuard aGuard (m_aMutex);
     318                 :            : 
     319         [ #  # ]:          0 :     if( rxListener.is() )
     320                 :            :     {
     321                 :          0 :         std::vector< uno::Reference< accessibility::XAccessibleEventListener > >::iterator aIter = mxEventListeners.begin();
     322                 :          0 :         bool bFound = false;
     323                 :            : 
     324 [ #  # ][ #  # ]:          0 :         while( !bFound && ( aIter != mxEventListeners.end() ) )
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     325                 :            :         {
     326 [ #  # ][ #  # ]:          0 :             if( *aIter == rxListener )
     327                 :            :             {
     328         [ #  # ]:          0 :                 mxEventListeners.erase( aIter );
     329                 :          0 :                 bFound = true;
     330                 :            :             }
     331                 :            :             else
     332                 :          0 :                 ++aIter;
     333                 :            :         }
     334         [ #  # ]:          0 :     }
     335                 :          0 : }
     336                 :            : 
     337                 :          0 : sal_Bool SAL_CALL ThumbnailViewAcc::containsPoint( const awt::Point& aPoint )
     338                 :            :     throw (uno::RuntimeException)
     339                 :            : {
     340         [ #  # ]:          0 :     ThrowIfDisposed();
     341         [ #  # ]:          0 :     const awt::Rectangle    aRect( getBounds() );
     342                 :          0 :     const Point             aSize( aRect.Width, aRect.Height );
     343                 :          0 :     const Point             aNullPoint, aTestPoint( aPoint.X, aPoint.Y );
     344                 :            : 
     345 [ #  # ][ #  # ]:          0 :     return Rectangle( aNullPoint, aSize ).IsInside( aTestPoint );
     346                 :            : }
     347                 :            : 
     348                 :          0 : uno::Reference< accessibility::XAccessible > SAL_CALL ThumbnailViewAcc::getAccessibleAtPoint( const awt::Point& aPoint )
     349                 :            :     throw (uno::RuntimeException)
     350                 :            : {
     351         [ #  # ]:          0 :     ThrowIfDisposed();
     352         [ #  # ]:          0 :     const SolarMutexGuard aSolarGuard;
     353         [ #  # ]:          0 :     const sal_uInt16                                    nItemId = mpParent->GetItemId( Point( aPoint.X, aPoint.Y ) );
     354                 :          0 :     uno::Reference< accessibility::XAccessible >    xRet;
     355                 :            : 
     356         [ #  # ]:          0 :     if ( nItemId )
     357                 :            :     {
     358         [ #  # ]:          0 :         const size_t nItemPos = mpParent->GetItemPos( nItemId );
     359                 :            : 
     360         [ #  # ]:          0 :         if( THUMBNAILVIEW_ITEM_NONEITEM != nItemPos )
     361                 :            :         {
     362         [ #  # ]:          0 :             ThumbnailViewItem *const pItem = mpParent->mItemList[nItemPos];
     363 [ #  # ][ #  # ]:          0 :             xRet = pItem->GetAccessible( mbIsTransientChildrenDisabled );
     364                 :            :         }
     365                 :            :     }
     366                 :            : 
     367         [ #  # ]:          0 :     return xRet;
     368                 :            : }
     369                 :            : 
     370                 :          0 : awt::Rectangle SAL_CALL ThumbnailViewAcc::getBounds()
     371                 :            :     throw (uno::RuntimeException)
     372                 :            : {
     373         [ #  # ]:          0 :     ThrowIfDisposed();
     374         [ #  # ]:          0 :     const SolarMutexGuard aSolarGuard;
     375         [ #  # ]:          0 :     const Point         aOutPos( mpParent->GetPosPixel() );
     376                 :          0 :     const Size          aOutSize( mpParent->GetOutputSizePixel() );
     377                 :          0 :     awt::Rectangle      aRet;
     378                 :            : 
     379                 :          0 :     aRet.X = aOutPos.X();
     380                 :          0 :     aRet.Y = aOutPos.Y();
     381                 :          0 :     aRet.Width = aOutSize.Width();
     382                 :          0 :     aRet.Height = aOutSize.Height();
     383                 :            : 
     384         [ #  # ]:          0 :     return aRet;
     385                 :            : }
     386                 :            : 
     387                 :          0 : awt::Point SAL_CALL ThumbnailViewAcc::getLocation()
     388                 :            :     throw (uno::RuntimeException)
     389                 :            : {
     390         [ #  # ]:          0 :     ThrowIfDisposed();
     391         [ #  # ]:          0 :     const awt::Rectangle    aRect( getBounds() );
     392                 :          0 :     awt::Point              aRet;
     393                 :            : 
     394                 :          0 :     aRet.X = aRect.X;
     395                 :          0 :     aRet.Y = aRect.Y;
     396                 :            : 
     397                 :          0 :     return aRet;
     398                 :            : }
     399                 :            : 
     400                 :          0 : awt::Point SAL_CALL ThumbnailViewAcc::getLocationOnScreen()
     401                 :            :     throw (uno::RuntimeException)
     402                 :            : {
     403         [ #  # ]:          0 :     ThrowIfDisposed();
     404         [ #  # ]:          0 :     const SolarMutexGuard aSolarGuard;
     405         [ #  # ]:          0 :     const Point         aScreenPos( mpParent->OutputToAbsoluteScreenPixel( Point() ) );
     406                 :          0 :     awt::Point          aRet;
     407                 :            : 
     408                 :          0 :     aRet.X = aScreenPos.X();
     409                 :          0 :     aRet.Y = aScreenPos.Y();
     410                 :            : 
     411         [ #  # ]:          0 :     return aRet;
     412                 :            : }
     413                 :            : 
     414                 :          0 : awt::Size SAL_CALL ThumbnailViewAcc::getSize()
     415                 :            :     throw (uno::RuntimeException)
     416                 :            : {
     417         [ #  # ]:          0 :     ThrowIfDisposed();
     418         [ #  # ]:          0 :     const awt::Rectangle    aRect( getBounds() );
     419                 :          0 :     awt::Size               aRet;
     420                 :            : 
     421                 :          0 :     aRet.Width = aRect.Width;
     422                 :          0 :     aRet.Height = aRect.Height;
     423                 :            : 
     424                 :          0 :     return aRet;
     425                 :            : }
     426                 :            : 
     427                 :          0 : void SAL_CALL ThumbnailViewAcc::grabFocus()
     428                 :            :     throw (uno::RuntimeException)
     429                 :            : {
     430         [ #  # ]:          0 :     ThrowIfDisposed();
     431         [ #  # ]:          0 :     const SolarMutexGuard aSolarGuard;
     432 [ #  # ][ #  # ]:          0 :     mpParent->GrabFocus();
     433                 :          0 : }
     434                 :            : 
     435                 :          0 : uno::Any SAL_CALL ThumbnailViewAcc::getAccessibleKeyBinding()
     436                 :            :     throw (uno::RuntimeException)
     437                 :            : {
     438                 :          0 :     ThrowIfDisposed();
     439                 :          0 :     return uno::Any();
     440                 :            : }
     441                 :            : 
     442                 :          0 : sal_Int32 SAL_CALL ThumbnailViewAcc::getForeground(  )
     443                 :            :     throw (uno::RuntimeException)
     444                 :            : {
     445                 :          0 :     ThrowIfDisposed();
     446                 :          0 :     sal_uInt32 nColor = Application::GetSettings().GetStyleSettings().GetWindowTextColor().GetColor();
     447                 :          0 :     return static_cast<sal_Int32>(nColor);
     448                 :            : }
     449                 :            : 
     450                 :          0 : sal_Int32 SAL_CALL ThumbnailViewAcc::getBackground(  )
     451                 :            :     throw (uno::RuntimeException)
     452                 :            : {
     453                 :          0 :     ThrowIfDisposed();
     454                 :          0 :     sal_uInt32 nColor = Application::GetSettings().GetStyleSettings().GetWindowColor().GetColor();
     455                 :          0 :     return static_cast<sal_Int32>(nColor);
     456                 :            : }
     457                 :            : 
     458                 :          0 : void SAL_CALL ThumbnailViewAcc::selectAccessibleChild( sal_Int32 nChildIndex )
     459                 :            :     throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
     460                 :            : {
     461         [ #  # ]:          0 :     ThrowIfDisposed();
     462         [ #  # ]:          0 :     const SolarMutexGuard aSolarGuard;
     463         [ #  # ]:          0 :     ThumbnailViewItem* pItem = getItem (sal::static_int_cast< sal_uInt16 >(nChildIndex));
     464                 :            : 
     465         [ #  # ]:          0 :     if(pItem != NULL)
     466                 :            :     {
     467         [ #  # ]:          0 :         mpParent->SelectItem( pItem->mnId );
     468                 :            :     }
     469                 :            :     else
     470 [ #  # ][ #  # ]:          0 :         throw lang::IndexOutOfBoundsException();
     471                 :          0 : }
     472                 :            : 
     473                 :          0 : sal_Bool SAL_CALL ThumbnailViewAcc::isAccessibleChildSelected( sal_Int32 nChildIndex )
     474                 :            :     throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
     475                 :            : {
     476         [ #  # ]:          0 :     ThrowIfDisposed();
     477         [ #  # ]:          0 :     const SolarMutexGuard aSolarGuard;
     478         [ #  # ]:          0 :     ThumbnailViewItem* pItem = getItem (sal::static_int_cast< sal_uInt16 >(nChildIndex));
     479                 :          0 :     sal_Bool            bRet = sal_False;
     480                 :            : 
     481         [ #  # ]:          0 :     if (pItem != NULL)
     482                 :          0 :         bRet = mpParent->IsItemSelected( pItem->mnId );
     483                 :            :     else
     484         [ #  # ]:          0 :         throw lang::IndexOutOfBoundsException();
     485                 :            : 
     486         [ #  # ]:          0 :     return bRet;
     487                 :            : }
     488                 :            : 
     489                 :          0 : void SAL_CALL ThumbnailViewAcc::clearAccessibleSelection()
     490                 :            :     throw (uno::RuntimeException)
     491                 :            : {
     492         [ #  # ]:          0 :     ThrowIfDisposed();
     493 [ #  # ][ #  # ]:          0 :     const SolarMutexGuard aSolarGuard;
     494                 :          0 : }
     495                 :            : 
     496                 :          0 : void SAL_CALL ThumbnailViewAcc::selectAllAccessibleChildren()
     497                 :            :     throw (uno::RuntimeException)
     498                 :            : {
     499                 :          0 :     ThrowIfDisposed();
     500                 :            :     // unsupported due to single selection only
     501                 :          0 : }
     502                 :            : 
     503                 :          0 : sal_Int32 SAL_CALL ThumbnailViewAcc::getSelectedAccessibleChildCount()
     504                 :            :     throw (uno::RuntimeException)
     505                 :            : {
     506         [ #  # ]:          0 :     ThrowIfDisposed();
     507         [ #  # ]:          0 :     const SolarMutexGuard aSolarGuard;
     508                 :          0 :     sal_Int32           nRet = 0;
     509                 :            : 
     510 [ #  # ][ #  # ]:          0 :     for( sal_uInt16 i = 0, nCount = getItemCount(); i < nCount; i++ )
     511                 :            :     {
     512         [ #  # ]:          0 :         ThumbnailViewItem* pItem = getItem (i);
     513                 :            : 
     514 [ #  # ][ #  # ]:          0 :         if( pItem && mpParent->IsItemSelected( pItem->mnId ) )
                 [ #  # ]
     515                 :          0 :             ++nRet;
     516                 :            :     }
     517                 :            : 
     518         [ #  # ]:          0 :     return nRet;
     519                 :            : }
     520                 :            : 
     521                 :          0 : uno::Reference< accessibility::XAccessible > SAL_CALL ThumbnailViewAcc::getSelectedAccessibleChild( sal_Int32 nSelectedChildIndex )
     522                 :            :     throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
     523                 :            : {
     524         [ #  # ]:          0 :     ThrowIfDisposed();
     525         [ #  # ]:          0 :     const SolarMutexGuard aSolarGuard;
     526                 :          0 :     uno::Reference< accessibility::XAccessible >    xRet;
     527                 :            : 
     528 [ #  # ][ #  # ]:          0 :     for( sal_uInt16 i = 0, nCount = getItemCount(), nSel = 0; ( i < nCount ) && !xRet.is(); i++ )
         [ #  # ][ #  # ]
     529                 :            :     {
     530         [ #  # ]:          0 :         ThumbnailViewItem* pItem = getItem(i);
     531                 :            : 
     532 [ #  # ][ #  # ]:          0 :         if( pItem && mpParent->IsItemSelected( pItem->mnId ) && ( nSelectedChildIndex == static_cast< sal_Int32 >( nSel++ ) ) )
         [ #  # ][ #  # ]
     533 [ #  # ][ #  # ]:          0 :             xRet = pItem->GetAccessible( mbIsTransientChildrenDisabled );
     534                 :            :     }
     535                 :            : 
     536         [ #  # ]:          0 :     return xRet;
     537                 :            : }
     538                 :            : 
     539                 :          0 : void SAL_CALL ThumbnailViewAcc::deselectAccessibleChild( sal_Int32 nChildIndex )
     540                 :            :     throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
     541                 :            : {
     542         [ #  # ]:          0 :     ThrowIfDisposed();
     543         [ #  # ]:          0 :     const SolarMutexGuard aSolarGuard;
     544                 :            :     // Because of the single selection we can reset the whole selection when
     545                 :            :     // the specified child is currently selected.
     546                 :            : //FIXME TODO    if (isAccessibleChildSelected(nChildIndex))
     547                 :            : //FIXME TODO        ;
     548         [ #  # ]:          0 :     (void) nChildIndex;
     549                 :          0 : }
     550                 :            : 
     551                 :          0 : sal_Int64 SAL_CALL ThumbnailViewAcc::getSomething( const uno::Sequence< sal_Int8 >& rId ) throw( uno::RuntimeException )
     552                 :            : {
     553                 :            :     sal_Int64 nRet;
     554                 :            : 
     555 [ #  # ][ #  # ]:          0 :     if( ( rId.getLength() == 16 ) && ( 0 == rtl_compareMemory( ThumbnailViewAcc::getUnoTunnelId().getConstArray(), rId.getConstArray(), 16 ) ) )
                 [ #  # ]
     556                 :          0 :         nRet = reinterpret_cast< sal_Int64 >( this );
     557                 :            :     else
     558                 :          0 :         nRet = 0;
     559                 :            : 
     560                 :          0 :     return nRet;
     561                 :            : }
     562                 :            : 
     563                 :          0 : void SAL_CALL ThumbnailViewAcc::disposing (void)
     564                 :            : {
     565         [ #  # ]:          0 :     ::std::vector<uno::Reference<accessibility::XAccessibleEventListener> > aListenerListCopy;
     566                 :            : 
     567                 :            :     {
     568                 :            :         // Make a copy of the list and clear the original.
     569         [ #  # ]:          0 :         const SolarMutexGuard aSolarGuard;
     570         [ #  # ]:          0 :         ::osl::MutexGuard aGuard (m_aMutex);
     571         [ #  # ]:          0 :         aListenerListCopy = mxEventListeners;
     572                 :          0 :         mxEventListeners.clear();
     573                 :            : 
     574                 :            :         // Reset the pointer to the parent.  It has to be the one who has
     575                 :            :         // disposed us because he is dying.
     576 [ #  # ][ #  # ]:          0 :         mpParent = NULL;
     577                 :            :     }
     578                 :            : 
     579                 :            :     // Inform all listeners that this objects is disposing.
     580                 :            :     ::std::vector<uno::Reference<accessibility::XAccessibleEventListener> >::const_iterator
     581         [ #  # ]:          0 :           aListenerIterator (aListenerListCopy.begin());
     582 [ #  # ][ #  # ]:          0 :     lang::EventObject aEvent (static_cast<accessibility::XAccessible*>(this));
                 [ #  # ]
     583 [ #  # ][ #  # ]:          0 :     while (aListenerIterator != aListenerListCopy.end())
     584                 :            :     {
     585                 :            :         try
     586                 :            :         {
     587 [ #  # ][ #  # ]:          0 :             (*aListenerIterator)->disposing (aEvent);
     588                 :            :         }
     589         [ #  # ]:          0 :         catch(const uno::Exception&)
     590                 :            :         {
     591                 :            :             // Ignore exceptions.
     592                 :            :         }
     593                 :            : 
     594                 :          0 :         ++aListenerIterator;
     595         [ #  # ]:          0 :     }
     596                 :          0 : }
     597                 :            : 
     598                 :          0 : sal_uInt16 ThumbnailViewAcc::getItemCount (void) const
     599                 :            : {
     600                 :          0 :     return mpParent->ImplGetVisibleItemCount();
     601                 :            : }
     602                 :            : 
     603                 :          0 : ThumbnailViewItem* ThumbnailViewAcc::getItem (sal_uInt16 nIndex) const
     604                 :            : {
     605                 :          0 :     return mpParent->ImplGetVisibleItem (static_cast<sal_uInt16>(nIndex));
     606                 :            : }
     607                 :            : 
     608                 :          0 : void ThumbnailViewAcc::ThrowIfDisposed (void)
     609                 :            :     throw (::com::sun::star::lang::DisposedException)
     610                 :            : {
     611 [ #  # ][ #  # ]:          0 :     if (rBHelper.bDisposed || rBHelper.bInDispose)
     612                 :            :     {
     613                 :            :         OSL_TRACE ("Calling disposed object. Throwing exception:");
     614                 :            :         throw lang::DisposedException (
     615                 :            :             ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("object has been already disposed")),
     616 [ #  # ][ #  # ]:          0 :             static_cast<uno::XWeak*>(this));
                 [ #  # ]
     617                 :            :     }
     618                 :            :     else
     619                 :            :     {
     620                 :            :         DBG_ASSERT (mpParent!=NULL, "ValueSetAcc not disposed but mpParent == NULL");
     621                 :            :     }
     622                 :          0 : }
     623                 :            : 
     624                 :          0 : ThumbnailViewItemAcc::ThumbnailViewItemAcc( ThumbnailViewItem* pParent, bool bIsTransientChildrenDisabled ) :
     625                 :            :     mpParent( pParent ),
     626 [ #  # ][ #  # ]:          0 :     mbIsTransientChildrenDisabled( bIsTransientChildrenDisabled )
     627                 :            : {
     628                 :          0 : }
     629                 :            : 
     630         [ #  # ]:          0 : ThumbnailViewItemAcc::~ThumbnailViewItemAcc()
     631                 :            : {
     632         [ #  # ]:          0 : }
     633                 :            : 
     634                 :          0 : void ThumbnailViewItemAcc::FireAccessibleEvent( short nEventId, const uno::Any& rOldValue, const uno::Any& rNewValue )
     635                 :            : {
     636         [ #  # ]:          0 :     if( nEventId )
     637                 :            :     {
     638         [ #  # ]:          0 :         ::std::vector< uno::Reference< accessibility::XAccessibleEventListener > >                  aTmpListeners( mxEventListeners );
     639         [ #  # ]:          0 :         ::std::vector< uno::Reference< accessibility::XAccessibleEventListener > >::const_iterator  aIter( aTmpListeners.begin() );
     640         [ #  # ]:          0 :         accessibility::AccessibleEventObject                                                        aEvtObject;
     641                 :            : 
     642                 :          0 :         aEvtObject.EventId = nEventId;
     643         [ #  # ]:          0 :         aEvtObject.Source = static_cast<uno::XWeak*>(this);
     644                 :          0 :         aEvtObject.NewValue = rNewValue;
     645                 :          0 :         aEvtObject.OldValue = rOldValue;
     646                 :            : 
     647 [ #  # ][ #  # ]:          0 :         while( aIter != aTmpListeners.end() )
     648                 :            :         {
     649 [ #  # ][ #  # ]:          0 :             (*aIter)->notifyEvent( aEvtObject );
     650         [ #  # ]:          0 :             aIter++;
     651         [ #  # ]:          0 :         }
     652                 :            :     }
     653                 :          0 : }
     654                 :            : 
     655                 :          0 : void ThumbnailViewItemAcc::ParentDestroyed()
     656                 :            : {
     657         [ #  # ]:          0 :     const ::osl::MutexGuard aGuard( maMutex );
     658         [ #  # ]:          0 :     mpParent = NULL;
     659                 :          0 : }
     660                 :            : 
     661                 :            : namespace
     662                 :            : {
     663                 :            :     class theValueItemAccUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theValueItemAccUnoTunnelId > {};
     664                 :            : }
     665                 :            : 
     666                 :          0 : const uno::Sequence< sal_Int8 >& ThumbnailViewItemAcc::getUnoTunnelId()
     667                 :            : {
     668                 :          0 :     return theValueItemAccUnoTunnelId::get().getSeq();
     669                 :            : }
     670                 :            : 
     671                 :          0 : ThumbnailViewItemAcc* ThumbnailViewItemAcc::getImplementation( const uno::Reference< uno::XInterface >& rxData )
     672                 :            :     throw()
     673                 :            : {
     674                 :            :     try
     675                 :            :     {
     676         [ #  # ]:          0 :         uno::Reference< lang::XUnoTunnel > xUnoTunnel( rxData, uno::UNO_QUERY );
     677 [ #  # ][ #  # ]:          0 :         return( xUnoTunnel.is() ? reinterpret_cast<ThumbnailViewItemAcc*>(sal::static_int_cast<sal_IntPtr>(xUnoTunnel->getSomething( ThumbnailViewItemAcc::getUnoTunnelId() ))) : NULL );
         [ #  # ][ #  # ]
                 [ #  # ]
     678                 :            :     }
     679                 :          0 :     catch(const ::com::sun::star::uno::Exception&)
     680                 :            :     {
     681                 :          0 :         return NULL;
     682                 :            :     }
     683                 :            : }
     684                 :            : 
     685                 :          0 : uno::Reference< accessibility::XAccessibleContext > SAL_CALL ThumbnailViewItemAcc::getAccessibleContext()
     686                 :            :     throw (uno::RuntimeException)
     687                 :            : {
     688                 :          0 :     return this;
     689                 :            : }
     690                 :            : 
     691                 :          0 : sal_Int32 SAL_CALL ThumbnailViewItemAcc::getAccessibleChildCount()
     692                 :            :     throw (uno::RuntimeException)
     693                 :            : {
     694                 :          0 :     return 0;
     695                 :            : }
     696                 :            : 
     697                 :          0 : uno::Reference< accessibility::XAccessible > SAL_CALL ThumbnailViewItemAcc::getAccessibleChild( sal_Int32 )
     698                 :            :     throw (lang::IndexOutOfBoundsException, uno::RuntimeException)
     699                 :            : {
     700         [ #  # ]:          0 :     throw lang::IndexOutOfBoundsException();
     701                 :            : }
     702                 :            : 
     703                 :          0 : uno::Reference< accessibility::XAccessible > SAL_CALL ThumbnailViewItemAcc::getAccessibleParent()
     704                 :            :     throw (uno::RuntimeException)
     705                 :            : {
     706         [ #  # ]:          0 :     const SolarMutexGuard aSolarGuard;
     707                 :          0 :     uno::Reference< accessibility::XAccessible >    xRet;
     708                 :            : 
     709         [ #  # ]:          0 :     if( mpParent )
     710 [ #  # ][ #  # ]:          0 :         xRet = mpParent->mrParent.GetAccessible();
     711                 :            : 
     712         [ #  # ]:          0 :     return xRet;
     713                 :            : }
     714                 :            : 
     715                 :          0 : sal_Int32 SAL_CALL ThumbnailViewItemAcc::getAccessibleIndexInParent()
     716                 :            :     throw (uno::RuntimeException)
     717                 :            : {
     718         [ #  # ]:          0 :     const SolarMutexGuard aSolarGuard;
     719                 :            :     // The index defaults to -1 to indicate the child does not belong to its
     720                 :            :     // parent.
     721                 :          0 :     sal_Int32 nIndexInParent = -1;
     722                 :            : 
     723         [ #  # ]:          0 :     if( mpParent )
     724                 :            :     {
     725                 :          0 :         bool bDone = false;
     726                 :            : 
     727         [ #  # ]:          0 :         sal_uInt16 nCount = mpParent->mrParent.ImplGetVisibleItemCount();
     728                 :            :         ThumbnailViewItem* pItem;
     729 [ #  # ][ #  # ]:          0 :         for (sal_uInt16 i=0; i<nCount && !bDone; i++)
                 [ #  # ]
     730                 :            :         {
     731                 :            :             // Guard the retrieval of the i-th child with a try/catch block
     732                 :            :             // just in case the number of children changes in the mean time.
     733                 :            :             try
     734                 :            :             {
     735         [ #  # ]:          0 :                 pItem = mpParent->mrParent.ImplGetVisibleItem (i);
     736                 :            :             }
     737         [ #  # ]:          0 :             catch (const lang::IndexOutOfBoundsException&)
     738                 :            :             {
     739                 :          0 :                 pItem = NULL;
     740                 :            :             }
     741                 :            : 
     742                 :            :             // Do not create an accessible object for the test.
     743 [ #  # ][ #  # ]:          0 :             if (pItem != NULL && pItem->mpxAcc != NULL)
     744 [ #  # ][ #  # ]:          0 :                 if (pItem->GetAccessible( mbIsTransientChildrenDisabled ).get() == this )
                 [ #  # ]
     745                 :            :                 {
     746                 :          0 :                     nIndexInParent = i;
     747                 :          0 :                     bDone = true;
     748                 :            :                 }
     749                 :            :         }
     750                 :            :     }
     751                 :            : 
     752 [ #  # ][ #  # ]:          0 :     return nIndexInParent;
     753                 :            : }
     754                 :            : 
     755                 :          0 : sal_Int16 SAL_CALL ThumbnailViewItemAcc::getAccessibleRole()
     756                 :            :     throw (uno::RuntimeException)
     757                 :            : {
     758                 :          0 :     return accessibility::AccessibleRole::LIST_ITEM;
     759                 :            : }
     760                 :            : 
     761                 :          0 : ::rtl::OUString SAL_CALL ThumbnailViewItemAcc::getAccessibleDescription()
     762                 :            :     throw (uno::RuntimeException)
     763                 :            : {
     764                 :          0 :     return ::rtl::OUString();
     765                 :            : }
     766                 :            : 
     767                 :          0 : ::rtl::OUString SAL_CALL ThumbnailViewItemAcc::getAccessibleName()
     768                 :            :     throw (uno::RuntimeException)
     769                 :            : {
     770         [ #  # ]:          0 :     const SolarMutexGuard aSolarGuard;
     771                 :          0 :     rtl::OUString aRet;
     772                 :            : 
     773         [ #  # ]:          0 :     if( mpParent )
     774                 :            :     {
     775                 :          0 :         aRet = mpParent->maTitle;
     776                 :            : 
     777         [ #  # ]:          0 :         if( aRet.isEmpty() )
     778                 :            :         {
     779                 :          0 :             rtl::OUStringBuffer aBuffer("Item ");
     780         [ #  # ]:          0 :             aBuffer.append(static_cast<sal_Int32>(mpParent->mnId));
     781         [ #  # ]:          0 :             aRet = aBuffer.makeStringAndClear();
     782                 :            :         }
     783                 :            :     }
     784                 :            : 
     785         [ #  # ]:          0 :     return aRet;
     786                 :            : }
     787                 :            : 
     788                 :          0 : uno::Reference< accessibility::XAccessibleRelationSet > SAL_CALL ThumbnailViewItemAcc::getAccessibleRelationSet()
     789                 :            :     throw (uno::RuntimeException)
     790                 :            : {
     791                 :          0 :     return uno::Reference< accessibility::XAccessibleRelationSet >();
     792                 :            : }
     793                 :            : 
     794                 :          0 : uno::Reference< accessibility::XAccessibleStateSet > SAL_CALL ThumbnailViewItemAcc::getAccessibleStateSet()
     795                 :            :     throw (uno::RuntimeException)
     796                 :            : {
     797         [ #  # ]:          0 :     const SolarMutexGuard aSolarGuard;
     798         [ #  # ]:          0 :     ::utl::AccessibleStateSetHelper*    pStateSet = new ::utl::AccessibleStateSetHelper;
     799                 :            : 
     800         [ #  # ]:          0 :     if( mpParent )
     801                 :            :     {
     802         [ #  # ]:          0 :         pStateSet->AddState (accessibility::AccessibleStateType::ENABLED);
     803         [ #  # ]:          0 :         pStateSet->AddState (accessibility::AccessibleStateType::SENSITIVE);
     804         [ #  # ]:          0 :         pStateSet->AddState (accessibility::AccessibleStateType::SHOWING);
     805         [ #  # ]:          0 :         pStateSet->AddState (accessibility::AccessibleStateType::VISIBLE);
     806         [ #  # ]:          0 :         if ( !mbIsTransientChildrenDisabled )
     807         [ #  # ]:          0 :             pStateSet->AddState (accessibility::AccessibleStateType::TRANSIENT);
     808                 :            : 
     809                 :            :         // SELECTABLE
     810         [ #  # ]:          0 :         pStateSet->AddState( accessibility::AccessibleStateType::SELECTABLE );
     811                 :            :         //      pStateSet->AddState( accessibility::AccessibleStateType::FOCUSABLE );
     812                 :            : 
     813                 :            :         // SELECTED
     814         [ #  # ]:          0 :         if( mpParent->mrParent.GetSelectItemId() == mpParent->mnId )
     815                 :            :         {
     816         [ #  # ]:          0 :             pStateSet->AddState( accessibility::AccessibleStateType::SELECTED );
     817                 :            :             //              pStateSet->AddState( accessibility::AccessibleStateType::FOCUSED );
     818                 :            :         }
     819                 :            :     }
     820                 :            : 
     821 [ #  # ][ #  # ]:          0 :     return pStateSet;
                 [ #  # ]
     822                 :            : }
     823                 :            : 
     824                 :          0 : lang::Locale SAL_CALL ThumbnailViewItemAcc::getLocale()
     825                 :            :     throw (accessibility::IllegalAccessibleComponentStateException, uno::RuntimeException)
     826                 :            : {
     827         [ #  # ]:          0 :     const SolarMutexGuard aSolarGuard;
     828                 :          0 :     const ::rtl::OUString                           aEmptyStr;
     829         [ #  # ]:          0 :     uno::Reference< accessibility::XAccessible >    xParent( getAccessibleParent() );
     830                 :          0 :     lang::Locale                                    aRet( aEmptyStr, aEmptyStr, aEmptyStr );
     831                 :            : 
     832         [ #  # ]:          0 :     if( xParent.is() )
     833                 :            :     {
     834 [ #  # ][ #  # ]:          0 :         uno::Reference< accessibility::XAccessibleContext > xParentContext( xParent->getAccessibleContext() );
     835                 :            : 
     836         [ #  # ]:          0 :         if( xParentContext.is() )
     837 [ #  # ][ #  # ]:          0 :             aRet = xParentContext->getLocale();
     838                 :            :     }
     839                 :            : 
     840         [ #  # ]:          0 :     return aRet;
     841                 :            : }
     842                 :            : 
     843                 :          0 : void SAL_CALL ThumbnailViewItemAcc::addEventListener( const uno::Reference< accessibility::XAccessibleEventListener >& rxListener )
     844                 :            :     throw (uno::RuntimeException)
     845                 :            : {
     846         [ #  # ]:          0 :     const ::osl::MutexGuard aGuard( maMutex );
     847                 :            : 
     848         [ #  # ]:          0 :     if( rxListener.is() )
     849                 :            :     {
     850         [ #  # ]:          0 :            ::std::vector< uno::Reference< accessibility::XAccessibleEventListener > >::const_iterator aIter = mxEventListeners.begin();
     851                 :          0 :         sal_Bool bFound = sal_False;
     852                 :            : 
     853 [ #  # ][ #  # ]:          0 :         while( !bFound && ( aIter != mxEventListeners.end() ) )
         [ #  # ][ #  # ]
           [ #  #  #  # ]
     854                 :            :         {
     855 [ #  # ][ #  # ]:          0 :             if( *aIter == rxListener )
     856                 :          0 :                 bFound = sal_True;
     857                 :            :             else
     858                 :          0 :                 ++aIter;
     859                 :            :         }
     860                 :            : 
     861         [ #  # ]:          0 :         if (!bFound)
     862         [ #  # ]:          0 :             mxEventListeners.push_back( rxListener );
     863         [ #  # ]:          0 :     }
     864                 :          0 : }
     865                 :            : 
     866                 :          0 : void SAL_CALL ThumbnailViewItemAcc::removeEventListener( const uno::Reference< accessibility::XAccessibleEventListener >& rxListener )
     867                 :            :     throw (uno::RuntimeException)
     868                 :            : {
     869         [ #  # ]:          0 :     const ::osl::MutexGuard aGuard( maMutex );
     870                 :            : 
     871         [ #  # ]:          0 :     if( rxListener.is() )
     872                 :            :     {
     873                 :          0 :            ::std::vector< uno::Reference< accessibility::XAccessibleEventListener > >::iterator aIter = mxEventListeners.begin();
     874                 :          0 :         sal_Bool bFound = sal_False;
     875                 :            : 
     876 [ #  # ][ #  # ]:          0 :         while( !bFound && ( aIter != mxEventListeners.end() ) )
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     877                 :            :         {
     878 [ #  # ][ #  # ]:          0 :             if( *aIter == rxListener )
     879                 :            :             {
     880         [ #  # ]:          0 :                 mxEventListeners.erase( aIter );
     881                 :          0 :                 bFound = sal_True;
     882                 :            :             }
     883                 :            :             else
     884                 :          0 :                 ++aIter;
     885                 :            :         }
     886         [ #  # ]:          0 :     }
     887                 :          0 : }
     888                 :            : 
     889                 :          0 : sal_Bool SAL_CALL ThumbnailViewItemAcc::containsPoint( const awt::Point& aPoint )
     890                 :            :     throw (uno::RuntimeException)
     891                 :            : {
     892         [ #  # ]:          0 :     const awt::Rectangle    aRect( getBounds() );
     893                 :          0 :     const Point             aSize( aRect.Width, aRect.Height );
     894                 :          0 :     const Point             aNullPoint, aTestPoint( aPoint.X, aPoint.Y );
     895                 :            : 
     896 [ #  # ][ #  # ]:          0 :     return Rectangle( aNullPoint, aSize ).IsInside( aTestPoint );
     897                 :            : }
     898                 :            : 
     899                 :          0 : uno::Reference< accessibility::XAccessible > SAL_CALL ThumbnailViewItemAcc::getAccessibleAtPoint( const awt::Point& )
     900                 :            :     throw (uno::RuntimeException)
     901                 :            : {
     902                 :          0 :     uno::Reference< accessibility::XAccessible > xRet;
     903                 :          0 :     return xRet;
     904                 :            : }
     905                 :            : 
     906                 :          0 : awt::Rectangle SAL_CALL ThumbnailViewItemAcc::getBounds()
     907                 :            :     throw (uno::RuntimeException)
     908                 :            : {
     909         [ #  # ]:          0 :     const SolarMutexGuard aSolarGuard;
     910                 :          0 :     awt::Rectangle      aRet;
     911                 :            : 
     912         [ #  # ]:          0 :     if( mpParent )
     913                 :            :     {
     914                 :          0 :         Rectangle   aRect( mpParent->getDrawArea() );
     915                 :          0 :         Point       aOrigin;
     916         [ #  # ]:          0 :         Rectangle   aParentRect( aOrigin, mpParent->mrParent.GetOutputSizePixel() );
     917                 :            : 
     918         [ #  # ]:          0 :         aRect.Intersection( aParentRect );
     919                 :            : 
     920                 :          0 :         aRet.X = aRect.Left();
     921                 :          0 :         aRet.Y = aRect.Top();
     922         [ #  # ]:          0 :         aRet.Width = aRect.GetWidth();
     923         [ #  # ]:          0 :         aRet.Height = aRect.GetHeight();
     924                 :            :     }
     925                 :            : 
     926         [ #  # ]:          0 :     return aRet;
     927                 :            : }
     928                 :            : 
     929                 :          0 : awt::Point SAL_CALL ThumbnailViewItemAcc::getLocation()
     930                 :            :     throw (uno::RuntimeException)
     931                 :            : {
     932         [ #  # ]:          0 :     const awt::Rectangle    aRect( getBounds() );
     933                 :          0 :     awt::Point              aRet;
     934                 :            : 
     935                 :          0 :     aRet.X = aRect.X;
     936                 :          0 :     aRet.Y = aRect.Y;
     937                 :            : 
     938                 :          0 :     return aRet;
     939                 :            : }
     940                 :            : 
     941                 :          0 : awt::Point SAL_CALL ThumbnailViewItemAcc::getLocationOnScreen()
     942                 :            :     throw (uno::RuntimeException)
     943                 :            : {
     944         [ #  # ]:          0 :     const SolarMutexGuard aSolarGuard;
     945                 :          0 :     awt::Point          aRet;
     946                 :            : 
     947         [ #  # ]:          0 :     if( mpParent )
     948                 :            :     {
     949                 :          0 :         const Point aPos = mpParent->getDrawArea().TopLeft();
     950         [ #  # ]:          0 :         const Point aScreenPos( mpParent->mrParent.OutputToAbsoluteScreenPixel( aPos ) );
     951                 :            : 
     952                 :          0 :         aRet.X = aScreenPos.X();
     953                 :          0 :         aRet.Y = aScreenPos.Y();
     954                 :            :     }
     955                 :            : 
     956         [ #  # ]:          0 :     return aRet;
     957                 :            : }
     958                 :            : 
     959                 :          0 : awt::Size SAL_CALL ThumbnailViewItemAcc::getSize()
     960                 :            :     throw (uno::RuntimeException)
     961                 :            : {
     962         [ #  # ]:          0 :     const awt::Rectangle    aRect( getBounds() );
     963                 :          0 :     awt::Size               aRet;
     964                 :            : 
     965                 :          0 :     aRet.Width = aRect.Width;
     966                 :          0 :     aRet.Height = aRect.Height;
     967                 :            : 
     968                 :          0 :     return aRet;
     969                 :            : }
     970                 :            : 
     971                 :          0 : void SAL_CALL ThumbnailViewItemAcc::grabFocus()
     972                 :            :     throw (uno::RuntimeException)
     973                 :            : {
     974                 :            :     // nothing to do
     975                 :          0 : }
     976                 :            : 
     977                 :          0 : uno::Any SAL_CALL ThumbnailViewItemAcc::getAccessibleKeyBinding()
     978                 :            :     throw (uno::RuntimeException)
     979                 :            : {
     980                 :          0 :     return uno::Any();
     981                 :            : }
     982                 :            : 
     983                 :          0 : sal_Int32 SAL_CALL ThumbnailViewItemAcc::getForeground(  )
     984                 :            :     throw (uno::RuntimeException)
     985                 :            : {
     986                 :          0 :     sal_uInt32 nColor = Application::GetSettings().GetStyleSettings().GetWindowTextColor().GetColor();
     987                 :          0 :     return static_cast<sal_Int32>(nColor);
     988                 :            : }
     989                 :            : 
     990                 :          0 : sal_Int32 SAL_CALL ThumbnailViewItemAcc::getBackground(  )
     991                 :            :     throw (uno::RuntimeException)
     992                 :            : {
     993                 :          0 :     return static_cast<sal_Int32>(Application::GetSettings().GetStyleSettings().GetWindowColor().GetColor());
     994                 :            : }
     995                 :            : 
     996                 :          0 : sal_Int64 SAL_CALL ThumbnailViewItemAcc::getSomething( const uno::Sequence< sal_Int8 >& rId ) throw( uno::RuntimeException )
     997                 :            : {
     998                 :            :     sal_Int64 nRet;
     999                 :            : 
    1000 [ #  # ][ #  # ]:          0 :     if( ( rId.getLength() == 16 ) && ( 0 == rtl_compareMemory( ThumbnailViewItemAcc::getUnoTunnelId().getConstArray(), rId.getConstArray(), 16 ) ) )
                 [ #  # ]
    1001                 :          0 :         nRet = reinterpret_cast< sal_Int64 >( this );
    1002                 :            :     else
    1003                 :          0 :         nRet = 0;
    1004                 :            : 
    1005                 :          0 :     return nRet;
    1006                 :            : }
    1007                 :            : 
    1008                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
    1009                 :            : 
    1010                 :            : 

Generated by: LCOV version 1.10