xref: /trunk/main/sw/inc/HandleAnchorNodeChg.hxx (revision 1d2dbeb0)
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 _HANDLEANCHORNODECHG_HXX
24 #define _HANDLEANCHORNODECHG_HXX
25 
26 class SwFlyFrmFmt;
27 class SwFmtAnchor;
28 class SwFlyFrm;
29 
30 // OD 2006-02-28 #125892#
31 // helper class to track change of anchor node of at-paragraph respectively
32 // at-character anchored fly frames
33 // if such a change happens, it has to be checked, if the count of the anchor
34 // frames also change. if yes, a re-creation of the fly frames is needed:
35 // - deletion of existing fly frames before the intrinsic anchor node changes
36 // - creation of new fly frames after the intrinsic anchor node change.
37 class SwHandleAnchorNodeChg
38 {
39 public:
40     /** checks, if re-creation of fly frames for an anchor node change at the
41         given fly frame format is necessary, and performs the first part.
42 
43         @author OD
44 
45         @param _rFlyFrmFmt
46         reference to the fly frame format instance, which is handled.
47 
48         @param _rNewAnchorFmt
49         new anchor attribute, which will be applied at the given fly frame format
50 
51         @param _pKeepThisFlyFrm
52         optional parameter - pointer to a fly frame of the given fly frame format,
53         which isn't deleted, if re-creation of fly frames is necessary.
54     */
55     SwHandleAnchorNodeChg( SwFlyFrmFmt& _rFlyFrmFmt,
56                            const SwFmtAnchor& _rNewAnchorFmt,
57                            SwFlyFrm* _pKeepThisFlyFrm = 0L );
58 
59     /** calls <SwFlyFrmFmt::MakeFrms>, if re-creation of fly frames is necessary.
60 
61         @author OD
62     */
63     ~SwHandleAnchorNodeChg();
64 
65 private:
66     // fly frame format, which is tracked for a anchor node change.
67     SwFlyFrmFmt& mrFlyFrmFmt;
68     // internal flag, which indicates that the certain anchor node change occurs
69     // and that re-creation of fly frames is necessary.
70     bool mbAnchorNodeChanged;
71 
72     // no copy-constructor
73     SwHandleAnchorNodeChg( const SwHandleAnchorNodeChg& );
74     // no assignment-operator
75     void operator=( const SwHandleAnchorNodeChg );
76 };
77 #endif
78