LibreOffice Module sw (master) 1
ftnfrm.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_FTNFRM_HXX
21#define INCLUDED_SW_SOURCE_CORE_INC_FTNFRM_HXX
22
23#include "layfrm.hxx"
24
25class SwContentFrame;
26class SwRootFrame;
27class SwTextNode;
28class SwTextFootnote;
29class SwBorderAttrs;
30class SwFootnoteFrame;
31
32void sw_RemoveFootnotes( SwFootnoteBossFrame* pBoss, bool bPageOnly, bool bEndNotes );
33
34namespace sw {
35
37 SwRootFrame const& rLayout, SwTextNode const& rTextNode,
38 std::vector<std::pair<sal_Int32, sal_Int32>> const*const pExtents);
39
40}
41
42// There exists a special container frame on a page for footnotes. It's called
43// SwFootnoteContFrame. Each footnote is separated by a SwFootnoteFrame which contains
44// the text frames of a footnote. SwFootnoteFrame can be split and will then
45// continue on another page.
47{
48 static SwFootnoteFrame* AddChained(bool bAppend, SwFrame *pNewUpper, bool bDefaultFormat);
49
50public:
52
53 const SwFootnoteFrame* FindFootNote() const;
54
55 static inline SwFootnoteFrame* AppendChained(SwFrame* pThis, bool bDefaultFormat);
56 static inline SwFootnoteFrame* PrependChained(SwFrame* pThis, bool bDefaultFormat);
57
58 virtual SwTwips ShrinkFrame( SwTwips, bool bTst = false, bool bInfo = false ) override;
59 virtual SwTwips GrowFrame ( SwTwips, bool bTst = false, bool bInfo = false ) override;
60 virtual void Format( vcl::RenderContext* pRenderContext, const SwBorderAttrs *pAttrs = nullptr ) override;
61 virtual void PaintSwFrameShadowAndBorder(
62 const SwRect&,
63 const SwPageFrame* pPage,
64 const SwBorderAttrs&) const override;
65 virtual void PaintSubsidiaryLines( const SwPageFrame*, const SwRect& ) const override;
66 void PaintLine( const SwRect &, const SwPageFrame * ) const;
67};
68
70{
71 return AddChained(true, pThis, bDefaultFormat);
72}
73
75{
76 return AddChained(false, pThis, bDefaultFormat);
77}
78
79class SwFootnoteFrame final : public SwLayoutFrame
80{
81 // Pointer to FootnoteFrame in which the footnote will be continued:
82 // - 0 no following existent
83 // - this for the last one
84 // - otherwise the following FootnoteFrame
86 SwFootnoteFrame *mpMaster; // FootnoteFrame from which I am the following
87 SwContentFrame *mpReference; // in this ContentFrame is the footnote reference
88 SwTextFootnote *mpAttribute; // footnote attribute (for recognition)
89
90 // if true paragraphs in this footnote are NOT permitted to flow backwards
92 // #i49383# - control unlock of position of lower anchored objects.
94
95public:
97
98 virtual bool IsDeleteForbidden() const override;
99 virtual void Cut() override;
100 virtual void Paste( SwFrame* pParent, SwFrame* pSibling = nullptr ) override;
101
102 virtual void PaintSubsidiaryLines( const SwPageFrame*, const SwRect& ) const override;
103
104 bool operator<( const SwTextFootnote* pTextFootnote ) const;
105
106#ifdef DBG_UTIL
107 const SwContentFrame *GetRef() const;
109#else
110 const SwContentFrame *GetRef() const { return mpReference; }
111 SwContentFrame *GetRef() { return mpReference; }
112#endif
113 const SwContentFrame *GetRefFromAttr() const;
115
116 const SwFootnoteFrame *GetFollow() const { return mpFollow; }
118
119 const SwFootnoteFrame *GetMaster() const { return mpMaster; }
121
122 const SwTextFootnote *GetAttr() const { return mpAttribute; }
124
125 void SetFollow( SwFootnoteFrame *pNew ) { mpFollow = pNew; }
126 void SetMaster( SwFootnoteFrame *pNew ) { mpMaster = pNew; }
127 void SetRef ( SwContentFrame *pNew ) { mpReference = pNew; }
128
129 void InvalidateNxtFootnoteCnts( SwPageFrame const * pPage );
130
133 bool IsBackMoveLocked() const { return mbBackMoveLocked; }
134
135 // prevents that the last content deletes the SwFootnoteFrame as well (Cut())
136 void ColLock() { mbColLocked = true; }
137 void ColUnlock() { mbColLocked = false; }
138
139 // #i49383#
141 {
143 }
145 {
147 }
149 {
151 }
152
161};
162
163#endif
164
165/* 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
virtual SwTwips ShrinkFrame(SwTwips, bool bTst=false, bool bInfo=false) override
Definition: ftnfrm.cxx:453
virtual void PaintSubsidiaryLines(const SwPageFrame *, const SwRect &) const override
This method is overridden in order to have no subsidiary lines around the footnotes containers.
Definition: paintfrm.cxx:7036
virtual SwTwips GrowFrame(SwTwips, bool bTst=false, bool bInfo=false) override
Definition: ftnfrm.cxx:319
static SwFootnoteFrame * AddChained(bool bAppend, SwFrame *pNewUpper, bool bDefaultFormat)
Definition: ftnfrm.cxx:157
void PaintLine(const SwRect &, const SwPageFrame *) const
Paint footnote lines.
Definition: paintfrm.cxx:5458
virtual void PaintSwFrameShadowAndBorder(const SwRect &, const SwPageFrame *pPage, const SwBorderAttrs &) const override
Special implementation because of the footnote line.
Definition: paintfrm.cxx:5444
virtual void Format(vcl::RenderContext *pRenderContext, const SwBorderAttrs *pAttrs=nullptr) override
"format" the frame (Fixsize is not set here).
Definition: ftnfrm.cxx:230
const SwFootnoteFrame * FindFootNote() const
Definition: findfrm.cxx:619
static SwFootnoteFrame * AppendChained(SwFrame *pThis, bool bDefaultFormat)
Definition: ftnfrm.hxx:69
static SwFootnoteFrame * PrependChained(SwFrame *pThis, bool bDefaultFormat)
Definition: ftnfrm.hxx:74
SwFootnoteContFrame(SwFrameFormat *, SwFrame *)
Definition: ftnfrm.cxx:151
SwContentFrame * FindLastContent()
search for last content in the current footnote frame
Definition: ftnfrm.cxx:2946
void InvalidateNxtFootnoteCnts(SwPageFrame const *pPage)
Definition: ftnfrm.cxx:496
SwFootnoteFrame * GetMaster()
Definition: ftnfrm.hxx:120
const SwFootnoteFrame * GetFollow() const
Definition: ftnfrm.hxx:116
void SetRef(SwContentFrame *pNew)
Definition: ftnfrm.hxx:127
SwFootnoteFrame * mpFollow
Definition: ftnfrm.hxx:85
SwFootnoteFrame * GetFollow()
Definition: ftnfrm.hxx:117
SwContentFrame * mpReference
Definition: ftnfrm.hxx:87
const SwContentFrame * GetRefFromAttr() const
Definition: ftnfrm.cxx:2927
SwFootnoteFrame * mpMaster
Definition: ftnfrm.hxx:86
virtual void Cut() override
Definition: ftnfrm.cxx:541
void UnlockPosOfLowerObjs()
Definition: ftnfrm.hxx:140
void UnlockBackMove()
Definition: ftnfrm.hxx:132
SwTextFootnote * mpAttribute
Definition: ftnfrm.hxx:88
void ColUnlock()
Definition: ftnfrm.hxx:137
SwFootnoteFrame(SwFrameFormat *, SwFrame *, SwContentFrame *, SwTextFootnote *)
Definition: ftnfrm.cxx:483
bool mbUnlockPosOfLowerObjs
Definition: ftnfrm.hxx:93
bool operator<(const SwTextFootnote *pTextFootnote) const
Definition: ftnfrm.cxx:64
virtual void PaintSubsidiaryLines(const SwPageFrame *, const SwRect &) const override
This method is overridden in order to have no subsidiary lines around the footnotes.
Definition: paintfrm.cxx:7027
void SetFollow(SwFootnoteFrame *pNew)
Definition: ftnfrm.hxx:125
void SetMaster(SwFootnoteFrame *pNew)
Definition: ftnfrm.hxx:126
const SwFootnoteFrame * GetMaster() const
Definition: ftnfrm.hxx:119
virtual void Paste(SwFrame *pParent, SwFrame *pSibling=nullptr) override
Definition: ftnfrm.cxx:592
const SwTextFootnote * GetAttr() const
Definition: ftnfrm.hxx:122
bool IsUnlockPosOfLowerObjs() const
Definition: ftnfrm.hxx:148
void ColLock()
Definition: ftnfrm.hxx:136
const SwContentFrame * GetRef() const
Definition: ftnfrm.cxx:2906
void KeepLockPosOfLowerObjs()
Definition: ftnfrm.hxx:144
virtual bool IsDeleteForbidden() const override
Definition: ftnfrm.cxx:520
SwTextFootnote * GetAttr()
Definition: ftnfrm.hxx:123
void LockBackMove()
Definition: ftnfrm.hxx:131
bool IsBackMoveLocked() const
Definition: ftnfrm.hxx:133
bool mbBackMoveLocked
Definition: ftnfrm.hxx:91
Style of a layout element.
Definition: frmfmt.hxx:62
Base class of the Writer layout elements.
Definition: frame.hxx:315
bool mbColLocked
Definition: frame.hxx:443
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
Of course Writer needs its own rectangles.
Definition: swrect.hxx:35
The root element of a Writer document layout.
Definition: rootfrm.hxx:82
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:89
void sw_RemoveFootnotes(SwFootnoteBossFrame *pBoss, bool bPageOnly, bool bEndNotes)
remove all footnotes (not the references) and all footnote pages
Definition: ftnfrm.cxx:918
Dialog to specify the properties of date form field.
void RemoveFootnotesForNode(SwRootFrame const &rLayout, SwTextNode const &rTextNode, std::vector< std::pair< sal_Int32, sal_Int32 > > const *const pExtents)
Definition: txtfrm.cxx:804
tools::Long SwTwips
Definition: swtypes.hxx:51