Revert "reduce symbol visibility in sw"
[LibreOffice.git] / sw / inc / node.hxx
blobec17dd6aa78cb71e23a5dd20ce9e534393048ddb
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 .
20 #ifndef INCLUDED_SW_INC_NODE_HXX
21 #define INCLUDED_SW_INC_NODE_HXX
23 #include <sal/types.h>
25 #include "swdllapi.h"
26 #include "BorderCacheOwner.hxx"
27 #include "ndarr.hxx"
28 #include "ndtyp.hxx"
29 #include "contentindex.hxx"
30 #include "fmtcol.hxx"
31 #include "nodeoffset.hxx"
33 #include <sfx2/AccessibilityIssue.hxx>
35 #include <memory>
36 #include <vector>
38 class SwContentFrame;
39 class SwContentNode;
40 class SwDoc;
41 class SwEndNode;
42 class SwFrame;
43 class SwFrameFormat;
44 class SwGrfNode;
45 class SwNoTextNode;
46 class SwNodeIndex;
47 class SwOLENode;
48 class SwRect;
49 class SwSection;
50 class SwSectionFormat;
51 class SwTOXBase;
52 class SwSectionNode;
53 class SwStartNode;
54 class SwTabFrame;
55 class SwRootFrame;
56 class SwTable;
57 class SwTableNode;
58 class SwTableBox;
59 class SwTextNode;
60 class SwPageDesc;
61 class SwViewShell;
62 struct SwPosition;
63 class IStyleAccess;
64 class IDocumentSettingAccess;
65 class IDocumentDeviceAccess;
66 class IDocumentMarkAccess;
67 class IDocumentRedlineAccess;
68 class IDocumentStylePoolAccess;
69 class IDocumentLinksAdministration;
70 class IDocumentFieldsAccess;
71 class IDocumentContentOperations;
72 class IDocumentListItems;
73 class Point;
74 enum class SvxFrameDirection;
75 typedef std::vector<SwOLENode*> SwOLENodes; // docary.hxx
76 enum class SwCursorSkipMode;
78 namespace drawinglayer::attribute {
79 class SdrAllFillAttributesHelper;
80 typedef std::shared_ptr< SdrAllFillAttributesHelper > SdrAllFillAttributesHelperPtr;
83 // Accessibility check
85 namespace sw
87 struct AccessibilityCheckStatus
89 std::unique_ptr<sfx::AccessibilityIssueCollection> pCollection;
90 void reset();
95 /// Base class of the Writer document model elements.
96 class SW_DLLPUBLIC SwNode
97 : public sw::BorderCacheOwner, private BigPtrEntry
99 friend class SwNodes;
101 SwNodeType m_nNodeType;
103 /// For text nodes: level of auto format. Was put here because we had still free bits.
104 sal_uInt8 m_nAFormatNumLvl : 3;
105 bool m_bIgnoreDontExpand : 1; ///< for Text Attributes - ignore the flag
107 mutable sw::AccessibilityCheckStatus m_aAccessibilityCheckStatus;
109 public:
110 /// sw_redlinehide: redline node merge state
111 enum class Merge { None, First, NonFirst, Hidden };
112 bool IsCreateFrameWhenHidingRedlines() const {
113 return m_eMerge == Merge::None || m_eMerge == Merge::First;
115 void SetRedlineMergeFlag(Merge const eMerge) { m_eMerge = eMerge; }
116 Merge GetRedlineMergeFlag() const { return m_eMerge; }
117 private:
118 Merge m_eMerge;
120 #ifdef DBG_UTIL
121 static tools::Long s_nSerial;
122 tools::Long m_nSerial;
123 #endif
125 /// all SwFrameFormat that are anchored at the node
126 /// invariant: SwFrameFormat is in the list iff
127 /// SwFrameFormat::GetAnchor().GetContentAnchor() points to this node
128 std::vector<SwFrameFormat*> m_aAnchoredFlys;
130 protected:
131 SwStartNode* m_pStartOfSection;
133 /// only used by SwContentNodeTmp in SwTextNode::Update
134 SwNode();
136 SwNode( const SwNode& rWhere, const SwNodeType nNodeId );
138 /// for the initial StartNode
139 SwNode( SwNodes& rNodes, SwNodeOffset nPos, const SwNodeType nNodeId );
141 public:
142 /** the = 0 forces the class to be an abstract base class, but the dtor can be still called
143 from subclasses */
144 virtual ~SwNode() override = 0;
146 #ifdef DBG_UTIL
147 tools::Long GetSerial() const { return m_nSerial; }
148 #endif
150 sal_uInt16 GetSectionLevel() const;
152 inline SwNodeOffset StartOfSectionIndex() const;
153 const SwStartNode* StartOfSectionNode() const { return m_pStartOfSection; }
154 SwStartNode* StartOfSectionNode() { return m_pStartOfSection; }
156 inline SwNodeOffset EndOfSectionIndex() const;
157 inline const SwEndNode* EndOfSectionNode() const;
158 inline SwEndNode* EndOfSectionNode();
160 sal_uInt8 GetAutoFormatLvl() const { return m_nAFormatNumLvl; }
161 void SetAutoFormatLvl( sal_uInt8 nVal ) { m_nAFormatNumLvl = nVal; }
163 bool IsIgnoreDontExpand() const { return m_bIgnoreDontExpand; }
164 void SetIgnoreDontExpand( bool bNew ) { m_bIgnoreDontExpand = bNew; }
166 SwNodeType GetNodeType() const { return m_nNodeType; }
168 inline SwStartNode *GetStartNode();
169 inline const SwStartNode *GetStartNode() const;
170 inline SwContentNode *GetContentNode();
171 inline const SwContentNode *GetContentNode() const;
172 inline SwEndNode *GetEndNode();
173 inline const SwEndNode *GetEndNode() const;
174 inline SwTextNode *GetTextNode();
175 inline const SwTextNode *GetTextNode() const;
176 inline SwOLENode *GetOLENode();
177 inline const SwOLENode *GetOLENode() const;
178 inline SwNoTextNode *GetNoTextNode();
179 inline const SwNoTextNode *GetNoTextNode() const;
180 inline SwGrfNode *GetGrfNode();
181 inline const SwGrfNode *GetGrfNode() const;
182 inline SwTableNode *GetTableNode();
183 inline const SwTableNode *GetTableNode() const;
184 inline SwSectionNode *GetSectionNode();
185 inline const SwSectionNode *GetSectionNode() const;
187 bool IsStartNode() const { return bool(SwNodeType::Start & m_nNodeType); }
188 bool IsContentNode() const { return bool(SwNodeType::ContentMask & m_nNodeType); }
189 bool IsEndNode() const { return SwNodeType::End == m_nNodeType; }
190 bool IsTextNode() const { return SwNodeType::Text == m_nNodeType; }
191 bool IsTableNode() const { return SwNodeType::Table == m_nNodeType; }
192 bool IsSectionNode() const { return SwNodeType::Section == m_nNodeType; }
193 bool IsOLENode() const { return SwNodeType::Ole == m_nNodeType; }
194 bool IsNoTextNode() const { return bool(SwNodeType::NoTextMask & m_nNodeType); }
195 bool IsGrfNode() const { return SwNodeType::Grf == m_nNodeType; }
198 Checks if this node is in redlines.
200 @retval true this node is in redlines
201 @retval false else
203 bool IsInRedlines() const;
205 /** Search table node, in which it is. If it is in no table
206 @return 0. */
207 SwTableNode *FindTableNode();
208 inline const SwTableNode *FindTableNode() const;
210 /** Search section node, in which it is. If it is in no section
211 @return 0. */
212 SwSectionNode *FindSectionNode();
213 inline const SwSectionNode *FindSectionNode() const;
215 SwStartNode* FindSttNodeByType( SwStartNodeType eTyp );
216 inline const SwStartNode* FindSttNodeByType( SwStartNodeType eTyp ) const;
218 const SwStartNode* FindTableBoxStartNode() const
219 { return FindSttNodeByType( SwTableBoxStartNode ); }
220 const SwStartNode* FindFlyStartNode() const
221 { return FindSttNodeByType( SwFlyStartNode ); }
222 const SwStartNode* FindFootnoteStartNode() const
223 { return FindSttNodeByType( SwFootnoteStartNode ); }
224 const SwStartNode* FindHeaderStartNode() const
225 { return FindSttNodeByType( SwHeaderStartNode ); }
226 const SwStartNode* FindFooterStartNode() const
227 { return FindSttNodeByType( SwFooterStartNode ); }
229 /// Node is in which nodes-array/doc?
230 inline SwNodes& GetNodes();
231 inline const SwNodes& GetNodes() const;
233 SwDoc& GetDoc()
235 return GetNodes().GetDoc();
238 const SwDoc& GetDoc() const
240 return GetNodes().GetDoc();
243 /** Provides access to the document setting interface
245 const IDocumentSettingAccess* getIDocumentSettingAccess() const;
247 /** Provides access to the document device interface
249 const IDocumentDeviceAccess& getIDocumentDeviceAccess() const;
251 /** Provides access to the document bookmark interface
253 const IDocumentMarkAccess* getIDocumentMarkAccess() const;
255 /** Provides access to the document redline interface
257 const IDocumentRedlineAccess& getIDocumentRedlineAccess() const;
259 /** Provides access to the document style pool interface
261 const IDocumentStylePoolAccess& getIDocumentStylePoolAccess() const;
263 /** Provides access to the document draw model interface
265 const IDocumentDrawModelAccess& getIDocumentDrawModelAccess() const;
267 /** Provides access to the document layout interface
269 const IDocumentLayoutAccess& getIDocumentLayoutAccess() const;
270 IDocumentLayoutAccess& getIDocumentLayoutAccess();
272 /** Provides access to the document links administration interface
274 const IDocumentLinksAdministration& getIDocumentLinksAdministration() const;
275 IDocumentLinksAdministration& getIDocumentLinksAdministration();
277 /** Provides access to the document fields administration interface
279 const IDocumentFieldsAccess& getIDocumentFieldsAccess() const;
280 IDocumentFieldsAccess& getIDocumentFieldsAccess();
282 /** Provides access to the document content operations interface
284 IDocumentContentOperations& getIDocumentContentOperations();
286 /** Provides access to the document automatic styles interface
288 IStyleAccess& getIDocumentStyleAccess();
290 /** Provides access to the document's numbered items interface */
291 IDocumentListItems& getIDocumentListItems();
293 /// Is node in the visible area of the Shell?
294 bool IsInVisibleArea( SwViewShell const * pSh ) const;
295 /// Is node in a protected area?
296 bool IsInProtectSect() const;
297 /** Is node in something that is protected (range, frame,
298 table cells ... including anchor in case of frames or footnotes)? */
299 bool IsProtect() const;
301 /** Search PageDesc with which this node is formatted. If layout is existent
302 search over layout, else only the hard way is left: search over the nodes
303 to the front!! */
304 const SwPageDesc* FindPageDesc( SwNodeOffset* pPgDescNdIdx = nullptr ) const;
306 /// If node is in a fly return the respective format.
307 SwFrameFormat* GetFlyFormat() const;
309 /// If node is in a table return the respective table box.
310 SwTableBox* GetTableBox() const;
312 SwNodeOffset GetIndex() const { return SwNodeOffset(GetPos()); }
314 const SwTextNode* FindOutlineNodeOfLevel(sal_uInt8 nLvl, SwRootFrame const* pLayout = nullptr) const;
316 sal_uInt8 HasPrevNextLayNode() const;
318 std::vector<SwFrameFormat *> const & GetAnchoredFlys() const { return m_aAnchoredFlys; }
319 void AddAnchoredFly(SwFrameFormat *);
320 void RemoveAnchoredFly(SwFrameFormat *);
323 * Dumps the node structure to the given destination (file nodes.xml in the current directory by default)
325 virtual void dumpAsXml(xmlTextWriterPtr pWriter) const;
327 bool operator==(const SwNode& rOther) const { return this == &rOther; }
328 bool operator!=(const SwNode& rOther) const { return this != &rOther; }
329 bool operator<(const SwNode& rOther) const { assert(&GetNodes() == &rOther.GetNodes()); return GetIndex() < rOther.GetIndex(); }
330 bool operator<=(const SwNode& rOther) const { assert(&GetNodes() == &rOther.GetNodes()); return GetIndex() <= rOther.GetIndex(); }
331 bool operator>(const SwNode& rOther) const { assert(&GetNodes() == &rOther.GetNodes()); return GetIndex() > rOther.GetIndex(); }
332 bool operator>=(const SwNode& rOther) const { assert(&GetNodes() == &rOther.GetNodes()); return GetIndex() >= rOther.GetIndex(); }
334 sw::AccessibilityCheckStatus& getAccessibilityCheckStatus()
336 return m_aAccessibilityCheckStatus;
339 void resetAndQueueAccessibilityCheck(bool bIssueObjectNameChanged = false);
341 private:
342 SwNode( const SwNode & rNodes ) = delete;
343 SwNode & operator= ( const SwNode & rNodes ) = delete;
346 /// Starts a section of nodes in the document model.
347 class SAL_DLLPUBLIC_RTTI SwStartNode: public SwNode
349 friend class SwNode;
350 friend class SwNodes;
351 friend class SwEndNode; ///< to set the theEndOfSection !!
353 SwEndNode* m_pEndOfSection;
354 SwStartNodeType m_eStartNodeType;
356 /// for the initial StartNode
357 SwStartNode( SwNodes& rNodes, SwNodeOffset nPos );
359 protected:
360 SwStartNode( const SwNode& rWhere,
361 const SwNodeType nNodeType = SwNodeType::Start,
362 SwStartNodeType = SwNormalStartNode );
363 public:
364 SwStartNodeType GetStartNodeType() const { return m_eStartNodeType; }
366 /// Call ChkCondcoll to all ContentNodes of section.
367 void CheckSectionCondColl() const;
369 virtual void dumpAsXml(xmlTextWriterPtr pWriter) const override;
371 private:
372 SwStartNode( const SwStartNode & rNode ) = delete;
373 SwStartNode & operator= ( const SwStartNode & rNode ) = delete;
376 /// Ends a section of nodes in the document model.
377 class SwEndNode final : public SwNode
379 friend class SwNodes;
380 friend class SwTableNode; ///< To enable creation of its EndNote.
381 friend class SwSectionNode; ///< To enable creation of its EndNote.
383 /// for the initial StartNode
384 SwEndNode( SwNodes& rNodes, SwNodeOffset nPos, SwStartNode& rSttNd );
386 SwEndNode( const SwNode& rWhere, SwStartNode& rSttNd );
388 SwEndNode( const SwEndNode & rNode ) = delete;
389 SwEndNode & operator= ( const SwEndNode & rNode ) = delete;
392 // SwContentNode
394 class SAL_DLLPUBLIC_RTTI SwContentNode: public sw::BroadcastingModify, public SwNode, public SwContentIndexReg
397 sw::WriterMultiListener m_aCondCollListener;
398 SwFormatColl* m_pCondColl;
399 mutable bool mbSetModifyAtAttr;
401 protected:
402 /// only used by SwContentNodeTmp in SwTextNode::Update
403 SwContentNode();
405 SwContentNode( const SwNode& rWhere, const SwNodeType nNodeType,
406 SwFormatColl *pFormatColl );
407 /** the = 0 forces the class to be an abstract base class, but the dtor can be still called
408 from subclasses */
409 virtual ~SwContentNode() override = 0;
411 /** Attribute-set for all auto attributes of a ContentNode.
412 (e.g. TextNode or NoTextNode). */
413 std::shared_ptr<const SwAttrSet> mpAttrSet;
415 /// Make respective nodes create the specific AttrSets.
416 virtual void NewAttrSet( SwAttrPool& ) = 0;
418 /** There some functions that like to remove items from the internal
419 SwAttrSet (handle): */
420 sal_uInt16 ClearItemsFromAttrSet( const std::vector<sal_uInt16>& rWhichIds );
422 virtual void SwClientNotify( const SwModify&, const SfxHint& rHint) override;
424 public:
426 /** MakeFrame will be called for a certain layout
427 pSib is another SwFrame of the same layout (e.g. the SwRootFrame itself, a sibling, the parent) */
428 virtual SwContentFrame *MakeFrame( SwFrame* pSib ) = 0;
430 virtual SwContentNode *JoinNext();
431 /** Is it possible to join two nodes?
432 In pIdx the second position can be returned. */
433 SW_DLLPUBLIC bool CanJoinNext( SwNodeIndex* pIdx = nullptr ) const;
434 bool CanJoinNext( SwPosition* pIdx ) const;
435 SW_DLLPUBLIC bool CanJoinPrev( SwNodeIndex* pIdx =nullptr ) const;
437 bool GoNext(SwContentIndex *, SwCursorSkipMode nMode ) const;
438 bool GoNext(SwPosition*, SwCursorSkipMode nMode ) const;
439 bool GoPrevious(SwContentIndex *, SwCursorSkipMode nMode ) const;
441 /// @see GetFrameOfModify
442 SW_DLLPUBLIC SwContentFrame *getLayoutFrame( const SwRootFrame*,
443 const SwPosition *pPos = nullptr,
444 std::pair<Point, bool> const* pViewPosAndCalcFrame = nullptr) const;
445 /** @return the real size of the frame or an empty rectangle if
446 no layout exists. Needed for export filters. */
447 SW_DLLPUBLIC SwRect FindLayoutRect( const bool bPrtArea = false,
448 const Point* pPoint = nullptr ) const;
449 SW_DLLPUBLIC SwRect FindPageFrameRect() const;
451 /** Method creates all views of document for given node. The content
452 frames that are created are put in the respective layout. */
453 void MakeFramesForAdjacentContentNode(SwContentNode& rNode);
455 /** Method deletes all views of document for the node. The content-
456 frames are removed from the respective layout.
458 void DelFrames(SwRootFrame const* pLayout);
460 /** @return count of elements of node content. Default is 1.
461 There are differences between text node and formula node. */
462 virtual sal_Int32 Len() const;
464 virtual SwContentNode* MakeCopy(SwDoc&, SwNode& rWhere, bool bNewFrames) const = 0;
466 /// Get information from Client.
467 virtual bool GetInfo( SfxPoolItem& ) const override;
469 /// SS for PoolItems: hard attributation.
471 /// If bInParent is FALSE search for attribute only in this node.
472 const SfxPoolItem& GetAttr( sal_uInt16 nWhich, bool bInParent=true ) const;
473 template<class T>
474 const T& GetAttr( TypedWhichId<T> nWhich, bool bInParent=true ) const
475 { return static_cast<const T&>(GetAttr(sal_uInt16(nWhich), bInParent)); }
476 SW_DLLPUBLIC bool GetAttr( SfxItemSet& rSet ) const;
477 /// made virtual
478 SW_DLLPUBLIC virtual bool SetAttr( const SfxPoolItem& );
479 virtual bool SetAttr( const SfxItemSet& rSet );
480 virtual bool ResetAttr( sal_uInt16 nWhich1, sal_uInt16 nWhich2 = 0 );
481 virtual bool ResetAttr( const std::vector<sal_uInt16>& rWhichArr );
482 virtual sal_uInt16 ResetAllAttr();
484 /// Obtains attribute that is not delivered via conditional style!
485 SW_DLLPUBLIC const SfxPoolItem* GetNoCondAttr( sal_uInt16 nWhich, bool bInParents ) const;
486 template<class T>
487 const T* GetNoCondAttr( TypedWhichId<T> nWhich, bool bInParents ) const
488 { return static_cast<const T*>(GetNoCondAttr(sal_uInt16(nWhich), bInParents)); }
490 /** Does node has already its own auto-attributes?
491 Access to SwAttrSet. */
492 inline const SwAttrSet &GetSwAttrSet() const;
493 const SwAttrSet *GetpSwAttrSet() const { return mpAttrSet.get(); }
494 bool HasSwAttrSet() const { return mpAttrSet != nullptr; }
496 virtual SwFormatColl* ChgFormatColl( SwFormatColl* );
497 SwFormatColl* GetFormatColl() const { return const_cast<SwFormatColl*>(static_cast<const SwFormatColl*>(GetRegisteredIn())); }
499 inline SwFormatColl& GetAnyFormatColl() const;
500 void SetCondFormatColl( SwFormatColl* );
501 inline SwFormatColl* GetCondFormatColl() const;
503 bool IsAnyCondition( SwCollCondition& rTmp ) const;
504 void ChkCondColl(const SwTextFormatColl* pColl = nullptr);
506 /** Invalidates NumRule at the node. NumRule is updated
507 on EndAction of a Shell at the latest. */
508 bool InvalidateNumRule();
510 /** determines the text direction for a certain
511 position. @return -1, if text direction could *not* be determined. */
512 SvxFrameDirection GetTextDirection( const SwPosition& rPos,
513 const Point* pPt ) const;
515 void SetModifyAtAttr( bool bSetModifyAtAttr ) const { mbSetModifyAtAttr = bSetModifyAtAttr; }
516 bool GetModifyAtAttr() const { return mbSetModifyAtAttr; }
518 static std::unique_ptr<SwOLENodes> CreateOLENodesArray( const SwFormatColl& rColl, bool bOnlyWithInvalidSize );
520 // Access to DrawingLayer FillAttributes in a preprocessed form for primitive usage
521 virtual drawinglayer::attribute::SdrAllFillAttributesHelperPtr getSdrAllFillAttributesHelper() const;
523 void UpdateAttr(const SwUpdateAttr&);
525 private:
526 SwContentNode( const SwContentNode & rNode ) = delete;
527 SwContentNode & operator= ( const SwContentNode & rNode ) = delete;
530 // SwTableNode
532 class SW_DLLPUBLIC SwTableNode final : public SwStartNode, public sw::BroadcastingModify
534 friend class SwNodes;
535 std::unique_ptr<SwTable> m_pTable;
537 virtual ~SwTableNode() override;
539 public:
540 SwTableNode( const SwNode& );
542 const SwTable& GetTable() const { return *m_pTable; }
543 SwTable& GetTable() { return *m_pTable; }
544 SwTabFrame *MakeFrame( SwFrame* );
546 /// Creates the frms for the table node (i.e. the TabFrames).
547 /// pIdxBehind is optional parameter.
548 void MakeOwnFrames(SwPosition* pIdxBehind = nullptr);
550 /** Method deletes all views of document for the node.
551 The content frames are removed from the respective layout. */
552 void DelFrames(SwRootFrame const* pLayout = nullptr);
554 /** Method creates all views of the document for the previous node.
555 The content frames that are created are put into the respective layout. */
556 void MakeFramesForAdjacentContentNode(const SwNodeIndex & rIdx);
558 SwTableNode* MakeCopy( SwDoc&, const SwNodeIndex& ) const;
559 void SetNewTable( std::unique_ptr<SwTable> , bool bNewFrames=true );
561 // Removes redline objects that relate to this table from the 'Extra Redlines' table
562 void RemoveRedlines();
564 void dumpAsXml(xmlTextWriterPtr pWriter) const override;
566 private:
567 SwTableNode( const SwTableNode & rNode ) = delete;
568 SwTableNode & operator= ( const SwTableNode & rNode ) = delete;
571 /// A section node represents the start of a section on the UI, i.e. the container created using
572 /// Insert -> Section menu item.
573 class SAL_DLLPUBLIC_RTTI SwSectionNode final
574 : public SwStartNode
576 friend class SwNodes;
578 private:
579 SwSectionNode(const SwSectionNode&) = delete;
580 SwSectionNode& operator=(const SwSectionNode&) = delete;
582 std::unique_ptr<SwSection> const m_pSection;
584 virtual ~SwSectionNode() override;
586 public:
587 SwSectionNode(const SwNode& rWhere,
588 SwSectionFormat & rFormat, SwTOXBase const*const pTOXBase);
590 const SwSection& GetSection() const { return *m_pSection; }
591 SwSection& GetSection() { return *m_pSection; }
593 SwFrame* MakeFrame(SwFrame* pSib, bool bHidden);
595 /** Creates the frms for the SectionNode (i.e. the SectionFrames).
596 On default the frames are created until the end of the range.
597 When another NodeIndex pEnd is passed a MakeFrames is called up to it.
598 Used by TableToText. */
599 void MakeOwnFrames(SwNodeIndex* pIdxBehind, SwNodeIndex* pEnd = nullptr);
601 /** Method deletes all views of document for the node. The
602 content frames are removed from the respective layout. */
603 void DelFrames(SwRootFrame const* pLayout = nullptr, bool bForce = false);
605 /** Method creates all views of document for the previous node.
606 The content frames created are put into the respective layout. */
607 void MakeFramesForAdjacentContentNode(const SwNodeIndex & rIdx);
609 SwSectionNode* MakeCopy( SwDoc&, const SwNodeIndex& ) const;
611 /// Set pointer in format of section on itself.
612 void NodesArrChgd();
614 /** Check for not hidden areas whether there is content that is not in
615 a hidden sub-area. */
616 bool IsContentHidden() const;
618 void dumpAsXml(xmlTextWriterPtr pWriter) const override;
622 /** This class is internal, used only during DocumentContentOperationsManager::CopyWithFlyInFly(), and for undo.
624 Some of the nodes are then replaced with SwPlaceholderNode, and at the end of the operation, removed again.
625 FIXME find out if this is really necessary, and if we can avoid creation of the SwPlaceholderNodes in the first place.
627 class SwPlaceholderNode final : private SwNode
629 private:
630 friend class SwNodes;
631 SwPlaceholderNode(const SwNode& rWhere);
634 inline SwEndNode *SwNode::GetEndNode()
636 return IsEndNode() ? static_cast<SwEndNode*>(this) : nullptr;
638 inline const SwEndNode *SwNode::GetEndNode() const
640 return IsEndNode() ? static_cast<const SwEndNode*>(this) : nullptr;
642 inline SwStartNode *SwNode::GetStartNode()
644 return IsStartNode() ? static_cast<SwStartNode*>(this) : nullptr;
646 inline const SwStartNode *SwNode::GetStartNode() const
648 return IsStartNode() ? static_cast<const SwStartNode*>(this) : nullptr;
650 inline SwTableNode *SwNode::GetTableNode()
652 return IsTableNode() ? static_cast<SwTableNode*>(this) : nullptr;
654 inline const SwTableNode *SwNode::GetTableNode() const
656 return IsTableNode() ? static_cast<const SwTableNode*>(this) : nullptr;
658 inline SwSectionNode *SwNode::GetSectionNode()
660 return IsSectionNode() ? static_cast<SwSectionNode*>(this) : nullptr;
662 inline const SwSectionNode *SwNode::GetSectionNode() const
664 return IsSectionNode() ? static_cast<const SwSectionNode*>(this) : nullptr;
666 inline SwContentNode *SwNode::GetContentNode()
668 return IsContentNode() ? static_cast<SwContentNode*>(this) : nullptr;
670 inline const SwContentNode *SwNode::GetContentNode() const
672 return IsContentNode() ? static_cast<const SwContentNode*>(this) : nullptr;
675 inline const SwStartNode* SwNode::FindSttNodeByType( SwStartNodeType eTyp ) const
677 return const_cast<SwNode*>(this)->FindSttNodeByType( eTyp );
679 inline const SwTableNode* SwNode::FindTableNode() const
681 return const_cast<SwNode*>(this)->FindTableNode();
683 inline const SwSectionNode* SwNode::FindSectionNode() const
685 return const_cast<SwNode*>(this)->FindSectionNode();
687 inline SwNodeOffset SwNode::StartOfSectionIndex() const
689 return m_pStartOfSection->GetIndex();
691 inline SwNodeOffset SwNode::EndOfSectionIndex() const
693 return EndOfSectionNode()->GetIndex();
695 inline const SwEndNode* SwNode::EndOfSectionNode() const
697 const SwStartNode* pStNd = IsStartNode() ? static_cast<const SwStartNode*>(this) : m_pStartOfSection;
698 return pStNd->m_pEndOfSection;
700 inline SwEndNode* SwNode::EndOfSectionNode()
702 const SwStartNode* pStNd = IsStartNode() ? static_cast<const SwStartNode*>(this) : m_pStartOfSection;
703 return pStNd->m_pEndOfSection;
706 inline SwNodes& SwNode::GetNodes()
708 return static_cast<SwNodes&>(GetArray());
710 inline const SwNodes& SwNode::GetNodes() const
712 return static_cast<SwNodes&>(GetArray());
715 inline SwFormatColl* SwContentNode::GetCondFormatColl() const
717 return m_pCondColl;
720 inline SwFormatColl& SwContentNode::GetAnyFormatColl() const
722 return m_pCondColl
723 ? *m_pCondColl
724 : *const_cast<SwFormatColl*>(static_cast<const SwFormatColl*>(GetRegisteredIn()));
727 inline const SwAttrSet& SwContentNode::GetSwAttrSet() const
729 return mpAttrSet ? *GetpSwAttrSet() : GetAnyFormatColl().GetAttrSet();
732 inline const SfxPoolItem& SwContentNode::GetAttr( sal_uInt16 nWhich,
733 bool bInParents ) const
735 return GetSwAttrSet().Get( nWhich, bInParents );
738 inline SwPlaceholderNode::SwPlaceholderNode(const SwNode& rWhere)
739 : SwNode(rWhere, SwNodeType::PlaceHolder)
743 inline SwNode* SwNodes::operator[]( SwNodeOffset n ) const
745 return static_cast<SwNode*>(BigPtrArray::operator[] ( sal_Int32(n) ));
748 #endif
750 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */