xref: /AOO41X/main/sw/source/core/inc/anchoredobjectposition.hxx (revision 1d2dbeb0b7301723c6d13094e87a8714ef81a328)
1*1d2dbeb0SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*1d2dbeb0SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*1d2dbeb0SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*1d2dbeb0SAndrew Rist  * distributed with this work for additional information
6*1d2dbeb0SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*1d2dbeb0SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*1d2dbeb0SAndrew Rist  * "License"); you may not use this file except in compliance
9*1d2dbeb0SAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
11*1d2dbeb0SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
13*1d2dbeb0SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*1d2dbeb0SAndrew Rist  * software distributed under the License is distributed on an
15*1d2dbeb0SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*1d2dbeb0SAndrew Rist  * KIND, either express or implied.  See the License for the
17*1d2dbeb0SAndrew Rist  * specific language governing permissions and limitations
18*1d2dbeb0SAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
20*1d2dbeb0SAndrew Rist  *************************************************************/
21*1d2dbeb0SAndrew Rist 
22*1d2dbeb0SAndrew Rist 
23cdf0e10cSrcweir #ifndef _ANCHOREDOBJECTPOSITION_HXX
24cdf0e10cSrcweir #define _ANCHOREDOBJECTPOSITION_HXX
25cdf0e10cSrcweir 
26cdf0e10cSrcweir #include <swtypes.hxx>
27cdf0e10cSrcweir // OD 2004-03-16 #i11860#
28cdf0e10cSrcweir #include <frame.hxx>
29cdf0e10cSrcweir 
30cdf0e10cSrcweir class SdrObject;
31cdf0e10cSrcweir class SwFrm;
32cdf0e10cSrcweir class SwFlyFrm;
33cdf0e10cSrcweir class SwContact;
34cdf0e10cSrcweir class SwFrmFmt;
35cdf0e10cSrcweir class SwRect;
36cdf0e10cSrcweir class SvxLRSpaceItem;
37cdf0e10cSrcweir class SvxULSpaceItem;
38cdf0e10cSrcweir class SwFmtHoriOrient;
39cdf0e10cSrcweir // OD 2004-03-23 #i26701#
40cdf0e10cSrcweir class SwAnchoredObject;
41cdf0e10cSrcweir 
42cdf0e10cSrcweir namespace objectpositioning
43cdf0e10cSrcweir {
44cdf0e10cSrcweir     class SwEnvironmentOfAnchoredObject;
45cdf0e10cSrcweir 
46cdf0e10cSrcweir     class SwAnchoredObjectPosition
47cdf0e10cSrcweir     {
48cdf0e10cSrcweir         private:
49cdf0e10cSrcweir             // object to be positioned
50cdf0e10cSrcweir             SdrObject& mrDrawObj;
51cdf0e10cSrcweir 
52cdf0e10cSrcweir          // information about object
53cdf0e10cSrcweir             // does the object represents a Writer fly frame
54cdf0e10cSrcweir             bool mbIsObjFly;
55cdf0e10cSrcweir             // OD 2004-03-23 #i26791# - anchored object the object belongs to;
56cdf0e10cSrcweir             SwAnchoredObject* mpAnchoredObj;
57cdf0e10cSrcweir             // frame the object is anchored at
58cdf0e10cSrcweir             SwFrm* mpAnchorFrm;
59cdf0e10cSrcweir             // contact object
60cdf0e10cSrcweir             SwContact* mpContact;
61cdf0e10cSrcweir             // frame format
62cdf0e10cSrcweir             const SwFrmFmt* mpFrmFmt;
63cdf0e10cSrcweir             // --> OD 2006-03-15 #i62875#
64cdf0e10cSrcweir             bool mbFollowTextFlow;
65cdf0e10cSrcweir             // <--
66cdf0e10cSrcweir             // --> OD 2006-03-15 #i62875#
67cdf0e10cSrcweir             // for compatibility option <DoNotCaptureDrawObjsOnPage>
68cdf0e10cSrcweir             bool mbDoNotCaptureAnchoredObj;
69cdf0e10cSrcweir             // <--
70cdf0e10cSrcweir 
71cdf0e10cSrcweir             /** determine information about object
72cdf0e10cSrcweir 
73cdf0e10cSrcweir                 OD 30.07.2003 #110978#
74cdf0e10cSrcweir                 member <mbIsObjFly>, <mpAnchoredObj>, <mpAnchorFrm>, <mpContact>
75cdf0e10cSrcweir                 and <mpFrmFmt> are set
76cdf0e10cSrcweir 
77cdf0e10cSrcweir                 @author OD
78cdf0e10cSrcweir             */
79cdf0e10cSrcweir             void _GetInfoAboutObj();
80cdf0e10cSrcweir 
81cdf0e10cSrcweir             // --> OD 2006-03-15 #i62875#
82cdf0e10cSrcweir             // --> OD 2009-09-01 #mongolianlayout# - add parameter <bVertL2R>
83cdf0e10cSrcweir             SwTwips _ImplAdjustVertRelPos( const SwTwips nTopOfAnch,
84cdf0e10cSrcweir                                            const bool bVert,
85cdf0e10cSrcweir                                            const bool bVertL2R,
86cdf0e10cSrcweir                                            const SwFrm&  rPageAlignLayFrm,
87cdf0e10cSrcweir                                            const SwTwips nProposedRelPosY,
88cdf0e10cSrcweir                                            const bool bFollowTextFlow,
89cdf0e10cSrcweir                                            const bool bCheckBottom = true ) const;
90cdf0e10cSrcweir             SwTwips _ImplAdjustHoriRelPos( const SwFrm&  _rPageAlignLayFrm,
91cdf0e10cSrcweir                                            const SwTwips _nProposedRelPosX ) const;
92cdf0e10cSrcweir             // <--
93cdf0e10cSrcweir 
94cdf0e10cSrcweir         protected:
95cdf0e10cSrcweir             SwAnchoredObjectPosition( SdrObject& _rDrawObj );
96cdf0e10cSrcweir             virtual ~SwAnchoredObjectPosition();
97cdf0e10cSrcweir 
98cdf0e10cSrcweir          // accessors for object and its corresponding data/information
GetObject() const99cdf0e10cSrcweir             inline SdrObject& GetObject() const
100cdf0e10cSrcweir             {
101cdf0e10cSrcweir                 return mrDrawObj;
102cdf0e10cSrcweir             }
IsObjFly() const103cdf0e10cSrcweir             inline bool IsObjFly() const
104cdf0e10cSrcweir             {
105cdf0e10cSrcweir                 return mbIsObjFly;
106cdf0e10cSrcweir             }
GetAnchoredObj() const107cdf0e10cSrcweir             inline SwAnchoredObject& GetAnchoredObj() const
108cdf0e10cSrcweir             {
109cdf0e10cSrcweir                 return *mpAnchoredObj;
110cdf0e10cSrcweir             }
GetAnchorFrm() const111cdf0e10cSrcweir             inline SwFrm& GetAnchorFrm() const
112cdf0e10cSrcweir             {
113cdf0e10cSrcweir                 return *mpAnchorFrm;
114cdf0e10cSrcweir             }
GetContact() const115cdf0e10cSrcweir             inline SwContact& GetContact() const
116cdf0e10cSrcweir             {
117cdf0e10cSrcweir                 return *mpContact;
118cdf0e10cSrcweir             }
GetFrmFmt() const119cdf0e10cSrcweir             inline const SwFrmFmt& GetFrmFmt() const
120cdf0e10cSrcweir             {
121cdf0e10cSrcweir                 return *mpFrmFmt;
122cdf0e10cSrcweir             }
123cdf0e10cSrcweir             // --> OD 2006-03-15 #i62875#
DoesObjFollowsTextFlow() const124cdf0e10cSrcweir             inline bool DoesObjFollowsTextFlow() const
125cdf0e10cSrcweir             {
126cdf0e10cSrcweir                 return mbFollowTextFlow;
127cdf0e10cSrcweir             }
128cdf0e10cSrcweir             // <--
129cdf0e10cSrcweir 
130cdf0e10cSrcweir          // virtual methods providing data for to character anchored objects.
131cdf0e10cSrcweir             virtual bool IsAnchoredToChar() const;
132cdf0e10cSrcweir             virtual const SwFrm* ToCharOrientFrm() const;
133cdf0e10cSrcweir             virtual const SwRect* ToCharRect() const;
134cdf0e10cSrcweir             // OD 12.11.2003 #i22341#
135cdf0e10cSrcweir             virtual SwTwips ToCharTopOfLine() const;
136cdf0e10cSrcweir 
137cdf0e10cSrcweir         // *********************************************************************
138cdf0e10cSrcweir             /** helper method to determine top of a frame for the vertical
139cdf0e10cSrcweir                 object positioning
140cdf0e10cSrcweir 
141cdf0e10cSrcweir                 OD 2004-03-11 #i11860#
142cdf0e10cSrcweir 
143cdf0e10cSrcweir                 @author OD
144cdf0e10cSrcweir             */
145cdf0e10cSrcweir             SwTwips _GetTopForObjPos( const SwFrm& _rFrm,
146cdf0e10cSrcweir                                       const SwRectFn& _fnRect,
147cdf0e10cSrcweir                                       const bool _bVert ) const;
148cdf0e10cSrcweir 
149cdf0e10cSrcweir         // *********************************************************************
150cdf0e10cSrcweir             void _GetVertAlignmentValues( const SwFrm& _rVertOrientFrm,
151cdf0e10cSrcweir                                           const SwFrm& _rPageAlignLayFrm,
152cdf0e10cSrcweir                                           const sal_Int16 _eRelOrient,
153cdf0e10cSrcweir                                           SwTwips&      _orAlignAreaHeight,
154cdf0e10cSrcweir                                           SwTwips&      _orAlignAreaOffset ) const;
155cdf0e10cSrcweir 
156cdf0e10cSrcweir         // *********************************************************************
157cdf0e10cSrcweir         // --> OD 2004-06-17 #i26791# - add output parameter <_roVertOffsetToFrmAnchorPos>
158cdf0e10cSrcweir             SwTwips _GetVertRelPos( const SwFrm& _rVertOrientFrm,
159cdf0e10cSrcweir                                     const SwFrm& _rPageAlignLayFrm,
160cdf0e10cSrcweir                                     const sal_Int16 _eVertOrient,
161cdf0e10cSrcweir                                     const sal_Int16 _eRelOrient,
162cdf0e10cSrcweir                                     const SwTwips          _nVertPos,
163cdf0e10cSrcweir                                     const SvxLRSpaceItem& _rLRSpacing,
164cdf0e10cSrcweir                                     const SvxULSpaceItem& _rULSpacing,
165cdf0e10cSrcweir                                     SwTwips& _roVertOffsetToFrmAnchorPos ) const;
166cdf0e10cSrcweir 
167cdf0e10cSrcweir         // *********************************************************************
168cdf0e10cSrcweir             /** adjust calculated vertical in order to keep object inside
169cdf0e10cSrcweir                 'page' alignment layout frame.
170cdf0e10cSrcweir 
171cdf0e10cSrcweir                 OD 2004-07-22 #i31805# - add parameter <bCheckBottom>
172cdf0e10cSrcweir                 OD 2004-10-08 #i26945# - add parameter <bFollowTextFlow>
173cdf0e10cSrcweir                 OD 2006-03-15 #i62875# - made inline, intrinsic actions moved
174cdf0e10cSrcweir                 to private method <_ImplAdjustVertRelPos>, which is only
175cdf0e10cSrcweir                 called, if <mbDoNotCaptureAnchoredObj> not set.
176cdf0e10cSrcweir                 OD 2009-09-01 #mongolianlayout# - add parameter <bVertL2R>
177cdf0e10cSrcweir 
178cdf0e10cSrcweir                 @param nTopOfAnch
179cdf0e10cSrcweir                 input parameter - 'vertical' position, at which the relative
180cdf0e10cSrcweir                 position of the object is calculated from.
181cdf0e10cSrcweir 
182cdf0e10cSrcweir                 @param bVert
183cdf0e10cSrcweir                 input parameter - boolean, indicating, if object is in vertical
184cdf0e10cSrcweir                 layout.
185cdf0e10cSrcweir 
186cdf0e10cSrcweir                 @param bVertL2R
187cdf0e10cSrcweir                 input parameter - boolean, indicating, if object is in mongolian
188cdf0e10cSrcweir                 layout (vertical left-to-right layout).
189cdf0e10cSrcweir 
190cdf0e10cSrcweir                 @param rPageAlignLayFrm
191cdf0e10cSrcweir                 input parameter - layout frame, which determines the 'page area'
192cdf0e10cSrcweir                 the object has to be vertical positioned in.
193cdf0e10cSrcweir 
194cdf0e10cSrcweir                 @param nProposedRelPosY
195cdf0e10cSrcweir                 input parameter - proposed relative vertical position, which
196cdf0e10cSrcweir                 will be adjusted.
197cdf0e10cSrcweir 
198cdf0e10cSrcweir                 @param bFollowTextFlow
199cdf0e10cSrcweir                 input parameter - value of attribute 'Follow text flow' of the
200cdf0e10cSrcweir                 anchored object.
201cdf0e10cSrcweir 
202cdf0e10cSrcweir                 @param bCheckBottom
203cdf0e10cSrcweir                 input parameter - boolean indicating, if bottom of anchored
204cdf0e10cSrcweir                 object has to be checked and thus, (if needed) the proposed
205cdf0e10cSrcweir                 relative position has to be adjusted. default value <true>
206cdf0e10cSrcweir 
207cdf0e10cSrcweir                 @author OD
208cdf0e10cSrcweir             */
_AdjustVertRelPos(const SwTwips nTopOfAnch,const bool bVert,const bool bVertL2R,const SwFrm & rPageAlignLayFrm,const SwTwips nProposedRelPosY,const bool bFollowTextFlow,const bool bCheckBottom=true) const209cdf0e10cSrcweir             inline SwTwips _AdjustVertRelPos( const SwTwips nTopOfAnch,
210cdf0e10cSrcweir                                               const bool bVert,
211cdf0e10cSrcweir                                               const bool bVertL2R,
212cdf0e10cSrcweir                                               const SwFrm& rPageAlignLayFrm,
213cdf0e10cSrcweir                                               const SwTwips nProposedRelPosY,
214cdf0e10cSrcweir                                               const bool bFollowTextFlow,
215cdf0e10cSrcweir                                               const bool bCheckBottom = true ) const
216cdf0e10cSrcweir             {
217cdf0e10cSrcweir                 return !mbDoNotCaptureAnchoredObj
218cdf0e10cSrcweir                        ? _ImplAdjustVertRelPos( nTopOfAnch, bVert, bVertL2R,
219cdf0e10cSrcweir                                                 rPageAlignLayFrm,
220cdf0e10cSrcweir                                                 nProposedRelPosY,
221cdf0e10cSrcweir                                                 bFollowTextFlow,
222cdf0e10cSrcweir                                                 bCheckBottom )
223cdf0e10cSrcweir                        : nProposedRelPosY;
224cdf0e10cSrcweir             }
225cdf0e10cSrcweir 
226cdf0e10cSrcweir         // *********************************************************************
227cdf0e10cSrcweir             /** calculate relative horizontal position
228cdf0e10cSrcweir 
229cdf0e10cSrcweir                 --> OD 2004-06-17 #i26791# - add output parameter
230cdf0e10cSrcweir                 <_roHoriOffsetToFrmAnchorPos>
231cdf0e10cSrcweir 
232cdf0e10cSrcweir                 @author OD
233cdf0e10cSrcweir 
234cdf0e10cSrcweir                 @param _rHoriOrientFrm
235cdf0e10cSrcweir                 input parameter - frame the horizontal position of the object
236cdf0e10cSrcweir                 is oriented at.
237cdf0e10cSrcweir 
238cdf0e10cSrcweir                 @param _rEnvOfObj
239cdf0e10cSrcweir                 input parameter - object instance to retrieve environment
240cdf0e10cSrcweir                 information about the object
241cdf0e10cSrcweir 
242cdf0e10cSrcweir                 @param _rHoriOrient
243cdf0e10cSrcweir                 input parameter - horizontal positioning and alignment, for which
244cdf0e10cSrcweir                 the relative position is calculated.
245cdf0e10cSrcweir 
246cdf0e10cSrcweir                 @param _rLRSpacing
247cdf0e10cSrcweir                 input parameter - left and right spacing of the object to the text
248cdf0e10cSrcweir 
249cdf0e10cSrcweir                 @param _rULSpacing
250cdf0e10cSrcweir                 input parameter - upper and lower spacing of the object to the text
251cdf0e10cSrcweir 
252cdf0e10cSrcweir                 @param _bObjWrapThrough
253cdf0e10cSrcweir                 input parameter - boolean indicating, if object has wrap mode
254cdf0e10cSrcweir                 'wrap through'.
255cdf0e10cSrcweir 
256cdf0e10cSrcweir                 @param _nRelPosY
257cdf0e10cSrcweir                 input parameter - relative vertical position
258cdf0e10cSrcweir 
259cdf0e10cSrcweir                 @param _roHoriOffsetToFrmAnchorPos
260cdf0e10cSrcweir                 output parameter - 'horizontal' offset to frame anchor position
261cdf0e10cSrcweir                 according to the alignment
262cdf0e10cSrcweir 
263cdf0e10cSrcweir                 @return relative horizontal position in SwTwips
264cdf0e10cSrcweir             */
265cdf0e10cSrcweir             SwTwips _CalcRelPosX( const SwFrm& _rHoriOrientFrm,
266cdf0e10cSrcweir                                   const SwEnvironmentOfAnchoredObject& _rEnvOfObj,
267cdf0e10cSrcweir                                   const SwFmtHoriOrient& _rHoriOrient,
268cdf0e10cSrcweir                                   const SvxLRSpaceItem& _rLRSpacing,
269cdf0e10cSrcweir                                   const SvxULSpaceItem& _rULSpacing,
270cdf0e10cSrcweir                                   const bool _bObjWrapThrough,
271cdf0e10cSrcweir                                   const SwTwips _nRelPosY,
272cdf0e10cSrcweir                                   SwTwips& _roHoriOffsetToFrmAnchorPos
273cdf0e10cSrcweir                                 ) const;
274cdf0e10cSrcweir 
275cdf0e10cSrcweir         // *********************************************************************
276cdf0e10cSrcweir             /** adjust calculated horizontal in order to keep object inside
277cdf0e10cSrcweir                 'page' alignment layout frame for object type position TO_CNTNT
278cdf0e10cSrcweir 
279cdf0e10cSrcweir                 OD 2006-03-15 #i62875# - made inline, intrinsic actions moved
280cdf0e10cSrcweir                 to private method <_ImplAdjustHoriRelPos>, which is only
281cdf0e10cSrcweir                 called, if <mbDoNotCaptureAnchoredObj> not set.
282cdf0e10cSrcweir 
283cdf0e10cSrcweir                 @author OD
284cdf0e10cSrcweir 
285cdf0e10cSrcweir                 @param _rPageAlignLayFrm
286cdf0e10cSrcweir                 input paramter - layout frame, which determines the 'page area'
287cdf0e10cSrcweir                 the object has to be horizontal positioned in.
288cdf0e10cSrcweir 
289cdf0e10cSrcweir                 @param _nProposedRelPosX
290cdf0e10cSrcweir                 input parameter - proposed relative horizontal position, which
291cdf0e10cSrcweir                 will be adjusted.
292cdf0e10cSrcweir 
293cdf0e10cSrcweir                 @return adjusted relative horizontal position in SwTwips.
294cdf0e10cSrcweir             */
_AdjustHoriRelPos(const SwFrm & _rPageAlignLayFrm,const SwTwips _nProposedRelPosX) const295cdf0e10cSrcweir             inline SwTwips _AdjustHoriRelPos( const SwFrm&  _rPageAlignLayFrm,
296cdf0e10cSrcweir                                               const SwTwips _nProposedRelPosX ) const
297cdf0e10cSrcweir             {
298cdf0e10cSrcweir                 return !mbDoNotCaptureAnchoredObj
299cdf0e10cSrcweir                        ? _ImplAdjustHoriRelPos( _rPageAlignLayFrm, _nProposedRelPosX )
300cdf0e10cSrcweir                        : _nProposedRelPosX;
301cdf0e10cSrcweir             }
302cdf0e10cSrcweir 
303cdf0e10cSrcweir         // *********************************************************************
304cdf0e10cSrcweir             /** toggle given horizontal orientation and relative alignment
305cdf0e10cSrcweir 
306cdf0e10cSrcweir                 @author OD
307cdf0e10cSrcweir 
308cdf0e10cSrcweir                 @param _bToggleLeftRight
309cdf0e10cSrcweir                 input parameter - boolean indicating, if horizontal orientation
310cdf0e10cSrcweir                 and relative alignment has to be toggled.
311cdf0e10cSrcweir 
312cdf0e10cSrcweir                 @param _ioeHoriOrient
313cdf0e10cSrcweir                 input/output parameter - horizontal orientation, that is toggled,
314cdf0e10cSrcweir                 if needed.
315cdf0e10cSrcweir 
316cdf0e10cSrcweir                 @param _iopeRelOrient
317cdf0e10cSrcweir                 optional input/output parameter (default value NULL)
318cdf0e10cSrcweir                 - if set, relative alignment, that is toggled, if needed.
319cdf0e10cSrcweir             */
320cdf0e10cSrcweir             void _ToggleHoriOrientAndAlign( const bool _bToggleLeftRight,
321cdf0e10cSrcweir                                             sal_Int16& _ioeHoriOrient,
322cdf0e10cSrcweir                                             sal_Int16& _iopeRelOrient
323cdf0e10cSrcweir                                           ) const;
324cdf0e10cSrcweir 
325cdf0e10cSrcweir         // *********************************************************************
326cdf0e10cSrcweir             /** determine alignment values for horizontal position of object
327cdf0e10cSrcweir 
328cdf0e10cSrcweir                 @author OD
329cdf0e10cSrcweir 
330cdf0e10cSrcweir                 @param _rHoriOrientFrm
331cdf0e10cSrcweir                 input parameter - frame the horizontal position of the object
332cdf0e10cSrcweir                 is oriented at.
333cdf0e10cSrcweir 
334cdf0e10cSrcweir                 @param _rPageAlignLayFrm
335cdf0e10cSrcweir                 input paramter - layout frame, which determines the 'page area'
336cdf0e10cSrcweir                 the object has to be horizontal positioned in.
337cdf0e10cSrcweir 
338cdf0e10cSrcweir                 @param _eRelOrient
339cdf0e10cSrcweir                 input parameter - horizontal relative alignment, for which
340cdf0e10cSrcweir                 the relative position is calculated.
341cdf0e10cSrcweir 
342cdf0e10cSrcweir                 @param _bToggleLeftRight
343cdf0e10cSrcweir                 input parameter - boolean indicating, if left/right alignments
344cdf0e10cSrcweir                 have to be toggled.
345cdf0e10cSrcweir 
346cdf0e10cSrcweir                 @param _bObjWrapThrough
347cdf0e10cSrcweir                 input parameter - boolean indicating, if object has wrap mode
348cdf0e10cSrcweir                 'wrap through'.
349cdf0e10cSrcweir                 important note: value is only relevant, if _rHoriOrientFrm is
350cdf0e10cSrcweir                                 a text frame.
351cdf0e10cSrcweir 
352cdf0e10cSrcweir                 @param _orAlignAreaWidth
353cdf0e10cSrcweir                 output parameter - width in SwTwips of the area the horizontal
354cdf0e10cSrcweir                 position is aligned to.
355cdf0e10cSrcweir 
356cdf0e10cSrcweir                 @param _orAlignAreaOffset
357cdf0e10cSrcweir                 output parameter - offset in SwTwips of the area the horizontal
358cdf0e10cSrcweir                 position is aligned to. offset is given to the 'left' of the
359cdf0e10cSrcweir                 anchor position.
360cdf0e10cSrcweir 
361cdf0e10cSrcweir                 @param _obAlignedRelToPage
362cdf0e10cSrcweir                 output parameter - boolean indicating, that object is aligned
363cdf0e10cSrcweir                 to 'page area'.
364cdf0e10cSrcweir             */
365cdf0e10cSrcweir             void _GetHoriAlignmentValues( const SwFrm&  _rHoriOrientFrm,
366cdf0e10cSrcweir                                           const SwFrm&  _rPageAlignLayFrm,
367cdf0e10cSrcweir                                           const sal_Int16 _eRelOrient,
368cdf0e10cSrcweir                                           const bool    _bObjWrapThrough,
369cdf0e10cSrcweir                                           SwTwips&      _orAlignAreaWidth,
370cdf0e10cSrcweir                                           SwTwips&      _orAlignAreaOffset,
371cdf0e10cSrcweir                                           bool&         _obAlignedRelToPage ) const;
372cdf0e10cSrcweir 
373cdf0e10cSrcweir         // *********************************************************************
374cdf0e10cSrcweir             /** adjust calculated horizontal position in order to draw object
375cdf0e10cSrcweir                 aside other objects with same positioning
376cdf0e10cSrcweir 
377cdf0e10cSrcweir                 @author OD
378cdf0e10cSrcweir 
379cdf0e10cSrcweir                 @param _rHoriOrientFrm
380cdf0e10cSrcweir                 input parameter - frame the horizontal position of the object
381cdf0e10cSrcweir                 is oriented at.
382cdf0e10cSrcweir 
383cdf0e10cSrcweir                 @param _nProposedRelPosX
384cdf0e10cSrcweir                 input parameter - proposed relative horizontal position, which
385cdf0e10cSrcweir                 will be adjusted.
386cdf0e10cSrcweir 
387cdf0e10cSrcweir                 @param _nRelPosY
388cdf0e10cSrcweir                 input parameter - relative vertical position
389cdf0e10cSrcweir 
390cdf0e10cSrcweir                 @param _eHoriOrient
391cdf0e10cSrcweir                 input parameter - horizontal position of object
392cdf0e10cSrcweir 
393cdf0e10cSrcweir                 @param _eRelOrient
394cdf0e10cSrcweir                 inpt parameter - alignment of object
395cdf0e10cSrcweir 
396cdf0e10cSrcweir                 @param _rLRSpacing
397cdf0e10cSrcweir                 input parameter - left and right spacing of the object to the text
398cdf0e10cSrcweir 
399cdf0e10cSrcweir                 @param _rULSpacing
400cdf0e10cSrcweir                 input parameter - upper and lower spacing of the object to the text
401cdf0e10cSrcweir 
402cdf0e10cSrcweir                 @param _bEvenPage
403cdf0e10cSrcweir                 input parameter - boolean indicating, if object is on an even page.
404cdf0e10cSrcweir 
405cdf0e10cSrcweir                 @return adjusted relative horizontal position in SwTwips
406cdf0e10cSrcweir             */
407cdf0e10cSrcweir             SwTwips _AdjustHoriRelPosForDrawAside( const SwFrm&  _rHoriOrientFrm,
408cdf0e10cSrcweir                                                    const SwTwips _nProposedRelPosX,
409cdf0e10cSrcweir                                                    const SwTwips _nRelPosY,
410cdf0e10cSrcweir                                                    const sal_Int16 _eHoriOrient,
411cdf0e10cSrcweir                                                    const sal_Int16 _eRelOrient,
412cdf0e10cSrcweir                                                    const SvxLRSpaceItem& _rLRSpacing,
413cdf0e10cSrcweir                                                    const SvxULSpaceItem& _rULSpacing,
414cdf0e10cSrcweir                                                    const bool _bEvenPage
415cdf0e10cSrcweir                                                  ) const;
416cdf0e10cSrcweir 
417cdf0e10cSrcweir         // *********************************************************************
418cdf0e10cSrcweir             /** detemine, if object has to draw aside given fly frame
419cdf0e10cSrcweir 
420cdf0e10cSrcweir                 method used by <_AdjustHoriRelPosForDrawAside(..)>
421cdf0e10cSrcweir 
422cdf0e10cSrcweir                 @author OD
423cdf0e10cSrcweir 
424cdf0e10cSrcweir                 @param _pFly
425cdf0e10cSrcweir                 input parameter - fly frame the draw aside check is done for.
426cdf0e10cSrcweir 
427cdf0e10cSrcweir                 @param _rObjRect
428cdf0e10cSrcweir                 input parameter - proposed object rectangle
429cdf0e10cSrcweir 
430cdf0e10cSrcweir                 @param _pObjContext
431cdf0e10cSrcweir                 input parameter - context of the object
432cdf0e10cSrcweir 
433cdf0e10cSrcweir                 @param _nObjIndex
434cdf0e10cSrcweir                 input parameter - index of the anchor frame of the object
435cdf0e10cSrcweir 
436cdf0e10cSrcweir                 @param _bEvenPage
437cdf0e10cSrcweir                 input parameter - boolean indicating, if object is on an even page.
438cdf0e10cSrcweir 
439cdf0e10cSrcweir                 @param _eHoriOrient
440cdf0e10cSrcweir                 input parameter - horizontal position of object
441cdf0e10cSrcweir 
442cdf0e10cSrcweir                 @param _eRelOrient
443cdf0e10cSrcweir                 inpt parameter - alignment of object
444cdf0e10cSrcweir 
445cdf0e10cSrcweir                 @return boolean indicating, if object has to be drawn aside
446cdf0e10cSrcweir                 given fly frame.
447cdf0e10cSrcweir             */
448cdf0e10cSrcweir             bool _DrawAsideFly( const SwFlyFrm* _pFly,
449cdf0e10cSrcweir                                 const SwRect&   _rObjRect,
450cdf0e10cSrcweir                                 const SwFrm*    _pObjContext,
451cdf0e10cSrcweir                                 const sal_uLong     _nObjIndex,
452cdf0e10cSrcweir                                 const bool      _bEvenPage,
453cdf0e10cSrcweir                                 const sal_Int16 _eHoriOrient,
454cdf0e10cSrcweir                                 const sal_Int16 _eRelOrient
455cdf0e10cSrcweir                               ) const;
456cdf0e10cSrcweir 
457cdf0e10cSrcweir         // *********************************************************************
458cdf0e10cSrcweir             /** determine, if object has to draw aside another object
459cdf0e10cSrcweir 
460cdf0e10cSrcweir                 the different alignments of the objects determines, if one has
461cdf0e10cSrcweir                 to draw aside another one. Thus, the given alignment are checked
462cdf0e10cSrcweir                 against each other, which one has to be drawn aside the other one.
463cdf0e10cSrcweir                 depending on parameter _bLeft check is done for left or right
464cdf0e10cSrcweir                 positioning.
465cdf0e10cSrcweir                 method used by <_DrawAsideFly(..)>
466cdf0e10cSrcweir 
467cdf0e10cSrcweir                 @author OD
468cdf0e10cSrcweir 
469cdf0e10cSrcweir                 @param _eRelOrient1
470cdf0e10cSrcweir                 input parameter - alignment 1
471cdf0e10cSrcweir 
472cdf0e10cSrcweir                 @param _eRelOrient2
473cdf0e10cSrcweir                 input parameter - alignment 2
474cdf0e10cSrcweir 
475cdf0e10cSrcweir                 @param _bLeft
476cdf0e10cSrcweir                 input parameter - boolean indicating, if check is done for left
477cdf0e10cSrcweir                 or for right positioning.
478cdf0e10cSrcweir 
479cdf0e10cSrcweir                 @return boolean indicating, if an object with an alignment
480cdf0e10cSrcweir                 <_eRelOrient1> has to be drawn aside an object with an
481cdf0e10cSrcweir                 alignment <_eRelOrient2>
482cdf0e10cSrcweir             */
483cdf0e10cSrcweir             bool _Minor( sal_Int16 _eRelOrient1,
484cdf0e10cSrcweir                          sal_Int16 _eRelOrient2,
485cdf0e10cSrcweir                          bool             _bLeft ) const;
486cdf0e10cSrcweir 
487cdf0e10cSrcweir         public:
488cdf0e10cSrcweir             virtual void CalcPosition() = 0;
489cdf0e10cSrcweir     };
490cdf0e10cSrcweir } // namespace objectpositioning
491cdf0e10cSrcweir 
492cdf0e10cSrcweir #endif
493