1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #ifndef INCLUDED_SW_INC_HANDLEANCHORNODECHG_HXX
20 #define INCLUDED_SW_INC_HANDLEANCHORNODECHG_HXX
22 class SwFlyFrameFormat
;
26 // helper class to track change of anchor node of at-paragraph respectively
27 // at-character anchored fly frames
28 // if such a change happens, it has to be checked, if the count of the anchor
29 // frames also change. if yes, a re-creation of the fly frames is needed:
30 // - deletion of existing fly frames before the intrinsic anchor node changes
31 // - creation of new fly frames after the intrinsic anchor node change.
32 class SwHandleAnchorNodeChg
35 /** checks, if re-creation of fly frames for an anchor node change at the
36 given fly frame format is necessary, and performs the first part.
40 @param _rFlyFrameFormat
41 reference to the fly frame format instance, which is handled.
43 @param _rNewAnchorFormat
44 new anchor attribute, which will be applied at the given fly frame format
46 @param _pKeepThisFlyFrm
47 optional parameter - pointer to a fly frame of the given fly frame format,
48 which isn't deleted, if re-creation of fly frames is necessary.
50 SwHandleAnchorNodeChg( SwFlyFrameFormat
& _rFlyFrameFormat
,
51 const SwFormatAnchor
& _rNewAnchorFormat
,
52 SwFlyFrm
* _pKeepThisFlyFrm
= 0L );
54 /** calls <SwFlyFrameFormat::MakeFrms>, if re-creation of fly frames is necessary.
58 ~SwHandleAnchorNodeChg();
61 // fly frame format, which is tracked for a anchor node change.
62 SwFlyFrameFormat
& mrFlyFrameFormat
;
63 // internal flag, which indicates that the certain anchor node change occurs
64 // and that re-creation of fly frames is necessary.
65 bool mbAnchorNodeChanged
;
67 SwHandleAnchorNodeChg( const SwHandleAnchorNodeChg
& ) SAL_DELETED_FUNCTION
;
68 void operator=( const SwHandleAnchorNodeChg
) SAL_DELETED_FUNCTION
;
72 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */