merge the formfield patch from ooo-build
[ooovba.git] / sw / source / core / inc / ftnfrm.hxx
blob0a1ac9c63fd651061846d370856df08f7548f9e8
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: ftnfrm.hxx,v $
10 * $Revision: 1.10 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef _FTNFRM_HXX
31 #define _FTNFRM_HXX
33 #include "layfrm.hxx"
35 class SwCntntFrm;
36 class SwTxtFtn;
37 class SwBorderAttrs;
38 class SwFtnFrm;
40 //Fuer Fussnoten gibt es einen Speziellen Bereich auf der Seite. Dieser
41 //Bereich ist ein SwFtnContFrm.
42 //Jede Fussnote ist durch einen SwFtnFrm abgegrenzt, dieser nimmt die
43 //Fussnotenabsaetze auf. SwFtnFrm koennen aufgespalten werden, sie gehen
44 //dann auf einer anderen Seite weiter.
46 class SwFtnContFrm: public SwLayoutFrm
48 public:
49 SwFtnContFrm( SwFrmFmt* );
51 const SwFtnFrm* FindFootNote() const;
53 virtual SwTwips ShrinkFrm( SwTwips, BOOL bTst = FALSE, BOOL bInfo = FALSE );
54 virtual SwTwips GrowFrm ( SwTwips, BOOL bTst = FALSE, BOOL bInfo = FALSE );
55 virtual void Format( const SwBorderAttrs *pAttrs = 0 );
56 virtual void PaintBorder( const SwRect &, const SwPageFrm *pPage,
57 const SwBorderAttrs & ) const;
58 void PaintLine( const SwRect &, const SwPageFrm * ) const;
61 class SwFtnFrm: public SwLayoutFrm
63 //Zeiger auf den FtnFrm in dem die Fussnote weitergefuehrt wird:
64 // 0 wenn kein Follow vorhanden,
65 // this beim letzten
66 // der Follow sonst.
67 SwFtnFrm *pFollow;
68 SwFtnFrm *pMaster; //Der FtnFrm dessen Follow ich bin.
69 SwCntntFrm *pRef; //In diesem CntntFrm steht die Fussnotenref.
70 SwTxtFtn *pAttr; //Fussnotenattribut (zum wiedererkennen)
72 BOOL bBackMoveLocked : 1; //Absaetze in dieser Fussnote duerfen derzeit
73 //nicht rueckwaerts fliessen.
74 // --> OD 2005-05-18 #i49383# - control unlock of position of lower anchored objects.
75 bool mbUnlockPosOfLowerObjs : 1;
76 // <--
77 #ifndef PRODUCT
78 protected:
79 virtual SwTwips ShrinkFrm( SwTwips, BOOL bTst = FALSE, BOOL bInfo = FALSE );
80 virtual SwTwips GrowFrm ( SwTwips, BOOL bTst = FALSE, BOOL bInfo = FALSE );
81 #endif
84 public:
85 SwFtnFrm( SwFrmFmt*, SwCntntFrm*, SwTxtFtn* );
87 virtual void Cut();
88 virtual void Paste( SwFrm* pParent, SwFrm* pSibling = 0 );
90 BOOL operator<( const SwTxtFtn* pTxtFtn ) const;
92 #ifdef PRODUCT
93 const SwCntntFrm *GetRef() const { return pRef; }
94 SwCntntFrm *GetRef() { return pRef; }
95 #else
96 //JP 15.10.2001: in a non pro version test if the attribute has the same
97 // meaning which his reference is
98 const SwCntntFrm *GetRef() const;
99 SwCntntFrm *GetRef();
100 #endif
101 const SwCntntFrm *GetRefFromAttr() const;
102 SwCntntFrm *GetRefFromAttr();
104 const SwFtnFrm *GetFollow() const { return pFollow; }
105 SwFtnFrm *GetFollow() { return pFollow; }
107 const SwFtnFrm *GetMaster() const { return pMaster; }
108 SwFtnFrm *GetMaster() { return pMaster; }
110 const SwTxtFtn *GetAttr() const { return pAttr; }
111 SwTxtFtn *GetAttr() { return pAttr; }
113 void SetFollow( SwFtnFrm *pNew ) { pFollow = pNew; }
114 void SetMaster( SwFtnFrm *pNew ) { pMaster = pNew; }
115 void SetRef ( SwCntntFrm *pNew ) { pRef = pNew; }
117 void InvalidateNxtFtnCnts( SwPageFrm* pPage );
119 void LockBackMove() { bBackMoveLocked = TRUE; }
120 void UnlockBackMove() { bBackMoveLocked = FALSE;}
121 BOOL IsBackMoveLocked() { return bBackMoveLocked; }
123 // Verhindert, dass der letzte Inhalt den SwFtnFrm mitloescht (Cut())
124 inline void ColLock() { bColLocked = TRUE; }
125 inline void ColUnlock() { bColLocked = FALSE; }
127 // --> OD 2005-05-18 #i49383#
128 inline void UnlockPosOfLowerObjs()
130 mbUnlockPosOfLowerObjs = true;
132 inline void KeepLockPosOfLowerObjs()
134 mbUnlockPosOfLowerObjs = false;
136 inline bool IsUnlockPosOfLowerObjs()
138 return mbUnlockPosOfLowerObjs;
140 // <--
141 /** search for last content in the current footnote frame
143 OD 2005-12-02 #i27138#
145 @author OD
147 @return SwCntntFrm*
148 pointer to found last content frame. NULL, if none is found.
150 SwCntntFrm* FindLastCntnt();
153 #endif //_FTNFRM_HXX