merge the formfield patch from ooo-build
[ooovba.git] / sw / source / core / inc / layouter.hxx
blob3101ecba2e869fc01782b067624cb990d9cad773
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: layouter.hxx,v $
10 * $Revision: 1.9 $
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 ************************************************************************/
30 #ifndef _LAYOUTER_HXX
31 #define _LAYOUTER_HXX
33 #include "swtypes.hxx"
35 class SwEndnoter;
36 class SwDoc;
37 class SwSectionFrm;
38 class SwFtnFrm;
39 class SwPageFrm;
40 class SwLooping;
41 class IDocumentLayoutAccess;
43 // --> OD 2004-06-23 #i28701#
44 class SwMovedFwdFrmsByObjPos;
45 class SwTxtFrm;
46 // <--
47 // --> OD 2004-10-05 #i26945#
48 class SwRowFrm;
49 // <--
50 // --> OD 2004-10-22 #i35911#
51 class SwObjsMarkedAsTmpConsiderWrapInfluence;
52 class SwAnchoredObject;
53 // <--
54 // --> OD 2005-01-12 #i40155#
55 #include <vector>
56 class SwFrm;
57 // <--
58 // --> OD 2006-05-10 #i65250#
59 #include <swtypes.hxx>
60 #include <hash_map>
61 class SwFlowFrm;
62 class SwLayoutFrm;
63 // <--
65 #define LOOP_PAGE 1
67 class SwLayouter
69 SwEndnoter* pEndnoter;
70 SwLooping* pLooping;
71 void _CollectEndnotes( SwSectionFrm* pSect );
72 BOOL StartLooping( SwPageFrm* pPage );
74 // --> OD 2004-06-23 #i28701#
75 SwMovedFwdFrmsByObjPos* mpMovedFwdFrms;
76 // <--
77 // --> OD 2004-10-22 #i35911#
78 SwObjsMarkedAsTmpConsiderWrapInfluence* mpObjsTmpConsiderWrapInfl;
79 // <--
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;
83 // <--
85 public:
86 // --> OD 2006-05-10 #i65250#
87 // - data structure to collect moving backward layout information
88 struct tMoveBwdLayoutInfoKey
90 // frame ID of flow frame
91 sal_uInt32 mnFrmId;
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;
102 private:
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;
126 // <--
127 public:
128 SwLayouter();
129 ~SwLayouter();
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 );
150 // <--
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 );
154 // <--
155 // --> OD 2004-10-05 #i26945#
156 static bool DoesRowContainMovedFwdFrm( const SwDoc& _rDoc,
157 const SwRowFrm& _rRowFrm );
158 // <--
160 // --> OD 2004-10-22 #i35911#
161 static void ClearObjsTmpConsiderWrapInfluence( const SwDoc& _rDoc );
162 static void InsertObjForTmpConsiderWrapInfluence(
163 const SwDoc& _rDoc,
164 SwAnchoredObject& _rAnchoredObj );
165 // <--
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 );
172 // <--
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 );
178 // <--
182 extern void LOOPING_LOUIE_LIGHT( bool bCondition, const SwTxtFrm& rTxtFrm );
184 #endif //_LAYOUTER_HXX