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 void dumpAsXml(xmlTextWriterPtr writer = nullptr) const override;
69};
70
72{
73 return AddChained(true, pThis, bDefaultFormat);
74}
75
77{
78 return AddChained(false, pThis, bDefaultFormat);
79}
80
83class SwFootnoteFrame final : public SwLayoutFrame
84{
85 // Pointer to FootnoteFrame in which the footnote will be continued:
86 // - 0 no following existent
87 // - this for the last one
88 // - otherwise the following FootnoteFrame
90 SwFootnoteFrame *mpMaster; // FootnoteFrame from which I am the following
91 SwContentFrame *mpReference; // in this ContentFrame is the footnote reference
92 SwTextFootnote *mpAttribute; // footnote attribute (for recognition)
93
94 // if true paragraphs in this footnote are NOT permitted to flow backwards
96 // #i49383# - control unlock of position of lower anchored objects.
98
99public:
101
102 virtual bool IsDeleteForbidden() const override;
103 virtual void Cut() override;
104 virtual void Paste( SwFrame* pParent, SwFrame* pSibling = nullptr ) override;
105
106 virtual void PaintSubsidiaryLines( const SwPageFrame*, const SwRect& ) const override;
107
108 bool operator<( const SwTextFootnote* pTextFootnote ) const;
109
110#ifdef DBG_UTIL
111 const SwContentFrame *GetRef() const;
113#else
114 const SwContentFrame *GetRef() const { return mpReference; }
115 SwContentFrame *GetRef() { return mpReference; }
116#endif
117 const SwContentFrame *GetRefFromAttr() const;
119
120 const SwFootnoteFrame *GetFollow() const { return mpFollow; }
122
123 const SwFootnoteFrame *GetMaster() const { return mpMaster; }
125
126 const SwTextFootnote *GetAttr() const { return mpAttribute; }
128
129 void SetFollow( SwFootnoteFrame *pNew ) { mpFollow = pNew; }
130 void SetMaster( SwFootnoteFrame *pNew ) { mpMaster = pNew; }
131 void SetRef ( SwContentFrame *pNew ) { mpReference = pNew; }
132
133 void InvalidateNxtFootnoteCnts( SwPageFrame const * pPage );
134
137 bool IsBackMoveLocked() const { return mbBackMoveLocked; }
138
139 // prevents that the last content deletes the SwFootnoteFrame as well (Cut())
140 void ColLock() { mbColLocked = true; }
141 void ColUnlock() { mbColLocked = false; }
142
143 // #i49383#
145 {
147 }
149 {
151 }
153 {
155 }
156
165
166 void dumpAsXml(xmlTextWriterPtr writer = nullptr) const override;
167};
168
169#endif
170
171/* 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:59
virtual SwTwips ShrinkFrame(SwTwips, bool bTst=false, bool bInfo=false) override
Definition: ftnfrm.cxx:455
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:7258
virtual SwTwips GrowFrame(SwTwips, bool bTst=false, bool bInfo=false) override
Definition: ftnfrm.cxx:321
void dumpAsXml(xmlTextWriterPtr writer=nullptr) const override
Definition: paintfrm.cxx:5613
static SwFootnoteFrame * AddChained(bool bAppend, SwFrame *pNewUpper, bool bDefaultFormat)
Definition: ftnfrm.cxx:159
void PaintLine(const SwRect &, const SwPageFrame *) const
Paint footnote lines.
Definition: paintfrm.cxx:5572
virtual void PaintSwFrameShadowAndBorder(const SwRect &, const SwPageFrame *pPage, const SwBorderAttrs &) const override
Special implementation because of the footnote line.
Definition: paintfrm.cxx:5558
virtual void Format(vcl::RenderContext *pRenderContext, const SwBorderAttrs *pAttrs=nullptr) override
"format" the frame (Fixsize is not set here).
Definition: ftnfrm.cxx:232
const SwFootnoteFrame * FindFootNote() const
Definition: findfrm.cxx:650
static SwFootnoteFrame * AppendChained(SwFrame *pThis, bool bDefaultFormat)
Definition: ftnfrm.hxx:71
static SwFootnoteFrame * PrependChained(SwFrame *pThis, bool bDefaultFormat)
Definition: ftnfrm.hxx:76
SwFootnoteContFrame(SwFrameFormat *, SwFrame *)
Definition: ftnfrm.cxx:153
Represents one footnote or endnote in the layout.
Definition: ftnfrm.hxx:84
SwContentFrame * FindLastContent()
search for last content in the current footnote frame
Definition: ftnfrm.cxx:2949
void InvalidateNxtFootnoteCnts(SwPageFrame const *pPage)
Definition: ftnfrm.cxx:498
SwFootnoteFrame * GetMaster()
Definition: ftnfrm.hxx:124
const SwFootnoteFrame * GetFollow() const
Definition: ftnfrm.hxx:120
void SetRef(SwContentFrame *pNew)
Definition: ftnfrm.hxx:131
SwFootnoteFrame * mpFollow
Definition: ftnfrm.hxx:89
SwFootnoteFrame * GetFollow()
Definition: ftnfrm.hxx:121
SwContentFrame * mpReference
Definition: ftnfrm.hxx:91
const SwContentFrame * GetRefFromAttr() const
Definition: ftnfrm.cxx:2930
SwFootnoteFrame * mpMaster
Definition: ftnfrm.hxx:90
virtual void Cut() override
Definition: ftnfrm.cxx:543
void UnlockPosOfLowerObjs()
Definition: ftnfrm.hxx:144
void UnlockBackMove()
Definition: ftnfrm.hxx:136
SwTextFootnote * mpAttribute
Definition: ftnfrm.hxx:92
void ColUnlock()
Definition: ftnfrm.hxx:141
SwFootnoteFrame(SwFrameFormat *, SwFrame *, SwContentFrame *, SwTextFootnote *)
Definition: ftnfrm.cxx:485
bool mbUnlockPosOfLowerObjs
Definition: ftnfrm.hxx:97
bool operator<(const SwTextFootnote *pTextFootnote) const
Definition: ftnfrm.cxx:66
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:7249
void SetFollow(SwFootnoteFrame *pNew)
Definition: ftnfrm.hxx:129
void SetMaster(SwFootnoteFrame *pNew)
Definition: ftnfrm.hxx:130
const SwFootnoteFrame * GetMaster() const
Definition: ftnfrm.hxx:123
void dumpAsXml(xmlTextWriterPtr writer=nullptr) const override
Definition: ftnfrm.cxx:2989
virtual void Paste(SwFrame *pParent, SwFrame *pSibling=nullptr) override
Definition: ftnfrm.cxx:594
const SwTextFootnote * GetAttr() const
Definition: ftnfrm.hxx:126
bool IsUnlockPosOfLowerObjs() const
Definition: ftnfrm.hxx:152
void ColLock()
Definition: ftnfrm.hxx:140
const SwContentFrame * GetRef() const
Definition: ftnfrm.cxx:2909
void KeepLockPosOfLowerObjs()
Definition: ftnfrm.hxx:148
virtual bool IsDeleteForbidden() const override
Definition: ftnfrm.cxx:522
SwTextFootnote * GetAttr()
Definition: ftnfrm.hxx:127
void LockBackMove()
Definition: ftnfrm.hxx:135
bool IsBackMoveLocked() const
Definition: ftnfrm.hxx:137
bool mbBackMoveLocked
Definition: ftnfrm.hxx:95
Style of a layout element.
Definition: frmfmt.hxx:72
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:60
Of course Writer needs its own rectangles.
Definition: swrect.hxx:35
The root element of a Writer document layout.
Definition: rootfrm.hxx:85
SwTextAttr subclass for footnotes and endnotes.
Definition: txtftn.hxx:34
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:112
struct _xmlTextWriter * xmlTextWriterPtr
void sw_RemoveFootnotes(SwFootnoteBossFrame *pBoss, bool bPageOnly, bool bEndNotes)
remove all footnotes (not the references) and all footnote pages
Definition: ftnfrm.cxx:920
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:891
tools::Long SwTwips
Definition: swtypes.hxx:51