Base class for elements that contain block-level nodes Paragraph and 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 Body, each header and footer is stored in a separate story represented by HeaderFooter.
Shows how to remove all shapes from a node.
#include <Aspose.Words.Cpp/Story.h>
Public Member Functions | |
SharedPtr< Paragraph > | AppendParagraph (String text) |
A shortcut method that creates a Paragraph object with optional text and appends it to the end of this object. More... | |
void | DeleteShapes () |
Deletes all shapes from the text of this story. More... | |
SharedPtr< Paragraph > | get_FirstParagraph () |
Gets the first paragraph in the story. More... | |
SharedPtr< Paragraph > | get_LastParagraph () |
Gets the last paragraph in the story. More... | |
SharedPtr< ParagraphCollection > | get_Paragraphs () |
Gets a collection of paragraphs that are immediate children of the story. More... | |
StoryType | get_StoryType () const |
Gets the type of this story. More... | |
SharedPtr< TableCollection > | get_Tables () |
Gets a collection of tables that are immediate children of the story. More... | |
virtual const TypeInfo & | GetType () const override |
virtual bool | Is (const TypeInfo &target) const override |
![]() | |
SharedPtr< Node > | AppendChild (SharedPtr< Node > newChild) |
Adds the specified node to the end of the list of child nodes for this node. More... | |
SharedPtr< NodeCollection > | get_ChildNodes () |
Gets all immediate child nodes of this node. More... | |
SharedPtr< CompositeNode > | get_Container () override |
int32_t | get_Count () |
Gets the number of immediate children of this node. More... | |
SharedPtr< Node > | get_FirstChild () const |
Gets the first child of the node. More... | |
bool | get_HasChildNodes () |
Returns true if this node has any child nodes. More... | |
bool | get_IsComposite () override |
Returns true as this node can have child nodes. More... | |
SharedPtr< Node > | get_LastChild () const |
Gets the last child of the node. More... | |
SharedPtr< Node > | GetChild (NodeType nodeType, int32_t index, bool isDeep) |
Returns an Nth child node that matches the specified type. More... | |
SharedPtr< NodeCollection > | GetChildNodes (NodeType nodeType, bool isDeep) |
Returns a live collection of child nodes that match the specified type. More... | |
SharedPtr< Node > | GetCurrentNode () override |
SharedPtr< IEnumerator< SharedPtr< Node > > > | GetEnumerator () override |
Provides support for the for each style iteration over the child nodes of this node. More... | |
SharedPtr< Node > | GetNextMatchingNode (SharedPtr< Node > curNode) override |
String | GetText () override |
Gets the text of this node and of all its children. More... | |
int32_t | IndexOf (SharedPtr< Node > child) |
Returns the index of the specified child node in the child node array. More... | |
SharedPtr< Node > | InsertAfter (SharedPtr< Node > newChild, SharedPtr< Node > refChild) |
Inserts the specified node immediately after the specified reference node. More... | |
SharedPtr< Node > | InsertBefore (SharedPtr< Node > newChild, SharedPtr< Node > refChild) |
Inserts the specified node immediately before the specified reference node. More... | |
SharedPtr< Node > | PrependChild (SharedPtr< Node > newChild) |
Adds the specified node to the beginning of the list of child nodes for this node. More... | |
void | RemoveAllChildren () |
Removes all the child nodes of the current node. More... | |
SharedPtr< Node > | RemoveChild (SharedPtr< Node > oldChild) |
Removes the specified child node. More... | |
void | RemoveSmartTags () |
Removes all SmartTag descendant nodes of the current node. More... | |
SharedPtr< NodeList > | SelectNodes (String xpath) |
Selects a list of nodes matching the XPath expression. More... | |
SharedPtr< Node > | SelectSingleNode (String xpath) |
Selects the first Node that matches the XPath expression. More... | |
![]() | |
virtual bool | Accept (SharedPtr< DocumentVisitor > visitor)=0 |
Accepts a visitor. More... | |
SharedPtr< Node > | Clone (bool isCloneChildren) |
Creates a duplicate of the node. More... | |
int32_t | get_CustomNodeId () const |
Specifies custom node identifier. More... | |
virtual SharedPtr< DocumentBase > | get_Document () const |
Gets the document to which this node belongs. More... | |
SharedPtr< Node > | get_NextSibling () |
Gets the node immediately following this node. More... | |
virtual NodeType | get_NodeType () const =0 |
Gets the type of this node. More... | |
SharedPtr< CompositeNode > | get_ParentNode () |
Gets the immediate parent of this node. More... | |
SharedPtr< Node > | get_PreviousSibling () |
Gets the node immediately preceding this node. More... | |
SharedPtr< Range > | get_Range () |
Returns a Range object that represents the portion of a document that is contained in this node. More... | |
SharedPtr< CompositeNode > | GetAncestor (NodeType ancestorType) |
Gets the first ancestor of the specified NodeType. More... | |
template<typename T > | |
T | GetAncestorOf () |
SharedPtr< Node > | NextPreOrder (SharedPtr< Node > rootNode) |
Gets next node according to the pre-order tree traversal algorithm. More... | |
SharedPtr< Node > | PreviousPreOrder (SharedPtr< Node > rootNode) |
Gets the previous node according to the pre-order tree traversal algorithm. More... | |
void | Remove () |
Removes itself from the parent. More... | |
void | set_CustomNodeId (int32_t value) |
Setter for get_CustomNodeId. More... | |
String | ToString (SaveFormat saveFormat) |
Exports the content of the node into a string in the specified format. More... | |
String | ToString (SharedPtr< SaveOptions > saveOptions) |
Exports the content of the node into a string using the specified save options. More... | |
Static Public Member Functions | |
static const TypeInfo & | Type () |
![]() | |
static const TypeInfo & | Type () |
![]() | |
static String | NodeTypeToString (NodeType nodeType) |
A utility method that converts a node type enum value into a user friendly string. More... | |
static const TypeInfo & | Type () |
System::SharedPtr<Aspose::Words::Paragraph> Aspose::Words::Story::AppendParagraph | ( | System::String | text | ) |
A shortcut method that creates a Paragraph object with optional text and appends it to the end of this object.
text | The text for the paragraph. Can be null or empty string. |
Shows how to create a header and a footer.
void Aspose::Words::Story::DeleteShapes | ( | ) |
Deletes all shapes from the text of this story.
Shows how to remove all shapes from a node.
System::SharedPtr<Aspose::Words::Paragraph> Aspose::Words::Story::get_FirstParagraph | ( | ) |
Gets the first paragraph in the story.
Shows how to format a run of text using its font property.
Shows how to create and format a text box.
System::SharedPtr<Aspose::Words::Paragraph> Aspose::Words::Story::get_LastParagraph | ( | ) |
Gets the last paragraph in the story.
Shows how to move a DocumentBuilder's cursor position to a specified node.
System::SharedPtr<Aspose::Words::ParagraphCollection> Aspose::Words::Story::get_Paragraphs | ( | ) |
Gets a collection of paragraphs that are immediate children of the story.
Shows how to check whether a paragraph is a move revision.
Aspose::Words::StoryType Aspose::Words::Story::get_StoryType | ( | ) | const |
Gets the type of this story.
Shows how to remove all shapes from a node.
System::SharedPtr<Aspose::Words::Tables::TableCollection> Aspose::Words::Story::get_Tables | ( | ) |
Gets a collection of tables that are immediate children of the story.
Shows how to remove the first and last rows of all tables in a document.
|
overridevirtual |
Reimplemented from Aspose::Words::CompositeNode.
Reimplemented in Aspose::Words::HeaderFooter, and Aspose::Words::Body.
|
overridevirtual |
Reimplemented from Aspose::Words::CompositeNode.
Reimplemented in Aspose::Words::HeaderFooter, and Aspose::Words::Body.
|
static |