Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : : #ifndef _LAYOUTER_HXX
29 : : #define _LAYOUTER_HXX
30 : :
31 : : #include "swtypes.hxx"
32 : :
33 : : class SwEndnoter;
34 : : class SwDoc;
35 : : class SwSectionFrm;
36 : : class SwFtnFrm;
37 : : class SwPageFrm;
38 : : class SwLooping;
39 : :
40 : : // --> #i28701#
41 : : class SwMovedFwdFrmsByObjPos;
42 : : class SwTxtFrm;
43 : : // --> #i26945#
44 : : class SwRowFrm;
45 : : // --> #i35911#
46 : : class SwObjsMarkedAsTmpConsiderWrapInfluence;
47 : : class SwAnchoredObject;
48 : : // --> #i65250#
49 : : #include <boost/unordered_map.hpp>
50 : : class SwFlowFrm;
51 : : class SwLayoutFrm;
52 : :
53 : : #define LOOP_PAGE 1
54 : :
55 : : class SwLayouter
56 : : {
57 : : SwEndnoter* pEndnoter;
58 : : SwLooping* pLooping;
59 : : void _CollectEndnotes( SwSectionFrm* pSect );
60 : : sal_Bool StartLooping( SwPageFrm* pPage );
61 : :
62 : : // --> #i28701#
63 : : SwMovedFwdFrmsByObjPos* mpMovedFwdFrms;
64 : : // --> #i35911#
65 : : SwObjsMarkedAsTmpConsiderWrapInfluence* mpObjsTmpConsiderWrapInfl;
66 : :
67 : : public:
68 : : // --> #i65250#
69 : : // - data structure to collect moving backward layout information
70 : : struct tMoveBwdLayoutInfoKey
71 : : {
72 : : // frame ID of flow frame
73 : : sal_uInt32 mnFrmId;
74 : : // position of new upper frame
75 : : SwTwips mnNewUpperPosX;
76 : : SwTwips mnNewUpperPosY;
77 : : // size of new upper frame
78 : : SwTwips mnNewUpperWidth;
79 : : SwTwips mnNewUpperHeight;
80 : : // free space in new upper frame
81 : : SwTwips mnFreeSpaceInNewUpper;
82 : :
83 : : };
84 : : private:
85 : : struct fMoveBwdLayoutInfoKeyHash
86 : : {
87 : 74 : size_t operator()( const tMoveBwdLayoutInfoKey& p_key ) const
88 : : {
89 : 74 : return p_key.mnFrmId;
90 : : }
91 : : };
92 : : struct fMoveBwdLayoutInfoKeyEq
93 : : {
94 : 26 : bool operator()( const tMoveBwdLayoutInfoKey& p_key1,
95 : : const tMoveBwdLayoutInfoKey& p_key2 ) const
96 : : {
97 : : return p_key1.mnFrmId == p_key2.mnFrmId &&
98 : : p_key1.mnNewUpperPosX == p_key2.mnNewUpperPosX &&
99 : : p_key1.mnNewUpperPosY == p_key2.mnNewUpperPosY &&
100 : : p_key1.mnNewUpperWidth == p_key2.mnNewUpperWidth &&
101 : : p_key1.mnNewUpperHeight == p_key2.mnNewUpperHeight &&
102 [ + - ][ + - ]: 26 : p_key1.mnFreeSpaceInNewUpper == p_key2.mnFreeSpaceInNewUpper;
[ + - ][ + - ]
[ + + ][ + - ]
103 : : }
104 : : };
105 : : boost::unordered_map< const tMoveBwdLayoutInfoKey, sal_uInt16,
106 : : fMoveBwdLayoutInfoKeyHash,
107 : : fMoveBwdLayoutInfoKeyEq > maMoveBwdLayoutInfo;
108 : : public:
109 : : SwLayouter();
110 : : ~SwLayouter();
111 : : void InsertEndnotes( SwSectionFrm* pSect );
112 : : void CollectEndnote( SwFtnFrm* pFtn );
113 : : sal_Bool HasEndnotes() const;
114 : :
115 : : void LoopControl( SwPageFrm* pPage, sal_uInt8 nLoop );
116 : : void EndLoopControl();
117 : : void LoopingLouieLight( const SwDoc& rDoc, const SwTxtFrm& rFrm );
118 : :
119 : : static void CollectEndnotes( SwDoc* pDoc, SwSectionFrm* pSect );
120 : : static sal_Bool Collecting( SwDoc* pDoc, SwSectionFrm* pSect, SwFtnFrm* pFtn );
121 : : static sal_Bool StartLoopControl( SwDoc* pDoc, SwPageFrm *pPage );
122 : :
123 : : // --> #i28701#
124 : : static void ClearMovedFwdFrms( const SwDoc& _rDoc );
125 : : static void InsertMovedFwdFrm( const SwDoc& _rDoc,
126 : : const SwTxtFrm& _rMovedFwdFrmByObjPos,
127 : : const sal_uInt32 _nToPageNum );
128 : : static bool FrmMovedFwdByObjPos( const SwDoc& _rDoc,
129 : : const SwTxtFrm& _rTxtFrm,
130 : : sal_uInt32& _ornToPageNum );
131 : : // --> #i40155# - ummark given frame as to be moved forward.
132 : : static void RemoveMovedFwdFrm( const SwDoc& _rDoc,
133 : : const SwTxtFrm& _rTxtFrm );
134 : : // --> #i26945#
135 : : static bool DoesRowContainMovedFwdFrm( const SwDoc& _rDoc,
136 : : const SwRowFrm& _rRowFrm );
137 : :
138 : : // --> #i35911#
139 : : static void ClearObjsTmpConsiderWrapInfluence( const SwDoc& _rDoc );
140 : : static void InsertObjForTmpConsiderWrapInfluence(
141 : : const SwDoc& _rDoc,
142 : : SwAnchoredObject& _rAnchoredObj );
143 : : // --> #i65250#
144 : : static bool MoveBwdSuppressed( const SwDoc& p_rDoc,
145 : : const SwFlowFrm& p_rFlowFrm,
146 : : const SwLayoutFrm& p_rNewUpperFrm );
147 : : static void ClearMoveBwdLayoutInfo( const SwDoc& p_rDoc );
148 : : };
149 : :
150 : :
151 : : extern void LOOPING_LOUIE_LIGHT( bool bCondition, const SwTxtFrm& rTxtFrm );
152 : :
153 : : #endif //_LAYOUTER_HXX
154 : :
155 : :
156 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|