LCOV - code coverage report
Current view: top level - sw/source/core/access - accfrmobjslist.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 28 28 100.0 %
Date: 2012-08-25 Functions: 12 12 100.0 %
Legend: Lines: hit not hit | Branches: + taken - not taken # not executed Branches: 1 2 50.0 %

           Branch data     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                 :            : #ifndef _ACCFRMOBJSLIST_HXX
      20                 :            : #define _ACCFRMOBJSLIST_HXX
      21                 :            : 
      22                 :            : #include <accfrmobj.hxx>
      23                 :            : #include <swrect.hxx>
      24                 :            : 
      25                 :            : class SwAccessibleMap;
      26                 :            : 
      27                 :            : class SwAccessibleChildSList;
      28                 :            : 
      29                 :            : class SwAccessibleChildSList_const_iterator
      30                 :            : {
      31                 :            : private:
      32                 :            :     friend class SwAccessibleChildSList;
      33                 :            : 
      34                 :            :     const SwAccessibleChildSList& rList;    // The frame we are iterating over
      35                 :            :     sw::access::SwAccessibleChild aCurr;    // The current object
      36                 :            :     sal_uInt16 nNextObj;                    // The index of the current sdr object
      37                 :            : 
      38                 :       2540 :     inline SwAccessibleChildSList_const_iterator( const SwAccessibleChildSList& rLst )
      39                 :            :         : rList( rLst )
      40                 :       2540 :         , nNextObj( 0 )
      41                 :       2540 :     {}
      42                 :            : 
      43                 :            :     SwAccessibleChildSList_const_iterator( const SwAccessibleChildSList& rLst,
      44                 :            :                                            SwAccessibleMap& rAccMap );
      45                 :            : 
      46                 :            :     SwAccessibleChildSList_const_iterator& next();
      47                 :            :     SwAccessibleChildSList_const_iterator& next_visible();
      48                 :            : 
      49                 :            : public:
      50                 :            : 
      51                 :            :     inline SwAccessibleChildSList_const_iterator( const SwAccessibleChildSList_const_iterator& rIter )
      52                 :            :         : rList( rIter.rList )
      53                 :            :         , aCurr( rIter.aCurr )
      54                 :            :         , nNextObj( rIter.nNextObj )
      55                 :            :     {}
      56                 :            : 
      57                 :       2540 :     inline sal_Bool operator==( const SwAccessibleChildSList_const_iterator& r ) const
      58                 :            :     {
      59                 :       2540 :         return aCurr == r.aCurr;
      60                 :            :     }
      61                 :            : 
      62                 :       2540 :     inline sal_Bool operator!=(
      63                 :            :             const SwAccessibleChildSList_const_iterator& r ) const
      64                 :            :     {
      65                 :       2540 :         return !(*this == r);
      66                 :            :     }
      67                 :            : 
      68                 :            :     SwAccessibleChildSList_const_iterator& operator++();
      69                 :            : 
      70                 :       1326 :     inline const sw::access::SwAccessibleChild& operator*() const
      71                 :            :     {
      72                 :       1326 :         return aCurr;
      73                 :            :     }
      74                 :            : };
      75                 :            : 
      76                 :            : // An iterator to iterate over a frame's child in any order
      77                 :            : class SwAccessibleChildSList
      78                 :            : {
      79                 :            :     const SwRect maVisArea;
      80                 :            :     const SwFrm& mrFrm;
      81                 :            :     const sal_Bool mbVisibleChildrenOnly;
      82                 :            :     SwAccessibleMap& mrAccMap;
      83                 :            : 
      84                 :            : public:
      85                 :            : 
      86                 :            :     typedef SwAccessibleChildSList_const_iterator const_iterator;
      87                 :            : 
      88                 :        294 :     inline SwAccessibleChildSList( const SwFrm& rFrm,
      89                 :            :                                    SwAccessibleMap& rAccMap )
      90                 :            :         : maVisArea()
      91                 :            :         , mrFrm( rFrm )
      92                 :            :         , mbVisibleChildrenOnly( sal_False )
      93                 :        294 :         , mrAccMap( rAccMap )
      94                 :        294 :     {}
      95                 :            : 
      96                 :        920 :     inline SwAccessibleChildSList( const SwRect& rVisArea,
      97                 :            :                                    const SwFrm& rFrm,
      98                 :            :                                    SwAccessibleMap& rAccMap )
      99                 :            :         : maVisArea( rVisArea )
     100                 :            :         , mrFrm( rFrm )
     101         [ +  - ]:        920 :         , mbVisibleChildrenOnly( sw::access::SwAccessibleChild( &rFrm ).IsVisibleChildrenOnly() )
     102                 :        920 :         , mrAccMap( rAccMap )
     103                 :            :     {
     104                 :        920 :     }
     105                 :            : 
     106                 :       1214 :     inline const_iterator begin() const
     107                 :            :     {
     108                 :       1214 :         return SwAccessibleChildSList_const_iterator( *this, mrAccMap );
     109                 :            :     }
     110                 :            : 
     111                 :       2540 :     inline const_iterator end() const
     112                 :            :     {
     113                 :       2540 :         return SwAccessibleChildSList_const_iterator( *this );
     114                 :            :     }
     115                 :            : 
     116                 :       2408 :     inline const SwFrm& GetFrm() const
     117                 :            :     {
     118                 :       2408 :         return mrFrm;
     119                 :            :     }
     120                 :            : 
     121                 :       2540 :     inline sal_Bool IsVisibleChildrenOnly() const
     122                 :            :     {
     123                 :       2540 :         return mbVisibleChildrenOnly;
     124                 :            :     }
     125                 :            : 
     126                 :        632 :     inline const SwRect& GetVisArea() const
     127                 :            :     {
     128                 :        632 :         return maVisArea;
     129                 :            :     }
     130                 :            : 
     131                 :        132 :     inline SwAccessibleMap& GetAccMap() const
     132                 :            :     {
     133                 :        132 :         return mrAccMap;
     134                 :            :     }
     135                 :            : };
     136                 :            : 
     137                 :            : #endif
     138                 :            : 
     139                 :            : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10