LibreOffice Module sw (master)  1
layouter.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_LAYOUTER_HXX
20 #define INCLUDED_SW_SOURCE_CORE_INC_LAYOUTER_HXX
21 
22 #include <swtypes.hxx>
23 #include <unordered_map>
24 #include <memory>
25 
26 class SwEndnoter;
27 class SwDoc;
28 class SwSectionFrame;
29 class SwFootnoteFrame;
30 class SwPageFrame;
31 class SwLooping;
32 
34 class SwTextFrame;
35 class SwRowFrame;
37 class SwAnchoredObject;
38 class SwFlowFrame;
39 class SwLayoutFrame;
40 
41 #define LOOP_PAGE 1
42 
44 {
45  std::unique_ptr<SwEndnoter> mpEndnoter;
46  std::unique_ptr<SwLooping> mpLooping;
47  void CollectEndnotes_( SwSectionFrame* pSect );
48  bool StartLooping( SwPageFrame const * pPage );
49 
50  // --> #i28701#
51  std::unique_ptr<SwMovedFwdFramesByObjPos> mpMovedFwdFrames;
52  // --> #i35911#
53  std::unique_ptr<SwObjsMarkedAsTmpConsiderWrapInfluence> mpObjsTmpConsiderWrapInfl;
54 
55 public:
56  // --> #i65250#
57  // - data structure to collect moving backward layout information
59  {
60  // frame ID of flow frame
61  sal_uInt32 mnFrameId;
62  // position of new upper frame
65  // size of new upper frame
68  // free space in new upper frame
70 
71  };
72 private:
74  {
75  size_t operator()( const tMoveBwdLayoutInfoKey& p_key ) const
76  {
77  return p_key.mnFrameId;
78  }
79  };
81  {
82  bool operator()( const tMoveBwdLayoutInfoKey& p_key1,
83  const tMoveBwdLayoutInfoKey& p_key2 ) const
84  {
85  return p_key1.mnFrameId == p_key2.mnFrameId &&
86  p_key1.mnNewUpperPosX == p_key2.mnNewUpperPosX &&
87  p_key1.mnNewUpperPosY == p_key2.mnNewUpperPosY &&
88  p_key1.mnNewUpperWidth == p_key2.mnNewUpperWidth &&
89  p_key1.mnNewUpperHeight == p_key2.mnNewUpperHeight &&
91  }
92  };
93  std::unordered_map< tMoveBwdLayoutInfoKey, sal_uInt16,
94  fMoveBwdLayoutInfoKeyHash,
96 public:
97  SwLayouter();
98  ~SwLayouter();
99  void InsertEndnotes( SwSectionFrame const * pSect );
100  void CollectEndnote( SwFootnoteFrame* pFootnote );
101  bool HasEndnotes() const;
102 
103  void LoopControl( SwPageFrame* pPage );
104  void EndLoopControl();
105  void LoopingLouieLight( const SwDoc& rDoc, const SwTextFrame& rFrame );
106 
107  static void CollectEndnotes( SwDoc* pDoc, SwSectionFrame* pSect );
108  static bool Collecting( SwDoc* pDoc, SwSectionFrame const * pSect, SwFootnoteFrame* pFootnote );
109  static bool StartLoopControl( SwDoc* pDoc, SwPageFrame const *pPage );
110 
111  // --> #i28701#
112  static void ClearMovedFwdFrames( const SwDoc& _rDoc );
113  static void InsertMovedFwdFrame( const SwDoc& _rDoc,
114  const SwTextFrame& _rMovedFwdFrameByObjPos,
115  const sal_uInt32 _nToPageNum );
116  static bool FrameMovedFwdByObjPos( const SwDoc& _rDoc,
117  const SwTextFrame& _rTextFrame,
118  sal_uInt32& _ornToPageNum );
119  // --> #i40155# - unmark given frame as to be moved forward.
120  static void RemoveMovedFwdFrame( const SwDoc& _rDoc,
121  const SwTextFrame& _rTextFrame );
122  // --> #i26945#
123  static bool DoesRowContainMovedFwdFrame( const SwDoc& _rDoc,
124  const SwRowFrame& _rRowFrame );
125 
126  // --> #i35911#
127  static void ClearObjsTmpConsiderWrapInfluence( const SwDoc& _rDoc );
129  const SwDoc& _rDoc,
130  SwAnchoredObject& _rAnchoredObj );
132  const SwDoc& _rDoc,
133  SwAnchoredObject& _rAnchoredObj );
134 
135  // --> #i65250#
136  static bool MoveBwdSuppressed( const SwDoc& p_rDoc,
137  const SwFlowFrame& p_rFlowFrame,
138  const SwLayoutFrame& p_rNewUpperFrame );
139  static void ClearMoveBwdLayoutInfo( const SwDoc& p_rDoc );
140 };
141 
142 extern void LOOPING_LOUIE_LIGHT( bool bCondition, const SwTextFrame& rTextFrame );
143 
144 #endif // INCLUDED_SW_SOURCE_CORE_INC_LAYOUTER_HXX
145 
146 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Base class that provides the general functionalities for frames that are allowed at page breaks (flow...
Definition: flowfrm.hxx:58
Represents the visualization of a paragraph.
Definition: txtfrm.hxx:149
void LoopControl(SwPageFrame *pPage)
Definition: layouter.cxx:236
std::unique_ptr< SwObjsMarkedAsTmpConsiderWrapInfluence > mpObjsTmpConsiderWrapInfl
Definition: layouter.hxx:53
void LOOPING_LOUIE_LIGHT(bool bCondition, const SwTextFrame &rTextFrame)
Definition: layouter.cxx:423
size_t operator()(const tMoveBwdLayoutInfoKey &p_key) const
Definition: layouter.hxx:75
static void ClearObjsTmpConsiderWrapInfluence(const SwDoc &_rDoc)
Definition: layouter.cxx:382
Definition: doc.hxx:185
bool StartLooping(SwPageFrame const *pPage)
Definition: layouter.cxx:253
long SwTwips
Definition: swtypes.hxx:49
static bool StartLoopControl(SwDoc *pDoc, SwPageFrame const *pPage)
Definition: layouter.cxx:290
std::unique_ptr< SwMovedFwdFramesByObjPos > mpMovedFwdFrames
Definition: layouter.hxx:51
static void InsertObjForTmpConsiderWrapInfluence(const SwDoc &_rDoc, SwAnchoredObject &_rAnchoredObj)
Definition: layouter.cxx:391
static bool Collecting(SwDoc *pDoc, SwSectionFrame const *pSect, SwFootnoteFrame *pFootnote)
Definition: layouter.cxx:274
wrapper class for the positioning of Writer fly frames and drawing objects
void CollectEndnote(SwFootnoteFrame *pFootnote)
Definition: layouter.cxx:224
void EndLoopControl()
Definition: layouter.cxx:261
static bool DoesRowContainMovedFwdFrame(const SwDoc &_rDoc, const SwRowFrame &_rRowFrame)
Definition: layouter.cxx:363
static void RemoveObjForTmpConsiderWrapInfluence(const SwDoc &_rDoc, SwAnchoredObject &_rAnchoredObj)
Definition: layouter.cxx:409
std::unique_ptr< SwEndnoter > mpEndnoter
Definition: layouter.hxx:45
std::unordered_map< tMoveBwdLayoutInfoKey, sal_uInt16, fMoveBwdLayoutInfoKeyHash, fMoveBwdLayoutInfoKeyEq > maMoveBwdLayoutInfo
Definition: layouter.hxx:95
static bool MoveBwdSuppressed(const SwDoc &p_rDoc, const SwFlowFrame &p_rFlowFrame, const SwLayoutFrame &p_rNewUpperFrame)
Definition: layouter.cxx:436
std::unique_ptr< SwLooping > mpLooping
Definition: layouter.hxx:46
static void RemoveMovedFwdFrame(const SwDoc &_rDoc, const SwTextFrame &_rTextFrame)
Definition: layouter.cxx:331
bool operator()(const tMoveBwdLayoutInfoKey &p_key1, const tMoveBwdLayoutInfoKey &p_key2) const
Definition: layouter.hxx:82
A page of the document layout.
Definition: pagefrm.hxx:40
void InsertEndnotes(SwSectionFrame const *pSect)
Definition: layouter.cxx:229
static void ClearMoveBwdLayoutInfo(const SwDoc &p_rDoc)
Definition: layouter.cxx:476
void LoopingLouieLight(const SwDoc &rDoc, const SwTextFrame &rFrame)
Definition: layouter.cxx:242
A layout frame is a frame that contains other frames (m_pLower), e.g. SwPageFrame or SwTabFrame...
Definition: layfrm.hxx:35
static bool FrameMovedFwdByObjPos(const SwDoc &_rDoc, const SwTextFrame &_rTextFrame, sal_uInt32 &_ornToPageNum)
Definition: layouter.cxx:341
bool HasEndnotes() const
Definition: layouter.cxx:219
static void CollectEndnotes(SwDoc *pDoc, SwSectionFrame *pSect)
Definition: layouter.cxx:266
static void InsertMovedFwdFrame(const SwDoc &_rDoc, const SwTextFrame &_rMovedFwdFrameByObjPos, const sal_uInt32 _nToPageNum)
Definition: layouter.cxx:311
SwRowFrame is one table row in the document layout.
Definition: rowfrm.hxx:28
void CollectEndnotes_(SwSectionFrame *pSect)
Definition: layouter.cxx:212
static void ClearMovedFwdFrames(const SwDoc &_rDoc)
Definition: layouter.cxx:302