Aspose::Words::Story Class Reference

Base class for elements that contain block-level nodes Aspose::Words::Paragraph and Aspose::Words::Tables::Table. More...

#include "Aspose.Words.Cpp/Model/Sections/Story.h"

Inherits Aspose::Words::CompositeNode.

Inherited by Aspose::Words::Body, and Aspose::Words::HeaderFooter.

Public Member Functions

Aspose::Words::StoryType get_StoryType () const
 Gets the type of this story. More...
 
System::SharedPtr< Aspose::Words::Paragraphget_FirstParagraph ()
 Gets the first paragraph in the story. More...
 
System::SharedPtr< Aspose::Words::Paragraphget_LastParagraph ()
 Gets the last paragraph in the story. More...
 
System::SharedPtr< Aspose::Words::ParagraphCollectionget_Paragraphs ()
 Gets a collection of paragraphs that are immediate children of the story. More...
 
System::SharedPtr< Aspose::Words::Tables::TableCollectionget_Tables ()
 Gets a collection of tables that are immediate children of the story. More...
 
void DeleteShapes ()
 Deletes all shapes from the text of this story. More...
 
System::SharedPtr< Aspose::Words::ParagraphAppendParagraph (System::String text)
 A shortcut method that creates a Aspose::Words::Paragraph object with optional text and appends it to the end of this object. More...
 
- Public Member Functions inherited from Aspose::Words::CompositeNode
virtual bool get_IsComposite ()
 Returns true as this node can have child nodes. More...
 
bool get_HasChildNodes ()
 Returns true if this node has any child nodes. More...
 
System::SharedPtr< Aspose::Words::NodeCollectionget_ChildNodes ()
 Gets all immediate child nodes of this node. More...
 
System::SharedPtr< Aspose::Words::Nodeget_FirstChild () const
 Gets the first child of the node. More...
 
System::SharedPtr< Aspose::Words::Nodeget_LastChild () const
 Gets the last child of the node. More...
 
int32_t get_Count ()
 Gets the number of immediate children of this node. More...
 
System::SharedPtr< Aspose::Words::CompositeNodeget_Container ()
 
virtual System::String GetText ()
 Gets the text of this node and of all its children. More...
 
System::SharedPtr< Aspose::Words::NodeCollectionGetChildNodes (Aspose::Words::NodeType nodeType, bool isDeep)
 Returns a live collection of child nodes that match the specified type. More...
 
System::SharedPtr< Aspose::Words::NodeGetChild (Aspose::Words::NodeType nodeType, int32_t index, bool isDeep)
 Returns an Nth child node that matches the specified type. More...
 
System::SharedPtr< Aspose::Words::NodeListSelectNodes (System::String xpath)
 Selects a list of nodes matching the XPath expression. More...
 
System::SharedPtr< Aspose::Words::NodeSelectSingleNode (System::String xpath)
 Selects the first Node that matches the XPath expression. More...
 
System::SharedPtr< System::Collections::Generic::IEnumerator< System::SharedPtr< Aspose::Words::Node > > > GetEnumerator ()
 Provides support for the for each style iteration over the child nodes of this node. More...
 
System::SharedPtr< Aspose::Words::NodeAppendChild (System::SharedPtr< Aspose::Words::Node > newChild)
 Adds the specified node to the end of the list of child nodes for this node. More...
 
System::SharedPtr< Aspose::Words::NodePrependChild (System::SharedPtr< Aspose::Words::Node > newChild)
 Adds the specified node to the beginning of the list of child nodes for this node. More...
 
System::SharedPtr< Aspose::Words::NodeInsertAfter (System::SharedPtr< Aspose::Words::Node > newChild, System::SharedPtr< Aspose::Words::Node > refChild)
 Inserts the specified node immediately after the specified reference node. More...
 
System::SharedPtr< Aspose::Words::NodeInsertBefore (System::SharedPtr< Aspose::Words::Node > newChild, System::SharedPtr< Aspose::Words::Node > refChild)
 Inserts the specified node immediately before the specified reference node. More...
 
System::SharedPtr< Aspose::Words::NodeRemoveChild (System::SharedPtr< Aspose::Words::Node > oldChild)
 Removes the specified child node. More...
 
void RemoveAllChildren ()
 Removes all the child nodes of the current node. More...
 
void RemoveSmartTags ()
 Removes all Aspose::Words::Markup::SmartTag descendant nodes of the current node. More...
 
