LibreOffice Module sw (master)
1
sw
source
core
inc
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
25
class
SwFootnoteBossFrame
;
26
class
SwFootnoteContFrame
;
27
class
SwFootnoteFrame
;
28
class
SwTextFootnote
;
29
30
// Set max. footnote area.
31
// Restoration of the old value in DTor. Implementation in ftnfrm.cxx
32
class
SwSaveFootnoteHeight
33
{
34
SwFrameDeleteGuard
aGuard
;
35
SwFootnoteBossFrame
*
pBoss
;
36
const
SwTwips
nOldHeight
;
37
SwTwips
nNewHeight
;
38
public
:
39
SwSaveFootnoteHeight
(
SwFootnoteBossFrame
*pBs,
const
SwTwips
nDeadLine );
40
~SwSaveFootnoteHeight
();
41
};
42
43
enum class
SwNeighbourAdjust
{
44
OnlyAdjust
,
GrowShrink
,
GrowAdjust
,
AdjustGrow
45
};
46
47
typedef
std::vector<SwFootnoteFrame*>
SwFootnoteFrames
;
48
49
class
SW_DLLPUBLIC
SwFootnoteBossFrame
:
public
SwLayoutFrame
50
{
51
// for private footnote operations
52
friend
class
SwFrame
;
53
friend
class
SwSaveFootnoteHeight
;
54
friend
class
SwPageFrame
;
// for setting of MaxFootnoteHeight
55
56
// max. height of the footnote container on this page
57
SwTwips
m_nMaxFootnoteHeight
;
58
59
SwFootnoteContFrame
*
MakeFootnoteCont
();
60
SwFootnoteFrame
*
FindFirstFootnote
();
61
SwNeighbourAdjust
NeighbourhoodAdjustment_
()
const
;
62
63
static
void
CollectFootnotes_
(
const
SwContentFrame
*,
SwFootnoteFrame
*,
64
SwFootnoteFrames
&,
const
SwFootnoteBossFrame
*);
65
66
protected
:
67
void
InsertFootnote
(
SwFootnoteFrame
* );
68
static
void
ResetFootnote
(
const
SwFootnoteFrame
*pAssumed );
69
70
public
:
71
SwFootnoteBossFrame
(
SwFrameFormat
* pFormat,
SwFrame
* pSib )
72
:
SwLayoutFrame
( pFormat, pSib )
73
,
m_nMaxFootnoteHeight
(0)
74
{}
75
76
SwLayoutFrame
*
FindBodyCont
();
77
inline
const
SwLayoutFrame
*
FindBodyCont
()
const
;
78
void
SetMaxFootnoteHeight
(
const
SwTwips
nNewMax ) {
m_nMaxFootnoteHeight
= nNewMax; }
79
80
// footnote interface
81
void
AppendFootnote
(
SwContentFrame
*,
SwTextFootnote
* );
82
bool
RemoveFootnote
(
const
SwContentFrame
*,
const
SwTextFootnote
*,
bool
bPrep =
true
);
83
static
SwFootnoteFrame
*
FindFootnote
(
const
SwContentFrame
*,
const
SwTextFootnote
* );
84
SwFootnoteContFrame
*
FindFootnoteCont
();
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 );
97
SwTwips
GetMaxFootnoteHeight
()
const
{
return
m_nMaxFootnoteHeight
; }
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)?
115
SwNeighbourAdjust
NeighbourhoodAdjustment
()
const
116
{
return
IsPageFrame
() ?
SwNeighbourAdjust::OnlyAdjust
:
NeighbourhoodAdjustment_
(); }
117
};
118
119
inline
const
SwLayoutFrame
*
SwFootnoteBossFrame::FindBodyCont
()
const
120
{
121
return
const_cast<
SwFootnoteBossFrame
*
>
(
this
)->
FindBodyCont
();
122
}
123
124
inline
const
SwFootnoteContFrame
*
SwFootnoteBossFrame::FindFootnoteCont
()
const
125
{
126
return
const_cast<
SwFootnoteBossFrame
*
>
(
this
)->
FindFootnoteCont
();
127
}
128
129
#endif
130
131
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SwContentFrame
SwContentFrame is the layout for content nodes: a common base class for text (paragraph) and non-text...
Definition:
cntfrm.hxx:59
SwFootnoteBossFrame
Definition:
ftnboss.hxx:50
SwFootnoteBossFrame::NeighbourhoodAdjustment
SwNeighbourAdjust NeighbourhoodAdjustment() const
Definition:
ftnboss.hxx:115
SwFootnoteBossFrame::SwFootnoteBossFrame
SwFootnoteBossFrame(SwFrameFormat *pFormat, SwFrame *pSib)
Definition:
ftnboss.hxx:71
SwFootnoteBossFrame::GetMaxFootnoteHeight
SwTwips GetMaxFootnoteHeight() const
Definition:
ftnboss.hxx:97
SwFootnoteBossFrame::MakeFootnoteCont
SwFootnoteContFrame * MakeFootnoteCont()
Insert a footnote container.
Definition:
ftnfrm.cxx:1028
SwFootnoteBossFrame::AppendFootnote
void AppendFootnote(SwContentFrame *, SwTextFootnote *)
Definition:
ftnfrm.cxx:1515
SwFootnoteBossFrame::ResetFootnote
static void ResetFootnote(const SwFootnoteFrame *pAssumed)
Definition:
ftnfrm.cxx:1195
SwFootnoteBossFrame::FindFootnote
static SwFootnoteFrame * FindFootnote(const SwContentFrame *, const SwTextFootnote *)
Definition:
ftnfrm.cxx:1696
SwFootnoteBossFrame::MoveFootnotes_
void MoveFootnotes_(SwFootnoteFrames &rFootnoteArr, bool bCalc=false)
Definition:
ftnfrm.cxx:1969
SwFootnoteBossFrame::FindBodyCont
SwLayoutFrame * FindBodyCont()
Searches the first ContentFrame in BodyText below the page.
Definition:
findfrm.cxx:48
SwFootnoteBossFrame::InsertFootnote
void InsertFootnote(SwFootnoteFrame *)
Definition:
ftnfrm.cxx:1235
SwFootnoteBossFrame::SetMaxFootnoteHeight
void SetMaxFootnoteHeight(const SwTwips nNewMax)
Definition:
ftnboss.hxx:78
SwFootnoteBossFrame::NeighbourhoodAdjustment_
SwNeighbourAdjust NeighbourhoodAdjustment_() const
Obtain if pFrame's size adjustment should be processed.
Definition:
ftnfrm.cxx:2620
SwFootnoteBossFrame::FindNearestFootnoteCont
SwFootnoteContFrame * FindNearestFootnoteCont(bool bDontLeave=false)
Search the next available footnote container.
Definition:
ftnfrm.cxx:1061
SwFootnoteBossFrame::RearrangeFootnotes
void RearrangeFootnotes(const SwTwips nDeadLine, const bool bLock, const SwTextFootnote *pAttr=nullptr)
Definition:
ftnfrm.cxx:2215
SwFootnoteBossFrame::FindFirstFootnote
SwFootnoteFrame * FindFirstFootnote()
Definition:
ftnfrm.cxx:1084
SwFootnoteBossFrame::ChangeFootnoteRef
static void ChangeFootnoteRef(const SwContentFrame *pOld, const SwTextFootnote *, SwContentFrame *pNew)
Definition:
ftnfrm.cxx:1764
SwFootnoteBossFrame::CollectFootnotes_
static void CollectFootnotes_(const SwContentFrame *, SwFootnoteFrame *, SwFootnoteFrames &, const SwFootnoteBossFrame *)
Definition:
ftnfrm.cxx:1832
SwFootnoteBossFrame::MoveFootnotes
void MoveFootnotes(const SwContentFrame *pSrc, SwContentFrame *pDest, SwTextFootnote const *pAttr)
Definition:
ftnfrm.cxx:2177
SwFootnoteBossFrame::m_nMaxFootnoteHeight
SwTwips m_nMaxFootnoteHeight
Definition:
ftnboss.hxx:57
SwFootnoteBossFrame::CollectFootnotes
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:1778
SwFootnoteBossFrame::SetFootnoteDeadLine
void SetFootnoteDeadLine(const SwTwips nDeadLine)
Definition:
ftnfrm.cxx:2511
SwFootnoteBossFrame::FindFootnoteCont
SwFootnoteContFrame * FindFootnoteCont()
Definition:
ftnfrm.cxx:1038
SwFootnoteBossFrame::GetVarSpace
SwTwips GetVarSpace() const
Definition:
ftnfrm.cxx:2539
SwFootnoteBossFrame::RemoveFootnote
bool RemoveFootnote(const SwContentFrame *, const SwTextFootnote *, bool bPrep=true)
Definition:
ftnfrm.cxx:1736
SwFootnoteContFrame
Definition:
ftnfrm.hxx:47
SwFootnoteFrame
Represents one footnote or endnote in the layout.
Definition:
ftnfrm.hxx:84
SwFrameDeleteGuard
Definition:
frame.hxx:1263
SwFrameFormat
Style of a layout element.
Definition:
frmfmt.hxx:72
SwFrame
Base class of the Writer layout elements.
Definition:
frame.hxx:315
SwFrame::IsPageFrame
bool IsPageFrame() const
Definition:
frame.hxx:1184
SwLayoutFrame
A layout frame is a frame that contains other frames (m_pLower), e.g. SwPageFrame or SwTabFrame.
Definition:
layfrm.hxx:36
SwPageFrame
A page of the document layout.
Definition:
pagefrm.hxx:60
SwSaveFootnoteHeight
Definition:
ftnboss.hxx:33
SwSaveFootnoteHeight::aGuard
SwFrameDeleteGuard aGuard
Definition:
ftnboss.hxx:34
SwSaveFootnoteHeight::nNewHeight
SwTwips nNewHeight
Definition:
ftnboss.hxx:37
SwSaveFootnoteHeight::pBoss
SwFootnoteBossFrame * pBoss
Definition:
ftnboss.hxx:35
SwSaveFootnoteHeight::nOldHeight
const SwTwips nOldHeight
Definition:
ftnboss.hxx:36
SwSaveFootnoteHeight::~SwSaveFootnoteHeight
~SwSaveFootnoteHeight()
Definition:
ftnfrm.cxx:2893
SwSaveFootnoteHeight::SwSaveFootnoteHeight
SwSaveFootnoteHeight(SwFootnoteBossFrame *pBs, const SwTwips nDeadLine)
Definition:
ftnfrm.cxx:2884
SwTextFootnote
SwTextAttr subclass for footnotes and endnotes.
Definition:
txtftn.hxx:34
SwFootnoteFrames
std::vector< SwFootnoteFrame * > SwFootnoteFrames
Definition:
ftnboss.hxx:47
SwNeighbourAdjust
SwNeighbourAdjust
Definition:
ftnboss.hxx:43
SwNeighbourAdjust::AdjustGrow
@ AdjustGrow
SwNeighbourAdjust::GrowShrink
@ GrowShrink
SwNeighbourAdjust::GrowAdjust
@ GrowAdjust
SwNeighbourAdjust::OnlyAdjust
@ OnlyAdjust
layfrm.hxx
SW_DLLPUBLIC
#define SW_DLLPUBLIC
Definition:
swdllapi.h:28
SwTwips
tools::Long SwTwips
Definition:
swtypes.hxx:51
Generated on Sun Jul 30 2023 04:28:37 for LibreOffice Module sw (master) by
1.9.3