LCOV - code coverage report
Current view: top level - accessibility/source/extended - AccessibleGridControlHeaderCell.cxx (source / functions) Hit Total Coverage
Test: commit 10e77ab3ff6f4314137acd6e2702a6e5c1ce1fae Lines: 1 59 1.7 %
Date: 2014-11-03 Functions: 2 15 13.3 %
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             : 
      21             : #include "accessibility/extended/AccessibleGridControlHeaderCell.hxx"
      22             : #include <svtools/accessibletable.hxx>
      23             : #include "accessibility/extended/AccessibleGridControl.hxx"
      24             : 
      25             : namespace accessibility
      26             : {
      27             :     using namespace ::com::sun::star::accessibility;
      28             :     using namespace ::com::sun::star::lang;
      29             :     using namespace ::com::sun::star::uno;
      30             :     using namespace ::svt;
      31             :     using namespace ::svt::table;
      32             : 
      33           0 : AccessibleGridControlHeaderCell::AccessibleGridControlHeaderCell(sal_Int32 _nColumnRowId,
      34             :                                   const Reference< XAccessible >& rxParent,
      35             :                                   IAccessibleTable& rTable,
      36             :                                   AccessibleTableControlObjType  eObjType)
      37             : : AccessibleGridControlCell( rxParent, rTable, _nColumnRowId, 0, eObjType)
      38           0 : , m_nColumnRowId(_nColumnRowId)
      39             : {
      40           0 : }
      41             : /** Creates a new AccessibleStateSetHelper and fills it with states of the
      42             :     current object.
      43             :     @return
      44             :         A filled AccessibleStateSetHelper.
      45             : */
      46           0 : ::utl::AccessibleStateSetHelper* AccessibleGridControlHeaderCell::implCreateStateSetHelper()
      47             : {
      48             :     ::utl::AccessibleStateSetHelper*
      49           0 :         pStateSetHelper = new ::utl::AccessibleStateSetHelper;
      50             : 
      51           0 :     if( isAlive() )
      52             :     {
      53             :         // SHOWING done with mxParent
      54           0 :         if( implIsShowing() )
      55           0 :             pStateSetHelper->AddState( AccessibleStateType::SHOWING );
      56             : 
      57           0 :         pStateSetHelper->AddState( AccessibleStateType::VISIBLE );
      58           0 :         pStateSetHelper->AddState( AccessibleStateType::FOCUSABLE );
      59           0 :         pStateSetHelper->AddState( AccessibleStateType::TRANSIENT );
      60           0 :         pStateSetHelper->AddState( AccessibleStateType::SELECTABLE );
      61             : 
      62           0 :         if ( m_aTable.IsRowSelected(m_nColumnRowId) )
      63           0 :             pStateSetHelper->AddState( AccessibleStateType::SELECTED );
      64             :     }
      65             :     else
      66           0 :         pStateSetHelper->AddState( AccessibleStateType::DEFUNC );
      67             : 
      68           0 :     return pStateSetHelper;
      69             : }
      70             : 
      71             : /** @return
      72             :         The count of visible children.
      73             : */
      74           0 : sal_Int32 SAL_CALL AccessibleGridControlHeaderCell::getAccessibleChildCount()
      75             :     throw ( RuntimeException, std::exception )
      76             : {
      77           0 :     return 0;
      78             : }
      79             : 
      80             : 
      81             : /** @return
      82             :         The XAccessible interface of the specified child.
      83             : */
      84           0 : Reference<XAccessible > SAL_CALL AccessibleGridControlHeaderCell::getAccessibleChild( sal_Int32 )
      85             :     throw ( IndexOutOfBoundsException,RuntimeException, std::exception )
      86             : {
      87           0 :     throw IndexOutOfBoundsException();
      88             : }
      89             : // XInterface -------------------------------------------------------------
      90             : 
      91             :     /** Queries for a new interface. */
      92           0 :     ::com::sun::star::uno::Any SAL_CALL AccessibleGridControlHeaderCell::queryInterface(
      93             :             const ::com::sun::star::uno::Type& rType )
      94             :         throw ( ::com::sun::star::uno::RuntimeException, std::exception )
      95             :     {
      96           0 :         Any aRet = AccessibleGridControlCell::queryInterface(rType);
      97           0 :         return aRet;
      98             :     }
      99             : 
     100             :     /** Aquires the object (calls acquire() on base class). */
     101           0 :     void SAL_CALL AccessibleGridControlHeaderCell::acquire() throw ()
     102             :     {
     103           0 :         AccessibleGridControlCell::acquire();
     104           0 :     }
     105             : 
     106             :     /** Releases the object (calls release() on base class). */
     107           0 :     void SAL_CALL AccessibleGridControlHeaderCell::release() throw ()
     108             :     {
     109           0 :         AccessibleGridControlCell::release();
     110           0 :     }
     111             :         /** @return  The XAccessibleContext interface of this object. */
     112           0 :     Reference< com::sun::star::accessibility::XAccessibleContext > SAL_CALL AccessibleGridControlHeaderCell::getAccessibleContext() throw ( RuntimeException, std::exception )
     113             :     {
     114           0 :         ensureIsAlive();
     115           0 :         return this;
     116             :     }
     117             : 
     118             : 
     119             : 
     120             : /** Grabs the focus to the column header. */
     121           0 : void SAL_CALL AccessibleGridControlHeaderCell::grabFocus()
     122             :     throw ( ::com::sun::star::uno::RuntimeException, std::exception )
     123             : {
     124           0 : }
     125             : 
     126             : /** @return
     127             :         The name of this class.
     128             : */
     129           0 : OUString SAL_CALL AccessibleGridControlHeaderCell::getImplementationName()
     130             :     throw ( ::com::sun::star::uno::RuntimeException, std::exception )
     131             : {
     132           0 :     return OUString( "com.sun.star.accessibility.AccessibleGridControlHeaderCell" );
     133             : }
     134             : 
     135           0 : Rectangle AccessibleGridControlHeaderCell::implGetBoundingBox()
     136             : {
     137           0 :     vcl::Window* pParent = m_aTable.GetAccessibleParentWindow();
     138           0 :     Rectangle aGridRect( m_aTable.GetWindowExtentsRelative( pParent ) );
     139           0 :     sal_Int32 nIndex = getAccessibleIndexInParent();
     140           0 :     Rectangle aCellRect;
     141           0 :     if(m_eObjType == TCTYPE_COLUMNHEADERCELL)
     142           0 :         aCellRect = m_aTable.calcHeaderCellRect(true, nIndex);
     143             :     else
     144           0 :         aCellRect = m_aTable.calcHeaderCellRect(false, nIndex);
     145           0 :     return Rectangle(Point(aGridRect.Left()+aCellRect.Left(),aGridRect.Top()+aCellRect.Top()), aCellRect.GetSize());
     146             : }
     147             : 
     148             : 
     149           0 : Rectangle AccessibleGridControlHeaderCell::implGetBoundingBoxOnScreen()
     150             : {
     151           0 :     Rectangle aGridRect( m_aTable.GetWindowExtentsRelative( NULL ) );
     152           0 :     sal_Int32 nIndex = getAccessibleIndexInParent();
     153           0 :     Rectangle aCellRect;
     154           0 :     if(m_eObjType == TCTYPE_COLUMNHEADERCELL)
     155           0 :         aCellRect = m_aTable.calcHeaderCellRect(true, nIndex);
     156             :     else
     157           0 :         aCellRect = m_aTable.calcHeaderCellRect(false, nIndex);
     158           0 :     return Rectangle(Point(aGridRect.Left()+aCellRect.Left(),aGridRect.Top()+aCellRect.Top()), aCellRect.GetSize());
     159             : }
     160             : 
     161           0 : sal_Int32 SAL_CALL AccessibleGridControlHeaderCell::getAccessibleIndexInParent()
     162             :     throw ( RuntimeException, std::exception )
     163             : {
     164           0 :     SolarMutexGuard g;
     165             : 
     166           0 :     ensureIsAlive();
     167           0 :     sal_Int32 nIndex = m_nColumnRowId;
     168           0 :     return nIndex;
     169             : }
     170             : 
     171          60 : } // namespace accessibility
     172             : 
     173             : 
     174             : 
     175             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10