Base class for custom document visitors.
With DocumentVisitor you can define and execute custom operations that require enumeration over the document tree.
For example, Aspose.Words uses DocumentVisitor internally for saving Document in various formats and for other operations like finding fields or bookmarks over a fragment of a document.
To use DocumentVisitor:
DocumentVisitor provides default implementations for all of the VisitXXX methods to make it easier to create new document visitors as only the methods required for the particular visitor need to be overridden. It is not necessary to override all of the visitor methods.
For more information see the Visitor design pattern.
Shows how to use a document visitor to print a document's node structure.
#include <Aspose.Words.Cpp/DocumentVisitor.h>
Public Member Functions | |
virtual const TypeInfo & | GetType () const override |
virtual bool | Is (const TypeInfo &target) const override |
virtual VisitorAction | VisitAbsolutePositionTab (SharedPtr< AbsolutePositionTab > tab) |
Called when a AbsolutePositionTab node is encountered in the document. More... | |
virtual VisitorAction | VisitBodyEnd (SharedPtr< Body > body) |
Called when enumeration of the main text story in a section has ended. More... | |
virtual VisitorAction | VisitBodyStart (SharedPtr< Body > body) |
Called when enumeration of the main text story in a section has started. More... | |
virtual VisitorAction | VisitBookmarkEnd (SharedPtr< BookmarkEnd > bookmarkEnd) |
Called when an end of a bookmark is encountered in the document. More... | |
virtual VisitorAction | VisitBookmarkStart (SharedPtr< BookmarkStart > bookmarkStart) |
Called when a start of a bookmark is encountered in the document. More... | |
virtual VisitorAction | VisitBuildingBlockEnd (SharedPtr< BuildingBlock > block) |
Called when enumeration of a building block has ended. More... | |
virtual VisitorAction | VisitBuildingBlockStart (SharedPtr< BuildingBlock > block) |
Called when enumeration of a building block has started. More... | |
virtual VisitorAction | VisitCellEnd (SharedPtr< Cell > cell) |
Called when enumeration of a table cell has ended. More... | |
virtual VisitorAction | VisitCellStart (SharedPtr< Cell > cell) |
Called when enumeration of a table cell has started. More... | |
virtual VisitorAction | VisitCommentEnd (SharedPtr< Comment > comment) |
Called when enumeration of a comment text has ended. More... | |
virtual VisitorAction | VisitCommentRangeEnd (SharedPtr< CommentRangeEnd > commentRangeEnd) |
Called when the end of a commented range of text is encountered. More... | |
virtual VisitorAction | VisitCommentRangeStart (SharedPtr< CommentRangeStart > commentRangeStart) |
Called when the start of a commented range of text is encountered. More... | |
virtual VisitorAction | VisitCommentStart (SharedPtr< Comment > comment) |
Called when enumeration of a comment text has started. More... | |
virtual VisitorAction | VisitDocumentEnd (SharedPtr< Document > doc) |
Called when enumeration of the document has finished. More... | |
virtual VisitorAction | VisitDocumentStart (SharedPtr< Document > doc) |
Called when enumeration of the document has started. More... | |
virtual VisitorAction | VisitEditableRangeEnd (SharedPtr< EditableRangeEnd > editableRangeEnd) |
Called when an end of an editable range is encountered in the document. More... | |
virtual VisitorAction | VisitEditableRangeStart (SharedPtr< EditableRangeStart > editableRangeStart) |
Called when a start of an editable range is encountered in the document. More... | |
virtual VisitorAction | VisitFieldEnd (SharedPtr< FieldEnd > fieldEnd) |
Called when a field ends in the document. More... | |
virtual VisitorAction | VisitFieldSeparator (SharedPtr< FieldSeparator > fieldSeparator) |
Called when a field separator is encountered in the document. More... | |
virtual VisitorAction | VisitFieldStart (SharedPtr< FieldStart > fieldStart) |
Called when a field starts in the document. More... | |
virtual VisitorAction | VisitFootnoteEnd (SharedPtr< Footnote > footnote) |
Called when enumeration of a footnote or endnote text has ended. More... | |
virtual VisitorAction | VisitFootnoteStart (SharedPtr< Footnote > footnote) |
Called when enumeration of a footnote or endnote text has started. More... | |
virtual VisitorAction | VisitFormField (SharedPtr< FormField > formField) |
Called when a form field is encountered in the document. More... | |
virtual VisitorAction | VisitGlossaryDocumentEnd (SharedPtr< GlossaryDocument > glossary) |
Called when enumeration of a glossary document has ended. More... | |
virtual VisitorAction | VisitGlossaryDocumentStart (SharedPtr< GlossaryDocument > glossary) |
Called when enumeration of a glossary document has started. More... | |
virtual VisitorAction | VisitGroupShapeEnd (SharedPtr< GroupShape > groupShape) |
Called when enumeration of a group shape has ended. More... | |
virtual VisitorAction | VisitGroupShapeStart (SharedPtr< GroupShape > groupShape) |
Called when enumeration of a group shape has started. More... | |
virtual VisitorAction | VisitHeaderFooterEnd (SharedPtr< HeaderFooter > headerFooter) |
Called when enumeration of a header or footer in a section has ended. More... | |
virtual VisitorAction | VisitHeaderFooterStart (SharedPtr< HeaderFooter > headerFooter) |
Called when enumeration of a header or footer in a section has started. More... | |
virtual VisitorAction | VisitOfficeMathEnd (SharedPtr< OfficeMath > officeMath) |
Called when enumeration of a Office Math object has ended. More... | |
virtual VisitorAction | VisitOfficeMathStart (SharedPtr< OfficeMath > officeMath) |
Called when enumeration of a Office Math object has started. More... | |
virtual VisitorAction | VisitParagraphEnd (SharedPtr< Paragraph > paragraph) |
Called when enumeration of a paragraph has ended. More... | |
virtual VisitorAction | VisitParagraphStart (SharedPtr< Paragraph > paragraph) |
Called when enumeration of a paragraph has started. More... | |
virtual VisitorAction | VisitRowEnd (SharedPtr< Row > row) |
Called when enumeration of a table row has ended. More... | |
virtual VisitorAction | VisitRowStart (SharedPtr< Row > row) |
Called when enumeration of a table row has started. More... | |
virtual VisitorAction | VisitRun (SharedPtr< Run > run) |
Called when a run of text in the is encountered. More... | |
virtual VisitorAction | VisitSectionEnd (SharedPtr< Section > section) |
Called when enumeration of a section has ended. More... | |
virtual VisitorAction | VisitSectionStart (SharedPtr< Section > section) |
Called when enumeration of a section has started. More... | |
virtual VisitorAction | VisitShapeEnd (SharedPtr< Shape > shape) |
Called when enumeration of a shape has ended. More... | |
virtual VisitorAction | VisitShapeStart (SharedPtr< Shape > shape) |
Called when enumeration of a shape has started. More... | |
virtual VisitorAction | VisitSmartTagEnd (SharedPtr< SmartTag > smartTag) |
Called when enumeration of a smart tag has ended. More... | |
virtual VisitorAction | VisitSmartTagStart (SharedPtr< SmartTag > smartTag) |
Called when enumeration of a smart tag has started. More... | |
virtual VisitorAction | VisitSpecialChar (SharedPtr< SpecialChar > specialChar) |
Called when a SpecialChar node is encountered in the document. More... | |
virtual VisitorAction | VisitStructuredDocumentTagEnd (SharedPtr< StructuredDocumentTag > sdt) |
Called when enumeration of a structured document tag has ended. More... | |
virtual VisitorAction | VisitStructuredDocumentTagRangeEnd (SharedPtr< StructuredDocumentTagRangeEnd > sdtRangeEnd) |
virtual VisitorAction | VisitStructuredDocumentTagRangeStart (SharedPtr< StructuredDocumentTagRangeStart > sdtRangeStart) |
virtual VisitorAction | VisitStructuredDocumentTagStart (SharedPtr< StructuredDocumentTag > sdt) |
Called when enumeration of a structured document tag has started. More... | |
virtual VisitorAction | VisitSubDocument (SharedPtr< SubDocument > subDocument) |
Called when a subDocument is encountered. More... | |
virtual VisitorAction | VisitTableEnd (SharedPtr< Table > table) |
Called when enumeration of a table has ended. More... | |
virtual VisitorAction | VisitTableStart (SharedPtr< Table > table) |
Called when enumeration of a table has started. More... | |
Static Public Member Functions | |
static const TypeInfo & | Type () |
|
overridevirtual |
Reimplemented from System::Object.
|
overridevirtual |
Reimplemented from System::Object.
|
static |
|
virtual |
Called when a AbsolutePositionTab node is encountered in the document.
tab | The object that is being visited. |
Shows how to process absolute position tab characters with a document visitor.
|
virtual |
Called when enumeration of the main text story in a section has ended.
body | The object that is being visited. |
Shows how to use a document visitor to print a document's node structure.
|
virtual |
Called when enumeration of the main text story in a section has started.
body | The object that is being visited. |
Shows how to use a document visitor to print a document's node structure.
|
virtual |
Called when an end of a bookmark is encountered in the document.
bookmarkEnd | The object that is being visited. |
Shows how to add bookmarks and update their contents.
|
virtual |
Called when a start of a bookmark is encountered in the document.
bookmarkStart | The object that is being visited. |
Shows how to add bookmarks and update their contents.
|
virtual |
Called when enumeration of a building block has ended.
Note: A building block node and its children are not visited when you execute a Visitor over a Document. If you want to execute a Visitor over a building block, you need to execute the visitor over GlossaryDocument or call Accept().
block | The object that is being visited. |
Shows ways of accessing building blocks in a glossary document.
|
virtual |
Called when enumeration of a building block has started.
Note: A building block node and its children are not visited when you execute a Visitor over a Document. If you want to execute a Visitor over a building block, you need to execute the visitor over GlossaryDocument or call Accept().
block | The object that is being visited. |
Shows ways of accessing building blocks in a glossary document.
|
virtual |
Called when enumeration of a table cell has ended.
cell | The object that is being visited. |
Shows how to print the node structure of every table in a document.
Shows how to use a DocumentVisitor implementation to remove all hidden content from a document.
|
virtual |
Called when enumeration of a table cell has started.
cell | The object that is being visited. |
Shows how to print the node structure of every table in a document.
|
virtual |
Called when enumeration of a comment text has ended.
comment | The object that is being visited. |
Shows how to print the node structure of every comment and comment range in a document.
|
virtual |
Called when the end of a commented range of text is encountered.
commentRangeEnd | The object that is being visited. |
Shows how to print the node structure of every comment and comment range in a document.
|
virtual |
Called when the start of a commented range of text is encountered.
commentRangeStart | The object that is being visited. |
Shows how to print the node structure of every comment and comment range in a document.
|
virtual |
Called when enumeration of a comment text has started.
comment | The object that is being visited. |
Shows how to print the node structure of every comment and comment range in a document.
Shows how to use a DocumentVisitor implementation to remove all hidden content from a document.
|
virtual |
Called when enumeration of the document has finished.
doc | The object that is being visited. |
Shows how to use a document visitor to print a document's node structure.
|
virtual |
Called when enumeration of the document has started.
doc | The object that is being visited. |
Shows how to use a document visitor to print a document's node structure.
|
virtual |
Called when an end of an editable range is encountered in the document.
editableRangeEnd | The object that is being visited. |
Shows how to print the node structure of every editable range in a document.
|
virtual |
Called when a start of an editable range is encountered in the document.
editableRangeStart | The object that is being visited. |
Shows how to print the node structure of every editable range in a document.
|
virtual |
Called when a field ends in the document.
For more info see VisitFieldStart()
fieldEnd | The object that is being visited. |
Shows how to print the node structure of every field in a document.
|
virtual |
Called when a field separator is encountered in the document.
The field separator separates field code from field value in the document. Note that some fields have only field code and do not have field separator and field value.
For more info see VisitFieldStart()
fieldSeparator | The object that is being visited. |
Shows how to print the node structure of every field in a document.
|
virtual |
Called when a field starts in the document.
A field in a Word Word document consists of a field code and field value.
For example, a field that displays a page number can be represented as follows:
[FieldStart]PAGE[FieldSeparator]98[FieldEnd]
The field separator separates field code from field value in the document. Note that some fields have only field code and do not have field separator and field value.
Fields can be nested.
fieldStart | The object that is being visited. |
Shows how to print the node structure of every field in a document.
|
virtual |
Called when enumeration of a footnote or endnote text has ended.
footnote | The object that is being visited. |
Shows how to print the node structure of every footnote in a document.
|
virtual |
Called when enumeration of a footnote or endnote text has started.
footnote | The object that is being visited. |
Shows how to print the node structure of every footnote in a document.
Shows how to use a DocumentVisitor implementation to remove all hidden content from a document.
|
virtual |
Called when a form field is encountered in the document.
formField | The object that is being visited. |
Shows how to use a DocumentVisitor implementation to remove all hidden content from a document.
|
virtual |
Called when enumeration of a glossary document has ended.
Note: A glossary document node and its children are not visited when you execute a Visitor over a Document. If you want to execute a Visitor over a glossary document, you need to call Accept().
glossary | The object that is being visited. |
Shows ways of accessing building blocks in a glossary document.
|
virtual |
Called when enumeration of a glossary document has started.
Note: A glossary document node and its children are not visited when you execute a Visitor over a Document. If you want to execute a Visitor over a glossary document, you need to call Accept().
glossary | The object that is being visited. |
Shows ways of accessing building blocks in a glossary document.
|
virtual |
Called when enumeration of a group shape has ended.
groupShape | The object that is being visited. |
Shows how to create a group of shapes, and print its contents using a document visitor.
|
virtual |
Called when enumeration of a group shape has started.
groupShape | The object that is being visited. |
Shows how to create a group of shapes, and print its contents using a document visitor.
Shows how to use a DocumentVisitor implementation to remove all hidden content from a document.
|
virtual |
Called when enumeration of a header or footer in a section has ended.
headerFooter | The object that is being visited. |
Shows how to print the node structure of every header and footer in a document.
|
virtual |
Called when enumeration of a header or footer in a section has started.
headerFooter | The object that is being visited. |
Shows how to print the node structure of every header and footer in a document.
|
virtual |
Called when enumeration of a Office Math object has ended.
officeMath | The object that is being visited. |
Shows how to print the node structure of every office math node in a document.
|
virtual |
Called when enumeration of a Office Math object has started.
officeMath | The object that is being visited. |
Shows how to print the node structure of every office math node in a document.
|
virtual |
Called when enumeration of a paragraph has ended.
paragraph | The object that is being visited. |
Shows how to use a document visitor to print a document's node structure.
|
virtual |
Called when enumeration of a paragraph has started.
paragraph | The object that is being visited. |
Shows how to use a document visitor to print a document's node structure.
Shows how to use a DocumentVisitor implementation to remove all hidden content from a document.
|
virtual |
Called when enumeration of a table row has ended.
row | The object that is being visited. |
Shows how to print the node structure of every table in a document.
Shows how to use a DocumentVisitor implementation to remove all hidden content from a document.
|
virtual |
Called when enumeration of a table row has started.
row | The object that is being visited. |
Shows how to print the node structure of every table in a document.
|
virtual |
Called when a run of text in the is encountered.
run | The object that is being visited. |
Shows how to use a document visitor to print a document's node structure.
|
virtual |
Called when enumeration of a section has ended.
section | The object that is being visited. |
Shows how to use a document visitor to print a document's node structure.
|
virtual |
Called when enumeration of a section has started.
section | The object that is being visited. |
Shows how to use a document visitor to print a document's node structure.
|
virtual |
Called when enumeration of a shape has ended.
shape | The object that is being visited. |
Shows how to create a group of shapes, and print its contents using a document visitor.
|
virtual |
Called when enumeration of a shape has started.
shape | The object that is being visited. |
Shows how to create a group of shapes, and print its contents using a document visitor.
Shows how to use a DocumentVisitor implementation to remove all hidden content from a document.
|
virtual |
Called when enumeration of a smart tag has ended.
smartTag | The object that is being visited. |
Shows how to print the node structure of every smart tag in a document.
|
virtual |
Called when enumeration of a smart tag has started.
smartTag | The object that is being visited. |
Shows how to print the node structure of every smart tag in a document.
|
virtual |
Called when a SpecialChar node is encountered in the document.
specialChar | The object that is being visited. |
Shows how to use a DocumentVisitor implementation to remove all hidden content from a document.
|
virtual |
Called when enumeration of a structured document tag has ended.
sdt | The object that is being visited. |
Shows how to print the node structure of every structured document tag in a document.
|
virtual |
|
virtual |
|
virtual |
Called when enumeration of a structured document tag has started.
sdt | The object that is being visited. |
Shows how to print the node structure of every structured document tag in a document.
|
virtual |
Called when a subDocument is encountered.
subDocument | The object that is being visited. |
Shows how to use a document visitor to print a document's node structure.
|
virtual |
Called when enumeration of a table has ended.
table | The object that is being visited. |
Shows how to print the node structure of every table in a document.
Shows how to use a DocumentVisitor implementation to remove all hidden content from a document.
|
virtual |
Called when enumeration of a table has started.
table | The object that is being visited. |
Shows how to print the node structure of every table in a document.