1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
19 #ifndef INCLUDED_SW_SOURCE_CORE_INC_ROWFRM_HXX
20 #define INCLUDED_SW_SOURCE_CORE_INC_ROWFRM_HXX
27 /// SwRowFrame is one table row in the document layout.
28 class SwRowFrame
: public SwLayoutFrame
30 virtual void Format(vcl::RenderContext
* pRenderContext
,
31 const SwBorderAttrs
* pAttrs
= nullptr) override
;
32 /// Only change the Frame size, not the PrtArea SSize
33 virtual SwTwips
ShrinkFrame(SwTwips
, bool bTst
= false, bool bInfo
= false) override
;
34 virtual SwTwips
GrowFrame(SwTwips
, bool bTst
= false, bool bInfo
= false) override
;
36 const SwTableLine
* m_pTabLine
;
37 SwRowFrame
* m_pFollowRow
; ///< note: this is *only* set on old-style tables!
39 sal_uInt16 mnTopMarginForLowers
;
40 sal_uInt16 mnBottomMarginForLowers
;
41 sal_uInt16 mnBottomLineSize
;
43 bool m_bIsFollowFlowRow
; ///< note: this is *only* set on old-style tables!
44 bool m_bIsRepeatedHeadline
;
45 bool m_bIsRowSpanLine
;
47 bool m_bForceRowSplitAllowed
;
50 virtual void DestroyImpl() override
;
51 virtual ~SwRowFrame() override
;
54 virtual void MakeAll(vcl::RenderContext
* pRenderContext
) override
;
55 virtual void SwClientNotify(const SwModify
&, const SfxHint
&) override
;
58 SwRowFrame(const SwTableLine
&, SwFrame
*, bool bInsertContent
= true);
60 virtual void Cut() override
;
63 * Register Flys after a line was created _AND_ inserted
64 * Must be called by the creator; the Fly is inserted _after_ it has
65 * been created; the same holds true for the Page at which the Flys
66 * are to be registered at.
68 void RegistFlys(SwPageFrame
* pPage
= nullptr);
70 const SwTableLine
* GetTabLine() const { return m_pTabLine
; }
73 * Adapts the Cells to the current height; invalidates the Cells if
74 * the Direction does not match the height
76 void AdjustCells(const SwTwips nHeight
, const bool bHeight
);
78 SwRowFrame
* GetFollowRow() const { return m_pFollowRow
; }
79 void SetFollowRow(SwRowFrame
* pNew
) { m_pFollowRow
= pNew
; }
82 sal_uInt16
GetTopMarginForLowers() const { return mnTopMarginForLowers
; }
83 void SetTopMarginForLowers(sal_uInt16 nNew
) { mnTopMarginForLowers
= nNew
; }
84 sal_uInt16
GetBottomMarginForLowers() const { return mnBottomMarginForLowers
; }
85 void SetBottomMarginForLowers(sal_uInt16 nNew
) { mnBottomMarginForLowers
= nNew
; }
86 sal_uInt16
GetBottomLineSize() const { return mnBottomLineSize
; }
87 void SetBottomLineSize(sal_uInt16 nNew
) { mnBottomLineSize
= nNew
; }
90 bool IsRepeatedHeadline() const { return m_bIsRepeatedHeadline
; }
91 void SetRepeatedHeadline(bool bNew
) { m_bIsRepeatedHeadline
= bNew
; }
93 // --> split table rows
94 bool IsRowSplitAllowed() const;
95 bool IsForceRowSplitAllowed() const { return m_bForceRowSplitAllowed
; }
96 void SetForceRowSplitAllowed(bool bNew
) { m_bForceRowSplitAllowed
= bNew
; };
97 bool IsFollowFlowRow() const { return m_bIsFollowFlowRow
; }
98 void SetFollowFlowRow(bool bNew
) { m_bIsFollowFlowRow
= bNew
; }
99 // <-- split table rows
101 // #131283# Table row keep feature
102 bool ShouldRowKeepWithNext(const bool bCheckParents
= true) const;
104 // #i4032# NEW TABLES
105 bool IsRowSpanLine() const { return m_bIsRowSpanLine
; }
106 void SetRowSpanLine(bool bNew
) { m_bIsRowSpanLine
= bNew
; }
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 SwFormatFrameSize
&);
129 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */