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 SwContentFrm;
26 : class SwTextFootnote;
27 : class SwBorderAttrs;
28 : class SwFootnoteFrm;
29 :
30 : void sw_RemoveFootnotes( SwFootnoteBossFrm* pBoss, bool bPageOnly, bool bEndNotes );
31 :
32 : // There exists a special section on a page for footnotes. It's called
33 : // SwFootnoteContFrm. Each footnote is separated by a SwFootnoteFrm which contains
34 : // the paragraphs of a footnote. SwFootnoteFrm can be splitted and will then
35 : // continue on another page.
36 174 : class SwFootnoteContFrm: public SwLayoutFrm
37 : {
38 : public:
39 : SwFootnoteContFrm( SwFrameFormat*, SwFrm* );
40 :
41 : const SwFootnoteFrm* 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 200 : class SwFootnoteFrm: public SwLayoutFrm
53 : {
54 : // Pointer to FootnoteFrm in which the footnote will be continued:
55 : // - 0 no following existent
56 : // - this for the last one
57 : // - otherwise the following FootnoteFrm
58 : SwFootnoteFrm *pFollow;
59 : SwFootnoteFrm *pMaster; // FootnoteFrm from which I am the following
60 : SwContentFrm *pRef; // in this ContentFrm is the footnote reference
61 : SwTextFootnote *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 : SwFootnoteFrm( SwFrameFormat*, SwFrm*, SwContentFrm*, SwTextFootnote* );
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 SwTextFootnote* pTextFootnote ) const;
82 :
83 : #ifdef DBG_UTIL
84 : const SwContentFrm *GetRef() const;
85 : SwContentFrm *GetRef();
86 : #else
87 475 : const SwContentFrm *GetRef() const { return pRef; }
88 2202 : SwContentFrm *GetRef() { return pRef; }
89 : #endif
90 : const SwContentFrm *GetRefFromAttr() const;
91 : SwContentFrm *GetRefFromAttr();
92 :
93 10 : const SwFootnoteFrm *GetFollow() const { return pFollow; }
94 511 : SwFootnoteFrm *GetFollow() { return pFollow; }
95 :
96 284 : const SwFootnoteFrm *GetMaster() const { return pMaster; }
97 879 : SwFootnoteFrm *GetMaster() { return pMaster; }
98 :
99 868 : const SwTextFootnote *GetAttr() const { return pAttr; }
100 2221 : SwTextFootnote *GetAttr() { return pAttr; }
101 :
102 129 : void SetFollow( SwFootnoteFrm *pNew ) { pFollow = pNew; }
103 127 : void SetMaster( SwFootnoteFrm *pNew ) { pMaster = pNew; }
104 0 : void SetRef ( SwContentFrm *pNew ) { pRef = pNew; }
105 :
106 : void InvalidateNxtFootnoteCnts( SwPageFrm* pPage );
107 :
108 126 : void LockBackMove() { bBackMoveLocked = true; }
109 121 : void UnlockBackMove() { bBackMoveLocked = false;}
110 478 : bool IsBackMoveLocked() { return bBackMoveLocked; }
111 :
112 : // prevents that the last content deletes the SwFootnoteFrm as well (Cut())
113 105 : inline void ColLock() { mbColLocked = true; }
114 105 : inline void ColUnlock() { mbColLocked = false; }
115 :
116 : // #i49383#
117 199 : inline void UnlockPosOfLowerObjs()
118 : {
119 199 : mbUnlockPosOfLowerObjs = true;
120 199 : }
121 199 : inline void KeepLockPosOfLowerObjs()
122 : {
123 199 : mbUnlockPosOfLowerObjs = false;
124 199 : }
125 258 : inline bool IsUnlockPosOfLowerObjs()
126 : {
127 258 : return mbUnlockPosOfLowerObjs;
128 : }
129 :
130 : /** search for last content in the current footnote frame
131 :
132 : OD 2005-12-02 #i27138#
133 :
134 : @return SwContentFrm*
135 : pointer to found last content frame. NULL, if none is found.
136 : */
137 : SwContentFrm* FindLastContent();
138 : };
139 :
140 : #endif
141 :
142 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|