int32_t IndexOf (System::SharedPtr< Aspose::Words::Node > child)
 Returns the index of the specified child node in the child node array. More...
 
System::SharedPtr< Aspose::Words::NodeGetNextMatchingNode (System::SharedPtr< Aspose::Words::Node > curNode)
 
System::SharedPtr< Aspose::Words::NodeGetCurrentNode ()
 
- Public Member Functions inherited from Aspose::Words::Node
virtual Aspose::Words::NodeType get_NodeType () const =0
 Gets the type of this node. More...
 
System::SharedPtr< Aspose::Words::CompositeNodeget_ParentNode ()
 Gets the immediate parent of this node. More...
 
virtual System::SharedPtr< Aspose::Words::DocumentBaseget_Document ()
 Gets the document to which this node belongs. More...
 
System::SharedPtr< Aspose::Words::Nodeget_PreviousSibling ()
 Gets the node immediately preceding this node. More...
 
System::SharedPtr< Aspose::Words::Nodeget_NextSibling ()
 Gets the node immediately following this node. More...
 
System::SharedPtr< Aspose::Words::Rangeget_Range ()
 Returns a Range object that represents the portion of a document that is contained in this node. More...
 
System::SharedPtr< Aspose::Words::NodeClone (bool isCloneChildren)
 
virtual bool Accept (System::SharedPtr< Aspose::Words::DocumentVisitor > visitor)=0
 Accepts a visitor. More...
 
template<typename T >
GetAncestorOf ()
 
System::SharedPtr< Aspose::Words::CompositeNodeGetAncestor (Aspose::Words::NodeType ancestorType)
 Gets the first ancestor of the specified Aspose::Words::NodeType. More...
 
void Remove ()
 Removes itself from the parent. More...
 
System::SharedPtr< Aspose::Words::NodeNextPreOrder (System::SharedPtr< Aspose::Words::Node > rootNode)
 Gets next node according to the pre-order tree traversal algorithm. More...
 
System::SharedPtr< Aspose::Words::NodePreviousPreOrder (System::SharedPtr< Aspose::Words::Node > rootNode)
 Gets the previous node according to the pre-order tree traversal algorithm. More...
 
System::String ToString (Aspose::Words::SaveFormat saveFormat)
 Exports the content of the node into a string in the specified format. More...
 
System::String ToString (System::SharedPtr< Aspose::Words::Saving::SaveOptions > saveOptions)
 Exports the content of the node into a string using the specified save options. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from Aspose::Words::Node
static System::String NodeTypeToString (Aspose::Words::NodeType nodeType)
 A utility method that converts a node type enum value into a user friendly string. More...
 

Detailed Description

Base class for elements that contain block-level nodes Aspose::Words::Paragraph and Aspose::Words::Tables::Table.

Text of a Word document is said to consist of several stories. The main text is stored in the main text story represented by Aspose::Words::Body, each header and footer is stored in a separate story represented by Aspose::Words::HeaderFooter.

Member Function Documentation

◆ AppendParagraph()

System::SharedPtr<Aspose::Words::Paragraph> Aspose::Words::Story::AppendParagraph ( System::String  text)

A shortcut method that creates a Aspose::Words::Paragraph object with optional text and appends it to the end of this object.

Parameters
textThe text for the paragraph. Can be null or empty string.
Returns
The newly created and appended paragraph.

◆ DeleteShapes()

void Aspose::Words::Story::DeleteShapes ( )

Deletes all shapes from the text of this story.

◆ get_FirstParagraph()

System::SharedPtr<Aspose::Words::Paragraph> Aspose::Words::Story::get_FirstParagraph ( )

Gets the first paragraph in the story.

◆ get_LastParagraph()

System::SharedPtr<Aspose::Words::Paragraph> Aspose::Words::Story::get_LastParagraph ( )

Gets the last paragraph in the story.

◆ get_Paragraphs()

System::SharedPtr<Aspose::Words::ParagraphCollection> Aspose::Words::Story::get_Paragraphs ( )

Gets a collection of paragraphs that are immediate children of the story.

◆ get_StoryType()

Aspose::Words::StoryType Aspose::Words::Story::get_StoryType ( ) const

Gets the type of this story.

◆ get_Tables()

System::SharedPtr<Aspose::Words::Tables::TableCollection> Aspose::Words::Story::get_Tables ( )

Gets a collection of tables that are immediate children of the story.