LCOV - code coverage report
Current view: top level - comphelper/source/misc - accessiblecomponenthelper.cxx (source / functions) Hit Total Coverage
Test: commit 10e77ab3ff6f4314137acd6e2702a6e5c1ce1fae Lines: 51 63 81.0 %
Date: 2014-11-03 Functions: 20 30 66.7 %
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 <comphelper/accessiblecomponenthelper.hxx>
      21             : 
      22             : 
      23             : namespace comphelper
      24             : {
      25             : 
      26             : 
      27             :     using namespace ::com::sun::star::uno;
      28             :     using namespace ::com::sun::star::awt;
      29             :     using namespace ::com::sun::star::lang;
      30             :     using namespace ::com::sun::star::accessibility;
      31             : 
      32             : 
      33             :     //= OCommonAccessibleComponent
      34             : 
      35             : 
      36        5514 :     OCommonAccessibleComponent::OCommonAccessibleComponent( IMutex* _pExternalLock )
      37        5514 :         :OAccessibleContextHelper( _pExternalLock )
      38             :     {
      39        5514 :     }
      40             : 
      41             : 
      42        5432 :     OCommonAccessibleComponent::~OCommonAccessibleComponent( )
      43             :     {
      44        5432 :     }
      45             : 
      46             : 
      47       13070 :     bool SAL_CALL OCommonAccessibleComponent::containsPoint( const Point& _rPoint ) throw (RuntimeException)
      48             :     {
      49       13070 :         OExternalLockGuard aGuard( this );
      50       13070 :         Rectangle aBounds( implGetBounds() );
      51       13070 :         return  ( _rPoint.X >= 0 )
      52       10856 :             &&  ( _rPoint.Y >= 0 )
      53        6558 :             &&  ( _rPoint.X < aBounds.Width )
      54       17438 :             &&  ( _rPoint.Y < aBounds.Height );
      55             :     }
      56             : 
      57             : 
      58        1442 :     Point SAL_CALL OCommonAccessibleComponent::getLocation(  ) throw (RuntimeException)
      59             :     {
      60        1442 :         OExternalLockGuard aGuard( this );
      61        1442 :         Rectangle aBounds( implGetBounds() );
      62        1442 :         return Point( aBounds.X, aBounds.Y );
      63             :     }
      64             : 
      65             : 
      66        1430 :     Point SAL_CALL OCommonAccessibleComponent::getLocationOnScreen(  ) throw (RuntimeException)
      67             :     {
      68        1430 :         OExternalLockGuard aGuard( this );
      69             : 
      70        1430 :         Point aScreenLoc( 0, 0 );
      71             : 
      72        2860 :         Reference< XAccessibleComponent > xParentComponent( implGetParentContext(), UNO_QUERY );
      73             :         OSL_ENSURE( xParentComponent.is(), "OCommonAccessibleComponent::getLocationOnScreen: no parent component!" );
      74        1430 :         if ( xParentComponent.is() )
      75             :         {
      76        1430 :             Point aParentScreenLoc( xParentComponent->getLocationOnScreen() );
      77        1430 :             Point aOwnRelativeLoc( getLocation() );
      78        1430 :             aScreenLoc.X = aParentScreenLoc.X + aOwnRelativeLoc.X;
      79        1430 :             aScreenLoc.Y = aParentScreenLoc.Y + aOwnRelativeLoc.Y;
      80             :         }
      81             : 
      82        2860 :         return aScreenLoc;
      83             :     }
      84             : 
      85             : 
      86          12 :     Size SAL_CALL OCommonAccessibleComponent::getSize(  ) throw (RuntimeException)
      87             :     {
      88          12 :         OExternalLockGuard aGuard( this );
      89          12 :         Rectangle aBounds( implGetBounds() );
      90          12 :         return Size( aBounds.Width, aBounds.Height );
      91             :     }
      92             : 
      93             : 
      94        1594 :     Rectangle SAL_CALL OCommonAccessibleComponent::getBounds(  ) throw (RuntimeException)
      95             :     {
      96        1594 :         OExternalLockGuard aGuard( this );
      97        1594 :         return implGetBounds();
      98             :     }
      99             : 
     100             : 
     101             :     //= OAccessibleComponentHelper
     102             : 
     103             : 
     104          58 :     OAccessibleComponentHelper::OAccessibleComponentHelper( IMutex* _pExternalLock )
     105          58 :         :OCommonAccessibleComponent( _pExternalLock )
     106             :     {
     107          58 :     }
     108             : 
     109             : 
     110        2146 :     IMPLEMENT_FORWARD_XINTERFACE2( OAccessibleComponentHelper, OCommonAccessibleComponent, OAccessibleComponentHelper_Base )
     111           0 :     IMPLEMENT_FORWARD_XTYPEPROVIDER2( OAccessibleComponentHelper, OCommonAccessibleComponent, OAccessibleComponentHelper_Base )
     112             :         // (order matters: the first is the class name, the second is the class doing the ref counting)
     113             : 
     114             : 
     115           0 :     sal_Bool SAL_CALL OAccessibleComponentHelper::containsPoint( const Point& _rPoint ) throw (RuntimeException, std::exception)
     116             :     {
     117           0 :         return OCommonAccessibleComponent::containsPoint( _rPoint );
     118             :     }
     119             : 
     120             : 
     121           0 :     Point SAL_CALL OAccessibleComponentHelper::getLocation(  ) throw (RuntimeException, std::exception)
     122             :     {
     123           0 :         return OCommonAccessibleComponent::getLocation( );
     124             :     }
     125             : 
     126             : 
     127           0 :     Point SAL_CALL OAccessibleComponentHelper::getLocationOnScreen(  ) throw (RuntimeException, std::exception)
     128             :     {
     129           0 :         return OCommonAccessibleComponent::getLocationOnScreen( );
     130             :     }
     131             : 
     132             : 
     133           0 :     Size SAL_CALL OAccessibleComponentHelper::getSize(  ) throw (RuntimeException, std::exception)
     134             :     {
     135           0 :         return OCommonAccessibleComponent::getSize( );
     136             :     }
     137             : 
     138             : 
     139           0 :     Rectangle SAL_CALL OAccessibleComponentHelper::getBounds(  ) throw (RuntimeException, std::exception)
     140             :     {
     141           0 :         return OCommonAccessibleComponent::getBounds( );
     142             :     }
     143             : 
     144             : 
     145             :     //= OAccessibleExtendedComponentHelper
     146             : 
     147             : 
     148        5456 :     OAccessibleExtendedComponentHelper::OAccessibleExtendedComponentHelper( IMutex* _pExternalLock )
     149        5456 :         :OCommonAccessibleComponent( _pExternalLock )
     150             :     {
     151        5456 :     }
     152             : 
     153             : 
     154      415717 :     IMPLEMENT_FORWARD_XINTERFACE2( OAccessibleExtendedComponentHelper, OCommonAccessibleComponent, OAccessibleExtendedComponentHelper_Base )
     155           0 :     IMPLEMENT_FORWARD_XTYPEPROVIDER2( OAccessibleExtendedComponentHelper, OCommonAccessibleComponent, OAccessibleExtendedComponentHelper_Base )
     156             :         // (order matters: the first is the class name, the second is the class doing the ref counting)
     157             : 
     158             : 
     159       13070 :     sal_Bool SAL_CALL OAccessibleExtendedComponentHelper::containsPoint( const Point& _rPoint ) throw (RuntimeException, std::exception)
     160             :     {
     161       13070 :         return OCommonAccessibleComponent::containsPoint( _rPoint );
     162             :     }
     163             : 
     164             : 
     165          12 :     Point SAL_CALL OAccessibleExtendedComponentHelper::getLocation(  ) throw (RuntimeException, std::exception)
     166             :     {
     167          12 :         return OCommonAccessibleComponent::getLocation( );
     168             :     }
     169             : 
     170             : 
     171        1430 :     Point SAL_CALL OAccessibleExtendedComponentHelper::getLocationOnScreen(  ) throw (RuntimeException, std::exception)
     172             :     {
     173        1430 :         return OCommonAccessibleComponent::getLocationOnScreen( );
     174             :     }
     175             : 
     176             : 
     177          12 :     Size SAL_CALL OAccessibleExtendedComponentHelper::getSize(  ) throw (RuntimeException, std::exception)
     178             :     {
     179          12 :         return OCommonAccessibleComponent::getSize( );
     180             :     }
     181             : 
     182             : 
     183        1594 :     Rectangle SAL_CALL OAccessibleExtendedComponentHelper::getBounds(  ) throw (RuntimeException, std::exception)
     184             :     {
     185        1594 :         return OCommonAccessibleComponent::getBounds( );
     186             :     }
     187             : 
     188             : 
     189             : }   // namespace comphelper
     190             : 
     191             : 
     192             : 
     193             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10