LCOV - code coverage report
Current view: top level - libreoffice/accessibility/source/standard - vclxaccessiblestatusbaritem.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 0 245 0.0 %
Date: 2012-12-17 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/standard/vclxaccessiblestatusbaritem.hxx>
      21             : #include <toolkit/helper/externallock.hxx>
      22             : #include <toolkit/helper/convert.hxx>
      23             : #include <accessibility/helper/characterattributeshelper.hxx>
      24             : 
      25             : #include <com/sun/star/accessibility/AccessibleEventId.hpp>
      26             : #include <com/sun/star/accessibility/AccessibleRole.hpp>
      27             : #include <com/sun/star/accessibility/AccessibleStateType.hpp>
      28             : #include <com/sun/star/datatransfer/clipboard/XClipboard.hpp>
      29             : #include <com/sun/star/datatransfer/clipboard/XFlushableClipboard.hpp>
      30             : #include <cppuhelper/supportsservice.hxx>
      31             : #include <unotools/accessiblestatesethelper.hxx>
      32             : #include <unotools/accessiblerelationsethelper.hxx>
      33             : #include <vcl/svapp.hxx>
      34             : #include <vcl/unohelp2.hxx>
      35             : #include <vcl/status.hxx>
      36             : #include <vcl/controllayout.hxx>
      37             : 
      38             : #include <memory>
      39             : 
      40             : 
      41             : using namespace ::com::sun::star::accessibility;
      42             : using namespace ::com::sun::star::uno;
      43             : using namespace ::com::sun::star::lang;
      44             : using namespace ::com::sun::star::beans;
      45             : using namespace ::com::sun::star;
      46             : using namespace ::comphelper;
      47             : 
      48             : 
      49             : // -----------------------------------------------------------------------------
      50             : // class VCLXAccessibleStatusBarItem
      51             : // -----------------------------------------------------------------------------
      52             : 
      53           0 : VCLXAccessibleStatusBarItem::VCLXAccessibleStatusBarItem( StatusBar* pStatusBar, sal_uInt16 nItemId )
      54             :     :AccessibleTextHelper_BASE( new VCLExternalSolarLock() )
      55             :     ,m_pStatusBar( pStatusBar )
      56           0 :     ,m_nItemId( nItemId )
      57             : {
      58           0 :     m_pExternalLock = static_cast< VCLExternalSolarLock* >( getExternalLock() );
      59             : 
      60           0 :     m_sItemName = GetItemName();
      61           0 :     m_sItemText = GetItemText();
      62           0 :     m_bShowing  = IsShowing();
      63           0 : }
      64             : 
      65             : // -----------------------------------------------------------------------------
      66             : 
      67           0 : VCLXAccessibleStatusBarItem::~VCLXAccessibleStatusBarItem()
      68             : {
      69           0 :     delete m_pExternalLock;
      70           0 :     m_pExternalLock = NULL;
      71           0 : }
      72             : 
      73             : // -----------------------------------------------------------------------------
      74             : 
      75           0 : sal_Bool VCLXAccessibleStatusBarItem::IsShowing()
      76             : {
      77           0 :     sal_Bool bShowing = sal_False;
      78             : 
      79           0 :     if ( m_pStatusBar )
      80           0 :         bShowing = m_pStatusBar->IsItemVisible( m_nItemId );
      81             : 
      82           0 :     return bShowing;
      83             : }
      84             : 
      85             : // -----------------------------------------------------------------------------
      86             : 
      87           0 : void VCLXAccessibleStatusBarItem::SetShowing( sal_Bool bShowing )
      88             : {
      89           0 :     if ( m_bShowing != bShowing )
      90             :     {
      91           0 :         Any aOldValue, aNewValue;
      92           0 :         if ( m_bShowing )
      93           0 :             aOldValue <<= AccessibleStateType::SHOWING;
      94             :         else
      95           0 :             aNewValue <<= AccessibleStateType::SHOWING;
      96           0 :         m_bShowing = bShowing;
      97           0 :         NotifyAccessibleEvent( AccessibleEventId::STATE_CHANGED, aOldValue, aNewValue );
      98             :     }
      99           0 : }
     100             : 
     101             : // -----------------------------------------------------------------------------
     102             : 
     103           0 : void VCLXAccessibleStatusBarItem::SetItemName( const OUString& sItemName )
     104             : {
     105           0 :     if ( !m_sItemName.equals( sItemName ) )
     106             :     {
     107           0 :         Any aOldValue, aNewValue;
     108           0 :         aOldValue <<= m_sItemName;
     109           0 :         aNewValue <<= sItemName;
     110           0 :         m_sItemName = sItemName;
     111           0 :         NotifyAccessibleEvent( AccessibleEventId::NAME_CHANGED, aOldValue, aNewValue );
     112             :     }
     113           0 : }
     114             : 
     115             : // -----------------------------------------------------------------------------
     116             : 
     117           0 : OUString VCLXAccessibleStatusBarItem::GetItemName()
     118             : {
     119           0 :     OUString sName;
     120           0 :     if ( m_pStatusBar )
     121           0 :         sName = m_pStatusBar->GetAccessibleName( m_nItemId );
     122             : 
     123           0 :     return sName;
     124             : }
     125             : 
     126             : // -----------------------------------------------------------------------------
     127             : 
     128           0 : void VCLXAccessibleStatusBarItem::SetItemText( const OUString& sItemText )
     129             : {
     130           0 :     Any aOldValue, aNewValue;
     131           0 :     if ( implInitTextChangedEvent( m_sItemText, sItemText, aOldValue, aNewValue ) )
     132             :     {
     133           0 :         m_sItemText = sItemText;
     134           0 :         NotifyAccessibleEvent( AccessibleEventId::TEXT_CHANGED, aOldValue, aNewValue );
     135           0 :     }
     136           0 : }
     137             : 
     138             : // -----------------------------------------------------------------------------
     139             : 
     140           0 : OUString VCLXAccessibleStatusBarItem::GetItemText()
     141             : {
     142           0 :     OUString sText;
     143           0 :     ::vcl::ControlLayoutData aLayoutData;
     144           0 :     if ( m_pStatusBar )
     145             :     {
     146           0 :         Rectangle aItemRect = m_pStatusBar->GetItemRect( m_nItemId );
     147           0 :         m_pStatusBar->RecordLayoutData( &aLayoutData, aItemRect );
     148           0 :         sText = aLayoutData.m_aDisplayText;
     149             :     }
     150             : 
     151           0 :     return sText;
     152             : }
     153             : 
     154             : // -----------------------------------------------------------------------------
     155             : 
     156           0 : void VCLXAccessibleStatusBarItem::FillAccessibleStateSet( utl::AccessibleStateSetHelper& rStateSet )
     157             : {
     158           0 :     rStateSet.AddState( AccessibleStateType::ENABLED );
     159           0 :     rStateSet.AddState( AccessibleStateType::SENSITIVE );
     160             : 
     161           0 :     rStateSet.AddState( AccessibleStateType::VISIBLE );
     162             : 
     163           0 :     if ( IsShowing() )
     164           0 :         rStateSet.AddState( AccessibleStateType::SHOWING );
     165           0 : }
     166             : 
     167             : // -----------------------------------------------------------------------------
     168             : // OCommonAccessibleComponent
     169             : // -----------------------------------------------------------------------------
     170             : 
     171           0 : awt::Rectangle VCLXAccessibleStatusBarItem::implGetBounds() throw (RuntimeException)
     172             : {
     173           0 :     awt::Rectangle aBounds( 0, 0, 0, 0 );
     174             : 
     175           0 :     if ( m_pStatusBar )
     176           0 :         aBounds = AWTRectangle( m_pStatusBar->GetItemRect( m_nItemId ) );
     177             : 
     178           0 :     return aBounds;
     179             : }
     180             : 
     181             : // -----------------------------------------------------------------------------
     182             : // OCommonAccessibleText
     183             : // -----------------------------------------------------------------------------
     184             : 
     185           0 : OUString VCLXAccessibleStatusBarItem::implGetText()
     186             : {
     187           0 :     return GetItemText();
     188             : }
     189             : 
     190             : // -----------------------------------------------------------------------------
     191             : 
     192           0 : lang::Locale VCLXAccessibleStatusBarItem::implGetLocale()
     193             : {
     194           0 :     return Application::GetSettings().GetLanguageTag().getLocale();
     195             : }
     196             : 
     197             : // -----------------------------------------------------------------------------
     198             : 
     199           0 : void VCLXAccessibleStatusBarItem::implGetSelection( sal_Int32& nStartIndex, sal_Int32& nEndIndex )
     200             : {
     201           0 :     nStartIndex = 0;
     202           0 :     nEndIndex = 0;
     203           0 : }
     204             : 
     205             : // -----------------------------------------------------------------------------
     206             : // XInterface
     207             : // -----------------------------------------------------------------------------
     208             : 
     209           0 : IMPLEMENT_FORWARD_XINTERFACE2( VCLXAccessibleStatusBarItem, AccessibleTextHelper_BASE, VCLXAccessibleStatusBarItem_BASE )
     210             : 
     211             : // -----------------------------------------------------------------------------
     212             : // XTypeProvider
     213             : // -----------------------------------------------------------------------------
     214             : 
     215           0 : IMPLEMENT_FORWARD_XTYPEPROVIDER2( VCLXAccessibleStatusBarItem, AccessibleTextHelper_BASE, VCLXAccessibleStatusBarItem_BASE )
     216             : 
     217             : // -----------------------------------------------------------------------------
     218             : // XComponent
     219             : // -----------------------------------------------------------------------------
     220             : 
     221           0 : void VCLXAccessibleStatusBarItem::disposing()
     222             : {
     223           0 :     AccessibleTextHelper_BASE::disposing();
     224             : 
     225           0 :     m_pStatusBar = NULL;
     226           0 :     m_sItemName = OUString();
     227           0 :     m_sItemText = OUString();
     228           0 : }
     229             : 
     230             : // -----------------------------------------------------------------------------
     231             : // XServiceInfo
     232             : // -----------------------------------------------------------------------------
     233             : 
     234           0 : OUString VCLXAccessibleStatusBarItem::getImplementationName() throw (RuntimeException)
     235             : {
     236           0 :     return OUString( "com.sun.star.comp.toolkit.AccessibleStatusBarItem" );
     237             : }
     238             : 
     239             : // -----------------------------------------------------------------------------
     240             : 
     241           0 : sal_Bool VCLXAccessibleStatusBarItem::supportsService( const OUString& rServiceName ) throw (RuntimeException)
     242             : {
     243           0 :     return cppu::supportsService(this, rServiceName);
     244             : }
     245             : 
     246             : // -----------------------------------------------------------------------------
     247             : 
     248           0 : Sequence< OUString > VCLXAccessibleStatusBarItem::getSupportedServiceNames() throw (RuntimeException)
     249             : {
     250           0 :     Sequence< OUString > aNames(1);
     251           0 :     aNames[0] = "com.sun.star.awt.AccessibleStatusBarItem";
     252           0 :     return aNames;
     253             : }
     254             : 
     255             : // -----------------------------------------------------------------------------
     256             : // XAccessible
     257             : // -----------------------------------------------------------------------------
     258             : 
     259           0 : Reference< XAccessibleContext > VCLXAccessibleStatusBarItem::getAccessibleContext(  ) throw (RuntimeException)
     260             : {
     261           0 :     OExternalLockGuard aGuard( this );
     262             : 
     263           0 :     return this;
     264             : }
     265             : 
     266             : // -----------------------------------------------------------------------------
     267             : // XAccessibleContext
     268             : // -----------------------------------------------------------------------------
     269             : 
     270           0 : sal_Int32 VCLXAccessibleStatusBarItem::getAccessibleChildCount() throw (RuntimeException)
     271             : {
     272           0 :     OExternalLockGuard aGuard( this );
     273             : 
     274           0 :     return 0;
     275             : }
     276             : 
     277             : // -----------------------------------------------------------------------------
     278             : 
     279           0 : Reference< XAccessible > VCLXAccessibleStatusBarItem::getAccessibleChild( sal_Int32 i ) throw (IndexOutOfBoundsException, RuntimeException)
     280             : {
     281           0 :     OExternalLockGuard aGuard( this );
     282             : 
     283           0 :     if ( i < 0 || i >= getAccessibleChildCount() )
     284           0 :         throw IndexOutOfBoundsException();
     285             : 
     286           0 :     return Reference< XAccessible >();
     287             : }
     288             : 
     289             : // -----------------------------------------------------------------------------
     290             : 
     291           0 : Reference< XAccessible > VCLXAccessibleStatusBarItem::getAccessibleParent(  ) throw (RuntimeException)
     292             : {
     293           0 :     OExternalLockGuard aGuard( this );
     294             : 
     295           0 :     Reference< XAccessible > xParent;
     296           0 :     if ( m_pStatusBar )
     297           0 :         xParent = m_pStatusBar->GetAccessible();
     298             : 
     299           0 :     return xParent;
     300             : }
     301             : 
     302             : // -----------------------------------------------------------------------------
     303             : 
     304           0 : sal_Int32 VCLXAccessibleStatusBarItem::getAccessibleIndexInParent(  ) throw (RuntimeException)
     305             : {
     306           0 :     OExternalLockGuard aGuard( this );
     307             : 
     308           0 :     sal_Int32 nIndexInParent = -1;
     309           0 :     if ( m_pStatusBar )
     310           0 :         nIndexInParent = m_pStatusBar->GetItemPos( m_nItemId );
     311             : 
     312           0 :     return nIndexInParent;
     313             : }
     314             : 
     315             : // -----------------------------------------------------------------------------
     316             : 
     317           0 : sal_Int16 VCLXAccessibleStatusBarItem::getAccessibleRole(  ) throw (RuntimeException)
     318             : {
     319           0 :     OExternalLockGuard aGuard( this );
     320             : 
     321           0 :     return AccessibleRole::LABEL;
     322             : }
     323             : 
     324             : // -----------------------------------------------------------------------------
     325             : 
     326           0 : OUString VCLXAccessibleStatusBarItem::getAccessibleDescription(  ) throw (RuntimeException)
     327             : {
     328           0 :     OExternalLockGuard aGuard( this );
     329             : 
     330           0 :     OUString sDescription;
     331           0 :     if ( m_pStatusBar )
     332           0 :         sDescription = m_pStatusBar->GetHelpText( m_nItemId );
     333             : 
     334           0 :     return sDescription;
     335             : }
     336             : 
     337             : // -----------------------------------------------------------------------------
     338             : 
     339           0 : OUString VCLXAccessibleStatusBarItem::getAccessibleName(  ) throw (RuntimeException)
     340             : {
     341           0 :     OExternalLockGuard aGuard( this );
     342             : 
     343           0 :     return GetItemName();
     344             : }
     345             : 
     346             : // -----------------------------------------------------------------------------
     347             : 
     348           0 : Reference< XAccessibleRelationSet > VCLXAccessibleStatusBarItem::getAccessibleRelationSet(  ) throw (RuntimeException)
     349             : {
     350           0 :     OExternalLockGuard aGuard( this );
     351             : 
     352           0 :     utl::AccessibleRelationSetHelper* pRelationSetHelper = new utl::AccessibleRelationSetHelper;
     353           0 :     Reference< XAccessibleRelationSet > xSet = pRelationSetHelper;
     354           0 :     return xSet;
     355             : }
     356             : 
     357             : // -----------------------------------------------------------------------------
     358             : 
     359           0 : Reference< XAccessibleStateSet > VCLXAccessibleStatusBarItem::getAccessibleStateSet(  ) throw (RuntimeException)
     360             : {
     361           0 :     OExternalLockGuard aGuard( this );
     362             : 
     363           0 :     utl::AccessibleStateSetHelper* pStateSetHelper = new utl::AccessibleStateSetHelper;
     364           0 :     Reference< XAccessibleStateSet > xSet = pStateSetHelper;
     365             : 
     366           0 :     if ( !rBHelper.bDisposed && !rBHelper.bInDispose )
     367             :     {
     368           0 :         FillAccessibleStateSet( *pStateSetHelper );
     369             :     }
     370             :     else
     371             :     {
     372           0 :         pStateSetHelper->AddState( AccessibleStateType::DEFUNC );
     373             :     }
     374             : 
     375           0 :     return xSet;
     376             : }
     377             : 
     378             : // -----------------------------------------------------------------------------
     379             : 
     380           0 : Locale VCLXAccessibleStatusBarItem::getLocale(  ) throw (IllegalAccessibleComponentStateException, RuntimeException)
     381             : {
     382           0 :     OExternalLockGuard aGuard( this );
     383             : 
     384           0 :     return Application::GetSettings().GetLanguageTag().getLocale();
     385             : }
     386             : 
     387             : // -----------------------------------------------------------------------------
     388             : // XAccessibleComponent
     389             : // -----------------------------------------------------------------------------
     390             : 
     391           0 : Reference< XAccessible > VCLXAccessibleStatusBarItem::getAccessibleAtPoint( const awt::Point& ) throw (RuntimeException)
     392             : {
     393           0 :     OExternalLockGuard aGuard( this );
     394             : 
     395           0 :     return Reference< XAccessible >();
     396             : }
     397             : 
     398             : // -----------------------------------------------------------------------------
     399             : 
     400           0 : void VCLXAccessibleStatusBarItem::grabFocus(  ) throw (RuntimeException)
     401             : {
     402             :     // no focus for status bar items
     403           0 : }
     404             : 
     405             : // -----------------------------------------------------------------------------
     406             : 
     407           0 : sal_Int32 VCLXAccessibleStatusBarItem::getForeground(   ) throw (RuntimeException)
     408             : {
     409           0 :     OExternalLockGuard aGuard( this );
     410             : 
     411           0 :     sal_Int32 nColor = 0;
     412           0 :     Reference< XAccessible > xParent = getAccessibleParent();
     413           0 :     if ( xParent.is() )
     414             :     {
     415           0 :         Reference< XAccessibleComponent > xParentComp( xParent->getAccessibleContext(), UNO_QUERY );
     416           0 :         if ( xParentComp.is() )
     417           0 :             nColor = xParentComp->getForeground();
     418             :     }
     419             : 
     420           0 :     return nColor;
     421             : }
     422             : 
     423             : // -----------------------------------------------------------------------------
     424             : 
     425           0 : sal_Int32 VCLXAccessibleStatusBarItem::getBackground(  ) throw (RuntimeException)
     426             : {
     427           0 :     OExternalLockGuard aGuard( this );
     428             : 
     429           0 :     sal_Int32 nColor = 0;
     430           0 :     Reference< XAccessible > xParent = getAccessibleParent();
     431           0 :     if ( xParent.is() )
     432             :     {
     433           0 :         Reference< XAccessibleComponent > xParentComp( xParent->getAccessibleContext(), UNO_QUERY );
     434           0 :         if ( xParentComp.is() )
     435           0 :             nColor = xParentComp->getBackground();
     436             :     }
     437             : 
     438           0 :     return nColor;
     439             : }
     440             : 
     441             : // -----------------------------------------------------------------------------
     442             : // XAccessibleExtendedComponent
     443             : // -----------------------------------------------------------------------------
     444             : 
     445           0 : Reference< awt::XFont > VCLXAccessibleStatusBarItem::getFont(  ) throw (RuntimeException)
     446             : {
     447           0 :     OExternalLockGuard aGuard( this );
     448             : 
     449           0 :     Reference< awt::XFont > xFont;
     450           0 :     Reference< XAccessible > xParent = getAccessibleParent();
     451           0 :     if ( xParent.is() )
     452             :     {
     453           0 :         Reference< XAccessibleExtendedComponent > xParentComp( xParent->getAccessibleContext(), UNO_QUERY );
     454           0 :         if ( xParentComp.is() )
     455           0 :             xFont = xParentComp->getFont();
     456             :     }
     457             : 
     458           0 :     return xFont;
     459             : }
     460             : 
     461             : // -----------------------------------------------------------------------------
     462             : 
     463           0 : OUString VCLXAccessibleStatusBarItem::getTitledBorderText(  ) throw (RuntimeException)
     464             : {
     465           0 :     OExternalLockGuard aGuard( this );
     466             : 
     467           0 :     return GetItemText();
     468             : }
     469             : 
     470             : // -----------------------------------------------------------------------------
     471             : 
     472           0 : OUString VCLXAccessibleStatusBarItem::getToolTipText(  ) throw (RuntimeException)
     473             : {
     474           0 :     OExternalLockGuard aGuard( this );
     475             : 
     476           0 :     return OUString();
     477             : }
     478             : 
     479             : // -----------------------------------------------------------------------------
     480             : // XAccessibleText
     481             : // -----------------------------------------------------------------------------
     482             : 
     483           0 : sal_Int32 VCLXAccessibleStatusBarItem::getCaretPosition() throw (RuntimeException)
     484             : {
     485           0 :     OExternalLockGuard aGuard( this );
     486             : 
     487           0 :     return -1;
     488             : }
     489             : 
     490             : // -----------------------------------------------------------------------------
     491             : 
     492           0 : sal_Bool VCLXAccessibleStatusBarItem::setCaretPosition( sal_Int32 nIndex ) throw (IndexOutOfBoundsException, RuntimeException)
     493             : {
     494           0 :     OExternalLockGuard aGuard( this );
     495             : 
     496           0 :     if ( !implIsValidRange( nIndex, nIndex, implGetText().getLength() ) )
     497           0 :         throw IndexOutOfBoundsException();
     498             : 
     499           0 :     return sal_False;
     500             : }
     501             : 
     502             : // -----------------------------------------------------------------------------
     503             : 
     504           0 : Sequence< PropertyValue > VCLXAccessibleStatusBarItem::getCharacterAttributes( sal_Int32 nIndex, const Sequence< OUString >& aRequestedAttributes ) throw (IndexOutOfBoundsException, RuntimeException)
     505             : {
     506           0 :     OExternalLockGuard aGuard( this );
     507             : 
     508           0 :     Sequence< PropertyValue > aValues;
     509           0 :     OUString sText( implGetText() );
     510             : 
     511           0 :     if ( !implIsValidIndex( nIndex, sText.getLength() ) )
     512           0 :         throw IndexOutOfBoundsException();
     513             : 
     514           0 :     if ( m_pStatusBar )
     515             :     {
     516           0 :         Font aFont = m_pStatusBar->GetFont();
     517           0 :         sal_Int32 nBackColor = getBackground();
     518           0 :         sal_Int32 nColor = getForeground();
     519           0 :         ::std::auto_ptr< CharacterAttributesHelper > pHelper( new CharacterAttributesHelper( aFont, nBackColor, nColor ) );
     520           0 :         aValues = pHelper->GetCharacterAttributes( aRequestedAttributes );
     521             :     }
     522             : 
     523           0 :     return aValues;
     524             : }
     525             : 
     526             : // -----------------------------------------------------------------------------
     527             : 
     528           0 : awt::Rectangle VCLXAccessibleStatusBarItem::getCharacterBounds( sal_Int32 nIndex ) throw (IndexOutOfBoundsException, RuntimeException)
     529             : {
     530           0 :     OExternalLockGuard aGuard( this );
     531             : 
     532           0 :     if ( !implIsValidIndex( nIndex, implGetText().getLength() ) )
     533           0 :         throw IndexOutOfBoundsException();
     534             : 
     535           0 :     awt::Rectangle aBounds( 0, 0, 0, 0 );
     536           0 :     if ( m_pStatusBar )
     537             :     {
     538           0 :         ::vcl::ControlLayoutData aLayoutData;
     539           0 :         Rectangle aItemRect = m_pStatusBar->GetItemRect( m_nItemId );
     540           0 :         m_pStatusBar->RecordLayoutData( &aLayoutData, aItemRect );
     541           0 :         Rectangle aCharRect = aLayoutData.GetCharacterBounds( nIndex );
     542           0 :         aCharRect.Move( -aItemRect.Left(), -aItemRect.Top() );
     543           0 :         aBounds = AWTRectangle( aCharRect );
     544             :     }
     545             : 
     546           0 :     return aBounds;
     547             : }
     548             : 
     549             : // -----------------------------------------------------------------------------
     550             : 
     551           0 : sal_Int32 VCLXAccessibleStatusBarItem::getIndexAtPoint( const awt::Point& aPoint ) throw (RuntimeException)
     552             : {
     553           0 :     OExternalLockGuard aGuard( this );
     554             : 
     555           0 :     sal_Int32 nIndex = -1;
     556           0 :     if ( m_pStatusBar )
     557             :     {
     558           0 :         ::vcl::ControlLayoutData aLayoutData;
     559           0 :         Rectangle aItemRect = m_pStatusBar->GetItemRect( m_nItemId );
     560           0 :         m_pStatusBar->RecordLayoutData( &aLayoutData, aItemRect );
     561           0 :         Point aPnt( VCLPoint( aPoint ) );
     562           0 :         aPnt += aItemRect.TopLeft();
     563           0 :         nIndex = aLayoutData.GetIndexForPoint( aPnt );
     564             :     }
     565             : 
     566           0 :     return nIndex;
     567             : }
     568             : 
     569             : // -----------------------------------------------------------------------------
     570             : 
     571           0 : sal_Bool VCLXAccessibleStatusBarItem::setSelection( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (IndexOutOfBoundsException, RuntimeException)
     572             : {
     573           0 :     OExternalLockGuard aGuard( this );
     574             : 
     575           0 :     if ( !implIsValidRange( nStartIndex, nEndIndex, implGetText().getLength() ) )
     576           0 :         throw IndexOutOfBoundsException();
     577             : 
     578           0 :     return sal_False;
     579             : }
     580             : 
     581             : // -----------------------------------------------------------------------------
     582             : 
     583           0 : sal_Bool VCLXAccessibleStatusBarItem::copyText( sal_Int32 nStartIndex, sal_Int32 nEndIndex ) throw (IndexOutOfBoundsException, RuntimeException)
     584             : {
     585           0 :     OExternalLockGuard aGuard( this );
     586             : 
     587           0 :     sal_Bool bReturn = sal_False;
     588             : 
     589           0 :     if ( m_pStatusBar )
     590             :     {
     591           0 :         Reference< datatransfer::clipboard::XClipboard > xClipboard = m_pStatusBar->GetClipboard();
     592           0 :         if ( xClipboard.is() )
     593             :         {
     594           0 :             OUString sText( getTextRange( nStartIndex, nEndIndex ) );
     595             : 
     596           0 :             ::vcl::unohelper::TextDataObject* pDataObj = new ::vcl::unohelper::TextDataObject( sText );
     597           0 :             const sal_uInt32 nRef = Application::ReleaseSolarMutex();
     598           0 :             xClipboard->setContents( pDataObj, NULL );
     599             : 
     600           0 :             Reference< datatransfer::clipboard::XFlushableClipboard > xFlushableClipboard( xClipboard, uno::UNO_QUERY );
     601           0 :             if( xFlushableClipboard.is() )
     602           0 :                 xFlushableClipboard->flushClipboard();
     603             : 
     604           0 :             Application::AcquireSolarMutex( nRef );
     605             : 
     606           0 :             bReturn = sal_True;
     607           0 :         }
     608             :     }
     609             : 
     610           0 :     return bReturn;
     611             : }
     612             : 
     613             : // -----------------------------------------------------------------------------
     614             : 
     615             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10