1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 #ifndef _ENVIRONMENTOFANCHOREDOBJECT_HXX
24 #define _ENVIRONMENTOFANCHOREDOBJECT_HXX
25 
26 class SwFrm;
27 class SwLayoutFrm;
28 
29 namespace objectpositioning
30 {
31     class SwEnvironmentOfAnchoredObject
32     {
33         private:
34             const bool mbFollowTextFlow;
35 
36         public:
37             /** construtor
38 
39                 OD 05.11.2003
40 
41                 @author OD
42 
43                 @param _bFollowTextFlow
44                 input parameter - indicates, if the anchored object, for which
45                 this environment is instantiated, follow the text flow or not
46             */
47             SwEnvironmentOfAnchoredObject( const bool _bFollowTextFlow );
48 
49             /** destructor
50 
51                 OD 05.11.2003
52 
53                 @author OD
54             */
55             ~SwEnvironmentOfAnchoredObject();
56 
57             /** determine environment layout frame for possible horizontal object
58                 positions respectively for alignment to 'page areas'
59 
60                 OD 05.11.2003
61                 this is, if object has to follow the text flow:
62                 - cell frame, if anchored inside a cell
63                 - fly frame, if anchored inside a fly frame
64                 otherwise it's the page frame
65 
66                 this is, if object hasn't to follow the text flow:
67                 - page frame.
68                 OD 2005-01-20 #118546# - no exception any more. Thus remove
69                 parameter <_bForPageAlignment>
70 
71                 @author OD
72 
73                 @param _rHoriOrientFrm
74                 input parameter - frame, at which the horizontal position is
75                 oriented at (typically it's the anchor frame).
76                 starting point for the search of the layout frame.
77 
78                 @return reference to the layout frame, which determines the
79                 the horizontal environment the object has to be positioned in.
80             */
81             const SwLayoutFrm& GetHoriEnvironmentLayoutFrm( const SwFrm& _rHoriOrientFrm ) const;
82 
83             /** determine environment layout frame for possible vertical object
84                 positions respectively for alignments to 'page areas'
85 
86                 OD 05.11.2003
87                 this is, if object has to follow the text flow:
88                 - cell frame, if anchored inside a cell
89                 - fly frame, if anchored inside a fly frame
90                 - header/footer frame, if anchored inside page header/footer
91                 - footnote frame, if anchored inside footnote
92                 otherwise it's the document body frame
93 
94                 this is, if object hasn't to follow the text flow:
95                 - page frame.
96                 OD 2005-01-20 #118546# - no exception any more. Thus remove
97                 parameter <_bForPageAlignment>
98 
99                 @author OD
100 
101                 @param _rVertOrientFrm
102                 input parameter - frame, at which the vertical position is
103                 oriented at (typically it's the anchor frame).
104                 starting point for the search of the layout frame.
105 
106                 @return reference to the layout frame, which determines the
107                 the vertical environment the object has to be positioned in.
108             */
109             const SwLayoutFrm& GetVertEnvironmentLayoutFrm( const SwFrm& _rVertOrientFrm ) const;
110     };
111 } // namespace objectpositioning
112 
113 #endif
114