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 
24 class SwTableLine;
25 class SwBorderAttrs;
26 
29 {
30  virtual void Format( vcl::RenderContext* pRenderContext, const SwBorderAttrs *pAttrs = nullptr ) override;
32  virtual SwTwips ShrinkFrame( SwTwips, bool bTst = false, bool bInfo = false ) override;
33  virtual SwTwips GrowFrame ( SwTwips, bool bTst = false, bool bInfo = false ) override;
34 
37  // #i29550#
40  sal_uInt16 mnBottomLineSize;
41  // <-- collapsing
45 
48 
49  virtual void DestroyImpl() override;
50  virtual ~SwRowFrame() override;
51 
52 protected:
53  virtual void MakeAll(vcl::RenderContext* pRenderContext) override;
54  virtual void Modify( const SfxPoolItem*, const SfxPoolItem* ) override;
55 
56 public:
57  SwRowFrame( const SwTableLine &, SwFrame*, bool bInsertContent = true );
58 
59  virtual void Cut() override;
60 
67  void RegistFlys( SwPageFrame *pPage = nullptr );
68 
69  const SwTableLine *GetTabLine() const { return m_pTabLine; }
70 
75  void AdjustCells( const SwTwips nHeight, const bool bHeight );
76 
77  SwRowFrame* GetFollowRow() const { return m_pFollowRow; }
78  void SetFollowRow( SwRowFrame* pNew ) { m_pFollowRow = pNew; }
79 
80  // #i29550#
81  sal_uInt16 GetTopMarginForLowers() const { return mnTopMarginForLowers; }
82  void SetTopMarginForLowers( sal_uInt16 nNew ) { mnTopMarginForLowers = nNew; }
83  sal_uInt16 GetBottomMarginForLowers() const { return mnBottomMarginForLowers; }
84  void SetBottomMarginForLowers( sal_uInt16 nNew ) { mnBottomMarginForLowers = nNew; }
85  sal_uInt16 GetBottomLineSize() const { return mnBottomLineSize; }
86  void SetBottomLineSize( sal_uInt16 nNew ) { mnBottomLineSize = nNew; }
87  // <-- collapsing
88 
89  bool IsRepeatedHeadline() const { return m_bIsRepeatedHeadline; }
90  void SetRepeatedHeadline( bool bNew ) { m_bIsRepeatedHeadline = bNew; }
91 
92  // --> split table rows
93  bool IsRowSplitAllowed() const;
95  void SetForceRowSplitAllowed( bool bNew) { m_bForceRowSplitAllowed = bNew; };
96  bool IsFollowFlowRow() const { return m_bIsFollowFlowRow; }
97  void SetFollowFlowRow( bool bNew ) { m_bIsFollowFlowRow = bNew; }
98  // <-- split table rows
99 
100  // #131283# Table row keep feature
101  bool ShouldRowKeepWithNext( const bool bCheckParents = true ) const;
102 
103  // #i4032# NEW TABLES
104  bool IsRowSpanLine() const { return m_bIsRowSpanLine; }
105  void SetRowSpanLine( bool bNew ) { m_bIsRowSpanLine = bNew; }
106 
107  // A row may only be split if the minimum height of the row frame
108  // fits into the vertical space left.
109  // The minimum height is found as maximum of two values: minimal
110  // contents of the row (e.g., height of first line of text, or an
111  // object, or lower table cell), and the minimum height setting.
112  // As the minimum height setting should not prevent the row to
113  // flow, (it only should ensure that *total* height is no less), we
114  // should not consider the setting when the split is performed
115  // (we should be able to keep on first page as little as required).
116  // When IsInSplit is true, lcl_CalcMinRowHeight will ignore the
117  // minimum height setting. It is set in lcl_RecalcSplitLine around
118  // lcl_RecalcRow and SwRowFrame::Calc that decide if it's possible
119  // to keep part of row's content on first page, and update table's
120  // height to fit the rest of space.
121  bool IsInSplit() const { return m_bIsInSplit; }
122  void SetInSplit(bool bNew = true) { m_bIsInSplit = bNew; }
123 };
124 
125 #endif
126 
127 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Base class of the Writer layout elements.
Definition: frame.hxx:297
bool m_bIsInSplit
Definition: rowfrm.hxx:47
sal_uInt16 mnBottomMarginForLowers
Definition: rowfrm.hxx:39
bool m_bIsFollowFlowRow
note: this is only set on old-style tables!
Definition: rowfrm.hxx:42
SwRowFrame * m_pFollowRow
note: this is only set on old-style tables!
Definition: rowfrm.hxx:36
void SetRowSpanLine(bool bNew)
Definition: rowfrm.hxx:105
sal_uInt16 GetBottomMarginForLowers() const
Definition: rowfrm.hxx:83
void SetBottomMarginForLowers(sal_uInt16 nNew)
Definition: rowfrm.hxx:84
SwTableLine is one table row in the document model.
Definition: swtable.hxx:350
long SwTwips
Definition: swtypes.hxx:49
bool IsRepeatedHeadline() const
Definition: rowfrm.hxx:89
void SetInSplit(bool bNew=true)
Definition: rowfrm.hxx:122
bool m_bForceRowSplitAllowed
Definition: rowfrm.hxx:46
virtual void DestroyImpl() override
Definition: tabfrm.cxx:3800
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:4438
bool IsFollowFlowRow() const
Definition: rowfrm.hxx:96
bool IsRowSpanLine() const
Definition: rowfrm.hxx:104
virtual void Cut() override
Definition: tabfrm.cxx:4539
void SetForceRowSplitAllowed(bool bNew)
Definition: rowfrm.hxx:95
const SwTableLine * m_pTabLine
Definition: rowfrm.hxx:35
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:3817
bool m_bIsRowSpanLine
Definition: rowfrm.hxx:44
sal_uInt16 GetTopMarginForLowers() const
Definition: rowfrm.hxx:81
void SetRepeatedHeadline(bool bNew)
Definition: rowfrm.hxx:90
bool IsForceRowSplitAllowed() const
Definition: rowfrm.hxx:94
SwRowFrame * GetFollowRow() const
Definition: rowfrm.hxx:77
virtual SwTwips ShrinkFrame(SwTwips, bool bTst=false, bool bInfo=false) override
Only change the Frame size, not the PrtArea SSize.
Definition: tabfrm.cxx:4617
A page of the document layout.
Definition: pagefrm.hxx:41
sal_uInt16 mnBottomLineSize
Definition: rowfrm.hxx:40
void SetTopMarginForLowers(sal_uInt16 nNew)
Definition: rowfrm.hxx:82
sal_uInt16 mnTopMarginForLowers
Definition: rowfrm.hxx:38
bool ShouldRowKeepWithNext(const bool bCheckParents=true) const
Definition: tabfrm.cxx:4743
bool IsInSplit() const
Definition: rowfrm.hxx:121
SwRowFrame(const SwTableLine &, SwFrame *, bool bInsertContent=true)
Definition: tabfrm.cxx:3771
sal_uInt16 GetBottomLineSize() const
Definition: rowfrm.hxx:85
virtual void Format(vcl::RenderContext *pRenderContext, const SwBorderAttrs *pAttrs=nullptr) override
"Formats" the Frame; Frame and PrtArea.
Definition: tabfrm.cxx:4269
bool IsRowSplitAllowed() const
Definition: tabfrm.cxx:4720
virtual void Modify(const SfxPoolItem *, const SfxPoolItem *) override
Definition: tabfrm.cxx:3822
virtual void MakeAll(vcl::RenderContext *pRenderContext) override
Definition: tabfrm.cxx:3858
void SetFollowRow(SwRowFrame *pNew)
Definition: rowfrm.hxx:78
bool m_bIsRepeatedHeadline
Definition: rowfrm.hxx:43
A layout frame is a frame that contains other frames (m_pLower), e.g. SwPageFrame or SwTabFrame...
Definition: layfrm.hxx:35
const SwTableLine * GetTabLine() const
Definition: rowfrm.hxx:69
virtual ~SwRowFrame() override
Definition: tabfrm.cxx:3813
void SetFollowFlowRow(bool bNew)
Definition: rowfrm.hxx:97
virtual SwTwips GrowFrame(SwTwips, bool bTst=false, bool bInfo=false) override
Definition: tabfrm.cxx:4550
void SetBottomLineSize(sal_uInt16 nNew)
Definition: rowfrm.hxx:86
SwRowFrame is one table row in the document layout.
Definition: rowfrm.hxx:28