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 
25 class SwContentFrame;
26 class SwRootFrame;
27 class SwTextNode;
28 class SwTextFootnote;
29 class SwBorderAttrs;
30 class SwFootnoteFrame;
31 
32 void sw_RemoveFootnotes( SwFootnoteBossFrame* pBoss, bool bPageOnly, bool bEndNotes );
33 
34 namespace 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 section on a page for footnotes. It's called
43 // SwFootnoteContFrame. Each footnote is separated by a SwFootnoteFrame which contains
44 // the paragraphs of a footnote. SwFootnoteFrame can be splitted and will then
45 // continue on another page.
47 {
48 public:
50 
51  const SwFootnoteFrame* FindFootNote() const;
52 
53  virtual SwTwips ShrinkFrame( SwTwips, bool bTst = false, bool bInfo = false ) override;
54  virtual SwTwips GrowFrame ( SwTwips, bool bTst = false, bool bInfo = false ) override;
55  virtual void Format( vcl::RenderContext* pRenderContext, const SwBorderAttrs *pAttrs = nullptr ) override;
56  virtual void PaintSwFrameShadowAndBorder(
57  const SwRect&,
58  const SwPageFrame* pPage,
59  const SwBorderAttrs&) const override;
60  virtual void PaintSubsidiaryLines( const SwPageFrame*, const SwRect& ) const override;
61  void PaintLine( const SwRect &, const SwPageFrame * ) const;
62 };
63 
65 {
66  // Pointer to FootnoteFrame in which the footnote will be continued:
67  // - 0 no following existent
68  // - this for the last one
69  // - otherwise the following FootnoteFrame
71  SwFootnoteFrame *mpMaster; // FootnoteFrame from which I am the following
72  SwContentFrame *mpReference; // in this ContentFrame is the footnote reference
73  SwTextFootnote *mpAttribute; // footnote attribute (for recognition)
74 
75  // if true paragraphs in this footnote are NOT permitted to flow backwards
76  bool mbBackMoveLocked : 1;
77  // #i49383# - control unlock of position of lower anchored objects.
79 
80 public:
82 
83  virtual bool IsDeleteForbidden() const override;
84  virtual void Cut() override;
85  virtual void Paste( SwFrame* pParent, SwFrame* pSibling = nullptr ) override;
86 
87  virtual void PaintSubsidiaryLines( const SwPageFrame*, const SwRect& ) const override;
88 
89  bool operator<( const SwTextFootnote* pTextFootnote ) const;
90 
91 #ifdef DBG_UTIL
92  const SwContentFrame *GetRef() const;
94 #else
95  const SwContentFrame *GetRef() const { return mpReference; }
96  SwContentFrame *GetRef() { return mpReference; }
97 #endif
98  const SwContentFrame *GetRefFromAttr() const;
100 
101  const SwFootnoteFrame *GetFollow() const { return mpFollow; }
103 
104  const SwFootnoteFrame *GetMaster() const { return mpMaster; }
106 
107  const SwTextFootnote *GetAttr() const { return mpAttribute; }
109 
110  void SetFollow( SwFootnoteFrame *pNew ) { mpFollow = pNew; }
111  void SetMaster( SwFootnoteFrame *pNew ) { mpMaster = pNew; }
112  void SetRef ( SwContentFrame *pNew ) { mpReference = pNew; }
113 
114  void InvalidateNxtFootnoteCnts( SwPageFrame const * pPage );
115 
116  void LockBackMove() { mbBackMoveLocked = true; }
117  void UnlockBackMove() { mbBackMoveLocked = false;}
119 
120  // prevents that the last content deletes the SwFootnoteFrame as well (Cut())
121  void ColLock() { mbColLocked = true; }
122  void ColUnlock() { mbColLocked = false; }
123 
124  // #i49383#
126  {
127  mbUnlockPosOfLowerObjs = true;
128  }
130  {
131  mbUnlockPosOfLowerObjs = false;
132  }
134  {
135  return mbUnlockPosOfLowerObjs;
136  }
137 
146 };
147 
148 #endif
149 
150 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void SetFollow(SwFootnoteFrame *pNew)
Definition: ftnfrm.hxx:110
bool IsBackMoveLocked()
Definition: ftnfrm.hxx:118
Base class of the Writer layout elements.
Definition: frame.hxx:295
void ColLock()
Definition: ftnfrm.hxx:121
virtual void Format(vcl::RenderContext *pRenderContext, const SwBorderAttrs *pAttrs=nullptr) override
"format" the frame (Fixsize is not set here).
Definition: ftnfrm.cxx:187
virtual void Paste(SwFrame *pParent, SwFrame *pSibling=nullptr) override
Definition: ftnfrm.cxx:550
void SetMaster(SwFootnoteFrame *pNew)
Definition: ftnfrm.hxx:111
virtual bool IsDeleteForbidden() const override
Definition: ftnfrm.cxx:478
long SwTwips
Definition: swtypes.hxx:49
Dialog to specify the properties of drop-down form field.
Definition: accfrmobj.cxx:40
virtual void Cut() override
Definition: ftnfrm.cxx:499
Of course Writer needs its own rectangles.
Definition: swrect.hxx:34
void InvalidateNxtFootnoteCnts(SwPageFrame const *pPage)
Definition: ftnfrm.cxx:454
void KeepLockPosOfLowerObjs()
Definition: ftnfrm.hxx:129
SwFootnoteFrame * GetFollow()
Definition: ftnfrm.hxx:102
SwFootnoteContFrame(SwFrameFormat *, SwFrame *)
Definition: ftnfrm.cxx:149
The root element of a Writer document layout.
Definition: rootfrm.hxx:79
bool mbUnlockPosOfLowerObjs
Definition: ftnfrm.hxx:78
SwTextFootnote * mpAttribute
Definition: ftnfrm.hxx:73
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:6758
virtual SwTwips ShrinkFrame(SwTwips, bool bTst=false, bool bInfo=false) override
Definition: ftnfrm.cxx:411
SwFootnoteFrame * mpMaster
Definition: ftnfrm.hxx:71
bool mbBackMoveLocked
Definition: ftnfrm.hxx:76
void UnlockPosOfLowerObjs()
Definition: ftnfrm.hxx:125
Style of a layout element.
Definition: frmfmt.hxx:57
virtual void PaintSwFrameShadowAndBorder(const SwRect &, const SwPageFrame *pPage, const SwBorderAttrs &) const override
Special implementation because of the footnote line.
Definition: paintfrm.cxx:5180
void RemoveFootnotesForNode(SwRootFrame const &rLayout, SwTextNode const &rTextNode, std::vector< std::pair< sal_Int32, sal_Int32 >> const *const pExtents)
Definition: txtfrm.cxx:800
void UnlockBackMove()
Definition: ftnfrm.hxx:117
A page of the document layout.
Definition: pagefrm.hxx:40
void LockBackMove()
Definition: ftnfrm.hxx:116
SwFootnoteFrame(SwFrameFormat *, SwFrame *, SwContentFrame *, SwTextFootnote *)
Definition: ftnfrm.cxx:441
const SwFootnoteFrame * GetMaster() const
Definition: ftnfrm.hxx:104
void sw_RemoveFootnotes(SwFootnoteBossFrame *pBoss, bool bPageOnly, bool bEndNotes)
remove all footnotes (not the references) and all footnote pages
Definition: ftnfrm.cxx:846
const SwFootnoteFrame * FindFootNote() const
Definition: findfrm.cxx:564
SwTextNode is a paragraph in the document model.
Definition: ndtxt.hxx:79
void SetRef(SwContentFrame *pNew)
Definition: ftnfrm.hxx:112
const SwFootnoteFrame * GetFollow() const
Definition: ftnfrm.hxx:101
bool mbColLocked
Definition: frame.hxx:424
bool operator<(const SwTextFootnote *pTextFootnote) const
Definition: ftnfrm.cxx:62
const SwContentFrame * GetRef() const
Definition: ftnfrm.cxx:2857
const SwTextFootnote * GetAttr() const
Definition: ftnfrm.hxx:107
SwContentFrame * mpReference
Definition: ftnfrm.hxx:72
SwFootnoteFrame * mpFollow
Definition: ftnfrm.hxx:70
const SwContentFrame * GetRefFromAttr() const
Definition: ftnfrm.cxx:2878
SwFootnoteFrame * GetMaster()
Definition: ftnfrm.hxx:105
void ColUnlock()
Definition: ftnfrm.hxx:122
SwTextFootnote * GetAttr()
Definition: ftnfrm.hxx:108
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:6749
void PaintLine(const SwRect &, const SwPageFrame *) const
Paint footnote lines.
Definition: paintfrm.cxx:5194
bool IsUnlockPosOfLowerObjs()
Definition: ftnfrm.hxx:133
virtual SwTwips GrowFrame(SwTwips, bool bTst=false, bool bInfo=false) override
Definition: ftnfrm.cxx:277
SwContentFrame * FindLastContent()
search for last content in the current footnote frame
Definition: ftnfrm.cxx:2897