LCOV - code coverage report
Current view: top level - sw/source/core/inc - ftnfrm.hxx (source / functions) Hit Total Coverage
Test: commit 10e77ab3ff6f4314137acd6e2702a6e5c1ce1fae Lines: 25 26 96.2 %
Date: 2014-11-03 Functions: 22 23 95.7 %
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_INC_FTNFRM_HXX
      21             : #define INCLUDED_SW_SOURCE_CORE_INC_FTNFRM_HXX
      22             : 
      23             : #include "layfrm.hxx"
      24             : 
      25             : class SwCntntFrm;
      26             : class SwTxtFtn;
      27             : class SwBorderAttrs;
      28             : class SwFtnFrm;
      29             : 
      30             : void sw_RemoveFtns( SwFtnBossFrm* pBoss, bool bPageOnly, bool bEndNotes );
      31             : 
      32             : // There exists a special section on a page for footnotes. It's called
      33             : // SwFtnContFrm. Each footnote is separated by a SwFtnFrm which contains
      34             : // the paragraphs of a footnote. SwFtnFrm can be splitted and will then
      35             : // continue on another page.
      36         252 : class SwFtnContFrm: public SwLayoutFrm
      37             : {
      38             : public:
      39             :     SwFtnContFrm( SwFrmFmt*, SwFrm* );
      40             : 
      41             :     const SwFtnFrm* FindFootNote() const;
      42             : 
      43             :     virtual SwTwips ShrinkFrm( SwTwips, bool bTst = false, bool bInfo = false ) SAL_OVERRIDE;
      44             :     virtual SwTwips GrowFrm  ( SwTwips, bool bTst = false, bool bInfo = false ) SAL_OVERRIDE;
      45             :     virtual void    Format( const SwBorderAttrs *pAttrs = 0 ) SAL_OVERRIDE;
      46             :     virtual void    PaintBorder( const SwRect &, const SwPageFrm *pPage,
      47             :                                  const SwBorderAttrs & ) const SAL_OVERRIDE;
      48             :     virtual void PaintSubsidiaryLines( const SwPageFrm*, const SwRect& ) const SAL_OVERRIDE;
      49             :             void    PaintLine( const SwRect &, const SwPageFrm * ) const;
      50             : };
      51             : 
      52         356 : class SwFtnFrm: public SwLayoutFrm
      53             : {
      54             :     // Pointer to FtnFrm in which the footnote will be continued:
      55             :     //  - 0     no following existent
      56             :     //  - this  for the last one
      57             :     //  - otherwise the following FtnFrm
      58             :     SwFtnFrm     *pFollow;
      59             :     SwFtnFrm     *pMaster;      // FtnFrm from which I am the following
      60             :     SwCntntFrm   *pRef;         // in this CntntFrm is the footnote reference
      61             :     SwTxtFtn     *pAttr;        // footnote attribute (for recognition)
      62             : 
      63             :     // if true paragraphs in this footnote are NOT permitted to flow backwards
      64             :     bool bBackMoveLocked : 1;
      65             :     // #i49383# - control unlock of position of lower anchored objects.
      66             :     bool mbUnlockPosOfLowerObjs : 1;
      67             : #ifdef DBG_UTIL
      68             : protected:
      69             :     virtual SwTwips ShrinkFrm( SwTwips, bool bTst = false, bool bInfo = false ) SAL_OVERRIDE;
      70             :     virtual SwTwips GrowFrm  ( SwTwips, bool bTst = false, bool bInfo = false ) SAL_OVERRIDE;
      71             : #endif
      72             : 
      73             : public:
      74             :     SwFtnFrm( SwFrmFmt*, SwFrm*, SwCntntFrm*, SwTxtFtn* );
      75             : 
      76             :     virtual void Cut() SAL_OVERRIDE;
      77             :     virtual void Paste( SwFrm* pParent, SwFrm* pSibling = 0 ) SAL_OVERRIDE;
      78             : 
      79             :     virtual void PaintSubsidiaryLines( const SwPageFrm*, const SwRect& ) const SAL_OVERRIDE;
      80             : 
      81             :     bool operator<( const SwTxtFtn* pTxtFtn ) const;
      82             : 
      83             : #ifdef DBG_UTIL
      84             :     const SwCntntFrm *GetRef() const;
      85             :          SwCntntFrm  *GetRef();
      86             : #else
      87         606 :     const SwCntntFrm *GetRef() const    { return pRef; }
      88        3158 :          SwCntntFrm  *GetRef()          { return pRef; }
      89             : #endif
      90             :     const SwCntntFrm *GetRefFromAttr()  const;
      91             :           SwCntntFrm *GetRefFromAttr();
      92             : 
      93          20 :     const SwFtnFrm *GetFollow() const   { return pFollow; }
      94         790 :           SwFtnFrm *GetFollow()         { return pFollow; }
      95             : 
      96         454 :     const SwFtnFrm *GetMaster() const   { return pMaster; }
      97        1466 :           SwFtnFrm *GetMaster()         { return pMaster; }
      98             : 
      99        1090 :     const SwTxtFtn   *GetAttr() const   { return pAttr; }
     100        3348 :           SwTxtFtn   *GetAttr()         { return pAttr; }
     101             : 
     102         178 :     void SetFollow( SwFtnFrm *pNew ) { pFollow = pNew; }
     103         178 :     void SetMaster( SwFtnFrm *pNew ) { pMaster = pNew; }
     104           0 :     void SetRef   ( SwCntntFrm *pNew ) { pRef = pNew; }
     105             : 
     106             :     void InvalidateNxtFtnCnts( SwPageFrm* pPage );
     107             : 
     108         212 :     void LockBackMove()     { bBackMoveLocked = true; }
     109         212 :     void UnlockBackMove()   { bBackMoveLocked = false;}
     110         746 :     bool IsBackMoveLocked() { return bBackMoveLocked; }
     111             : 
     112             :     // prevents that the last content deletes the SwFtnFrm as well (Cut())
     113         206 :     inline void ColLock()       { mbColLocked = true; }
     114         206 :     inline void ColUnlock()     { mbColLocked = false; }
     115             : 
     116             :     // #i49383#
     117         390 :     inline void UnlockPosOfLowerObjs()
     118             :     {
     119         390 :         mbUnlockPosOfLowerObjs = true;
     120         390 :     }
     121         390 :     inline void KeepLockPosOfLowerObjs()
     122             :     {
     123         390 :         mbUnlockPosOfLowerObjs = false;
     124         390 :     }
     125         396 :     inline bool IsUnlockPosOfLowerObjs()
     126             :     {
     127         396 :         return mbUnlockPosOfLowerObjs;
     128             :     }
     129             : 
     130             :     /** search for last content in the current footnote frame
     131             : 
     132             :         OD 2005-12-02 #i27138#
     133             : 
     134             :         @return SwCntntFrm*
     135             :         pointer to found last content frame. NULL, if none is found.
     136             :     */
     137             :     SwCntntFrm* FindLastCntnt();
     138             : };
     139             : 
     140             : #endif
     141             : 
     142             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10