LCOV - code coverage report
Current view: top level - libreoffice/comphelper/source/misc - accessiblecomponenthelper.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 0 67 0.0 %
Date: 2012-12-27 Functions: 0 33 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 <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           0 :     OCommonAccessibleComponent::OCommonAccessibleComponent( )
      37             :     {
      38           0 :     }
      39             : 
      40             :     //---------------------------------------------------------------------
      41           0 :     OCommonAccessibleComponent::OCommonAccessibleComponent( IMutex* _pExternalLock )
      42           0 :         :OAccessibleContextHelper( _pExternalLock )
      43             :     {
      44           0 :     }
      45             : 
      46             :     //---------------------------------------------------------------------
      47           0 :     OCommonAccessibleComponent::~OCommonAccessibleComponent( )
      48             :     {
      49           0 :         forgetExternalLock();
      50             :             // this ensures that the lock, which may be already destroyed as part of the derivee,
      51             :             // is not used anymore
      52           0 :     }
      53             : 
      54             :     //--------------------------------------------------------------------
      55           0 :     sal_Bool SAL_CALL OCommonAccessibleComponent::containsPoint( const Point& _rPoint ) throw (RuntimeException)
      56             :     {
      57           0 :         OExternalLockGuard aGuard( this );
      58           0 :         Rectangle aBounds( implGetBounds() );
      59             :         return  ( _rPoint.X >= 0 )
      60             :             &&  ( _rPoint.Y >= 0 )
      61             :             &&  ( _rPoint.X < aBounds.Width )
      62           0 :             &&  ( _rPoint.Y < aBounds.Height );
      63             :     }
      64             : 
      65             :     //--------------------------------------------------------------------
      66           0 :     Point SAL_CALL OCommonAccessibleComponent::getLocation(  ) throw (RuntimeException)
      67             :     {
      68           0 :         OExternalLockGuard aGuard( this );
      69           0 :         Rectangle aBounds( implGetBounds() );
      70           0 :         return Point( aBounds.X, aBounds.Y );
      71             :     }
      72             : 
      73             :     //--------------------------------------------------------------------
      74           0 :     Point SAL_CALL OCommonAccessibleComponent::getLocationOnScreen(  ) throw (RuntimeException)
      75             :     {
      76           0 :         OExternalLockGuard aGuard( this );
      77             : 
      78           0 :         Point aScreenLoc( 0, 0 );
      79             : 
      80           0 :         Reference< XAccessibleComponent > xParentComponent( implGetParentContext(), UNO_QUERY );
      81             :         OSL_ENSURE( xParentComponent.is(), "OCommonAccessibleComponent::getLocationOnScreen: no parent component!" );
      82           0 :         if ( xParentComponent.is() )
      83             :         {
      84           0 :             Point aParentScreenLoc( xParentComponent->getLocationOnScreen() );
      85           0 :             Point aOwnRelativeLoc( getLocation() );
      86           0 :             aScreenLoc.X = aParentScreenLoc.X + aOwnRelativeLoc.X;
      87           0 :             aScreenLoc.Y = aParentScreenLoc.Y + aOwnRelativeLoc.Y;
      88             :         }
      89             : 
      90           0 :         return aScreenLoc;
      91             :     }
      92             : 
      93             :     //--------------------------------------------------------------------
      94           0 :     Size SAL_CALL OCommonAccessibleComponent::getSize(  ) throw (RuntimeException)
      95             :     {
      96           0 :         OExternalLockGuard aGuard( this );
      97           0 :         Rectangle aBounds( implGetBounds() );
      98           0 :         return Size( aBounds.Width, aBounds.Height );
      99             :     }
     100             : 
     101             :     //--------------------------------------------------------------------
     102           0 :     Rectangle SAL_CALL OCommonAccessibleComponent::getBounds(  ) throw (RuntimeException)
     103             :     {
     104           0 :         OExternalLockGuard aGuard( this );
     105           0 :         return implGetBounds();
     106             :     }
     107             : 
     108             :     //=====================================================================
     109             :     //= OAccessibleComponentHelper
     110             :     //=====================================================================
     111             :     //---------------------------------------------------------------------
     112           0 :     OAccessibleComponentHelper::OAccessibleComponentHelper( )
     113             :     {
     114           0 :     }
     115             : 
     116             :     //---------------------------------------------------------------------
     117           0 :     OAccessibleComponentHelper::OAccessibleComponentHelper( IMutex* _pExternalLock )
     118           0 :         :OCommonAccessibleComponent( _pExternalLock )
     119             :     {
     120           0 :     }
     121             : 
     122             :     //--------------------------------------------------------------------
     123           0 :     IMPLEMENT_FORWARD_XINTERFACE2( OAccessibleComponentHelper, OCommonAccessibleComponent, OAccessibleComponentHelper_Base )
     124           0 :     IMPLEMENT_FORWARD_XTYPEPROVIDER2( OAccessibleComponentHelper, OCommonAccessibleComponent, OAccessibleComponentHelper_Base )
     125             :         // (order matters: the first is the class name, the second is the class doing the ref counting)
     126             : 
     127             :     //--------------------------------------------------------------------
     128           0 :     sal_Bool SAL_CALL OAccessibleComponentHelper::containsPoint( const Point& _rPoint ) throw (RuntimeException)
     129             :     {
     130           0 :         return OCommonAccessibleComponent::containsPoint( _rPoint );
     131             :     }
     132             : 
     133             :     //--------------------------------------------------------------------
     134           0 :     Point SAL_CALL OAccessibleComponentHelper::getLocation(  ) throw (RuntimeException)
     135             :     {
     136           0 :         return OCommonAccessibleComponent::getLocation( );
     137             :     }
     138             : 
     139             :     //--------------------------------------------------------------------
     140           0 :     Point SAL_CALL OAccessibleComponentHelper::getLocationOnScreen(  ) throw (RuntimeException)
     141             :     {
     142           0 :         return OCommonAccessibleComponent::getLocationOnScreen( );
     143             :     }
     144             : 
     145             :     //--------------------------------------------------------------------
     146           0 :     Size SAL_CALL OAccessibleComponentHelper::getSize(  ) throw (RuntimeException)
     147             :     {
     148           0 :         return OCommonAccessibleComponent::getSize( );
     149             :     }
     150             : 
     151             :     //--------------------------------------------------------------------
     152           0 :     Rectangle SAL_CALL OAccessibleComponentHelper::getBounds(  ) throw (RuntimeException)
     153             :     {
     154           0 :         return OCommonAccessibleComponent::getBounds( );
     155             :     }
     156             : 
     157             :     //=====================================================================
     158             :     //= OAccessibleExtendedComponentHelper
     159             :     //=====================================================================
     160             :     //---------------------------------------------------------------------
     161           0 :     OAccessibleExtendedComponentHelper::OAccessibleExtendedComponentHelper( )
     162             :     {
     163           0 :     }
     164             : 
     165             :     //---------------------------------------------------------------------
     166           0 :     OAccessibleExtendedComponentHelper::OAccessibleExtendedComponentHelper( IMutex* _pExternalLock )
     167           0 :         :OCommonAccessibleComponent( _pExternalLock )
     168             :     {
     169           0 :     }
     170             : 
     171             :     //--------------------------------------------------------------------
     172           0 :     IMPLEMENT_FORWARD_XINTERFACE2( OAccessibleExtendedComponentHelper, OCommonAccessibleComponent, OAccessibleExtendedComponentHelper_Base )
     173           0 :     IMPLEMENT_FORWARD_XTYPEPROVIDER2( OAccessibleExtendedComponentHelper, OCommonAccessibleComponent, OAccessibleExtendedComponentHelper_Base )
     174             :         // (order matters: the first is the class name, the second is the class doing the ref counting)
     175             : 
     176             :     //--------------------------------------------------------------------
     177           0 :     sal_Bool SAL_CALL OAccessibleExtendedComponentHelper::containsPoint( const Point& _rPoint ) throw (RuntimeException)
     178             :     {
     179           0 :         return OCommonAccessibleComponent::containsPoint( _rPoint );
     180             :     }
     181             : 
     182             :     //--------------------------------------------------------------------
     183           0 :     Point SAL_CALL OAccessibleExtendedComponentHelper::getLocation(  ) throw (RuntimeException)
     184             :     {
     185           0 :         return OCommonAccessibleComponent::getLocation( );
     186             :     }
     187             : 
     188             :     //--------------------------------------------------------------------
     189           0 :     Point SAL_CALL OAccessibleExtendedComponentHelper::getLocationOnScreen(  ) throw (RuntimeException)
     190             :     {
     191           0 :         return OCommonAccessibleComponent::getLocationOnScreen( );
     192             :     }
     193             : 
     194             :     //--------------------------------------------------------------------
     195           0 :     Size SAL_CALL OAccessibleExtendedComponentHelper::getSize(  ) throw (RuntimeException)
     196             :     {
     197           0 :         return OCommonAccessibleComponent::getSize( );
     198             :     }
     199             : 
     200             :     //--------------------------------------------------------------------
     201           0 :     Rectangle SAL_CALL OAccessibleExtendedComponentHelper::getBounds(  ) throw (RuntimeException)
     202             :     {
     203           0 :         return OCommonAccessibleComponent::getBounds( );
     204             :     }
     205             : 
     206             : //.........................................................................
     207             : }   // namespace comphelper
     208             : //.........................................................................
     209             : 
     210             : 
     211             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10