1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: layouter.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
33 #include "swtypes.hxx"
41 class IDocumentLayoutAccess
;
43 // --> OD 2004-06-23 #i28701#
44 class SwMovedFwdFrmsByObjPos
;
47 // --> OD 2004-10-05 #i26945#
50 // --> OD 2004-10-22 #i35911#
51 class SwObjsMarkedAsTmpConsiderWrapInfluence
;
52 class SwAnchoredObject
;
54 // --> OD 2005-01-12 #i40155#
58 // --> OD 2006-05-10 #i65250#
59 #include <swtypes.hxx>
69 SwEndnoter
* pEndnoter
;
71 void _CollectEndnotes( SwSectionFrm
* pSect
);
72 BOOL
StartLooping( SwPageFrm
* pPage
);
74 // --> OD 2004-06-23 #i28701#
75 SwMovedFwdFrmsByObjPos
* mpMovedFwdFrms
;
77 // --> OD 2004-10-22 #i35911#
78 SwObjsMarkedAsTmpConsiderWrapInfluence
* mpObjsTmpConsiderWrapInfl
;
80 // --> OD 2005-01-12 #i40155# - data structure to collect frames, which are
81 // marked not to wrap around objects.
82 std::vector
< const SwFrm
* > maFrmsNotToWrap
;
86 // --> OD 2006-05-10 #i65250#
87 // - data structure to collect moving backward layout information
88 struct tMoveBwdLayoutInfoKey
90 // frame ID of flow frame
92 // position of new upper frame
93 SwTwips mnNewUpperPosX
;
94 SwTwips mnNewUpperPosY
;
95 // size of new upper frame
96 SwTwips mnNewUpperWidth
;
97 SwTwips mnNewUpperHeight
;
98 // free space in new upper frame
99 SwTwips mnFreeSpaceInNewUpper
;
103 struct fMoveBwdLayoutInfoKeyHash
105 size_t operator()( const tMoveBwdLayoutInfoKey
& p_key
) const
107 return p_key
.mnFrmId
;
110 struct fMoveBwdLayoutInfoKeyEq
112 bool operator()( const tMoveBwdLayoutInfoKey
& p_key1
,
113 const tMoveBwdLayoutInfoKey
& p_key2
) const
115 return p_key1
.mnFrmId
== p_key2
.mnFrmId
&&
116 p_key1
.mnNewUpperPosX
== p_key2
.mnNewUpperPosX
&&
117 p_key1
.mnNewUpperPosY
== p_key2
.mnNewUpperPosY
&&
118 p_key1
.mnNewUpperWidth
== p_key2
.mnNewUpperWidth
&&
119 p_key1
.mnNewUpperHeight
== p_key2
.mnNewUpperHeight
&&
120 p_key1
.mnFreeSpaceInNewUpper
== p_key2
.mnFreeSpaceInNewUpper
;
123 std::hash_map
< const tMoveBwdLayoutInfoKey
, sal_uInt16
,
124 fMoveBwdLayoutInfoKeyHash
,
125 fMoveBwdLayoutInfoKeyEq
> maMoveBwdLayoutInfo
;
130 void InsertEndnotes( SwSectionFrm
* pSect
);
131 void CollectEndnote( SwFtnFrm
* pFtn
);
132 BOOL
HasEndnotes() const;
134 void LoopControl( SwPageFrm
* pPage
, BYTE nLoop
);
135 void EndLoopControl();
136 void LoopingLouieLight( const SwDoc
& rDoc
, const SwTxtFrm
& rFrm
);
138 static void CollectEndnotes( SwDoc
* pDoc
, SwSectionFrm
* pSect
);
139 static BOOL
Collecting( SwDoc
* pDoc
, SwSectionFrm
* pSect
, SwFtnFrm
* pFtn
);
140 static BOOL
StartLoopControl( SwDoc
* pDoc
, SwPageFrm
*pPage
);
142 // --> OD 2004-06-23 #i28701#
143 static void ClearMovedFwdFrms( const SwDoc
& _rDoc
);
144 static void InsertMovedFwdFrm( const SwDoc
& _rDoc
,
145 const SwTxtFrm
& _rMovedFwdFrmByObjPos
,
146 const sal_uInt32 _nToPageNum
);
147 static bool FrmMovedFwdByObjPos( const SwDoc
& _rDoc
,
148 const SwTxtFrm
& _rTxtFrm
,
149 sal_uInt32
& _ornToPageNum
);
151 // --> OD 2005-01-12 #i40155# - ummark given frame as to be moved forward.
152 static void RemoveMovedFwdFrm( const SwDoc
& _rDoc
,
153 const SwTxtFrm
& _rTxtFrm
);
155 // --> OD 2004-10-05 #i26945#
156 static bool DoesRowContainMovedFwdFrm( const SwDoc
& _rDoc
,
157 const SwRowFrm
& _rRowFrm
);
160 // --> OD 2004-10-22 #i35911#
161 static void ClearObjsTmpConsiderWrapInfluence( const SwDoc
& _rDoc
);
162 static void InsertObjForTmpConsiderWrapInfluence(
164 SwAnchoredObject
& _rAnchoredObj
);
166 // --> OD 2005-01-12 #i40155#
167 static void ClearFrmsNotToWrap( const SwDoc
& _rDoc
);
168 static void InsertFrmNotToWrap( const SwDoc
& _rDoc
,
169 const SwFrm
& _rFrm
);
170 static bool FrmNotToWrap( const IDocumentLayoutAccess
& _rIDLA
,
171 const SwFrm
& _rFrm
);
173 // --> OD 2006-05-10 #i65250#
174 static bool MoveBwdSuppressed( const SwDoc
& p_rDoc
,
175 const SwFlowFrm
& p_rFlowFrm
,
176 const SwLayoutFrm
& p_rNewUpperFrm
);
177 static void ClearMoveBwdLayoutInfo( const SwDoc
& p_rDoc
);
182 extern void LOOPING_LOUIE_LIGHT( bool bCondition
, const SwTxtFrm
& rTxtFrm
);
184 #endif //_LAYOUTER_HXX