LibreOffice Module sw (master) 1
rowfrm.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_ROWFRM_HXX
20#define INCLUDED_SW_SOURCE_CORE_INC_ROWFRM_HXX
21
22#include "layfrm.hxx"
23
24class SwTableLine;
25class SwBorderAttrs;
26
28class SwRowFrame final : public SwLayoutFrame
29{
30 virtual void Format(vcl::RenderContext* pRenderContext,
31 const SwBorderAttrs* pAttrs = nullptr) override;
33 virtual SwTwips ShrinkFrame(SwTwips, bool bTst = false, bool bInfo = false) override;
34 virtual SwTwips GrowFrame(SwTwips, bool bTst = false, bool bInfo = false) override;
35
38 // #i29550#
41 sal_uInt16 mnBottomLineSize;
42 // <-- collapsing
46
49
50 virtual void DestroyImpl() override;
51 virtual ~SwRowFrame() override;
52
53 virtual void MakeAll(vcl::RenderContext* pRenderContext) override;
54 virtual void SwClientNotify(const SwModify&, const SfxHint&) override;
55 virtual const SwRowFrame* DynCastRowFrame() const override { return this; }
56
57public:
58 SwRowFrame(const SwTableLine&, SwFrame*, bool bInsertContent = true);
59
60 virtual void Cut() override;
61
68 void RegistFlys(SwPageFrame* pPage = nullptr);
69
70 const SwTableLine* GetTabLine() const { return m_pTabLine; }
71
76 void AdjustCells(const SwTwips nHeight, const bool bHeight);
77
79 void SetFollowRow(SwRowFrame* pNew) { m_pFollowRow = pNew; }
80
81 // #i29550#
82 sal_uInt16 GetTopMarginForLowers() const { return mnTopMarginForLowers; }
83 void SetTopMarginForLowers(sal_uInt16 nNew) { mnTopMarginForLowers = nNew; }
85 void SetBottomMarginForLowers(sal_uInt16 nNew) { mnBottomMarginForLowers = nNew; }
86 sal_uInt16 GetBottomLineSize() const { return mnBottomLineSize; }
87 void SetBottomLineSize(sal_uInt16 nNew) { mnBottomLineSize = nNew; }
88 // <-- collapsing
89
91 void SetRepeatedHeadline(bool bNew) { m_bIsRepeatedHeadline = bNew; }
92
93 // --> split table rows
94 bool IsRowSplitAllowed() const;
97 bool IsFollowFlowRow() const { return m_bIsFollowFlowRow; }
98 void SetFollowFlowRow(bool bNew) { m_bIsFollowFlowRow = bNew; }
99 // <-- split table rows
100
101 // #131283# Table row keep feature
102 bool ShouldRowKeepWithNext(const bool bCheckParents = true) const;
103
104 // #i4032# NEW TABLES
105 bool IsRowSpanLine() const { return m_bIsRowSpanLine; }
106 void SetRowSpanLine(bool bNew) { m_bIsRowSpanLine = bNew; }
107
108 // A row may only be split if the minimum height of the row frame
109 // fits into the vertical space left.
110 // The minimum height is found as maximum of two values: minimal
111 // contents of the row (e.g., height of first line of text, or an
112 // object, or lower table cell), and the minimum height setting.
113 // As the minimum height setting should not prevent the row to
114 // flow, (it only should ensure that *total* height is no less), we
115 // should not consider the setting when the split is performed
116 // (we should be able to keep on first page as little as required).
117 // When IsInSplit is true, lcl_CalcMinRowHeight will ignore the
118 // minimum height setting. It is set in lcl_RecalcSplitLine around
119 // lcl_RecalcRow and SwRowFrame::Calc that decide if it's possible
120 // to keep part of row's content on first page, and update table's
121 // height to fit the rest of space.
122 bool IsInSplit() const { return m_bIsInSplit; }
123 void SetInSplit(bool bNew = true) { m_bIsInSplit = bNew; }
124 void OnFrameSize(const SfxPoolItem&);
125
126 void dumpAsXml(xmlTextWriterPtr writer = nullptr) const override;
127};
128
129#endif
130
131/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Base class of the Writer layout elements.
Definition: frame.hxx:315
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
SwRowFrame is one table row in the document layout.
Definition: rowfrm.hxx:29
sal_uInt16 mnTopMarginForLowers
Definition: rowfrm.hxx:39
sal_uInt16 GetBottomMarginForLowers() const
Definition: rowfrm.hxx:84
void SetFollowRow(SwRowFrame *pNew)
Definition: rowfrm.hxx:79
sal_uInt16 mnBottomLineSize
Definition: rowfrm.hxx:41
bool m_bIsFollowFlowRow
note: this is only set on old-style tables!
Definition: rowfrm.hxx:43
bool IsRowSplitAllowed() const
Definition: tabfrm.cxx:5098
void SetInSplit(bool bNew=true)
Definition: rowfrm.hxx:123
virtual void Cut() override
Definition: tabfrm.cxx:4917
SwRowFrame * m_pFollowRow
note: this is only set on old-style tables!
Definition: rowfrm.hxx:37
virtual SwTwips ShrinkFrame(SwTwips, bool bTst=false, bool bInfo=false) override
Only change the Frame size, not the PrtArea SSize.
Definition: tabfrm.cxx:4995
void SetBottomMarginForLowers(sal_uInt16 nNew)
Definition: rowfrm.hxx:85
virtual const SwRowFrame * DynCastRowFrame() const override
Definition: rowfrm.hxx:55
virtual void SwClientNotify(const SwModify &, const SfxHint &) override
Definition: tabfrm.cxx:4115
void SetBottomLineSize(sal_uInt16 nNew)
Definition: rowfrm.hxx:87
const SwTableLine * m_pTabLine
Definition: rowfrm.hxx:36
virtual SwTwips GrowFrame(SwTwips, bool bTst=false, bool bInfo=false) override
Definition: tabfrm.cxx:4928
SwRowFrame(const SwTableLine &, SwFrame *, bool bInsertContent=true)
Definition: tabfrm.cxx:4040
sal_uInt16 mnBottomMarginForLowers
Definition: rowfrm.hxx:40
void SetRepeatedHeadline(bool bNew)
Definition: rowfrm.hxx:91
bool IsForceRowSplitAllowed() const
Definition: rowfrm.hxx:95
bool IsInSplit() const
Definition: rowfrm.hxx:122
bool IsRowSpanLine() const
Definition: rowfrm.hxx:105
SwRowFrame * GetFollowRow() const
Definition: rowfrm.hxx:78
void AdjustCells(const SwTwips nHeight, const bool bHeight)
Adapts the Cells to the current height; invalidates the Cells if the Direction does not match the hei...
Definition: tabfrm.cxx:4810
void OnFrameSize(const SfxPoolItem &)
Definition: tabfrm.cxx:4098
virtual void DestroyImpl() override
Definition: tabfrm.cxx:4076
bool m_bForceRowSplitAllowed
Definition: rowfrm.hxx:47
bool ShouldRowKeepWithNext(const bool bCheckParents=true) const
Definition: tabfrm.cxx:5121
virtual void Format(vcl::RenderContext *pRenderContext, const SwBorderAttrs *pAttrs=nullptr) override
"Formats" the Frame; Frame and PrtArea.
Definition: tabfrm.cxx:4641
void dumpAsXml(xmlTextWriterPtr writer=nullptr) const override
Definition: tabfrm.cxx:4195
sal_uInt16 GetBottomLineSize() const
Definition: rowfrm.hxx:86
void RegistFlys(SwPageFrame *pPage=nullptr)
Register Flys after a line was created AND inserted Must be called by the creator; the Fly is inserte...
Definition: tabfrm.cxx:4093
bool IsRepeatedHeadline() const
Definition: rowfrm.hxx:90
virtual void MakeAll(vcl::RenderContext *pRenderContext) override
Definition: tabfrm.cxx:4185
bool IsFollowFlowRow() const
Definition: rowfrm.hxx:97
void SetTopMarginForLowers(sal_uInt16 nNew)
Definition: rowfrm.hxx:83
void SetRowSpanLine(bool bNew)
Definition: rowfrm.hxx:106
const SwTableLine * GetTabLine() const
Definition: rowfrm.hxx:70
void SetForceRowSplitAllowed(bool bNew)
Definition: rowfrm.hxx:96
bool m_bIsInSplit
Definition: rowfrm.hxx:48
sal_uInt16 GetTopMarginForLowers() const
Definition: rowfrm.hxx:82
bool m_bIsRowSpanLine
Definition: rowfrm.hxx:45
virtual ~SwRowFrame() override
Definition: tabfrm.cxx:4089
void SetFollowFlowRow(bool bNew)
Definition: rowfrm.hxx:98
bool m_bIsRepeatedHeadline
Definition: rowfrm.hxx:44
SwTableLine is one table row in the document model.
Definition: swtable.hxx:376
struct _xmlTextWriter * xmlTextWriterPtr
tools::Long SwTwips
Definition: swtypes.hxx:51