merge the formfield patch from ooo-build
[ooovba.git] / sw / source / core / inc / tocntntanchoredobjectposition.hxx
blob4ae5d0e6d931eee51ac1a13dc1a24378eba15de2
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: tocntntanchoredobjectposition.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 _TOCNTNTANCHOREDOBJECTPOSITION_HXX
31 #define _TOCNTNTANCHOREDOBJECTPOSITION_HXX
32 #include <anchoredobjectposition.hxx>
34 class SwFrm;
35 class SwTxtFrm;
36 class SwLayoutFrm;
37 class SwRect;
39 namespace objectpositioning
41 class SwToCntntAnchoredObjectPosition : public SwAnchoredObjectPosition
43 private:
44 // calculated data for object position
45 const SwLayoutFrm* mpVertPosOrientFrm;
46 // --> OD 2004-06-17 #i26791#
47 // determine offset to frame anchor position according to the
48 // positioning alignments
49 Point maOffsetToFrmAnchorPos;
51 // data for calculation of position
52 bool mbAnchorToChar;
53 const SwFrm* mpToCharOrientFrm;
54 const SwRect* mpToCharRect;
55 SwTwips mnToCharTopOfLine;
57 virtual bool IsAnchoredToChar() const;
58 virtual const SwFrm* ToCharOrientFrm() const;
59 virtual const SwRect* ToCharRect() const;
60 // OD 12.11.2003 #i22341#
61 virtual SwTwips ToCharTopOfLine() const;
63 // method to cast <SwAnchoredObjectPosition::GetAnchorFrm()> to
64 // the needed type
65 SwTxtFrm& GetAnchorTxtFrm() const;
67 // *********************************************************************
68 /** determine frame for horizontal position
70 OD 04.08.2003
71 if the given proposed frame is a content frame, the proposed
72 frame is returned.
73 otherwise (given proposed frame is a layout frame),
74 the lower content frames of the proposed frame are checked
75 for the first, that the anchor or a follow of the anchor.
76 If none is found, the proposed frame is returned.
78 @author OD
80 @param _pProposedFrm
81 input parameter - proposed frame for horizontal position
83 @return constant reference to <SwFrm> object, at which the
84 horizontal position is determined.
86 const SwFrm& _GetHoriVirtualAnchor( const SwLayoutFrm& _pProposedFrm ) const;
88 public:
89 SwToCntntAnchoredObjectPosition( SdrObject& _rDrawObj );
90 virtual ~SwToCntntAnchoredObjectPosition();
92 /** calculate position of object
94 @author OD
96 virtual void CalcPosition();
98 /** frame, at which the vertical position is oriented at
100 @author OD
102 const SwLayoutFrm& GetVertPosOrientFrm() const;
104 } // namespace objectpositioning
106 #endif