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_SOURCE_CORE_INC_NODE2LAY_HXX
20 #define INCLUDED_SW_SOURCE_CORE_INC_NODE2LAY_HXX
22 #include <nodeoffset.hxx>
27 * This class connects the Nodes with the Layouts.
28 * It provides an intelligent iterator over Frames belonging to the Node or
29 * Node Range. Depending on the purpose of iterating (e.g. to insert other
30 * Frames before or after the Frames) Master/Follows are recognized and only
31 * the relevant ones are returned. Repeated table headers are also taken
33 * It's possible to iterate over SectionNodes that are either not directly
34 * assigned to a SectionFrame or to multiple ones due to nesting.
36 * This class is an interface between the method and a SwClientIter: it
37 * chooses the right sw::BroadcastingModify depending on the task, creates a SwClientIter
38 * and filters its iterations depending on the task.
39 * The task is determined by the choice of class.
41 * 1. Collecting the UpperFrames (so that later RestoreUpperFrames can be called)
42 * is called by MakeFrames, if there's no PrevNext (before/after we can insert
44 * 2. Inserting the Frames before/after which the new Frames of a Node need to
45 * be inserted, is also called by MakeFrames.
57 std::unique_ptr
<SwNode2LayImpl
> m_pImpl
;
60 /// Use this ctor for inserting before/after rNd
61 /// @param nIdx is the index of the to-be-inserted Node
62 SwNode2Layout(const SwNode
& rNd
, SwNodeOffset nIdx
);
65 SwLayoutFrame
* UpperFrame(SwFrame
*& rpFrame
, const SwNode
& rNode
);
67 SwFrame
* GetFrame(const Point
* pDocPos
) const;
70 class SwNode2LayoutSaveUpperFrames
72 std::unique_ptr
<SwNode2LayImpl
> m_pImpl
;
75 /// Use this ctor for collecting the UpperFrames
76 SwNode2LayoutSaveUpperFrames(const SwNode
& rNd
);
77 ~SwNode2LayoutSaveUpperFrames();
79 void RestoreUpperFrames(SwNodes
& rNds
, SwNodeOffset nStt
, SwNodeOffset nEnd
);
84 SwFrame
const* FindNeighbourFrameForNode(SwNode
const& rNode
);
90 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */