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