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
26class SwEndnoter;
27class SwDoc;
28class SwSectionFrame;
29class SwFootnoteFrame;
30class SwPageFrame;
31class SwLooping;
32
34class SwTextFrame;
35class SwRowFrame;
38class SwFlowFrame;
39class 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
55public:
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 };
72private:
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,
96public:
97 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
142extern 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: */
wrapper class for the positioning of Writer fly frames and drawing objects
Definition: doc.hxx:197
Represents one footnote or endnote in the layout.
Definition: ftnfrm.hxx:84
A layout frame is a frame that contains other frames (m_pLower), e.g. SwPageFrame or SwTabFrame.
Definition: layfrm.hxx:36
std::unordered_map< tMoveBwdLayoutInfoKey, sal_uInt16, fMoveBwdLayoutInfoKeyHash, fMoveBwdLayoutInfoKeyEq > maMoveBwdLayoutInfo
Definition: layouter.hxx:95
static bool DoesRowContainMovedFwdFrame(const SwDoc &_rDoc, const SwRowFrame &_rRowFrame)
Definition: layouter.cxx:360
void LoopingLouieLight(const SwDoc &rDoc, const SwTextFrame &rFrame)
Definition: layouter.cxx:241
static bool StartLoopControl(SwDoc *pDoc, SwPageFrame const *pPage)
Definition: layouter.cxx:287
static void InsertMovedFwdFrame(const SwDoc &_rDoc, const SwTextFrame &_rMovedFwdFrameByObjPos, const sal_uInt32 _nToPageNum)
Definition: layouter.cxx:308
std::unique_ptr< SwObjsMarkedAsTmpConsiderWrapInfluence > mpObjsTmpConsiderWrapInfl
Definition: layouter.hxx:53
static void ClearMovedFwdFrames(const SwDoc &_rDoc)
Definition: layouter.cxx:299
static void ClearMoveBwdLayoutInfo(const SwDoc &p_rDoc)
Definition: layouter.cxx:473
void InsertEndnotes(SwSectionFrame const *pSect)
Definition: layouter.cxx:228
static bool FrameMovedFwdByObjPos(const SwDoc &_rDoc, const SwTextFrame &_rTextFrame, sal_uInt32 &_ornToPageNum)
Definition: layouter.cxx:338
static void RemoveObjForTmpConsiderWrapInfluence(const SwDoc &_rDoc, SwAnchoredObject &_rAnchoredObj)
Definition: layouter.cxx:406
bool StartLooping(SwPageFrame const *pPage)
Definition: layouter.cxx:250
static void ClearObjsTmpConsiderWrapInfluence(const SwDoc &_rDoc)
Definition: layouter.cxx:379
std::unique_ptr< SwLooping > mpLooping
Definition: layouter.hxx:46
bool HasEndnotes() const
Definition: layouter.cxx:218
static void RemoveMovedFwdFrame(const SwDoc &_rDoc, const SwTextFrame &_rTextFrame)
Definition: layouter.cxx:328
void EndLoopControl()
Definition: layouter.cxx:258
std::unique_ptr< SwEndnoter > mpEndnoter
Definition: layouter.hxx:45
static void InsertObjForTmpConsiderWrapInfluence(const SwDoc &_rDoc, SwAnchoredObject &_rAnchoredObj)
Definition: layouter.cxx:388
static bool Collecting(SwDoc *pDoc, SwSectionFrame const *pSect, SwFootnoteFrame *pFootnote)
Definition: layouter.cxx:271
std::unique_ptr< SwMovedFwdFramesByObjPos > mpMovedFwdFrames
Definition: layouter.hxx:51
static bool MoveBwdSuppressed(const SwDoc &p_rDoc, const SwFlowFrame &p_rFlowFrame, const SwLayoutFrame &p_rNewUpperFrame)
Definition: layouter.cxx:433
void LoopControl(SwPageFrame *pPage)
Definition: layouter.cxx:235
void CollectEndnotes_(SwSectionFrame *pSect)
Definition: layouter.cxx:211
void CollectEndnote(SwFootnoteFrame *pFootnote)
Definition: layouter.cxx:223
static void CollectEndnotes(SwDoc *pDoc, SwSectionFrame *pSect)
Definition: layouter.cxx:263
A page of the document layout.
Definition: pagefrm.hxx:60
SwRowFrame is one table row in the document layout.
Definition: rowfrm.hxx:29
Represents the visualization of a paragraph.
Definition: txtfrm.hxx:168
void LOOPING_LOUIE_LIGHT(bool bCondition, const SwTextFrame &rTextFrame)
Definition: layouter.cxx:420
bool operator()(const tMoveBwdLayoutInfoKey &p_key1, const tMoveBwdLayoutInfoKey &p_key2) const
Definition: layouter.hxx:82
size_t operator()(const tMoveBwdLayoutInfoKey &p_key) const
Definition: layouter.hxx:75
tools::Long SwTwips
Definition: swtypes.hxx:51