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