LibreOffice Module sw (master) 1
ftnboss.hxx
Go to the documentation of this file.
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_FTNBOSS_HXX
21#define INCLUDED_SW_SOURCE_CORE_INC_FTNBOSS_HXX
22
23#include "layfrm.hxx"
24
27class SwFootnoteFrame;
28class SwTextFootnote;
29
30// Set max. footnote area.
31// Restoration of the old value in DTor. Implementation in ftnfrm.cxx
33{
38public:
39 SwSaveFootnoteHeight( SwFootnoteBossFrame *pBs, const SwTwips nDeadLine );
41};
42
45};
46
47typedef std::vector<SwFootnoteFrame*> SwFootnoteFrames;
48
49class SAL_DLLPUBLIC_RTTI SwFootnoteBossFrame: public SwLayoutFrame
50{
51 // for private footnote operations
52 friend class SwFrame;
54 friend class SwPageFrame; // for setting of MaxFootnoteHeight
55
56 // max. height of the footnote container on this page
58
62
65
66protected:
68 static void ResetFootnote( const SwFootnoteFrame *pAssumed );
69
70public:
72 : SwLayoutFrame( pFormat, pSib )
74 {}
75
77 inline const SwLayoutFrame *FindBodyCont() const;
78 void SetMaxFootnoteHeight( const SwTwips nNewMax ) { m_nMaxFootnoteHeight = nNewMax; }
79
80 // footnote interface
82 bool RemoveFootnote(const SwContentFrame *, const SwTextFootnote *, bool bPrep = true);
85 inline const SwFootnoteContFrame *FindFootnoteCont() const;
86 const SwFootnoteFrame *FindFirstFootnote( SwContentFrame const * ) const;
87 SwFootnoteContFrame *FindNearestFootnoteCont( bool bDontLeave = false );
88
89 static void ChangeFootnoteRef( const SwContentFrame *pOld, const SwTextFootnote *,
90 SwContentFrame *pNew );
91 void RearrangeFootnotes( const SwTwips nDeadLine, const bool bLock,
92 const SwTextFootnote *pAttr = nullptr );
93
94 // Set DeadLine (in document coordinates) so that the text formatter can
95 // temporarily limit footnote height.
96 void SetFootnoteDeadLine( const SwTwips nDeadLine );
98
99 // returns value for remaining space until the body reaches minimal height
100 SwTwips GetVarSpace() const;
101
102 // methods needed for layouting
103 // The parameter <_bCollectOnlyPreviousFootnotes> controls if only footnotes
104 // that are positioned before the this footnote boss-frame have to be
105 // collected.
106 void CollectFootnotes( const SwContentFrame* _pRef,
107 SwFootnoteBossFrame* _pOld,
108 SwFootnoteFrames& _rFootnoteArr,
109 const bool _bCollectOnlyPreviousFootnotes = false );
110 void MoveFootnotes_( SwFootnoteFrames &rFootnoteArr, bool bCalc = false );
111 void MoveFootnotes( const SwContentFrame *pSrc, SwContentFrame *pDest,
112 SwTextFootnote const *pAttr );
113
114 // should AdjustNeighbourhood be called (or Grow/Shrink)?
117};
118
120{
121 return const_cast<SwFootnoteBossFrame*>(this)->FindBodyCont();
122}
123
125{
126 return const_cast<SwFootnoteBossFrame*>(this)->FindFootnoteCont();
127}
128
129#endif
130
131/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SwContentFrame is the layout for content nodes: a common base class for text (paragraph) and non-text...
Definition: cntfrm.hxx:58
SwNeighbourAdjust NeighbourhoodAdjustment() const
Definition: ftnboss.hxx:115
SwFootnoteBossFrame(SwFrameFormat *pFormat, SwFrame *pSib)
Definition: ftnboss.hxx:71
SwTwips GetMaxFootnoteHeight() const
Definition: ftnboss.hxx:97
SwFootnoteContFrame * MakeFootnoteCont()
Insert a footnote container.
Definition: ftnfrm.cxx:1026
void AppendFootnote(SwContentFrame *, SwTextFootnote *)
Definition: ftnfrm.cxx:1513
static void ResetFootnote(const SwFootnoteFrame *pAssumed)
Definition: ftnfrm.cxx:1193
static SwFootnoteFrame * FindFootnote(const SwContentFrame *, const SwTextFootnote *)
Definition: ftnfrm.cxx:1694
void MoveFootnotes_(SwFootnoteFrames &rFootnoteArr, bool bCalc=false)
Definition: ftnfrm.cxx:1967
SwLayoutFrame * FindBodyCont()
Searches the first ContentFrame in BodyText below the page.
Definition: findfrm.cxx:46
void InsertFootnote(SwFootnoteFrame *)
Definition: ftnfrm.cxx:1233
void SetMaxFootnoteHeight(const SwTwips nNewMax)
Definition: ftnboss.hxx:78
SwNeighbourAdjust NeighbourhoodAdjustment_() const
Obtain if pFrame's size adjustment should be processed.
Definition: ftnfrm.cxx:2617
SwFootnoteContFrame * FindNearestFootnoteCont(bool bDontLeave=false)
Search the next available footnote container.
Definition: ftnfrm.cxx:1059
void RearrangeFootnotes(const SwTwips nDeadLine, const bool bLock, const SwTextFootnote *pAttr=nullptr)
Definition: ftnfrm.cxx:2213
SwFootnoteFrame * FindFirstFootnote()
Definition: ftnfrm.cxx:1082
static void ChangeFootnoteRef(const SwContentFrame *pOld, const SwTextFootnote *, SwContentFrame *pNew)
Definition: ftnfrm.cxx:1762
static void CollectFootnotes_(const SwContentFrame *, SwFootnoteFrame *, SwFootnoteFrames &, const SwFootnoteBossFrame *)
Definition: ftnfrm.cxx:1830
void MoveFootnotes(const SwContentFrame *pSrc, SwContentFrame *pDest, SwTextFootnote const *pAttr)
Definition: ftnfrm.cxx:2175
SwTwips m_nMaxFootnoteHeight
Definition: ftnboss.hxx:57
void CollectFootnotes(const SwContentFrame *_pRef, SwFootnoteBossFrame *_pOld, SwFootnoteFrames &_rFootnoteArr, const bool _bCollectOnlyPreviousFootnotes=false)
OD 03.04.2003 #108446# - add parameter <_bCollectOnlyPreviousFootnotes> in order to control,...
Definition: ftnfrm.cxx:1776
void SetFootnoteDeadLine(const SwTwips nDeadLine)
Definition: ftnfrm.cxx:2508
SwFootnoteContFrame * FindFootnoteCont()
Definition: ftnfrm.cxx:1036
SwTwips GetVarSpace() const
Definition: ftnfrm.cxx:2536
bool RemoveFootnote(const SwContentFrame *, const SwTextFootnote *, bool bPrep=true)
Definition: ftnfrm.cxx:1734
Style of a layout element.
Definition: frmfmt.hxx:62
Base class of the Writer layout elements.
Definition: frame.hxx:315
bool IsPageFrame() const
Definition: frame.hxx:1178
A layout frame is a frame that contains other frames (m_pLower), e.g. SwPageFrame or SwTabFrame.
Definition: layfrm.hxx:36
A page of the document layout.
Definition: pagefrm.hxx:58
SwFrameDeleteGuard aGuard
Definition: ftnboss.hxx:34
SwFootnoteBossFrame * pBoss
Definition: ftnboss.hxx:35
const SwTwips nOldHeight
Definition: ftnboss.hxx:36
SwSaveFootnoteHeight(SwFootnoteBossFrame *pBs, const SwTwips nDeadLine)
Definition: ftnfrm.cxx:2881
std::vector< SwFootnoteFrame * > SwFootnoteFrames
Definition: ftnboss.hxx:47
SwNeighbourAdjust
Definition: ftnboss.hxx:43
tools::Long SwTwips
Definition: swtypes.hxx:51