LCOV - code coverage report
Current view: top level - accessibility/source/extended - AccessibleBrowseBoxBase.cxx (source / functions) Hit Total Coverage
Test: commit e02a6cb2c3e2b23b203b422e4e0680877f232636 Lines: 0 243 0.0 %
Date: 2014-04-14 Functions: 0 48 0.0 %
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2             : /*
       3             :  * This file is part of the LibreOffice project.
       4             :  *
       5             :  * This Source Code Form is subject to the terms of the Mozilla Public
       6             :  * License, v. 2.0. If a copy of the MPL was not distributed with this
       7             :  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
       8             :  *
       9             :  * This file incorporates work covered by the following license notice:
      10             :  *
      11             :  *   Licensed to the Apache Software Foundation (ASF) under one or more
      12             :  *   contributor license agreements. See the NOTICE file distributed
      13             :  *   with this work for additional information regarding copyright
      14             :  *   ownership. The ASF licenses this file to you under the Apache
      15             :  *   License, Version 2.0 (the "License"); you may not use this file
      16             :  *   except in compliance with the License. You may obtain a copy of
      17             :  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
      18             :  */
      19             : 
      20             : #include "accessibility/extended/AccessibleBrowseBoxBase.hxx"
      21             : #include <svtools/accessibletableprovider.hxx>
      22             : #include <comphelper/servicehelper.hxx>
      23             : #include <cppuhelper/supportsservice.hxx>
      24             : 
      25             : #include <com/sun/star/accessibility/AccessibleEventId.hpp>
      26             : #include <com/sun/star/accessibility/AccessibleStateType.hpp>
      27             : #include <unotools/accessiblerelationsethelper.hxx>
      28             : 
      29             : 
      30             : 
      31             : using ::com::sun::star::uno::Reference;
      32             : using ::com::sun::star::uno::Sequence;
      33             : using ::com::sun::star::uno::Any;
      34             : 
      35             : using namespace ::com::sun::star;
      36             : using namespace ::com::sun::star::accessibility;
      37             : using namespace ::comphelper;
      38             : using namespace ::svt;
      39             : 
      40             : 
      41             : 
      42             : 
      43             : namespace accessibility {
      44             : 
      45             : using namespace com::sun::star::accessibility::AccessibleStateType;
      46             : 
      47             : 
      48             : // Ctor/Dtor/disposing --------------------------------------------------------
      49             : 
      50           0 : AccessibleBrowseBoxBase::AccessibleBrowseBoxBase(
      51             :         const Reference< XAccessible >& rxParent,
      52             :         IAccessibleTableProvider&                      rBrowseBox,
      53             :         const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow >& _xFocusWindow,
      54             :         AccessibleBrowseBoxObjType      eObjType ) :
      55             :     AccessibleBrowseBoxImplHelper( m_aMutex ),
      56             :     mxParent( rxParent ),
      57             :     mpBrowseBox( &rBrowseBox ),
      58             :     m_xFocusWindow(_xFocusWindow),
      59           0 :     maName( rBrowseBox.GetAccessibleObjectName( eObjType ) ),
      60           0 :     maDescription( rBrowseBox.GetAccessibleObjectDescription( eObjType ) ),
      61             :     meObjType( eObjType ),
      62           0 :     m_aClientId(0)
      63             : {
      64           0 :     if ( m_xFocusWindow.is() )
      65           0 :         m_xFocusWindow->addFocusListener( this );
      66           0 : }
      67             : 
      68           0 : AccessibleBrowseBoxBase::AccessibleBrowseBoxBase(
      69             :         const Reference< XAccessible >& rxParent,
      70             :         IAccessibleTableProvider&                      rBrowseBox,
      71             :         const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindow >& _xFocusWindow,
      72             :         AccessibleBrowseBoxObjType      eObjType,
      73             :         const OUString&          rName,
      74             :         const OUString&          rDescription ) :
      75             :     AccessibleBrowseBoxImplHelper( m_aMutex ),
      76             :     mxParent( rxParent ),
      77             :     mpBrowseBox( &rBrowseBox ),
      78             :     m_xFocusWindow(_xFocusWindow),
      79             :     maName( rName ),
      80             :     maDescription( rDescription ),
      81             :     meObjType( eObjType ),
      82           0 :     m_aClientId(0)
      83             : {
      84           0 :     if ( m_xFocusWindow.is() )
      85           0 :         m_xFocusWindow->addFocusListener( this );
      86           0 : }
      87             : 
      88           0 : AccessibleBrowseBoxBase::~AccessibleBrowseBoxBase()
      89             : {
      90           0 :     if( isAlive() )
      91             :     {
      92             :         // increment ref count to prevent double call of Dtor
      93           0 :         osl_atomic_increment( &m_refCount );
      94           0 :         dispose();
      95             :     }
      96           0 : }
      97             : 
      98           0 : void SAL_CALL AccessibleBrowseBoxBase::disposing()
      99             : {
     100           0 :     ::osl::MutexGuard aGuard( getOslMutex() );
     101           0 :     if ( m_xFocusWindow.is() )
     102             :     {
     103           0 :         SolarMutexGuard aSolarGuard;
     104           0 :         m_xFocusWindow->removeFocusListener( this );
     105             :     }
     106             : 
     107           0 :     if ( getClientId( ) )
     108             :     {
     109           0 :         AccessibleEventNotifier::TClientId nId( getClientId( ) );
     110           0 :         setClientId( 0 );
     111           0 :         AccessibleEventNotifier::revokeClientNotifyDisposing( nId, *this );
     112             :     }
     113             : 
     114           0 :     mxParent = NULL;
     115           0 :     mpBrowseBox = NULL;
     116           0 : }
     117             : 
     118             : // XAccessibleContext ---------------------------------------------------------
     119             : 
     120           0 : Reference< XAccessible > SAL_CALL AccessibleBrowseBoxBase::getAccessibleParent()
     121             :     throw ( uno::RuntimeException, std::exception )
     122             : {
     123           0 :     ::osl::MutexGuard aGuard( getOslMutex() );
     124           0 :     ensureIsAlive();
     125           0 :     return mxParent;
     126             : }
     127             : 
     128           0 : sal_Int32 SAL_CALL AccessibleBrowseBoxBase::getAccessibleIndexInParent()
     129             :     throw ( uno::RuntimeException, std::exception )
     130             : {
     131           0 :     ::osl::MutexGuard aGuard( getOslMutex() );
     132           0 :     ensureIsAlive();
     133             : 
     134             :     // -1 for child not found/no parent (according to specification)
     135           0 :     sal_Int32 nRet = -1;
     136             : 
     137           0 :     Reference< uno::XInterface > xMeMyselfAndI( static_cast< XAccessibleContext* >( this ), uno::UNO_QUERY );
     138             : 
     139             :     //  iterate over parent's children and search for this object
     140           0 :     if( mxParent.is() )
     141             :     {
     142             :         Reference< XAccessibleContext >
     143           0 :             xParentContext( mxParent->getAccessibleContext() );
     144           0 :         if( xParentContext.is() )
     145             :         {
     146           0 :             Reference< uno::XInterface > xChild;
     147             : 
     148           0 :             sal_Int32 nChildCount = xParentContext->getAccessibleChildCount();
     149           0 :             for( sal_Int32 nChild = 0; nChild < nChildCount; ++nChild )
     150             :             {
     151           0 :                 xChild = xChild.query( xParentContext->getAccessibleChild( nChild ) );
     152             : 
     153           0 :                 if ( xMeMyselfAndI.get() == xChild.get() )
     154             :                 {
     155           0 :                     nRet = nChild;
     156           0 :                     break;
     157             :                 }
     158           0 :             }
     159           0 :         }
     160             :    }
     161           0 :    return nRet;
     162             : }
     163             : 
     164           0 : OUString SAL_CALL AccessibleBrowseBoxBase::getAccessibleDescription()
     165             :     throw ( uno::RuntimeException, std::exception )
     166             : {
     167           0 :     ::osl::MutexGuard aGuard( getOslMutex() );
     168           0 :     ensureIsAlive();
     169           0 :     return maDescription;
     170             : }
     171             : 
     172           0 : OUString SAL_CALL AccessibleBrowseBoxBase::getAccessibleName()
     173             :     throw ( uno::RuntimeException, std::exception )
     174             : {
     175           0 :     ::osl::MutexGuard aGuard( getOslMutex() );
     176           0 :     ensureIsAlive();
     177           0 :     return maName;
     178             : }
     179             : 
     180             : Reference< XAccessibleRelationSet > SAL_CALL
     181           0 : AccessibleBrowseBoxBase::getAccessibleRelationSet()
     182             :     throw ( uno::RuntimeException, std::exception )
     183             : {
     184           0 :     ensureIsAlive();
     185             :     // BrowseBox does not have relations.
     186           0 :        return new utl::AccessibleRelationSetHelper;
     187             : }
     188             : 
     189             : Reference< XAccessibleStateSet > SAL_CALL
     190           0 : AccessibleBrowseBoxBase::getAccessibleStateSet()
     191             :     throw ( uno::RuntimeException, std::exception )
     192             : {
     193           0 :     SolarMutexGuard aSolarGuard;
     194           0 :     ::osl::MutexGuard aGuard( getOslMutex() );
     195             :     // don't check whether alive -> StateSet may contain DEFUNC
     196           0 :     return implCreateStateSetHelper();
     197             : }
     198             : 
     199           0 : lang::Locale SAL_CALL AccessibleBrowseBoxBase::getLocale()
     200             :     throw ( IllegalAccessibleComponentStateException, uno::RuntimeException, std::exception )
     201             : {
     202           0 :     ::osl::MutexGuard aGuard( getOslMutex() );
     203           0 :     ensureIsAlive();
     204           0 :     if( mxParent.is() )
     205             :     {
     206             :         Reference< XAccessibleContext >
     207           0 :             xParentContext( mxParent->getAccessibleContext() );
     208           0 :         if( xParentContext.is() )
     209           0 :             return xParentContext->getLocale();
     210             :     }
     211           0 :     throw IllegalAccessibleComponentStateException();
     212             : }
     213             : 
     214             : // XAccessibleComponent -------------------------------------------------------
     215             : 
     216           0 : sal_Bool SAL_CALL AccessibleBrowseBoxBase::containsPoint( const awt::Point& rPoint )
     217             :     throw ( uno::RuntimeException, std::exception )
     218             : {
     219           0 :     return Rectangle( Point(), getBoundingBox().GetSize() ).IsInside( VCLPoint( rPoint ) );
     220             : }
     221             : 
     222           0 : awt::Rectangle SAL_CALL AccessibleBrowseBoxBase::getBounds()
     223             :     throw ( uno::RuntimeException, std::exception )
     224             : {
     225           0 :     return AWTRectangle( getBoundingBox() );
     226             : }
     227             : 
     228           0 : awt::Point SAL_CALL AccessibleBrowseBoxBase::getLocation()
     229             :     throw ( uno::RuntimeException, std::exception )
     230             : {
     231           0 :     return AWTPoint( getBoundingBox().TopLeft() );
     232             : }
     233             : 
     234           0 : awt::Point SAL_CALL AccessibleBrowseBoxBase::getLocationOnScreen()
     235             :     throw ( uno::RuntimeException, std::exception )
     236             : {
     237           0 :     return AWTPoint( getBoundingBoxOnScreen().TopLeft() );
     238             : }
     239             : 
     240           0 : awt::Size SAL_CALL AccessibleBrowseBoxBase::getSize()
     241             :     throw ( uno::RuntimeException, std::exception )
     242             : {
     243           0 :     return AWTSize( getBoundingBox().GetSize() );
     244             : }
     245             : 
     246           0 : void SAL_CALL AccessibleBrowseBoxBase::focusGained( const ::com::sun::star::awt::FocusEvent& ) throw (::com::sun::star::uno::RuntimeException, std::exception)
     247             : {
     248           0 :     com::sun::star::uno::Any aFocused;
     249           0 :     com::sun::star::uno::Any aEmpty;
     250           0 :     aFocused <<= FOCUSED;
     251             : 
     252           0 :     commitEvent(AccessibleEventId::STATE_CHANGED,aFocused,aEmpty);
     253           0 : }
     254             : 
     255             : 
     256           0 : void SAL_CALL AccessibleBrowseBoxBase::focusLost( const ::com::sun::star::awt::FocusEvent& ) throw (::com::sun::star::uno::RuntimeException, std::exception)
     257             : {
     258           0 :     com::sun::star::uno::Any aFocused;
     259           0 :     com::sun::star::uno::Any aEmpty;
     260           0 :     aFocused <<= FOCUSED;
     261             : 
     262           0 :     commitEvent(AccessibleEventId::STATE_CHANGED,aEmpty,aFocused);
     263           0 : }
     264             : // XAccessibleEventBroadcaster ------------------------------------------------
     265             : 
     266           0 : void SAL_CALL AccessibleBrowseBoxBase::addAccessibleEventListener(
     267             :         const Reference< XAccessibleEventListener>& _rxListener )
     268             :     throw ( uno::RuntimeException, std::exception )
     269             : {
     270           0 :     if ( _rxListener.is() )
     271             :     {
     272           0 :         ::osl::MutexGuard aGuard( getOslMutex() );
     273           0 :         if ( !getClientId( ) )
     274           0 :             setClientId( AccessibleEventNotifier::registerClient( ) );
     275             : 
     276           0 :         AccessibleEventNotifier::addEventListener( getClientId( ), _rxListener );
     277             :     }
     278           0 : }
     279             : 
     280           0 : void SAL_CALL AccessibleBrowseBoxBase::removeAccessibleEventListener(
     281             :         const Reference< XAccessibleEventListener>& _rxListener )
     282             :     throw ( uno::RuntimeException, std::exception )
     283             : {
     284           0 :     if( _rxListener.is() && getClientId( ) )
     285             :     {
     286           0 :         ::osl::MutexGuard aGuard( getOslMutex() );
     287           0 :         sal_Int32 nListenerCount = AccessibleEventNotifier::removeEventListener( getClientId( ), _rxListener );
     288           0 :         if ( !nListenerCount )
     289             :         {
     290             :             // no listeners anymore
     291             :             // -> revoke ourself. This may lead to the notifier thread dying (if we were the last client),
     292             :             // and at least to us not firing any events anymore, in case somebody calls
     293             :             // NotifyAccessibleEvent, again
     294             : 
     295           0 :             AccessibleEventNotifier::TClientId nId( getClientId( ) );
     296           0 :             setClientId( 0 );
     297           0 :             AccessibleEventNotifier::revokeClient( nId );
     298           0 :         }
     299             :     }
     300           0 : }
     301             : 
     302             : // XTypeProvider --------------------------------------------------------------
     303             : 
     304           0 : Sequence< sal_Int8 > SAL_CALL AccessibleBrowseBoxBase::getImplementationId()
     305             :     throw ( uno::RuntimeException, std::exception )
     306             : {
     307           0 :     return css::uno::Sequence<sal_Int8>();
     308             : }
     309             : 
     310             : // XServiceInfo ---------------------------------------------------------------
     311             : 
     312           0 : sal_Bool SAL_CALL AccessibleBrowseBoxBase::supportsService(
     313             :         const OUString& rServiceName )
     314             :     throw ( uno::RuntimeException, std::exception )
     315             : {
     316           0 :     return cppu::supportsService(this, rServiceName);
     317             : }
     318             : 
     319           0 : Sequence< OUString > SAL_CALL AccessibleBrowseBoxBase::getSupportedServiceNames()
     320             :     throw ( uno::RuntimeException, std::exception )
     321             : {
     322           0 :     const OUString aServiceName( "com.sun.star.accessibility.AccessibleContext" );
     323           0 :     return Sequence< OUString >( &aServiceName, 1 );
     324             : }
     325             : 
     326             : // other public methods -------------------------------------------------------
     327             : 
     328           0 : void AccessibleBrowseBoxBase::setAccessibleName( const OUString& rName )
     329             : {
     330           0 :     ::osl::ClearableMutexGuard aGuard( getOslMutex() );
     331           0 :     Any aOld;
     332           0 :     aOld <<= maName;
     333           0 :     maName = rName;
     334             : 
     335           0 :     aGuard.clear();
     336             : 
     337             :     commitEvent(
     338             :         AccessibleEventId::NAME_CHANGED,
     339             :         uno::makeAny( maName ),
     340           0 :         aOld );
     341           0 : }
     342             : 
     343           0 : void AccessibleBrowseBoxBase::setAccessibleDescription( const OUString& rDescription )
     344             : {
     345           0 :     ::osl::ClearableMutexGuard aGuard( getOslMutex() );
     346           0 :     Any aOld;
     347           0 :     aOld <<= maDescription;
     348           0 :     maDescription = rDescription;
     349             : 
     350           0 :     aGuard.clear();
     351             : 
     352             :     commitEvent(
     353             :         AccessibleEventId::DESCRIPTION_CHANGED,
     354             :         uno::makeAny( maDescription ),
     355           0 :         aOld );
     356           0 : }
     357             : 
     358             : // internal virtual methods ---------------------------------------------------
     359             : 
     360           0 : sal_Bool AccessibleBrowseBoxBase::implIsShowing()
     361             : {
     362           0 :     sal_Bool bShowing = sal_False;
     363           0 :     if( mxParent.is() )
     364             :     {
     365             :         Reference< XAccessibleComponent >
     366           0 :             xParentComp( mxParent->getAccessibleContext(), uno::UNO_QUERY );
     367           0 :         if( xParentComp.is() )
     368           0 :             bShowing = implGetBoundingBox().IsOver(
     369           0 :                 VCLRectangle( xParentComp->getBounds() ) );
     370             :     }
     371           0 :     return bShowing;
     372             : }
     373             : 
     374           0 : ::utl::AccessibleStateSetHelper* AccessibleBrowseBoxBase::implCreateStateSetHelper()
     375             : {
     376             :     ::utl::AccessibleStateSetHelper*
     377           0 :         pStateSetHelper = new ::utl::AccessibleStateSetHelper;
     378             : 
     379           0 :     if( isAlive() )
     380             :     {
     381             :         // SHOWING done with mxParent
     382           0 :         if( implIsShowing() )
     383           0 :             pStateSetHelper->AddState( AccessibleStateType::SHOWING );
     384             :         // BrowseBox fills StateSet with states depending on object type
     385           0 :         mpBrowseBox->FillAccessibleStateSet( *pStateSetHelper, getType() );
     386             :     }
     387             :     else
     388           0 :         pStateSetHelper->AddState( AccessibleStateType::DEFUNC );
     389             : 
     390           0 :     return pStateSetHelper;
     391             : }
     392             : 
     393             : // internal helper methods ----------------------------------------------------
     394             : 
     395           0 : sal_Bool AccessibleBrowseBoxBase::isAlive() const
     396             : {
     397           0 :     return !rBHelper.bDisposed && !rBHelper.bInDispose && mpBrowseBox;
     398             : }
     399             : 
     400           0 : void AccessibleBrowseBoxBase::ensureIsAlive() const
     401             :     throw ( lang::DisposedException )
     402             : {
     403           0 :     if( !isAlive() )
     404           0 :         throw lang::DisposedException();
     405           0 : }
     406             : 
     407           0 : Rectangle AccessibleBrowseBoxBase::getBoundingBox()
     408             :     throw ( lang::DisposedException )
     409             : {
     410           0 :     SolarMutexGuard aSolarGuard;
     411           0 :     ::osl::MutexGuard aGuard( getOslMutex() );
     412           0 :     ensureIsAlive();
     413           0 :     Rectangle aRect = implGetBoundingBox();
     414           0 :     if ( 0 == aRect.Left() && 0 == aRect.Top() && 0 == aRect.Right() && 0 == aRect.Bottom() )
     415             :     {
     416             :         SAL_WARN( "accessibility", "rectangle doesn't exist" );
     417             :     }
     418           0 :     return aRect;
     419             : }
     420             : 
     421           0 : Rectangle AccessibleBrowseBoxBase::getBoundingBoxOnScreen()
     422             :     throw ( lang::DisposedException )
     423             : {
     424           0 :     SolarMutexGuard aSolarGuard;
     425           0 :     ::osl::MutexGuard aGuard( getOslMutex() );
     426           0 :     ensureIsAlive();
     427           0 :     Rectangle aRect = implGetBoundingBoxOnScreen();
     428           0 :     if ( 0 == aRect.Left() && 0 == aRect.Top() && 0 == aRect.Right() && 0 == aRect.Bottom() )
     429             :     {
     430             :         SAL_WARN( "accessibility", "rectangle doesn't exist" );
     431             :     }
     432           0 :     return aRect;
     433             : }
     434             : 
     435           0 : void AccessibleBrowseBoxBase::commitEvent(
     436             :         sal_Int16 _nEventId, const Any& _rNewValue, const Any& _rOldValue )
     437             : {
     438           0 :     ::osl::ClearableMutexGuard aGuard( getOslMutex() );
     439           0 :     if ( !getClientId( ) )
     440             :             // if we don't have a client id for the notifier, then we don't have listeners, then
     441             :             // we don't need to notify anything
     442           0 :             return;
     443             : 
     444             :     // build an event object
     445           0 :     AccessibleEventObject aEvent;
     446           0 :     aEvent.Source = *this;
     447           0 :     aEvent.EventId = _nEventId;
     448           0 :     aEvent.OldValue = _rOldValue;
     449           0 :     aEvent.NewValue = _rNewValue;
     450             : 
     451             :     // let the notifier handle this event
     452             : 
     453           0 :     AccessibleEventNotifier::addEvent( getClientId( ), aEvent );
     454             : }
     455             : 
     456           0 : sal_Int16 SAL_CALL AccessibleBrowseBoxBase::getAccessibleRole()
     457             :     throw ( uno::RuntimeException, std::exception )
     458             : {
     459           0 :     ensureIsAlive();
     460           0 :     sal_Int16 nRole = AccessibleRole::UNKNOWN;
     461           0 :     switch ( meObjType )
     462             :     {
     463             :         case BBTYPE_ROWHEADERCELL:
     464           0 :             nRole = AccessibleRole::ROW_HEADER;
     465           0 :             break;
     466             :         case BBTYPE_COLUMNHEADERCELL:
     467           0 :             nRole = AccessibleRole::COLUMN_HEADER;
     468           0 :             break;
     469             :         case BBTYPE_COLUMNHEADERBAR:
     470             :         case BBTYPE_ROWHEADERBAR:
     471             :         case BBTYPE_TABLE:
     472           0 :             nRole = AccessibleRole::TABLE;
     473           0 :             break;
     474             :         case BBTYPE_TABLECELL:
     475           0 :             nRole = AccessibleRole::TABLE_CELL;
     476           0 :             break;
     477             :         case BBTYPE_BROWSEBOX:
     478           0 :             nRole = AccessibleRole::PANEL;
     479           0 :             break;
     480             :         case BBTYPE_CHECKBOXCELL:
     481           0 :             nRole = AccessibleRole::CHECK_BOX;
     482           0 :             break;
     483             :     }
     484           0 :     return nRole;
     485             : }
     486             : 
     487           0 : Reference<XAccessible > SAL_CALL AccessibleBrowseBoxBase::getAccessibleAtPoint( const ::com::sun::star::awt::Point& )
     488             :         throw ( uno::RuntimeException, std::exception )
     489             : {
     490           0 :     return NULL;
     491             : }
     492             : 
     493           0 : void SAL_CALL AccessibleBrowseBoxBase::disposing( const ::com::sun::star::lang::EventObject& ) throw (::com::sun::star::uno::RuntimeException, std::exception)
     494             : {
     495           0 :     m_xFocusWindow = NULL;
     496           0 : }
     497             : 
     498           0 : sal_Int32 SAL_CALL AccessibleBrowseBoxBase::getForeground(  ) throw (::com::sun::star::uno::RuntimeException, std::exception)
     499             : {
     500           0 :     SolarMutexGuard aSolarGuard;
     501           0 :     ::osl::MutexGuard aGuard( getOslMutex() );
     502           0 :     ensureIsAlive();
     503             : 
     504           0 :     sal_Int32 nColor = 0;
     505           0 :     Window* pInst = mpBrowseBox->GetWindowInstance();
     506           0 :     if ( pInst )
     507             :     {
     508           0 :         if ( pInst->IsControlForeground() )
     509           0 :             nColor = pInst->GetControlForeground().GetColor();
     510             :         else
     511             :         {
     512           0 :             Font aFont;
     513           0 :             if ( pInst->IsControlFont() )
     514           0 :                 aFont = pInst->GetControlFont();
     515             :             else
     516           0 :                 aFont = pInst->GetFont();
     517           0 :             nColor = aFont.GetColor().GetColor();
     518             :         }
     519             :     }
     520             : 
     521           0 :     return nColor;
     522             : }
     523             : 
     524           0 : sal_Int32 SAL_CALL AccessibleBrowseBoxBase::getBackground(  ) throw (::com::sun::star::uno::RuntimeException, std::exception)
     525             : {
     526           0 :     SolarMutexGuard aSolarGuard;
     527           0 :     ::osl::MutexGuard aGuard( getOslMutex() );
     528           0 :     ensureIsAlive();
     529           0 :     sal_Int32 nColor = 0;
     530           0 :     Window* pInst = mpBrowseBox->GetWindowInstance();
     531           0 :     if ( pInst )
     532             :     {
     533           0 :         if ( pInst->IsControlBackground() )
     534           0 :             nColor = pInst->GetControlBackground().GetColor();
     535             :         else
     536           0 :             nColor = pInst->GetBackground().GetColor().GetColor();
     537             :     }
     538             : 
     539           0 :     return nColor;
     540             : }
     541             : 
     542             : 
     543             : // XInterface -----------------------------------------------------------------
     544           0 : IMPLEMENT_FORWARD_XINTERFACE2( BrowseBoxAccessibleElement, AccessibleBrowseBoxBase, BrowseBoxAccessibleElement_Base )
     545             : 
     546             : // XTypeProvider --------------------------------------------------------------
     547           0 : IMPLEMENT_FORWARD_XTYPEPROVIDER2( BrowseBoxAccessibleElement, AccessibleBrowseBoxBase, BrowseBoxAccessibleElement_Base )
     548             : 
     549             : // XAccessible ----------------------------------------------------------------
     550             : 
     551           0 : Reference< XAccessibleContext > SAL_CALL BrowseBoxAccessibleElement::getAccessibleContext() throw ( uno::RuntimeException, std::exception )
     552             : {
     553           0 :     ensureIsAlive();
     554           0 :     return this;
     555             : }
     556             : 
     557             : 
     558           0 : BrowseBoxAccessibleElement::BrowseBoxAccessibleElement( const Reference< XAccessible >& rxParent, IAccessibleTableProvider& rBrowseBox,
     559             :         const Reference< awt::XWindow >& _xFocusWindow, AccessibleBrowseBoxObjType  eObjType )
     560           0 :     :AccessibleBrowseBoxBase( rxParent, rBrowseBox, _xFocusWindow, eObjType )
     561             : {
     562           0 : }
     563             : 
     564             : 
     565           0 : BrowseBoxAccessibleElement::BrowseBoxAccessibleElement( const Reference< XAccessible >& rxParent, IAccessibleTableProvider& rBrowseBox,
     566             :         const Reference< awt::XWindow >& _xFocusWindow, AccessibleBrowseBoxObjType  eObjType,
     567             :         const OUString& rName, const OUString& rDescription )
     568           0 :     :AccessibleBrowseBoxBase( rxParent, rBrowseBox, _xFocusWindow, eObjType, rName, rDescription )
     569             : {
     570           0 : }
     571             : 
     572             : 
     573           0 : BrowseBoxAccessibleElement::~BrowseBoxAccessibleElement( )
     574             : {
     575           0 : }
     576             : 
     577             : 
     578             : 
     579             : } // namespace accessibility
     580             : 
     581             : 
     582             : 
     583             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10