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 <tools/solar.h>
26 * This class connects the Nodes with the Layouts.
27 * It provides an intelligent iterator over Frames belonging to the Node or
28 * Node Range. Depending on the purpose of iterating (e.g. to insert other
29 * Frames before or after the Frames) Master/Follows are recognized and only
30 * the relevant ones are returned. Repeated table headers are also taken
32 * It's possible to iterate over SectionNodes that are either not directly
33 * assigned to a SectionFrame or to multiple ones due to nesting.
35 * This class is an interface between the method and a SwClientIter: it
36 * chooses the right sw::BroadcastingModify depending on the task, creates a SwClientIter
37 * and filters its iterations depending on the task.
38 * The task is determined by the choice of class.
40 * 1. Collecting the UpperFrames (so that later RestoreUpperFrames can be called)
41 * is called by MakeFrames, if there's no PrevNext (before/after we can insert
43 * 2. Inserting the Frames before/after which the new Frames of a Node need to
44 * be inserted, is also called by MakeFrames.
56 std::unique_ptr
<SwNode2LayImpl
> m_pImpl
;
59 /// Use this ctor for inserting before/after rNd
60 /// @param nIdx is the index of the to-be-inserted Node
61 SwNode2Layout(const SwNode
& rNd
, sal_uLong nIdx
);
64 SwLayoutFrame
* UpperFrame(SwFrame
*& rpFrame
, const SwNode
& rNode
);
66 SwFrame
* GetFrame(const Point
* pDocPos
) const;
69 class SwNode2LayoutSaveUpperFrames
71 std::unique_ptr
<SwNode2LayImpl
> m_pImpl
;
74 /// Use this ctor for collecting the UpperFrames
75 SwNode2LayoutSaveUpperFrames(const SwNode
& rNd
);
76 ~SwNode2LayoutSaveUpperFrames();
78 void RestoreUpperFrames(SwNodes
& rNds
, sal_uLong nStt
, sal_uLong nEnd
);
83 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */