LibreOffice Module sw (master) 1
tabfrm.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_TABFRM_HXX
20#define INCLUDED_SW_SOURCE_CORE_INC_TABFRM_HXX
21
22#include "layfrm.hxx"
23#include "flowfrm.hxx"
24
25class SwTable;
26class SwBorderAttrs;
27class SwAttrSetChg;
28
30{
31 NONE = 0x00,
32 InvalidatePrt = 0x02,
34 InvalidatePrevPrt = 0x08,
37 InvalidatePos = 0x40,
38 InvalidateNextPos = 0x80,
39};
40
41namespace o3tl {
42 template<> struct typed_flags<SwTabFrameInvFlags> : is_typed_flags<SwTabFrameInvFlags, 0xfe> {};
43}
44
46class SwTabFrame final: public SwLayoutFrame, public SwFlowFrame
47{
48 friend void CalcContent( SwLayoutFrame *pLay, bool bNoColl );
49
50 // does the special treatment for Get_[Next|Prev]Leaf()
51 using SwFrame::GetLeaf;
52
54
55 bool m_bComplete :1;
59 bool m_bCalcLowers :1;
66
71
77 // want any notification to the master table
78
79 bool m_bRestrictTableGrowth :1; // Usually, the table may grow infinitely,
80 // as the table can be split in SwTabFrame::MakeAll
81 // In MakeAll, this flag is set to indicate that
82 // the table may only grow inside its upper. This
83 // is necessary, in order to let the text flow into
84 // the FollowFlowLine
85
87
88 // #i26945#
89 bool m_bConsiderObjsForMinCellHeight :1; // Usually, the floating screen objects
90 // are considered during the calculation
91 // for the minimal cell height.
92 // For the splitting table rows algorithm
93 // we need not to consider floating
94 // screen object for the preparation
95 // of the re-calculation of the
96 // last table row.
97 // #i26945#
98 bool m_bObjsDoesFit :1; // For splitting table rows algorithm, this boolean
99 // indicates, if the floating screen objects fits
100
102
108 bool Split( const SwTwips nCutPos, bool bTryToSplit, bool bTableRowKeep );
109 void Join();
110
111 void UpdateAttr_(
112 const SfxPoolItem*,
114 SwAttrSetChg *pa = nullptr,
115 SwAttrSetChg *pb = nullptr );
116
117 virtual bool ShouldBwdMoved( SwLayoutFrame *pNewUpper, bool &rReformat ) override;
118
119 virtual void DestroyImpl() override;
120 virtual ~SwTabFrame() override;
121
122 virtual void MakeAll(vcl::RenderContext* pRenderContext) override;
123 virtual void Format( vcl::RenderContext* pRenderContext, const SwBorderAttrs *pAttrs = nullptr ) override;
124 virtual void SwClientNotify(const SwModify&, const SfxHint&) override;
125 // only changes the Framesize, not the PrtArea size
126 virtual SwTwips GrowFrame ( SwTwips, bool bTst = false, bool bInfo = false ) override;
127 virtual const SwTabFrame* DynCastTabFrame() const override { return this; }
128
129public:
130 SwTabFrame( SwTable &, SwFrame* ); // calling RegistFlys always after creation _and_pasting!
131 SwTabFrame( SwTabFrame & ); // _only_ for the creation of follows
132
133 void JoinAndDelFollows(); // for DelFrames of the TableNodes!
134
135 // calls thr RegistFlys of the rows
136 void RegistFlys();
137
138 inline const SwTabFrame *GetFollow() const;
139 inline SwTabFrame *GetFollow();
140 SwTabFrame* FindMaster( bool bFirstMaster = false ) const;
141
142 virtual bool GetInfo( SfxPoolItem &rHint ) const override;
143 virtual void PaintSwFrame( vcl::RenderContext& rRenderContext, SwRect const&,
144 SwPrintData const*const pPrintData = nullptr ) const override;
145 virtual void CheckDirection( bool bVert ) override;
146
147 virtual void Cut() override;
148 virtual void Paste( SwFrame* pParent, SwFrame* pSibling = nullptr ) override;
149
150 virtual bool Prepare( const PrepareHint ePrep = PrepareHint::Clear,
151 const void *pVoid = nullptr, bool bNotify = true ) override;
152
154 inline const SwFrame *FindLastContentOrTable() const;
156 inline const SwContentFrame *FindLastContent() const;
157
158 const SwTable *GetTable() const { return m_pTable; }
159 SwTable *GetTable() { return m_pTable; }
160
161 bool IsComplete() const { return m_bComplete; }
162 void SetComplete() { m_bComplete = true; }
163 void ResetComplete() { m_bComplete = false; }
164
165 bool IsLowersFormatted() const { return m_bLowersFormatted; }
167
168 void SetCalcLowers() { m_bCalcLowers = true; } // use rarely
169 void SetResizeHTMLTable() { m_bResizeHTMLTable = true; } // same
171
172 // Start: New stuff for breaking table rows
173
175 void SetFollowFlowLine(bool bNew) { m_bHasFollowFlowLine = bNew; }
176
178 void SetRebuildLastLine(bool bNew) { m_bIsRebuildLastLine = bNew; }
179
181 void SetRestrictTableGrowth( bool bNew ) { m_bRestrictTableGrowth = bNew; }
182
185
187 {
188 return m_bInRecalcLowerRow;
189 }
190 void SetInRecalcLowerRow( bool bNew )
191 {
192 m_bInRecalcLowerRow = bNew;
193 }
194
195 // #i26945#
197 {
199 }
200 void SetConsiderObjsForMinCellHeight(bool const bConsiderObjsForMinCellHeight)
201 {
202 m_bConsiderObjsForMinCellHeight = bConsiderObjsForMinCellHeight;
203 }
204
205 // #i26945#
206 bool DoesObjsFit() const
207 {
208 return m_bObjsDoesFit;
209 }
210 void SetDoesObjsFit(bool const bObjsDoesFit)
211 {
212 m_bObjsDoesFit = bObjsDoesFit;
213 }
214
216
217 // End: New stuff for breaking table rows
218
219 bool CalcFlyOffsets(
220 SwTwips& rUpper,
221 tools::Long& rLeftOffset,
222 tools::Long& rRightOffset,
223 SwTwips * pSpaceBelowBottom) const;
224
226
227 bool IsInHeadline( const SwFrame& rFrame ) const;
229
230 bool IsLayoutSplitAllowed() const;
231
232 // #i29550#
233 bool IsCollapsingBorders() const;
234
235 sal_uInt16 GetBottomLineSize() const;
236
237 virtual void dumpAsXmlAttributes(xmlTextWriterPtr writer) const override;
238};
239
241{
242 return const_cast<SwTabFrame*>(this)->FindLastContentOrTable();
243}
244
246{
247 return const_cast<SwTabFrame*>(this)->FindLastContent();
248}
249
251{
252 return static_cast<const SwTabFrame*>(SwFlowFrame::GetFollow());
253}
255{
256 return static_cast<SwTabFrame*>(SwFlowFrame::GetFollow());
257}
258
259#endif // INCLUDED_SW_SOURCE_CORE_INC_TABFRM_HXX
260
261/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
struct _xmlTextWriter * xmlTextWriterPtr
SwContentFrame is the layout for content nodes: a common base class for text (paragraph) and non-text...
Definition: cntfrm.hxx:58
Base class that provides the general functionalities for frames that are allowed at page breaks (flow...
Definition: flowfrm.hxx:60
const SwFlowFrame * GetFollow() const
Definition: flowfrm.hxx:169
Base class of the Writer layout elements.
Definition: frame.hxx:315
SwLayoutFrame * GetLeaf(MakePageType eMakePage, bool bFwd)
Definition: flowfrm.cxx:842
A layout frame is a frame that contains other frames (m_pLower), e.g. SwPageFrame or SwTabFrame.
Definition: layfrm.hxx:36
Of course Writer needs its own rectangles.
Definition: swrect.hxx:35
SwRowFrame is one table row in the document layout.
Definition: rowfrm.hxx:29
SwTabFrame is one table in the document layout, containing rows (which contain cells).
Definition: tabfrm.hxx:47
void SetDoesObjsFit(bool const bObjsDoesFit)
Definition: tabfrm.hxx:210
bool IsCollapsingBorders() const
Definition: tabfrm.cxx:5845
SwTwips CalcHeightOfFirstContentLine() const
Function to calculate height of first text row.
Definition: tabfrm.cxx:6000
void SetCalcLowers()
Definition: tabfrm.hxx:168
SwContentFrame * FindLastContent()
Definition: tabfrm.cxx:3604
virtual void CheckDirection(bool bVert) override
Definition: wsfrm.cxx:441
friend void CalcContent(SwLayoutFrame *pLay, bool bNoColl)
Definition: fly.cxx:1423
virtual void DestroyImpl() override
Definition: tabfrm.cxx:144
SwTabFrame * FindMaster(bool bFirstMaster=false) const
Definition: flowfrm.cxx:773
const SwTabFrame * GetFollow() const
Definition: tabfrm.hxx:250
virtual ~SwTabFrame() override
Definition: tabfrm.cxx:153
virtual bool GetInfo(SfxPoolItem &rHint) const override
Definition: tabfrm.cxx:3508
bool IsRebuildLastLine() const
Definition: tabfrm.hxx:177
SwRowFrame * GetFirstNonHeadlineRow() const
Definition: tabfrm.cxx:5790
void SetInRecalcLowerRow(bool bNew)
Definition: tabfrm.hxx:190
SwTabFrame(SwTable &, SwFrame *)
Definition: tabfrm.cxx:74
void Join()
Definition: tabfrm.cxx:1386
virtual void MakeAll(vcl::RenderContext *pRenderContext) override
Definition: tabfrm.cxx:1880
void JoinAndDelFollows()
Definition: tabfrm.cxx:157
void ResetComplete()
Definition: tabfrm.hxx:163
void SetResizeHTMLTable()
Definition: tabfrm.hxx:169
SwFrame * FindLastContentOrTable()
Definition: tabfrm.cxx:3534
SwTable * GetTable()
Definition: tabfrm.hxx:159
virtual void Format(vcl::RenderContext *pRenderContext, const SwBorderAttrs *pAttrs=nullptr) override
"Formats" the frame; Frame and PrtArea.
Definition: tabfrm.cxx:2994
bool RemoveFollowFlowLine()
Definition: tabfrm.cxx:885
bool IsComplete() const
Definition: tabfrm.hxx:161
bool m_bInRecalcLowerRow
Definition: tabfrm.hxx:101
const SwTable * GetTable() const
Definition: tabfrm.hxx:158
void SetRebuildLastLine(bool bNew)
Definition: tabfrm.hxx:178
bool m_bLockBackMove
Communication between MakeAll and Layact.
Definition: tabfrm.hxx:61
bool m_bCalcLowers
Set entries for Repaint without needing to set the base class' CompletePaint With that we would want ...
Definition: tabfrm.hxx:59
virtual const SwTabFrame * DynCastTabFrame() const override
Definition: tabfrm.hxx:127
void SetLowersFormatted(bool b)
Definition: tabfrm.hxx:166
virtual void SwClientNotify(const SwModify &, const SfxHint &) override
Definition: tabfrm.cxx:3345
virtual void dumpAsXmlAttributes(xmlTextWriterPtr writer) const override
Definition: xmldump.cxx:658
bool m_bHasFollowFlowLine
Primarily for the StarONE SS The Contents are formatted via Calc() on MakeAll in any case.
Definition: tabfrm.hxx:72
bool IsRemoveFollowFlowLinePending() const
Definition: tabfrm.hxx:183
bool IsInHeadline(const SwFrame &rFrame) const
Definition: tabfrm.cxx:5771
bool m_bRemoveFollowFlowLinePending
Definition: tabfrm.hxx:86
void SetRestrictTableGrowth(bool bNew)
Definition: tabfrm.hxx:181
void RegistFlys()
Definition: tabfrm.cxx:167
void SetConsiderObjsForMinCellHeight(bool const bConsiderObjsForMinCellHeight)
Definition: tabfrm.hxx:200
sal_uInt16 GetBottomLineSize() const
Definition: tabfrm.cxx:5830
bool m_bObjsDoesFit
Definition: tabfrm.hxx:98
void SetRemoveFollowFlowLinePending(bool bNew)
Definition: tabfrm.hxx:184
bool IsLayoutSplitAllowed() const
Definition: tabfrm.cxx:5823
virtual SwTwips GrowFrame(SwTwips, bool bTst=false, bool bInfo=false) override
Definition: tabfrm.cxx:3262
void UpdateAttr_(const SfxPoolItem *, const SfxPoolItem *, SwTabFrameInvFlags &, SwAttrSetChg *pa=nullptr, SwAttrSetChg *pb=nullptr)
Definition: tabfrm.cxx:3411
void SetComplete()
Definition: tabfrm.hxx:162
virtual bool ShouldBwdMoved(SwLayoutFrame *pNewUpper, bool &rReformat) override
Return value defines if the frm needs to be relocated.
Definition: tabfrm.cxx:3618
virtual void PaintSwFrame(vcl::RenderContext &rRenderContext, SwRect const &, SwPrintData const *const pPrintData=nullptr) const override
Definition: paintfrm.cxx:4335
virtual void Paste(SwFrame *pParent, SwFrame *pSibling=nullptr) override
Definition: tabfrm.cxx:3835
bool IsLowersFormatted() const
Definition: tabfrm.hxx:165
bool m_bComplete
Definition: tabfrm.hxx:55
void SetFollowFlowLine(bool bNew)
Definition: tabfrm.hxx:175
bool HasFollowFlowLine() const
Definition: tabfrm.hxx:174
bool m_bRestrictTableGrowth
Means that currently the last line of the.
Definition: tabfrm.hxx:79
void SetONECalcLowers()
Definition: tabfrm.hxx:170
bool CalcFlyOffsets(SwTwips &rUpper, tools::Long &rLeftOffset, tools::Long &rRightOffset, SwTwips *pSpaceBelowBottom) const
Calculate the offsets arising because of FlyFrames.
Definition: tabfrm.cxx:2789
bool Split(const SwTwips nCutPos, bool bTryToSplit, bool bTableRowKeep)
Split() splits the Frame at the specified position: a Follow is created and constructed and inserted ...
Definition: tabfrm.cxx:1021
virtual void Cut() override
Definition: tabfrm.cxx:3730
bool DoesObjsFit() const
Definition: tabfrm.hxx:206
bool m_bResizeHTMLTable
The Master took care of the BackMove test.
Definition: tabfrm.hxx:62
bool IsConsiderObjsForMinCellHeight() const
Definition: tabfrm.hxx:196
bool m_bIsRebuildLastLine
Means that the first line in the follow.
Definition: tabfrm.hxx:75
bool m_bONECalcLowers
Call the Resize of the HTMLTableLayout in the MakeAll This is an optimization, so that we don't have ...
Definition: tabfrm.hxx:67
bool IsInRecalcLowerRow() const
Definition: tabfrm.hxx:186
virtual bool Prepare(const PrepareHint ePrep=PrepareHint::Clear, const void *pVoid=nullptr, bool bNotify=true) override
Definition: tabfrm.cxx:3896
bool IsRestrictTableGrowth() const
Definition: tabfrm.hxx:180
bool m_bConsiderObjsForMinCellHeight
Definition: tabfrm.hxx:89
SwTable * m_pTable
Definition: tabfrm.hxx:53
bool m_bLowersFormatted
For stability of the content in MakeAll.
Definition: tabfrm.hxx:60
SwTable is one table in the document model, containing rows (which contain cells).
Definition: swtable.hxx:113
NONE
long Long
tools::Long SwTwips
Definition: swtypes.hxx:51
PrepareHint
Definition: swtypes.hxx:194
SwTabFrameInvFlags
Definition: tabfrm.hxx:30
unsigned char sal_uInt8