merge the formfield patch from ooo-build
[ooovba.git] / sw / source / core / layout / objectformattertxtfrm.hxx
bloba4d842601114ac9d64027d404c22d8ca62b018a8
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: objectformattertxtfrm.hxx,v $
10 * $Revision: 1.10 $
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 _OBJECTFORMATTERTXTFRM_HXX
31 #define _OBJECTFORMATTERTXTFRM_HXX
33 #include <objectformatter.hxx>
34 #include <sal/types.h>
36 class SwTxtFrm;
38 // -----------------------------------------------------------------------------
39 // OD 2004-07-01 #i28701#
40 // Format floating screen objects, which are anchored at a given anchor text frame
41 // and registered at the given page frame.
42 // -----------------------------------------------------------------------------
43 class SwObjectFormatterTxtFrm : public SwObjectFormatter
45 private:
46 // anchor text frame
47 SwTxtFrm& mrAnchorTxtFrm;
49 // 'master' anchor text frame
50 SwTxtFrm* mpMasterAnchorTxtFrm;
52 SwObjectFormatterTxtFrm( SwTxtFrm& _rAnchorTxtFrm,
53 const SwPageFrm& _rPageFrm,
54 SwTxtFrm* _pMasterAnchorTxtFrm,
55 SwLayAction* _pLayAction );
57 /* method to invalidate objects, anchored previous to given object at
58 the anchor text frame
60 @param _rAnchoredObj
61 reference to anchored object - objects, anchored previous to
62 this one will be invalidated.
64 @author OD
66 void _InvalidatePrevObjs( SwAnchoredObject& _rAnchoredObj );
68 /* method to invalidate objects, anchored after the given object at
69 the page frame
71 @param _rAnchoredObj
72 reference to anchored object - objects, anchored after this one will
73 be invalidated.
75 @param _bInclObj
76 boolean indicates, if given anchored object <_rAnchoredObj> also have
77 to be invalidated.
79 @author OD
81 void _InvalidateFollowObjs( SwAnchoredObject& _rAnchoredObj,
82 const bool _bInclObj );
84 /** method to determine first anchored object, whose 'anchor is moved
85 forward'.
87 'anchor (of an object) is moved forward', if the anchor frame
88 respectively the anchor character of the object isn't on the
89 proposed page frame. Instead its on a following page
90 OD 2004-10-04 #i26945# - For at-character anchored objects,
91 it has also to be checked, if the anchor character is in a follow
92 text frame, which would move to the next page.
93 OD 2005-03-30 #i43913# - add output parameter <_boInFollow>
95 @author OD
97 @param _nWrapInfluenceOnPosition
98 input parameter - only object with this given wrapping style
99 influence are investigated.
101 @param _nFromPageNum
102 input parameter - number of page frame, the 'anchor' should be
104 @param _noToPageNum
105 output parameter - number of page frame, the 'anchor' of the returned
106 anchored object is.
108 @param _boInFollow
109 output parameter - boolean, indicating that anchor text frame is
110 currently on the same page, but it's a follow of in a follow row,
111 which will move forward. value only relevant, if method returns
112 an anchored object
114 @return SwAnchoredObject*
115 anchored object with a 'moved forward anchor'. If NULL, no such
116 anchored object is found.
118 SwAnchoredObject* _GetFirstObjWithMovedFwdAnchor(
119 const sal_Int16 _nWrapInfluenceOnPosition,
120 sal_uInt32& _noToPageNum,
121 bool& _boInFollow );
123 /** method to format the anchor frame for checking of the move forward condition
125 OD 2005-01-11 #i40141#
127 @author OD
129 void _FormatAnchorFrmForCheckMoveFwd();
131 /** method to determine if at least one anchored object has state
132 <temporarly consider wrapping style influence> set.
134 OD 2006-07-24 #b6449874#
136 @author OD
138 bool _AtLeastOneObjIsTmpConsiderWrapInfluence();
140 protected:
142 virtual SwFrm& GetAnchorFrm();
144 public:
145 virtual ~SwObjectFormatterTxtFrm();
147 // --> OD 2005-01-10 #i40147# - add parameter <_bCheckForMovedFwd>.
148 virtual bool DoFormatObj( SwAnchoredObject& _rAnchoredObj,
149 const bool _bCheckForMovedFwd = false );
150 // <--
151 virtual bool DoFormatObjs();
153 /** method to create an instance of <SwObjectFormatterTxtFrm> is
154 necessary.
156 @author OD
158 static SwObjectFormatterTxtFrm* CreateObjFormatter(
159 SwTxtFrm& _rAnchorTxtFrm,
160 const SwPageFrm& _rPageFrm,
161 SwLayAction* _pLayAction );
163 /** method to format given anchor text frame and its previous frames
165 OD 2005-11-17 #i56300#
166 Usage: Needed to check, if the anchor text frame is moved forward
167 due to the positioning and wrapping of its anchored objects, and
168 to format the frames, which have become invalid due to the anchored
169 object formatting in the iterative object positioning algorithm
171 @author OD
173 @param _rAnchorTxtFrm
174 input parameter - reference to anchor text frame, which has to be
175 formatted including its previous frames of the page.
177 static void FormatAnchorFrmAndItsPrevs( SwTxtFrm& _rAnchorTxtFrm );
179 /** method to check the conditions, if 'anchor is moved forward'
181 OD 2004-10-11 #i26945#
182 OD 2005-03-30 #i43913# - add output parameter <_boInFollow>
183 OD 2006-01-27 #i58182# - replace method by a corresponding static
184 method, because it's needed for the iterative positioning algorithm.
186 @author OD
188 @param _rAnchoredObj
189 input parameter - anchored object, for which the condition has to checked.
191 @param _nFromPageNum
192 input parameter - number of the page, on which the check is performed
194 @param _bAnchoredAtMasterBeforeFormatAnchor
195 input parameter - boolean indicating, that the given anchored object
196 was anchored at the master frame before the anchor frame has been
197 formatted.
199 @param _noToPageNum
200 output parameter - number of page frame, the 'anchor' of the returned
201 anchored object is.
203 @param _boInFollow
204 output parameter - boolean, indicating that anchor text frame is
205 currently on the same page, but it's a follow of in a follow row,
206 which will move forward. value only relevant, if method return <true>.
208 @return boolean
209 indicating, if 'anchor is moved forward'
211 static bool CheckMovedFwdCondition( SwAnchoredObject& _rAnchoredObj,
212 const sal_uInt32 _nFromPageNum,
213 const bool _bAnchoredAtMasterBeforeFormatAnchor,
214 sal_uInt32& _noToPageNum,
215 bool& _boInFollow );
218 #endif