1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 #ifndef _FTNFRM_HXX 24 #define _FTNFRM_HXX 25 26 #include "layfrm.hxx" 27 28 class SwCntntFrm; 29 class SwTxtFtn; 30 class SwBorderAttrs; 31 class SwFtnFrm; 32 33 //Fuer Fussnoten gibt es einen Speziellen Bereich auf der Seite. Dieser 34 //Bereich ist ein SwFtnContFrm. 35 //Jede Fussnote ist durch einen SwFtnFrm abgegrenzt, dieser nimmt die 36 //Fussnotenabsaetze auf. SwFtnFrm koennen aufgespalten werden, sie gehen 37 //dann auf einer anderen Seite weiter. 38 39 class SwFtnContFrm: public SwLayoutFrm 40 { 41 public: 42 SwFtnContFrm( SwFrmFmt*, SwFrm* ); 43 44 const SwFtnFrm* FindFootNote() const; 45 46 virtual SwTwips ShrinkFrm( SwTwips, sal_Bool bTst = sal_False, sal_Bool bInfo = sal_False ); 47 virtual SwTwips GrowFrm ( SwTwips, sal_Bool bTst = sal_False, sal_Bool bInfo = sal_False ); 48 virtual void Format( const SwBorderAttrs *pAttrs = 0 ); 49 virtual void PaintBorder( const SwRect &, const SwPageFrm *pPage, 50 const SwBorderAttrs & ) const; 51 void PaintLine( const SwRect &, const SwPageFrm * ) const; 52 }; 53 54 class SwFtnFrm: public SwLayoutFrm 55 { 56 //Zeiger auf den FtnFrm in dem die Fussnote weitergefuehrt wird: 57 // 0 wenn kein Follow vorhanden, 58 // this beim letzten 59 // der Follow sonst. 60 SwFtnFrm *pFollow; 61 SwFtnFrm *pMaster; //Der FtnFrm dessen Follow ich bin. 62 SwCntntFrm *pRef; //In diesem CntntFrm steht die Fussnotenref. 63 SwTxtFtn *pAttr; //Fussnotenattribut (zum wiedererkennen) 64 65 sal_Bool bBackMoveLocked : 1; //Absaetze in dieser Fussnote duerfen derzeit 66 //nicht rueckwaerts fliessen. 67 // --> OD 2005-05-18 #i49383# - control unlock of position of lower anchored objects. 68 bool mbUnlockPosOfLowerObjs : 1; 69 // <-- 70 #ifdef DBG_UTIL 71 protected: 72 virtual SwTwips ShrinkFrm( SwTwips, sal_Bool bTst = sal_False, sal_Bool bInfo = sal_False ); 73 virtual SwTwips GrowFrm ( SwTwips, sal_Bool bTst = sal_False, sal_Bool bInfo = sal_False ); 74 #endif 75 76 77 public: 78 SwFtnFrm( SwFrmFmt*, SwFrm*, SwCntntFrm*, SwTxtFtn* ); 79 80 virtual void Cut(); 81 virtual void Paste( SwFrm* pParent, SwFrm* pSibling = 0 ); 82 83 sal_Bool operator<( const SwTxtFtn* pTxtFtn ) const; 84 85 #ifndef DBG_UTIL GetRef() const86 const SwCntntFrm *GetRef() const { return pRef; } GetRef()87 SwCntntFrm *GetRef() { return pRef; } 88 #else 89 //JP 15.10.2001: in a non pro version test if the attribute has the same 90 // meaning which his reference is 91 const SwCntntFrm *GetRef() const; 92 SwCntntFrm *GetRef(); 93 #endif 94 const SwCntntFrm *GetRefFromAttr() const; 95 SwCntntFrm *GetRefFromAttr(); 96 GetFollow() const97 const SwFtnFrm *GetFollow() const { return pFollow; } GetFollow()98 SwFtnFrm *GetFollow() { return pFollow; } 99 GetMaster() const100 const SwFtnFrm *GetMaster() const { return pMaster; } GetMaster()101 SwFtnFrm *GetMaster() { return pMaster; } 102 GetAttr() const103 const SwTxtFtn *GetAttr() const { return pAttr; } GetAttr()104 SwTxtFtn *GetAttr() { return pAttr; } 105 SetFollow(SwFtnFrm * pNew)106 void SetFollow( SwFtnFrm *pNew ) { pFollow = pNew; } SetMaster(SwFtnFrm * pNew)107 void SetMaster( SwFtnFrm *pNew ) { pMaster = pNew; } SetRef(SwCntntFrm * pNew)108 void SetRef ( SwCntntFrm *pNew ) { pRef = pNew; } 109 110 void InvalidateNxtFtnCnts( SwPageFrm* pPage ); 111 LockBackMove()112 void LockBackMove() { bBackMoveLocked = sal_True; } UnlockBackMove()113 void UnlockBackMove() { bBackMoveLocked = sal_False;} IsBackMoveLocked()114 sal_Bool IsBackMoveLocked() { return bBackMoveLocked; } 115 116 // Verhindert, dass der letzte Inhalt den SwFtnFrm mitloescht (Cut()) ColLock()117 inline void ColLock() { bColLocked = sal_True; } ColUnlock()118 inline void ColUnlock() { bColLocked = sal_False; } 119 120 // --> OD 2005-05-18 #i49383# UnlockPosOfLowerObjs()121 inline void UnlockPosOfLowerObjs() 122 { 123 mbUnlockPosOfLowerObjs = true; 124 } KeepLockPosOfLowerObjs()125 inline void KeepLockPosOfLowerObjs() 126 { 127 mbUnlockPosOfLowerObjs = false; 128 } IsUnlockPosOfLowerObjs()129 inline bool IsUnlockPosOfLowerObjs() 130 { 131 return mbUnlockPosOfLowerObjs; 132 } 133 // <-- 134 /** search for last content in the current footnote frame 135 136 OD 2005-12-02 #i27138# 137 138 @author OD 139 140 @return SwCntntFrm* 141 pointer to found last content frame. NULL, if none is found. 142 */ 143 SwCntntFrm* FindLastCntnt(); 144 }; 145 146 #endif //_FTNFRM_HXX 147