LCOV - code coverage report
Current view: top level - sw/source/core/access - accframe.hxx (source / functions) Hit Total Coverage
Test: commit 0e63ca4fde4e446f346e35849c756a30ca294aab Lines: 19 19 100.0 %
Date: 2014-04-11 Functions: 8 8 100.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             : #ifndef INCLUDED_SW_SOURCE_CORE_ACCESS_ACCFRAME_HXX
      21             : #define INCLUDED_SW_SOURCE_CORE_ACCESS_ACCFRAME_HXX
      22             : 
      23             : #include <swrect.hxx>
      24             : 
      25             : #include <sal/types.h>
      26             : #include <rtl/ustring.hxx>
      27             : 
      28             : #include <list>
      29             : #include <accfrmobj.hxx>
      30             : 
      31             : class SwAccessibleMap;
      32             : class SwFrm;
      33             : class SwViewShell;
      34             : namespace sw { namespace access {
      35             :     class SwAccessibleChild;
      36             : }}
      37             : 
      38             : // Any method of this class must be called with an acquired solar mutex!
      39             : 
      40             : class SwAccessibleFrame
      41             : {
      42             :     SwRect maVisArea;
      43             :     const SwFrm* mpFrm;
      44             :     const sal_Bool mbIsInPagePreview;
      45             : 
      46             : protected:
      47             :     // #i77106# - method needs to be called by new class <SwAccessibleTableColHeaders>
      48             :     static sal_Int32 GetChildCount( SwAccessibleMap& rAccMap,
      49             :                                     const SwRect& rVisArea,
      50             :                                     const SwFrm *pFrm,
      51             :                                     sal_Bool bInPagePreviewr );
      52             : 
      53             : // private:
      54             :     static sw::access::SwAccessibleChild GetChild( SwAccessibleMap& rAccMap,
      55             :                                                    const SwRect& rVisArea,
      56             :                                                    const SwFrm& rFrm,
      57             :                                                    sal_Int32& rPos,
      58             :                                                    sal_Bool bInPagePreview);
      59             : 
      60             :     static sal_Bool GetChildIndex( SwAccessibleMap& rAccMap,
      61             :                                    const SwRect& rVisArea,
      62             :                                    const SwFrm& rFrm,
      63             :                                    const sw::access::SwAccessibleChild& rChild,
      64             :                                    sal_Int32& rPos,
      65             :                                    sal_Bool bInPagePreview );
      66             : 
      67             :     static sw::access::SwAccessibleChild GetChildAtPixel( const SwRect& rVisArea,
      68             :                                                           const SwFrm& rFrm,
      69             :                                                           const Point& rPos,
      70             :                                                           sal_Bool bInPagePreview,
      71             :                                                           SwAccessibleMap& rAccMap );
      72             : 
      73             :     static void GetChildren( SwAccessibleMap& rAccMap,
      74             :                              const SwRect& rVisArea,
      75             :                              const SwFrm& rFrm,
      76             :                              ::std::list< sw::access::SwAccessibleChild >& rChildren,
      77             :                              sal_Bool bInPagePreview );
      78             : 
      79             : protected:
      80             :     sal_Bool IsEditable( SwViewShell *pVSh ) const;
      81             : 
      82             :     sal_Bool IsOpaque( SwViewShell *pVSh ) const;
      83             : 
      84             :     sal_Bool IsShowing( const SwAccessibleMap& rAccMap,
      85             :                         const sw::access::SwAccessibleChild& rFrmOrObj ) const;
      86             :     inline sal_Bool IsShowing( const SwRect& rFrm ) const;
      87             :     inline sal_Bool IsShowing( const SwAccessibleMap& rAccMap ) const;
      88             : 
      89        2820 :     inline sal_Bool IsInPagePreview() const
      90             :     {
      91        2820 :         return mbIsInPagePreview;
      92             :     }
      93             : 
      94          33 :     inline void ClearFrm()
      95             :     {
      96          33 :         mpFrm = 0;
      97          33 :     }
      98             : 
      99             :     SwAccessibleFrame( const SwRect& rVisArea,
     100             :                        const SwFrm *pFrm,
     101             :                        sal_Bool bIsPagePreview );
     102             :     virtual ~SwAccessibleFrame();
     103             : 
     104             :     // MT: Move to private area?
     105             :     sal_Bool bIsAccDocUse;
     106             : public:
     107             :     // Return the SwFrm this context is attached to.
     108       11650 :     const SwFrm* GetFrm() const { return mpFrm; };
     109             : 
     110             :     static const SwFrm* GetParent( const sw::access::SwAccessibleChild& rFrmOrObj,
     111             :                                    sal_Bool bInPagePreview );
     112             : 
     113             :     sal_Int32 GetChildIndex( SwAccessibleMap& rAccMap,
     114             :                              const sw::access::SwAccessibleChild& rChild ) const;
     115             : 
     116             : protected:
     117             :     // Return the bounding box of the frame clipped to the vis area. If
     118             :     // no frame is specified, use this' frame.
     119             :     SwRect GetBounds( const SwAccessibleMap& rAccMap,
     120             :                       const SwFrm *pFrm = 0 );
     121             : 
     122             :     // Return the upper that has a context attached. This might be
     123             :     // another one than the immediate upper.
     124             :     inline const SwFrm *GetParent() const;
     125             : 
     126             :     // Return the lower count or the nth lower, there the lowers have a
     127             :     // not be same one as the SwFrm's lowers
     128             :     sal_Int32 GetChildCount( SwAccessibleMap& rAccMap ) const;
     129             :     sw::access::SwAccessibleChild GetChild( SwAccessibleMap& rAccMap,
     130             :                                             sal_Int32 nPos ) const;
     131             :     sw::access::SwAccessibleChild GetChildAtPixel( const Point& rPos,
     132             :                                                    SwAccessibleMap& rAccMap ) const;
     133             :     void GetChildren( SwAccessibleMap& rAccMap,
     134             :                       ::std::list< sw::access::SwAccessibleChild >& rChildren ) const;
     135             : 
     136          92 :     inline void SetVisArea( const SwRect& rNewVisArea )
     137             :     {
     138          92 :         maVisArea = rNewVisArea;
     139          92 :     }
     140             : 
     141         283 :     inline const SwRect& GetVisArea() const
     142             :     {
     143         283 :         return maVisArea;
     144             :     }
     145             : 
     146             :     OUString GetFormattedPageNumber() const;
     147             : };
     148             : 
     149         155 : inline sal_Bool SwAccessibleFrame::IsShowing( const SwRect& rFrm ) const
     150             : {
     151         155 :     return rFrm.IsOver( maVisArea );
     152             : }
     153             : 
     154         129 : inline sal_Bool SwAccessibleFrame::IsShowing( const SwAccessibleMap& rAccMap ) const
     155             : {
     156         129 :     sw::access::SwAccessibleChild aFrmOrObj( GetFrm() );
     157         129 :     return IsShowing( rAccMap, aFrmOrObj );
     158             : }
     159             : 
     160        2486 : inline const SwFrm *SwAccessibleFrame::GetParent() const
     161             : {
     162        2486 :     sw::access::SwAccessibleChild aFrmOrObj( GetFrm() );
     163        2486 :     return GetParent( aFrmOrObj, IsInPagePreview()  );
     164             : }
     165             : 
     166             : #endif
     167             : 
     168             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10