LibreOffice Module sw (master) 1
layfrm.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#ifndef INCLUDED_SW_SOURCE_CORE_INC_LAYFRM_HXX
20#define INCLUDED_SW_SOURCE_CORE_INC_LAYFRM_HXX
21
22#include "frame.hxx"
23#include <swdllapi.h>
24
26class SwContentFrame;
27class SwFormatCol;
29class SwFrameFormat;
30class SwBorderAttrs;
32class SwCellFrame;
33
36{
37 // The SwFrame in disguise
38 friend class SwFlowFrame;
39 friend class SwFrame;
40
41 // Releases the Lower while restructuring columns
43 friend void RestoreContent( SwFrame *, SwLayoutFrame *, SwFrame *pSibling );
44
45protected:
46
47 virtual void DestroyImpl() override;
48 virtual ~SwLayoutFrame() override;
49
50 virtual void Format( vcl::RenderContext* pRenderContext, const SwBorderAttrs *pAttrs = nullptr ) override;
51 virtual void MakeAll(vcl::RenderContext* pRenderContext) override;
52
54 std::vector<SwAnchoredObject*> m_VertPosOrientFramesFor;
55
56 virtual SwTwips ShrinkFrame( SwTwips, bool bTst = false, bool bInfo = false ) override;
57 virtual SwTwips GrowFrame ( SwTwips, bool bTst = false, bool bInfo = false ) override;
58
59 tools::Long CalcRel( const SwFormatFrameSize &rSz ) const;
60
61public:
62 // --> #i28701#
63
64 virtual void PaintSubsidiaryLines( const SwPageFrame*, const SwRect& ) const;
65 void RefreshLaySubsidiary( const SwPageFrame*, const SwRect& ) const;
66 void RefreshExtraData( const SwRect & ) const;
67
69 void ChgLowersProp( const Size& rOldSize );
70
71 void AdjustColumns( const SwFormatCol *pCol, bool bAdjustAttributes );
72
73 void ChgColumns( const SwFormatCol &rOld, const SwFormatCol &rNew,
74 const bool bChgFootnote = false );
75
77 void PaintColLines( const SwRect &, const SwFormatCol &,
78 const SwPageFrame * ) const;
79
80 virtual bool FillSelection( SwSelectionList& rList, const SwRect& rRect ) const override;
81
83 SwCursorMoveState* = nullptr, bool bTestBackground = false ) const override;
84
85 virtual void Cut() override;
86 virtual void Paste( SwFrame* pParent, SwFrame* pSibling = nullptr ) override;
87
92 const SwContentFrame* GetContentPos( Point &rPoint, const bool bDontLeave,
93 const bool bBodyOnly = false,
94 SwCursorMoveState *pCMS = nullptr,
95 const bool bDefaultExpand = true ) const;
96
98
99 virtual void PaintSwFrame( vcl::RenderContext& rRenderContext, SwRect const&,
100 SwPrintData const*const pPrintData = nullptr ) const override;
101 const SwFrame *Lower() const { return m_pLower; }
102 SwFrame *Lower() { return m_pLower; }
103 bool ContainsDeleteForbiddenLayFrame() const;
104 const SwContentFrame *ContainsContent() const;
105 inline SwContentFrame *ContainsContent();
106 const SwCellFrame *FirstCell() const;
107 inline SwCellFrame *FirstCell();
108
116 const SwFrame *ContainsAny( const bool _bInvestigateFootnoteForSections = false ) const;
117 inline SwFrame *ContainsAny( const bool _bInvestigateFootnoteForSections = false );
118 bool IsAnLower( const SwFrame * ) const;
119
120 virtual const SwFrameFormat *GetFormat() const;
121 virtual SwFrameFormat *GetFormat();
122 void SetFrameFormat( SwFrameFormat* );
123
130 bool MoveLowerFootnotes( SwContentFrame *pStart, SwFootnoteBossFrame *pOldBoss,
131 SwFootnoteBossFrame *pNewBoss, const bool bFootnoteNums );
132
133 // --> #i28701# - change purpose of method and its name
134 // --> #i44016# - add parameter <_bUnlockPosOfObjs> to
136 void NotifyLowerObjs( const bool _bUnlockPosOfObjs = false );
137
143 void InvaPercentLowers( SwTwips nDiff = 0 );
144
146 void FormatWidthCols( const SwBorderAttrs &, const SwTwips nBorder,
147 const SwTwips nMinHeight );
148
153 SwTwips InnerHeight() const;
154
167 bool IsBefore( const SwLayoutFrame* _pCheckRefLayFrame ) const;
168
169 const SwFrame* GetLastLower() const;
170 inline SwFrame* GetLastLower();
171
172 virtual void PaintBreak() const;
173
175 {
176 m_VertPosOrientFramesFor.push_back(pObj);
177 }
178
180 {
181 m_VertPosOrientFramesFor.erase(
182 std::remove(m_VertPosOrientFramesFor.begin(),
183 m_VertPosOrientFramesFor.end(), pObj),
184 m_VertPosOrientFramesFor.end());
185 }
186};
187
193{
194 return const_cast<SwContentFrame*>(static_cast<const SwLayoutFrame*>(this)->ContainsContent());
195}
196
198{
199 return const_cast<SwCellFrame*>(static_cast<const SwLayoutFrame*>(this)->FirstCell());
200}
201
202inline SwFrame* SwLayoutFrame::ContainsAny( const bool _bInvestigateFootnoteForSections )
203{
204 return const_cast<SwFrame*>(static_cast<const SwLayoutFrame*>(this)->ContainsAny( _bInvestigateFootnoteForSections ));
205}
206
210inline bool SwFrame::IsColBodyFrame() const
211{
213}
214
215inline bool SwFrame::IsPageBodyFrame() const
216{
218}
219
221{
222 return const_cast<SwFrame*>(static_cast<const SwLayoutFrame*>(this)->GetLastLower());
223}
224
225#endif // INCLUDED_SW_SOURCE_CORE_INC_LAYFRM_HXX
226
227/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
wrapper class for the positioning of Writer fly frames and drawing objects
SwCellFrame is one table cell in the document layout.
Definition: cellfrm.hxx:31
SwContentFrame is the layout for content nodes: a common base class for text (paragraph) and non-text...
Definition: cntfrm.hxx:59
Style of a layout element.
Definition: frmfmt.hxx:72
Base class of the Writer layout elements.
Definition: frame.hxx:315
virtual void Cut()=0
virtual void DestroyImpl()
Definition: ssfrm.cxx:329
virtual SwTwips ShrinkFrame(SwTwips, bool bTst=false, bool bInfo=false)=0
bool IsPageFrame() const
Definition: frame.hxx:1184
bool IsColumnFrame() const
Definition: frame.hxx:1188
SwFrameType mnFrameType
Definition: frame.hxx:414
virtual bool FillSelection(SwSelectionList &rList, const SwRect &rRect) const
Definition: unusedf.cxx:41
bool IsPageBodyFrame() const
Definition: layfrm.hxx:215
friend class SwLayoutFrame
Definition: frame.hxx:318
virtual bool GetModelPositionForViewPoint(SwPosition *, Point &, SwCursorMoveState *=nullptr, bool bTestBackground=false) const
Definition: unusedf.cxx:47
friend void RestoreContent(SwFrame *, SwLayoutFrame *, SwFrame *pSibling)
Definition: frmtool.cxx:3035
virtual void Paste(SwFrame *pParent, SwFrame *pSibling=nullptr)=0
SwLayoutFrame * GetUpper()
Definition: frame.hxx:684
virtual void Format(vcl::RenderContext *pRenderContext, const SwBorderAttrs *pAttrs=nullptr)
Calculates the frame area size and the print area, in case they are invalid.
Definition: unusedf.cxx:25
friend SwFrame * SaveContent(SwLayoutFrame *, SwFrame *pStart)
Definition: frmtool.cxx:2873
virtual SwTwips GrowFrame(SwTwips, bool bTst=false, bool bInfo=false)=0
virtual void PaintSwFrame(vcl::RenderContext &rRenderContext, SwRect const &, SwPrintData const *const pPrintData=nullptr) const
Definition: unusedf.cxx:30
virtual void MakeAll(vcl::RenderContext *pRenderContext)=0
bool IsColBodyFrame() const
These SwFrame inlines are here, so that frame.hxx does not need to include layfrm....
Definition: layfrm.hxx:210
A layout frame is a frame that contains other frames (m_pLower), e.g. SwPageFrame or SwTabFrame.
Definition: layfrm.hxx:36
const SwCellFrame * FirstCell() const
Calls ContainsAny first to reach the innermost cell.
Definition: findfrm.cxx:118
SwFrame * Lower()
Definition: layfrm.hxx:102
void ClearVertPosOrientFrameFor(SwAnchoredObject *pObj)
Definition: layfrm.hxx:179
const SwFrame * ContainsAny(const bool _bInvestigateFootnoteForSections=false) const
Method <ContainsAny()> doesn't investigate content of footnotes by default.
Definition: findfrm.cxx:131
std::vector< SwAnchoredObject * > m_VertPosOrientFramesFor
Definition: layfrm.hxx:54
const SwFrame * GetLastLower() const
Definition: findfrm.cxx:1917
const SwContentFrame * ContainsContent() const
Checks if the frame contains one or more ContentFrame's anywhere in his subsidiary structure; if so t...
Definition: findfrm.cxx:72
SwFrame * m_pLower
Definition: layfrm.hxx:53
void SetVertPosOrientFrameFor(SwAnchoredObject *pObj)
Definition: layfrm.hxx:174
const SwFrame * Lower() const
Definition: layfrm.hxx:101
A page of the document layout.
Definition: pagefrm.hxx:60
Of course Writer needs its own rectangles.
Definition: swrect.hxx:35
This class is used as parameter for creation of a block cursor selection.
virtual SotClipboardFormatId GetFormat(const TransferableDataHelper &aHelper) override
long Long
Marks a position in the document model.
Definition: pam.hxx:38
#define SW_DLLPUBLIC
Definition: swdllapi.h:28
tools::Long SwTwips
Definition: swtypes.hxx:51