LCOV - code coverage report
Current view: top level - libreoffice/editeng/source/accessibility - AccessibleComponentBase.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 0 48 0.0 %
Date: 2012-12-27 Functions: 0 18 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 <editeng/AccessibleComponentBase.hxx>
      21             : 
      22             : #include <com/sun/star/accessibility/AccessibleRole.hpp>
      23             : #include <com/sun/star/accessibility/XAccessibleSelection.hpp>
      24             : #include <com/sun/star/container/XChild.hpp>
      25             : #include <com/sun/star/beans/XPropertySet.hpp>
      26             : #include <com/sun/star/drawing/XShapes.hpp>
      27             : #include <com/sun/star/drawing/XShapeDescriptor.hpp>
      28             : #include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
      29             : 
      30             : #include <tools/color.hxx>
      31             : 
      32             : using namespace ::rtl;
      33             : using namespace ::com::sun::star;
      34             : using namespace ::com::sun::star::accessibility;
      35             : 
      36             : namespace accessibility {
      37             : 
      38             : //=====  internal  ============================================================
      39             : 
      40           0 : AccessibleComponentBase::AccessibleComponentBase (void)
      41             : {
      42           0 : }
      43             : 
      44             : 
      45             : 
      46             : 
      47           0 : AccessibleComponentBase::~AccessibleComponentBase (void)
      48             : {
      49           0 : }
      50             : 
      51             : 
      52             : 
      53             : 
      54             : //=====  XAccessibleComponent  ================================================
      55             : 
      56           0 : sal_Bool SAL_CALL AccessibleComponentBase::containsPoint (
      57             :         const ::com::sun::star::awt::Point& aPoint)
      58             :         throw (::com::sun::star::uno::RuntimeException)
      59             : {
      60           0 :     awt::Size aSize (getSize());
      61             :     return (aPoint.X >= 0)
      62             :         && (aPoint.X < aSize.Width)
      63             :         && (aPoint.Y >= 0)
      64           0 :         && (aPoint.Y < aSize.Height);
      65             : }
      66             : 
      67             : 
      68             : 
      69             : 
      70             : uno::Reference<XAccessible > SAL_CALL
      71           0 :     AccessibleComponentBase::getAccessibleAtPoint (
      72             :         const awt::Point& /*aPoint*/)
      73             :     throw (uno::RuntimeException)
      74             : {
      75           0 :     return uno::Reference<XAccessible>();
      76             : }
      77             : 
      78             : 
      79             : 
      80             : 
      81           0 : awt::Rectangle SAL_CALL AccessibleComponentBase::getBounds (void)
      82             :     throw (uno::RuntimeException)
      83             : {
      84           0 :     return awt::Rectangle();
      85             : }
      86             : 
      87             : 
      88             : 
      89             : 
      90           0 : awt::Point SAL_CALL AccessibleComponentBase::getLocation (void)
      91             :     throw (::com::sun::star::uno::RuntimeException)
      92             : {
      93           0 :     awt::Rectangle aBBox (getBounds());
      94           0 :     return awt::Point (aBBox.X, aBBox.Y);
      95             : }
      96             : 
      97             : 
      98             : 
      99             : 
     100           0 : awt::Point SAL_CALL AccessibleComponentBase::getLocationOnScreen (void)
     101             :     throw (::com::sun::star::uno::RuntimeException)
     102             : {
     103           0 :     return awt::Point();
     104             : }
     105             : 
     106             : 
     107             : 
     108             : 
     109           0 : ::com::sun::star::awt::Size SAL_CALL AccessibleComponentBase::getSize (void)
     110             :     throw (::com::sun::star::uno::RuntimeException)
     111             : {
     112           0 :     awt::Rectangle aBBox (getBounds());
     113           0 :     return awt::Size (aBBox.Width, aBBox.Height);
     114             : }
     115             : 
     116             : 
     117             : 
     118             : 
     119           0 : void SAL_CALL AccessibleComponentBase::addFocusListener (
     120             :     const ::com::sun::star::uno::Reference<
     121             :     ::com::sun::star::awt::XFocusListener >& /*xListener*/)
     122             :     throw (::com::sun::star::uno::RuntimeException)
     123             : {
     124             :     // Ignored
     125           0 : }
     126             : 
     127             : 
     128             : 
     129             : 
     130           0 : void SAL_CALL AccessibleComponentBase::removeFocusListener (const ::com::sun::star::uno::Reference<
     131             :     ::com::sun::star::awt::XFocusListener >& /*xListener*/ )
     132             :     throw (::com::sun::star::uno::RuntimeException)
     133             : {
     134             :     // Ignored
     135           0 : }
     136             : 
     137             : 
     138             : 
     139             : 
     140           0 : void SAL_CALL AccessibleComponentBase::grabFocus (void)
     141             :     throw (::com::sun::star::uno::RuntimeException)
     142             : {
     143           0 :     uno::Reference<XAccessibleContext> xContext (this, uno::UNO_QUERY);
     144             :     uno::Reference<XAccessibleSelection> xSelection (
     145           0 :         xContext->getAccessibleParent(), uno::UNO_QUERY);
     146           0 :     if (xSelection.is())
     147             :     {
     148             :         // Do a single selection on this object.
     149           0 :         xSelection->clearAccessibleSelection();
     150           0 :         xSelection->selectAccessibleChild (xContext->getAccessibleIndexInParent());
     151           0 :     }
     152           0 : }
     153             : 
     154             : 
     155             : 
     156             : 
     157           0 : sal_Int32 SAL_CALL AccessibleComponentBase::getForeground (void)
     158             :         throw (::com::sun::star::uno::RuntimeException)
     159             : {
     160           0 :     return Color(COL_BLACK).GetColor();
     161             : }
     162             : 
     163             : 
     164             : 
     165             : 
     166           0 : sal_Int32 SAL_CALL AccessibleComponentBase::getBackground (void)
     167             :     throw (::com::sun::star::uno::RuntimeException)
     168             : {
     169           0 :     return Color(COL_WHITE).GetColor();
     170             : }
     171             : 
     172             : 
     173             : 
     174             : 
     175             : //=====  XAccessibleExtendedComponent  ========================================
     176             : 
     177             : ::com::sun::star::uno::Reference< ::com::sun::star::awt::XFont > SAL_CALL
     178           0 :         AccessibleComponentBase::getFont (void)
     179             :         throw (::com::sun::star::uno::RuntimeException)
     180             : {
     181           0 :     return uno::Reference<awt::XFont>();
     182             : }
     183             : 
     184             : 
     185             : 
     186             : 
     187           0 : ::rtl::OUString SAL_CALL AccessibleComponentBase::getTitledBorderText (void)
     188             :         throw (::com::sun::star::uno::RuntimeException)
     189             : {
     190           0 :     return ::rtl::OUString ("");
     191             : }
     192             : 
     193             : 
     194             : 
     195             : 
     196           0 : ::rtl::OUString SAL_CALL AccessibleComponentBase::getToolTipText (void)
     197             :     throw (::com::sun::star::uno::RuntimeException)
     198             : {
     199           0 :     return ::rtl::OUString ("");
     200             : }
     201             : 
     202             : 
     203             : 
     204             : 
     205             : //=====  XTypeProvider  ===================================================
     206             : 
     207             : uno::Sequence<uno::Type> SAL_CALL
     208           0 :     AccessibleComponentBase::getTypes (void)
     209             :     throw (uno::RuntimeException)
     210             : {
     211             :     // Get list of types from the context base implementation...
     212           0 :     uno::Sequence<uno::Type> aTypeList (2);
     213             :     // ...and add the additional type for the component.
     214             :     const uno::Type aComponentType =
     215           0 :          ::getCppuType((const uno::Reference<XAccessibleComponent>*)0);
     216             :     const uno::Type aExtendedComponentType =
     217           0 :         ::getCppuType((const uno::Reference<XAccessibleExtendedComponent>*)0);
     218           0 :     aTypeList[0] = aComponentType;
     219           0 :     aTypeList[1] = aExtendedComponentType;
     220             : 
     221           0 :     return aTypeList;
     222             : }
     223             : 
     224             : 
     225             : } // end of namespace accessibility
     226             : 
     227             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10