Node.h
1 //////////////////////////////////////////////////////////////////////////
2 // Copyright 2001-2019 Aspose Pty Ltd. All Rights Reserved.
3 //
4 // This file is part of Aspose.Words. The source code in this file
5 // is only intended as a supplement to the documentation, and is provided
6 // "as is", without warranty of any kind, either expressed or implied.
7 //////////////////////////////////////////////////////////////////////////
8 #pragma once
9 
10 
11 #include <system/text/string_builder.h>
12 #include <system/string.h>
13 #include <system/shared_ptr.h>
14 #include <system/object.h>
15 #include <system/constraints.h>
16 #include <system/collections/stack.h>
17 #include <cstdint>
18 
19 #include "Aspose.Words.Cpp/Model/Nodes/NodeType.h"
20 #include "Aspose.Words.Cpp/Model/Document/SaveFormat.h"
21 #include "Aspose.Words.Cpp/aspose_words_api_defs.h"
22 
23 namespace Aspose { namespace Words { class AnnotationUtil; } }
24 namespace Aspose { namespace Words { class RangeBound; } }
25 namespace Aspose { namespace Words { namespace Revisions { class MoveRangeRevisionHelper; } } }
26 namespace Aspose { namespace Words { namespace Layout { namespace PreAps { class FloaterZOrderSorter; } } } }
27 namespace Aspose { namespace Words { namespace Fields { class FieldIncludeTextUpdater; } } }
28 namespace Aspose { namespace Words { class MoveRange; } }
29 namespace Aspose { namespace Words { class NodeCollection; } }
30 namespace Aspose { namespace Words { namespace Layout { class RevisionCommentsPreprocessor; } } }
31 namespace Aspose { namespace Words { namespace Layout { class ParagraphPrConverter; } } }
32 namespace Aspose { namespace Words { namespace Comparison { class ComparerNodeUtil; } } }
33 namespace Aspose { namespace Words { namespace Comparison { class ComparerIndexer; } } }
34 namespace Aspose { namespace Words { namespace Comparison { class StoryComparer; } } }
35 namespace Aspose { namespace Words { namespace Validation { class ComplexScriptRunUpdater; } } }
36 namespace Aspose { namespace Words { class DocumentInserter; } }
37 namespace Aspose { namespace Words { namespace Fields { class FieldUnlinker; } } }
38 namespace Aspose { namespace Words { namespace Fields { class HiddenParagraphTocEntry; } } }
39 namespace Aspose { namespace Words { namespace Math { class OfficeMathUtil; } } }
40 namespace Aspose { namespace Words { namespace Replacing { class FindReplaceIndexer; } } }
41 namespace Aspose { namespace Words { namespace Tables { class TableMerger; } } }
42 namespace Aspose { namespace Words { namespace RW { class InlineMarkupResolver; } } }
43 namespace Aspose { namespace Words { namespace Validation { class OfficeMathToShapeConverter; } } }
44 namespace Aspose { namespace Words { namespace Fields { class TocEntriesBookmarkDeferredRemover; } } }
45 namespace Aspose { namespace Words { class NodeEnumerator; } }
46 namespace Aspose { namespace Words { namespace Validation { namespace VmlToDml { class VmlToDmlComplexShapeConverter; } } } }
47 namespace Aspose { namespace Words { namespace RW { namespace Nrx { namespace Reader { class NrxFldCharReaderBase; } } } } }
48 namespace Aspose { namespace Words { namespace Replacing { class FindReplace; } } }
49 namespace Aspose { namespace Words { namespace MailMerging { class MailMergeRegion; } } }
50 namespace Aspose { namespace Words { namespace Fields { class FieldBuilder; } } }
51 namespace Aspose { namespace Words { namespace Fields { class Field; } } }
52 namespace Aspose { namespace Words { namespace MailMerging { class RepalacedTagRestoreCollector; } } }
53 namespace Aspose { namespace Words { namespace Revisions { class RevisionUtil; } } }
54 namespace Aspose { namespace Words { namespace Revisions { class BookmarkDeleter; } } }
55 namespace Aspose { namespace Words { namespace Revisions { class BookmarkMover; } } }
56 namespace Aspose { namespace Words { namespace Revisions { class RevisionHandlingContext; } } }
57 namespace Aspose { namespace Words { namespace Validation { class ShapeValidator; } } }
58 namespace Aspose { namespace Words { class CompositeNode; } }
59 namespace Aspose { namespace Words { namespace ApsBuilder { namespace Dml { class DmlPictureRenderer; } } } }
60 namespace Aspose { namespace Words { namespace Fields { class FieldDisplayContext; } } }
61 namespace Aspose { namespace Words { namespace Layout { namespace Core { class WarningGenerator; } } } }
62 namespace Aspose { namespace Words { namespace Layout { namespace Core { class StoryLayoutBuilder; } } } }
63 namespace Aspose { namespace Words { namespace ApsBuilder { namespace Math { class OfficeMathToApsConverter; } } } }
64 namespace Aspose { namespace Words { namespace Layout { class RunWrapFinder; } } }
65 namespace Aspose { namespace Words { class RangeDocumentBuilder; } }
66 namespace Aspose { namespace Words { namespace Fields { class FieldFakeResultAppender; } } }
67 namespace Aspose { namespace Words { namespace Fields { class FieldOldResultNodeCollection; } } }
68 namespace Aspose { namespace Words { namespace Fields { class FieldReplacer; } } }
69 namespace Aspose { namespace Words { namespace Fields { class FieldIndexAndTablesUtil; } } }
70 namespace Aspose { namespace Words { namespace Fields { class FieldIndex; } } }
71 namespace Aspose { namespace Words { namespace Fields { class ChapterTitleParagraphFinder; } } }
72 namespace Aspose { namespace Words { namespace Markup { class SdtContentUpdater; } } }
73 namespace Aspose { namespace Words { class EditableRangeEnd; } }
74 namespace Aspose { namespace Words { class EditableRangeStart; } }
75 namespace Aspose { namespace Words { class MoveRangeEnd; } }
76 namespace Aspose { namespace Words { class MoveRangeFinder; } }
77 namespace Aspose { namespace Words { class MoveRangeStart; } }
78 namespace Aspose { namespace Words { namespace Tables { class FixedGridCalculator; } } }
79 namespace Aspose { namespace Words { namespace Validation { namespace DmlToVml { class DmlUtil; } } } }
80 namespace Aspose { namespace Words { namespace RW { namespace Html { namespace Reader { class ContainerWithBordersInfo; } } } } }
81 namespace Aspose { namespace Words { namespace RW { namespace Html { namespace Writer { class HtmlStyleWriter; } } } } }
82 namespace Aspose { namespace Words { namespace RW { namespace Html { namespace Writer { class HtmlTabStopExtractor; } } } } }
83 namespace Aspose { namespace Words { namespace RW { namespace MathML { class MathMLWriter; } } } }
84 namespace Aspose { namespace Words { namespace RW { namespace MarkupLanguage { namespace Writer { class MarkupLanguageShapeWriter; } } } } }
85 namespace Aspose { namespace Words { namespace RW { namespace Odt { namespace Writer { class OdtTrackedChangesWriter; } } } } }
86 namespace Aspose { namespace Words { class SubDocument; } }
87 namespace Aspose { namespace Words { namespace Fields { class FieldPageRef; } } }
88 namespace Aspose { namespace Words { namespace Fields { class FieldRef; } } }
89 namespace Aspose { namespace Words { namespace Fields { class FieldSeqDataProvider; } } }
90 namespace Aspose { namespace Words { namespace Fields { class FieldToc; } } }
91 namespace Aspose { namespace Words { namespace Fields { class FieldXE; } } }
92 namespace Aspose { namespace Words { namespace Fields { class ParagraphTocEntry; } } }
93 namespace Aspose { namespace Words { namespace Fields { class StyleFinder; } } }
94 namespace Aspose { namespace Words { namespace Fields { class TocEntryExtractor; } } }
95 namespace Aspose { namespace Words { namespace Fields { class FieldUtil; } } }
96 namespace Aspose { namespace Words { namespace MailMerging { class TagReplacer; } } }
97 namespace Aspose { namespace Words { namespace Markup { class SdtContentHelper; } } }
98 namespace Aspose { namespace Words { namespace Markup { class XmlMapping; } } }
99 namespace Aspose { namespace Words { class ShapeFieldRemover; } }
100 namespace Aspose { namespace Words { class NodeCopier; } }
101 namespace Aspose { namespace Words { class NodeRemover; } }
102 namespace Aspose { namespace Words { class NodeTextCollector; } }
103 namespace Aspose { namespace Words { class DocumentPosition; } }
104 namespace Aspose { namespace Words { class NodeRange; } }
105 namespace Aspose { namespace Words { class NodeUtil; } }
106 namespace Aspose { namespace Words { namespace Layout { class AttributeConverter; } } }
107 namespace Aspose { namespace Words { namespace Layout { class DocumentSpanConverter; } } }
108 namespace Aspose { namespace Words { namespace Layout { namespace PreAps { class LayoutSpanPicture; } } } }
109 namespace Aspose { namespace Words { namespace Layout { namespace Core { class SpanGenerator; } } } }
110 namespace Aspose { namespace Words { class Bookmark; } }
111 namespace Aspose { namespace Words { class BookmarkEnd; } }
112 namespace Aspose { namespace Words { class BookmarkStart; } }
113 namespace Aspose { namespace Words { namespace Fields { class FieldUpdater; } } }
114 namespace Aspose { namespace Words { namespace Fields { namespace Expressions { class RectangularCellRange; } } } }
115 namespace Aspose { namespace Words { namespace Fields { class NodeRangeFieldCodeTokenizer; } } }
116 namespace Aspose { namespace Words { namespace Fields { class ResultEnumerator; } } }
117 namespace Aspose { namespace Words { namespace Fields { class FormField; } } }
118 namespace Aspose { namespace Words { class CommentRangeEnd; } }
119 namespace Aspose { namespace Words { class CommentRangeStart; } }
120 namespace Aspose { namespace Words { namespace Validation { class AnnotationValidator; } } }
121 namespace Aspose { namespace Words { namespace Validation { class CommentValidatorItem; } } }
122 namespace Aspose { namespace Words { namespace TableLayout { class Extensions; } } }
123 namespace Aspose { namespace Words { namespace Tables { class TableFormattingExpander; } } }
124 namespace Aspose { namespace Words { namespace Validation { class BookmarkValidator; } } }
125 namespace Aspose { namespace Words { class DocumentBuilder; } }
126 namespace Aspose { namespace Words { namespace Validation { class DocumentPostLoader; } } }
127 namespace Aspose { namespace Words { namespace Validation { class DocumentValidator; } } }
128 namespace Aspose { namespace Words { namespace Validation { class FieldValidator; } } }
129 namespace Aspose { namespace Words { namespace Saving { class ImageSavingArgs; } } }
130 namespace Aspose { namespace Words { class TableBuilder; } }
131 namespace Aspose { namespace Words { class WordCounter; } }
132 namespace Aspose { namespace Words { namespace Drawing { class ShapeBase; } } }
133 namespace Aspose { namespace Words { namespace ApsBuilder { namespace Shapes { class ShapeApsBuilder; } } } }
134 namespace Aspose { namespace Words { namespace RW { namespace Html { namespace Css { namespace New { class CssPositionStyleConverter; } } } } } }
135 namespace Aspose { namespace Words { namespace RW { namespace Html { namespace Writer { class HtmlCommonBorderSpanWriter; } } } } }
136 namespace Aspose { namespace Words { namespace RW { namespace Html { namespace Writer { class HtmlCoreWriter; } } } } }
137 namespace Aspose { namespace Words { namespace RW { namespace Html { namespace Writer { class HtmlParaBorderWriter; } } } } }
138 namespace Aspose { namespace Words { namespace Validation { class RubyConverter; } } }
139 namespace Aspose { namespace Words { namespace RW { namespace MarkupLanguage { namespace Writer { class MarkupLanguageDocumentTreeWriter; } } } } }
140 namespace Aspose { namespace Words { namespace RW { namespace MarkupLanguage { namespace Writer { class MarkupLanguageShapeResourceWriter; } } } } }
141 namespace Aspose { namespace Words { namespace Fields { class FieldRefUtil; } } }
142 namespace Aspose { namespace Words { namespace Fields { class FieldNumUtil; } } }
143 namespace Aspose { namespace Words { class FootnoteSeparatorCollection; } }
144 namespace Aspose { namespace Words { class NodeImporter; } }
145 namespace Aspose { namespace Words { namespace Lists { class ListCollection; } } }
146 namespace Aspose { namespace Words { namespace TableLayout { class ParagraphMeasurer; } } }
147 namespace Aspose { namespace Words { namespace TableLayout { class TableLayouter; } } }
148 namespace Aspose { namespace Words { class Inline; } }
149 namespace Aspose { namespace Words { class Paragraph; } }
150 namespace Aspose { namespace Words { namespace RW { namespace Docx { namespace Reader { class DocxDocumentReaderBase; } } } } }
151 namespace Aspose { namespace Words { namespace RW { namespace Nrx { namespace Reader { class NrxDocumentReaderBase; } } } } }
152 namespace Aspose { namespace Words { namespace RW { namespace Docx { namespace Writer { class DocxDocumentWriterBase; } } } } }
153 namespace Aspose { namespace Words { namespace RW { namespace Html { namespace Writer { class HtmlDocumentSplitter; } } } } }
154 namespace Aspose { namespace Words { namespace RW { namespace Odt { namespace Writer { class OdtShapeWriter; } } } } }
155 namespace Aspose { namespace Words { namespace RW { namespace Odt { namespace Reader { class OdtTextContentReader; } } } } }
156 namespace Aspose { namespace Words { namespace RW { namespace Odt { namespace Reader { class OdtContentReader; } } } } }
157 namespace Aspose { namespace Words { namespace RW { namespace Odt { namespace Writer { class OdtFieldWriter; } } } } }
158 namespace Aspose { namespace Words { class WordUtil; } }
159 namespace Aspose { namespace Words { namespace RW { namespace Docx { namespace Writer { class DocxDocumentWriter; } } } } }
160 namespace Aspose { namespace Words { namespace RW { namespace Doc { namespace Reader { class ModelBuilder; } } } } }
161 namespace Aspose { namespace Words { namespace RW { namespace Doc { namespace Writer { class DocWriter; } } } } }
162 namespace Aspose { namespace Words { namespace RW { namespace Html { class CssParagraph; } } } }
163 namespace Aspose { namespace Words { namespace RW { namespace HtmlCommon { class HtmlUtil; } } } }
164 namespace Aspose { namespace Words { namespace RW { namespace Html { namespace Reader { class HtmlReader; } } } } }
165 namespace Aspose { namespace Words { namespace RW { namespace Odt { namespace Writer { class OdtFootnoteWriter; } } } } }
166 namespace Aspose { namespace Words { namespace RW { namespace Odt { namespace Writer { class OdtBookmarkWriter; } } } } }
167 namespace Aspose { namespace Words { namespace RW { namespace Odt { namespace Writer { class OdtParagraphWriter; } } } } }
168 namespace Aspose { namespace Words { namespace RW { namespace Odt { namespace Writer { class OdtAutoStylesWriter; } } } } }
169 namespace Aspose { namespace Words { namespace RW { namespace Odt { namespace Writer { class OdtSpanWriter; } } } } }
170 namespace Aspose { namespace Words { namespace RW { namespace Odt { namespace Writer { class OdtTableWriter; } } } } }
171 namespace Aspose { namespace Words { namespace RW { namespace Odt { namespace Writer { class OdtParagraphPropertiesWriter; } } } } }
172 namespace Aspose { namespace Words { namespace RW { namespace Odt { namespace Writer { class OdtStylesWriter; } } } } }
173 namespace Aspose { namespace Words { namespace RW { namespace Odt { namespace Writer { class OdtWriter; } } } } }
174 namespace Aspose { namespace Words { namespace RW { namespace Rtf { namespace Reader { class RtfLegacyListHandler; } } } } }
175 namespace Aspose { namespace Words { namespace RW { namespace Rtf { namespace Reader { class RtfModelBuilder; } } } } }
176 namespace Aspose { namespace Words { namespace RW { namespace Rtf { namespace Writer { class RtfWriter; } } } } }
177 namespace Aspose { namespace Words { namespace RW { namespace Txt { namespace Writer { class TxtWriter; } } } } }
178 namespace Aspose { namespace Words { namespace RW { namespace Wml { namespace Reader { class WmlDocPrReader; } } } } }
179 namespace Aspose { namespace Words { namespace RW { namespace Wml { namespace Writer { class WmlWriter; } } } } }
180 namespace Aspose { namespace Words { enum class NodeLevel; } }
181 namespace Aspose { namespace Words { class DocumentBase; } }
182 namespace Aspose { namespace Words { class Range; } }
183 namespace Aspose { namespace Words { class Document; } }
184 namespace Aspose { namespace Words { class INodeCloningListener; } }
185 namespace Aspose { namespace Words { class DocumentVisitor; } }
186 namespace Aspose { namespace Words { enum class VisitorAction; } }
187 namespace Aspose { namespace Words { namespace Saving { class SaveOptions; } } }
188 
189 namespace Aspose {
190 
191 namespace Words {
192 
193 
194 /// <summary>
195 /// Base class for all nodes of a Word document.
196 /// </summary>
197 /// <remarks>
198 /// <p>A document is represented as a tree of nodes, similar to DOM or XmlDocument.</p>
199 /// <p>For more info see the Composite design pattern.</p>
200 /// <p>The <see cref="Aspose::Words::Node" /> class:</p>
201 /// <list type="bullet">
202 /// <item>Defines the child node interface.</item>
203 /// <item>Defines the interface for visiting nodes.</item>
204 /// <item>Provides default cloning capability.</item>
205 /// <item>Implements parent node and owner document mechanisms.</item>
206 /// <item>Implements access to sibling nodes.</item>
207 /// </list>
208 /// </remarks>
209 class Node : public virtual System::Object
210 {
211  typedef Node ThisType;
212  typedef System::Object BaseType;
213 
214  typedef ::System::BaseTypesInfo<BaseType> ThisTypeBaseTypesInfo;
215  ASPOSE_WORDS_SHARED_RTTI_INFO_DECL();
216 
218  friend class Aspose::Words::AnnotationUtil;
219  friend class Aspose::Words::RangeBound;
220  friend class Aspose::Words::Revisions::MoveRangeRevisionHelper;
221  friend class Aspose::Words::Layout::PreAps::FloaterZOrderSorter;
222  friend class Aspose::Words::Fields::FieldIncludeTextUpdater;
223  friend class Aspose::Words::MoveRange;
224  friend class Aspose::Words::NodeCollection;
225  friend class Aspose::Words::Layout::RevisionCommentsPreprocessor;
226  friend class Aspose::Words::Layout::ParagraphPrConverter;
227  friend class Aspose::Words::Comparison::ComparerNodeUtil;
228  friend class Aspose::Words::Comparison::ComparerIndexer;
229  friend class Aspose::Words::Comparison::StoryComparer;
230  friend class Aspose::Words::Validation::ComplexScriptRunUpdater;
231  friend class Aspose::Words::DocumentInserter;
232  friend class Aspose::Words::Fields::FieldUnlinker;
233  friend class Aspose::Words::Fields::HiddenParagraphTocEntry;
234  friend class Aspose::Words::Math::OfficeMathUtil;
235  friend class Aspose::Words::Replacing::FindReplaceIndexer;
236  friend class Aspose::Words::Tables::TableMerger;
237  friend class Aspose::Words::RW::InlineMarkupResolver;
238  friend class Aspose::Words::Validation::OfficeMathToShapeConverter;
239  friend class Aspose::Words::Fields::TocEntriesBookmarkDeferredRemover;
240  friend class Aspose::Words::Fields::TocEntriesBookmarkDeferredRemover;
241  friend class Aspose::Words::NodeEnumerator;
242  friend class Aspose::Words::Validation::VmlToDml::VmlToDmlComplexShapeConverter;
243  friend class Aspose::Words::RW::Nrx::Reader::NrxFldCharReaderBase;
244  friend class Aspose::Words::Replacing::FindReplace;
245  friend class Aspose::Words::MailMerging::MailMergeRegion;
246  friend class Aspose::Words::Fields::FieldBuilder;
247  friend class Aspose::Words::Fields::Field;
248  friend class Aspose::Words::MailMerging::RepalacedTagRestoreCollector;
249  friend class Aspose::Words::Revisions::RevisionUtil;
250  friend class Aspose::Words::Revisions::BookmarkDeleter;
251  friend class Aspose::Words::Revisions::BookmarkMover;
252  friend class Aspose::Words::Revisions::RevisionHandlingContext;
253  friend class Aspose::Words::Revisions::RevisionHandlingContext;
254  friend class Aspose::Words::Validation::ShapeValidator;
255  friend class Aspose::Words::CompositeNode;
256  friend class Aspose::Words::ApsBuilder::Dml::DmlPictureRenderer;
257  friend class Aspose::Words::Fields::FieldDisplayContext;
258  friend class Aspose::Words::Layout::Core::WarningGenerator;
259  friend class Aspose::Words::Layout::Core::StoryLayoutBuilder;
260  friend class Aspose::Words::ApsBuilder::Math::OfficeMathToApsConverter;
261  friend class Aspose::Words::Layout::RunWrapFinder;
262  friend class Aspose::Words::RangeDocumentBuilder;
263  friend class Aspose::Words::Fields::FieldFakeResultAppender;
264  friend class Aspose::Words::Fields::FieldOldResultNodeCollection;
265  friend class Aspose::Words::Fields::FieldReplacer;
266  friend class Aspose::Words::Fields::FieldIndexAndTablesUtil;
267  friend class Aspose::Words::Fields::FieldIndex;
268  friend class Aspose::Words::Fields::FieldIndex;
269  friend class Aspose::Words::Fields::ChapterTitleParagraphFinder;
270  friend class Aspose::Words::Markup::SdtContentUpdater;
271  friend class Aspose::Words::EditableRangeEnd;
272  friend class Aspose::Words::EditableRangeStart;
273  friend class Aspose::Words::MoveRangeEnd;
274  friend class Aspose::Words::MoveRangeFinder;
275  friend class Aspose::Words::MoveRangeStart;
276  friend class Aspose::Words::Tables::FixedGridCalculator;
277  friend class Aspose::Words::Validation::DmlToVml::DmlUtil;
278  friend class Aspose::Words::RW::Html::Reader::ContainerWithBordersInfo;
279  friend class Aspose::Words::RW::Html::Writer::HtmlStyleWriter;
280  friend class Aspose::Words::RW::Html::Writer::HtmlTabStopExtractor;
281  friend class Aspose::Words::RW::MathML::MathMLWriter;
282  friend class Aspose::Words::RW::MarkupLanguage::Writer::MarkupLanguageShapeWriter;
283  friend class Aspose::Words::RW::Odt::Writer::OdtTrackedChangesWriter;
284  friend class Aspose::Words::SubDocument;
285  friend class Aspose::Words::Fields::FieldPageRef;
286  friend class Aspose::Words::Fields::FieldRef;
287  friend class Aspose::Words::Fields::FieldSeqDataProvider;
288  friend class Aspose::Words::Fields::FieldToc;
289  friend class Aspose::Words::Fields::FieldXE;
290  friend class Aspose::Words::Fields::ParagraphTocEntry;
291  friend class Aspose::Words::Fields::StyleFinder;
292  friend class Aspose::Words::Fields::TocEntryExtractor;
293  friend class Aspose::Words::Fields::FieldUtil;
294  friend class Aspose::Words::MailMerging::TagReplacer;
295  friend class Aspose::Words::Markup::SdtContentHelper;
296  friend class Aspose::Words::Markup::XmlMapping;
297  friend class Aspose::Words::ShapeFieldRemover;
298  friend class Aspose::Words::NodeCopier;
299  friend class Aspose::Words::NodeRemover;
300  friend class Aspose::Words::NodeTextCollector;
301  friend class Aspose::Words::DocumentPosition;
302  friend class Aspose::Words::NodeRange;
303  friend class Aspose::Words::NodeUtil;
304  friend class Aspose::Words::Layout::AttributeConverter;
305  friend class Aspose::Words::Layout::DocumentSpanConverter;
306  friend class Aspose::Words::Layout::PreAps::LayoutSpanPicture;
307  friend class Aspose::Words::Layout::Core::SpanGenerator;
308  friend class Aspose::Words::Bookmark;
309  friend class Aspose::Words::BookmarkEnd;
310  friend class Aspose::Words::BookmarkStart;
311  friend class Aspose::Words::Fields::FieldUpdater;
312  friend class Aspose::Words::Fields::Expressions::RectangularCellRange;
313  friend class Aspose::Words::Fields::NodeRangeFieldCodeTokenizer;
314  friend class Aspose::Words::Fields::ResultEnumerator;
315  friend class Aspose::Words::Fields::FormField;
316  friend class Aspose::Words::CommentRangeEnd;
317  friend class Aspose::Words::CommentRangeStart;
318  friend class Aspose::Words::Validation::AnnotationValidator;
319  friend class Aspose::Words::Validation::CommentValidatorItem;
320  friend class Aspose::Words::TableLayout::Extensions;
321  friend class Aspose::Words::Tables::TableFormattingExpander;
322  friend class Aspose::Words::Validation::BookmarkValidator;
323  friend class Aspose::Words::DocumentBuilder;
324  friend class Aspose::Words::Validation::DocumentPostLoader;
325  friend class Aspose::Words::Validation::DocumentValidator;
326  friend class Aspose::Words::Validation::FieldValidator;
327  friend class Aspose::Words::Saving::ImageSavingArgs;
328  friend class Aspose::Words::TableBuilder;
329  friend class Aspose::Words::WordCounter;
330  friend class Aspose::Words::Drawing::ShapeBase;
331  friend class Aspose::Words::ApsBuilder::Shapes::ShapeApsBuilder;
332  friend class Aspose::Words::RW::Html::Css::New::CssPositionStyleConverter;
333  friend class Aspose::Words::RW::Html::Writer::HtmlCommonBorderSpanWriter;
334  friend class Aspose::Words::RW::Html::Writer::HtmlCoreWriter;
335  friend class Aspose::Words::RW::Html::Writer::HtmlParaBorderWriter;
336  friend class Aspose::Words::Validation::RubyConverter;
337  friend class Aspose::Words::RW::MarkupLanguage::Writer::MarkupLanguageDocumentTreeWriter;
338  friend class Aspose::Words::RW::MarkupLanguage::Writer::MarkupLanguageShapeResourceWriter;
339  friend class Aspose::Words::Fields::FieldRefUtil;
340  friend class Aspose::Words::Fields::FieldNumUtil;
341  friend class Aspose::Words::FootnoteSeparatorCollection;
342  friend class Aspose::Words::NodeImporter;
343  friend class Aspose::Words::Lists::ListCollection;
344  friend class Aspose::Words::TableLayout::ParagraphMeasurer;
345  friend class Aspose::Words::TableLayout::TableLayouter;
346  friend class Aspose::Words::Inline;
347  friend class Aspose::Words::Paragraph;
348  friend class Aspose::Words::RW::Docx::Reader::DocxDocumentReaderBase;
349  friend class Aspose::Words::RW::Nrx::Reader::NrxDocumentReaderBase;
350  friend class Aspose::Words::RW::Docx::Writer::DocxDocumentWriterBase;
351  friend class Aspose::Words::RW::Html::Writer::HtmlDocumentSplitter;
352  friend class Aspose::Words::RW::Odt::Writer::OdtShapeWriter;
353  friend class Aspose::Words::RW::Odt::Reader::OdtTextContentReader;
354  friend class Aspose::Words::RW::Odt::Reader::OdtContentReader;
355  friend class Aspose::Words::RW::Odt::Writer::OdtFieldWriter;
356  friend class Aspose::Words::WordUtil;
357  friend class Aspose::Words::RW::Docx::Writer::DocxDocumentWriter;
358  friend class Aspose::Words::RW::Doc::Reader::ModelBuilder;
359  friend class Aspose::Words::RW::Doc::Writer::DocWriter;
360  friend class Aspose::Words::RW::Html::CssParagraph;
361  friend class Aspose::Words::RW::HtmlCommon::HtmlUtil;
362  friend class Aspose::Words::RW::Html::Reader::HtmlReader;
363  friend class Aspose::Words::RW::Odt::Writer::OdtFootnoteWriter;
364  friend class Aspose::Words::RW::Odt::Writer::OdtBookmarkWriter;
365  friend class Aspose::Words::RW::Odt::Writer::OdtParagraphWriter;
366  friend class Aspose::Words::RW::Odt::Writer::OdtAutoStylesWriter;
367  friend class Aspose::Words::RW::Odt::Writer::OdtSpanWriter;
368  friend class Aspose::Words::RW::Odt::Writer::OdtTableWriter;
369  friend class Aspose::Words::RW::Odt::Writer::OdtParagraphPropertiesWriter;
370  friend class Aspose::Words::RW::Odt::Writer::OdtStylesWriter;
371  friend class Aspose::Words::RW::Odt::Writer::OdtWriter;
372  friend class Aspose::Words::RW::Rtf::Reader::RtfLegacyListHandler;
373  friend class Aspose::Words::RW::Rtf::Reader::RtfModelBuilder;
374  friend class Aspose::Words::RW::Rtf::Writer::RtfWriter;
375  friend class Aspose::Words::RW::Txt::Writer::TxtWriter;
376  friend class Aspose::Words::RW::Wml::Reader::WmlDocPrReader;
377  friend class Aspose::Words::RW::Wml::Writer::WmlWriter;
378 
379 public:
380  using System::Object::ToString;
381 
382 public:
383 
384  /// <summary>
385  /// Gets the type of this node.
386  /// </summary>
387  virtual ASPOSE_WORDS_SHARED_API Aspose::Words::NodeType get_NodeType() const = 0;
388  /// <summary>
389  /// Gets the immediate parent of this node.
390  /// </summary>
391  /// <remarks>
392  /// <p>If a node has just been created and not yet added to the tree,
393  /// or if it has been removed from the tree, the parent is null.</p>
394  /// </remarks>
395  ASPOSE_WORDS_SHARED_API System::SharedPtr<Aspose::Words::CompositeNode> get_ParentNode();
396  /// <summary>
397  /// Gets the document to which this node belongs.
398  /// </summary>
399  /// <remarks>
400  /// <p>The node always belongs to a document even if it has just been created
401  /// and not yet added to the tree, or if it has been removed from the tree.</p>
402  /// </remarks>
403  virtual ASPOSE_WORDS_SHARED_API System::SharedPtr<Aspose::Words::DocumentBase> get_Document();
404  /// <summary>
405  /// Gets the node immediately preceding this node.
406  /// </summary>
407  /// <remarks>
408  /// If there is no preceding node, a null is returned.
409  /// </remarks>
410  ASPOSE_WORDS_SHARED_API System::SharedPtr<Aspose::Words::Node> get_PreviousSibling();
411  /// <summary>
412  /// Gets the node immediately following this node.
413  /// </summary>
414  /// <remarks>
415  /// If there is no next node, a null is returned.
416  /// </remarks>
417  ASPOSE_WORDS_SHARED_API System::SharedPtr<Aspose::Words::Node> get_NextSibling();
418  /// <summary>
419  /// Returns true if this node can contain other nodes.
420  /// </summary>
421  /// <value>This method returns false as Node cannot have child nodes.</value>
422  virtual ASPOSE_WORDS_SHARED_API bool get_IsComposite();
423  /// <summary>
424  /// Returns a <b>Range</b> object that represents the portion of a document that is contained in this node.
425  /// </summary>
426  ASPOSE_WORDS_SHARED_API System::SharedPtr<Aspose::Words::Range> get_Range();
427 
428  ///
429  /// <include file="..\Docs\Text.xml" path="Topics/Topic[@name=&quot;Node.Clone&quot;]/*" />
430  ///
431  ASPOSE_WORDS_SHARED_API System::SharedPtr<Aspose::Words::Node> Clone(bool isCloneChildren);
432  /// <summary>
433  /// Accepts a visitor.
434  /// </summary>
435  /// <remarks>
436  /// <p>Enumerates over this node and all of its children. Each node calls a corresponding method on DocumentVisitor.</p>
437  /// <p>For more info see the Visitor design pattern.</p>
438  /// </remarks>
439  /// <param name="visitor">The visitor that will visit the nodes.</param>
440  /// <returns>True if all nodes were visited; false if DocumentVisitor stopped the operation before visiting all nodes.</returns>
441  virtual ASPOSE_WORDS_SHARED_API bool Accept(System::SharedPtr<Aspose::Words::DocumentVisitor> visitor) = 0;
442  /// <summary>
443  /// Gets the text of this node and of all its children.
444  /// </summary>
445  /// <remarks>
446  /// <p>The returned string includes all control and special characters as described in <see cref="Aspose::Words::ControlChar" />.</p>
447  /// </remarks>
448  virtual ASPOSE_WORDS_SHARED_API System::String GetText();
449  template <typename T>
451  {
452  typedef Aspose::Words::CompositeNode BaseT_CompositeNode;
453 assert_is_base_of(BaseT_CompositeNode, T);
454 System::SharedPtr<Aspose::Words::Node> curParent = System::StaticCast<Aspose::Words::Node>(this->get_ParentNode());
455 while (curParent != nullptr)
456 {
457  auto parent = System::StaticCast_noexcept<typename T::Pointee_>(curParent);
458  if (parent != nullptr)
459  {
460  return parent;
461  }
462  curParent = System::StaticCast<Aspose::Words::Node>(curParent->get_ParentNode());
463 }
464 return nullptr;
465  }
466  /// <summary>
467  /// Gets the first ancestor of the specified <see cref="Aspose::Words::NodeType" />.
468  /// </summary>
469  /// <param name="ancestorType">The node type of the ancestor to retrieve.</param>
470  /// <returns>The ancestor of the specified type or null if no ancestor of this type was found.</returns>
471  ASPOSE_WORDS_SHARED_API System::SharedPtr<Aspose::Words::CompositeNode> GetAncestor(Aspose::Words::NodeType ancestorType);
472  /// <summary>
473  /// Removes itself from the parent.
474  /// </summary>
475  ASPOSE_WORDS_SHARED_API void Remove();
476  /// <summary>
477  /// Gets next node according to the pre-order tree traversal algorithm.
478  /// </summary>
479  /// <param name="rootNode">The top node (limit) of traversal.</param>
480  /// <returns>Next node in pre-order order. Null if reached the rootNode.</returns>
481  ASPOSE_WORDS_SHARED_API System::SharedPtr<Aspose::Words::Node> NextPreOrder(System::SharedPtr<Aspose::Words::Node> rootNode);
482  /// <summary>
483  /// Gets the previous node according to the pre-order tree traversal algorithm.
484  /// </summary>
485  /// <param name="rootNode">The top node (limit) of traversal.</param>
486  /// <returns>Previous node in pre-order order. Null if reached the rootNode.</returns>
487  ASPOSE_WORDS_SHARED_API System::SharedPtr<Aspose::Words::Node> PreviousPreOrder(System::SharedPtr<Aspose::Words::Node> rootNode);
488  /// <summary>
489  /// Exports the content of the node into a string in the specified format.
490  /// </summary>
491  /// <returns>The content of the node in the specified format.</returns>
492  ASPOSE_WORDS_SHARED_API System::String ToString(Aspose::Words::SaveFormat saveFormat);
493  /// <summary>
494  /// Exports the content of the node into a string using the specified save options.
495  /// </summary>
496  /// <param name="saveOptions">Specifies the options that control how the node is saved.</param>
497  /// <returns>The content of the node in the specified format.</returns>
498  ASPOSE_WORDS_SHARED_API System::String ToString(System::SharedPtr<Aspose::Words::Saving::SaveOptions> saveOptions);
499  /// <summary>
500  /// A utility method that converts a node type enum value into a user friendly string.
501  /// </summary>
502  static ASPOSE_WORDS_SHARED_API System::String NodeTypeToString(Aspose::Words::NodeType nodeType);
503 
504 protected:
505 
506  System::SharedPtr<Aspose::Words::CompositeNode> get_FirstNonMarkupParentNode();
507  System::SharedPtr<Aspose::Words::Node> get_PreviousNonAnnotationSibling();
508  System::SharedPtr<Aspose::Words::Node> get_PreviousNonMarkupNodeLimited();
509  System::SharedPtr<Aspose::Words::Node> get_NextNonMarkupNodeLimited();
510  System::SharedPtr<Aspose::Words::CompositeNode> get_PreviousNonMarkupCompositeLimited();
511  System::SharedPtr<Aspose::Words::CompositeNode> get_NextNonMarkupCompositeLimited();
512  System::SharedPtr<Aspose::Words::Node> get_NextNonAnnotationSibling();
513  bool get_IsLastChild();
514  bool get_IsFirstChild();
515  bool get_IsFirstNonZeroLengthChild();
516  bool get_IsLastNonZeroLengthChild();
517  System::SharedPtr<Aspose::Words::Node> get_NextNode() const;
518  void set_NextNode(System::SharedPtr<Aspose::Words::Node> value);
519  System::SharedPtr<Aspose::Words::Node> get_PrevNode() const;
520  void set_PrevNode(System::SharedPtr<Aspose::Words::Node> value);
521  System::SharedPtr<Aspose::Words::Node> get_NextOrParent();
522  Aspose::Words::NodeLevel get_NodeLevel();
523  bool get_IsRemoved();
524 
525  ASPOSE_WORDS_SHARED_API Node();
526  ASPOSE_WORDS_SHARED_API Node(System::SharedPtr<Aspose::Words::DocumentBase> doc);
527 
528  System::SharedPtr<Aspose::Words::Document> FetchDocument();
529  System::SharedPtr<Aspose::Words::Document> FetchDocumentOrGlossaryMain();
530  int32_t GetStart();
531  int32_t GetEnd();
532  bool Contains(int32_t position);
533  virtual ASPOSE_WORDS_SHARED_API System::SharedPtr<Aspose::Words::Node> GetNodeFromPos(int32_t position);
534  virtual ASPOSE_WORDS_SHARED_API System::SharedPtr<Aspose::Words::Node> Clone(bool isCloneChildren, System::SharedPtr<Aspose::Words::INodeCloningListener> cloningListener);
535  static ASPOSE_WORDS_SHARED_API bool VisitorActionToBool(Aspose::Words::VisitorAction action);
536  virtual ASPOSE_WORDS_SHARED_API void GetTextToBuilder(System::SharedPtr<System::Text::StringBuilder> builder);
537  void SetParent(System::SharedPtr<Aspose::Words::Node> parentNode);
538  void SetDocument(System::SharedPtr<Aspose::Words::DocumentBase> doc);
539  bool IsAncestorNode(System::SharedPtr<Aspose::Words::Node> node);
540  System::SharedPtr<Aspose::Words::Node> GetTopmostAncestor();
541  virtual ASPOSE_WORDS_SHARED_API int32_t GetTextLength();
542  System::SharedPtr<Aspose::Words::Node> NextSiblingOfType(Aspose::Words::NodeType nodeType);
543  System::SharedPtr<Aspose::Words::Node> PreviousSiblingOfType(Aspose::Words::NodeType nodeType);
544  System::SharedPtr<Aspose::Words::Node> PreviousPreOrderOfType(System::SharedPtr<Aspose::Words::Node> rootNode, Aspose::Words::NodeType nodeType);
545  System::SharedPtr<Aspose::Words::Node> GetNearestSibling(bool isNext);
546  System::SharedPtr<Aspose::Words::Node> GetStoryAncestor(Aspose::Words::NodeType nodeType);
547  System::SharedPtr<Aspose::Words::DocumentPosition> GetBeforeDocumentPosition();
548  System::SharedPtr<Aspose::Words::DocumentPosition> GetAfterDocumentPosition();
549  bool IsAbove(System::SharedPtr<Aspose::Words::Node> node);
550  static System::SharedPtr<Aspose::Words::Node> GetCommonAncestor(System::SharedPtr<Aspose::Words::Node> nodeA, System::SharedPtr<Aspose::Words::Node> nodeB);
551  static bool NodeAIsAboveNodeB(System::SharedPtr<Aspose::Words::Node> a, System::SharedPtr<Aspose::Words::Node> b);
552  System::String GetNodeId() const;
553  ASPOSE_WORDS_SHARED_API System::Object::shared_members_type GetSharedMembers() override;
554 
555 private:
556 
557  System::WeakPtr<Aspose::Words::Node> mParentNode;
558  System::SharedPtr<Aspose::Words::Node> mNextNode;
559  System::WeakPtr<Aspose::Words::Node> mPrevNode;
560 
561  static System::SharedPtr<System::Collections::Generic::Stack<System::SharedPtr<Aspose::Words::Node>>> GetAncestors(System::SharedPtr<Aspose::Words::Node> node);
562  static System::SharedPtr<Aspose::Words::Node> FindTheLastMatchingObject(System::SharedPtr<System::Collections::Generic::Stack<System::SharedPtr<Aspose::Words::Node>>> a, System::SharedPtr<System::Collections::Generic::Stack<System::SharedPtr<Aspose::Words::Node>>> b);
563  virtual ThisType* CppMemberwiseClone() ASPOSE_CONST = 0;
564 
565 };
566 
567 }
568 }
Definition: DocumentVisitor.h:47
Definition: IFontData.h:19
Definition: CompareOptions.h:16
Definition: Hyphenation.h:18
Definition: Border.h:47
Definition: Document.h:30
Insert line breaks after every 76th character.
Stores and manages formatting of bulleted and numbered lists used in a document.
Definition: ListCollection.h:120
#define ASPOSE_CONST
Makes methods labelled as ASPOSE_CONST const.
Definition: defines.h:43
Represents a collection of nodes of a specific type.
Definition: NodeCollection.h:75
#define assert_is_base_of(Base, Derived)
The assert that checks if Derived is derived from Base.
Definition: constraints.h:73
Definition: ShapeBase.h:51
Base class for nodes that can contain other nodes.
Definition: CompositeNode.h:134
T GetAncestorOf()
Definition: Node.h:450
Definition: Border.h:65
Aspose::Words::Fields::FieldSwitchType GetSwitchType(System::String switchName)
#define FRIEND_FUNCTION_System_MakeObject
Macro to befriend MakeObject function.
Definition: smart_ptr.h:1366
virtual bool Accept(System::SharedPtr< Aspose::Words::DocumentVisitor > visitor)
Accepts a visitor.
Definition: Document.h:52
VisitorAction
Allows the visitor to control the enumeration of nodes.
Definition: VisitorAction.h:23