xref: /AOO41X/main/sw/source/core/inc/environmentofanchoredobject.hxx (revision cdf0e10c4e3984b49a9502b011690b615761d4a3)
1  /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 #ifndef _ENVIRONMENTOFANCHOREDOBJECT_HXX
28 #define _ENVIRONMENTOFANCHOREDOBJECT_HXX
29 
30 class SwFrm;
31 class SwLayoutFrm;
32 
33 namespace objectpositioning
34 {
35     class SwEnvironmentOfAnchoredObject
36     {
37         private:
38             const bool mbFollowTextFlow;
39 
40         public:
41             /** construtor
42 
43                 OD 05.11.2003
44 
45                 @author OD
46 
47                 @param _bFollowTextFlow
48                 input parameter - indicates, if the anchored object, for which
49                 this environment is instantiated, follow the text flow or not
50             */
51             SwEnvironmentOfAnchoredObject( const bool _bFollowTextFlow );
52 
53             /** destructor
54 
55                 OD 05.11.2003
56 
57                 @author OD
58             */
59             ~SwEnvironmentOfAnchoredObject();
60 
61             /** determine environment layout frame for possible horizontal object
62                 positions respectively for alignment to 'page areas'
63 
64                 OD 05.11.2003
65                 this is, if object has to follow the text flow:
66                 - cell frame, if anchored inside a cell
67                 - fly frame, if anchored inside a fly frame
68                 otherwise it's the page frame
69 
70                 this is, if object hasn't to follow the text flow:
71                 - page frame.
72                 OD 2005-01-20 #118546# - no exception any more. Thus remove
73                 parameter <_bForPageAlignment>
74 
75                 @author OD
76 
77                 @param _rHoriOrientFrm
78                 input parameter - frame, at which the horizontal position is
79                 oriented at (typically it's the anchor frame).
80                 starting point for the search of the layout frame.
81 
82                 @return reference to the layout frame, which determines the
83                 the horizontal environment the object has to be positioned in.
84             */
85             const SwLayoutFrm& GetHoriEnvironmentLayoutFrm( const SwFrm& _rHoriOrientFrm ) const;
86 
87             /** determine environment layout frame for possible vertical object
88                 positions respectively for alignments to 'page areas'
89 
90                 OD 05.11.2003
91                 this is, if object has to follow the text flow:
92                 - cell frame, if anchored inside a cell
93                 - fly frame, if anchored inside a fly frame
94                 - header/footer frame, if anchored inside page header/footer
95                 - footnote frame, if anchored inside footnote
96                 otherwise it's the document body frame
97 
98                 this is, if object hasn't to follow the text flow:
99                 - page frame.
100                 OD 2005-01-20 #118546# - no exception any more. Thus remove
101                 parameter <_bForPageAlignment>
102 
103                 @author OD
104 
105                 @param _rVertOrientFrm
106                 input parameter - frame, at which the vertical position is
107                 oriented at (typically it's the anchor frame).
108                 starting point for the search of the layout frame.
109 
110                 @return reference to the layout frame, which determines the
111                 the vertical environment the object has to be positioned in.
112             */
113             const SwLayoutFrm& GetVertEnvironmentLayoutFrm( const SwFrm& _rVertOrientFrm ) const;
114     };
115 } // namespace objectpositioning
116 
117 #endif
118