LCOV - code coverage report
Current view: top level - svx/source/accessibility - ChildrenManager.cxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 32 41 78.0 %
Date: 2012-08-25 Functions: 11 14 78.6 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 7 20 35.0 %

           Branch data     Line data    Source code
       1                 :            : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
       2                 :            : /*************************************************************************
       3                 :            :  *
       4                 :            :  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
       5                 :            :  *
       6                 :            :  * Copyright 2000, 2010 Oracle and/or its affiliates.
       7                 :            :  *
       8                 :            :  * OpenOffice.org - a multi-platform office productivity suite
       9                 :            :  *
      10                 :            :  * This file is part of OpenOffice.org.
      11                 :            :  *
      12                 :            :  * OpenOffice.org is free software: you can redistribute it and/or modify
      13                 :            :  * it under the terms of the GNU Lesser General Public License version 3
      14                 :            :  * only, as published by the Free Software Foundation.
      15                 :            :  *
      16                 :            :  * OpenOffice.org is distributed in the hope that it will be useful,
      17                 :            :  * but WITHOUT ANY WARRANTY; without even the implied warranty of
      18                 :            :  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      19                 :            :  * GNU Lesser General Public License version 3 for more details
      20                 :            :  * (a copy is included in the LICENSE file that accompanied this code).
      21                 :            :  *
      22                 :            :  * You should have received a copy of the GNU Lesser General Public License
      23                 :            :  * version 3 along with OpenOffice.org.  If not, see
      24                 :            :  * <http://www.openoffice.org/license.html>
      25                 :            :  * for a copy of the LGPLv3 License.
      26                 :            :  *
      27                 :            :  ************************************************************************/
      28                 :            : 
      29                 :            : #include <svx/ChildrenManager.hxx>
      30                 :            : #include "ChildrenManagerImpl.hxx"
      31                 :            : #include <svx/AccessibleShape.hxx>
      32                 :            : 
      33                 :            : using namespace ::com::sun::star;
      34                 :            : using namespace ::com::sun::star::accessibility;
      35                 :            : using ::com::sun::star::uno::Reference;
      36                 :            : 
      37                 :            : namespace accessibility {
      38                 :            : 
      39                 :            : 
      40                 :            : //=====  AccessibleChildrenManager  ===========================================
      41                 :            : 
      42                 :          6 : ChildrenManager::ChildrenManager (
      43                 :            :     const ::com::sun::star::uno::Reference<XAccessible>& rxParent,
      44                 :            :     const ::com::sun::star::uno::Reference<drawing::XShapes>& rxShapeList,
      45                 :            :     const AccessibleShapeTreeInfo& rShapeTreeInfo,
      46                 :            :     AccessibleContextBase& rContext)
      47                 :          6 :     : mpImpl (NULL)
      48                 :            : {
      49         [ +  - ]:          6 :     mpImpl = new ChildrenManagerImpl (rxParent, rxShapeList, rShapeTreeInfo, rContext);
      50         [ +  - ]:          6 :     if (mpImpl != NULL)
      51         [ +  - ]:          6 :         mpImpl->Init ();
      52                 :            :     else
      53                 :            :         throw uno::RuntimeException(
      54                 :            :             ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
      55 [ #  # ][ #  # ]:          0 :                 "ChildrenManager::ChildrenManager can't create implementation object")), NULL);
                 [ #  # ]
      56                 :          6 : }
      57                 :            : 
      58                 :            : 
      59                 :            : 
      60                 :            : 
      61                 :          6 : ChildrenManager::~ChildrenManager (void)
      62                 :            : {
      63         [ +  - ]:          6 :     if (mpImpl != NULL)
      64         [ +  - ]:          6 :         mpImpl->dispose();
      65                 :            : 
      66                 :            :     // emtpy
      67                 :            :     OSL_TRACE ("~ChildrenManager");
      68         [ -  + ]:         12 : }
      69                 :            : 
      70                 :            : 
      71                 :            : 
      72                 :            : 
      73                 :         26 : long ChildrenManager::GetChildCount (void) const throw ()
      74                 :            : {
      75                 :            :     OSL_ASSERT (mpImpl != NULL);
      76                 :         26 :     return mpImpl->GetChildCount();
      77                 :            : }
      78                 :            : 
      79                 :            : 
      80                 :            : 
      81                 :            : 
      82                 :         16 : ::com::sun::star::uno::Reference<XAccessible> ChildrenManager::GetChild (long nIndex)
      83                 :            :     throw (::com::sun::star::uno::RuntimeException,
      84                 :            :            ::com::sun::star::lang::IndexOutOfBoundsException)
      85                 :            : {
      86                 :            :     OSL_ASSERT (mpImpl != NULL);
      87                 :         16 :     return mpImpl->GetChild (nIndex);
      88                 :            : }
      89                 :            : 
      90                 :            : 
      91                 :            : 
      92                 :            : 
      93                 :         14 : void ChildrenManager::Update (bool bCreateNewObjectsOnDemand)
      94                 :            : {
      95                 :            :     OSL_ASSERT (mpImpl != NULL);
      96                 :         14 :     mpImpl->Update (bCreateNewObjectsOnDemand);
      97                 :         14 : }
      98                 :            : 
      99                 :            : 
     100                 :            : 
     101                 :            : 
     102                 :          8 : void ChildrenManager::SetShapeList (const ::com::sun::star::uno::Reference<
     103                 :            :     ::com::sun::star::drawing::XShapes>& xShapeList)
     104                 :            : {
     105                 :            :     OSL_ASSERT (mpImpl != NULL);
     106                 :          8 :     mpImpl->SetShapeList (xShapeList);
     107                 :          8 : }
     108                 :            : 
     109                 :            : 
     110                 :            : 
     111                 :            : 
     112                 :         14 : void ChildrenManager::AddAccessibleShape (std::auto_ptr<AccessibleShape> pShape)
     113                 :            : {
     114                 :            :     OSL_ASSERT (mpImpl != NULL);
     115         [ +  - ]:         14 :     mpImpl->AddAccessibleShape (pShape);
     116                 :         14 : }
     117                 :            : 
     118                 :            : 
     119                 :            : 
     120                 :            : 
     121                 :          8 : void ChildrenManager::ClearAccessibleShapeList (void)
     122                 :            : {
     123                 :            :     OSL_ASSERT (mpImpl != NULL);
     124                 :          8 :     mpImpl->ClearAccessibleShapeList ();
     125                 :          8 : }
     126                 :            : 
     127                 :            : 
     128                 :            : 
     129                 :            : 
     130                 :          0 : void ChildrenManager::SetInfo (AccessibleShapeTreeInfo& rShapeTreeInfo)
     131                 :            : {
     132                 :            :     OSL_ASSERT (mpImpl != NULL);
     133                 :          0 :     mpImpl->SetInfo (rShapeTreeInfo);
     134                 :          0 : }
     135                 :            : 
     136                 :            : 
     137                 :            : 
     138                 :            : 
     139                 :          6 : void ChildrenManager::UpdateSelection (void)
     140                 :            : {
     141                 :            :     OSL_ASSERT (mpImpl != NULL);
     142                 :          6 :     mpImpl->UpdateSelection ();
     143                 :          6 : }
     144                 :            : 
     145                 :            : 
     146                 :            : 
     147                 :            : 
     148                 :          0 : bool ChildrenManager::HasFocus (void)
     149                 :            : {
     150                 :            :     OSL_ASSERT (mpImpl != NULL);
     151                 :          0 :     return mpImpl->HasFocus ();
     152                 :            : }
     153                 :            : 
     154                 :            : 
     155                 :            : 
     156                 :            : 
     157                 :          0 : void ChildrenManager::RemoveFocus (void)
     158                 :            : {
     159                 :            :     OSL_ASSERT (mpImpl != NULL);
     160                 :          0 :     mpImpl->RemoveFocus ();
     161                 :          0 : }
     162                 :            : 
     163                 :            : 
     164                 :            : 
     165                 :            : 
     166                 :            : //=====  IAccessibleViewForwarderListener  ====================================
     167                 :         20 : void ChildrenManager::ViewForwarderChanged (ChangeType aChangeType,
     168                 :            :         const IAccessibleViewForwarder* pViewForwarder)
     169                 :            : {
     170                 :            :     OSL_ASSERT (mpImpl != NULL);
     171                 :         20 :     mpImpl->ViewForwarderChanged (aChangeType, pViewForwarder);
     172                 :         20 : }
     173                 :            : 
     174                 :            : 
     175                 :            : 
     176                 :            : } // end of namespace accessibility
     177                 :            : 
     178                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10