Detailed Description

Base class for inline-level nodes that can have character formatting associated with them, but cannot have child nodes of their own.

A class derived from Inline can be a child of Paragraph.

Examples

Shows how to view revision-related properties of Inline nodes.

auto doc = MakeObject<Document>(MyDir + u"Revision runs.docx");
// This document has 6 revisions
ASSERT_EQ(6, doc->get_Revisions()->get_Count());
// The parent node of a revision is the run that the revision concerns, which is an Inline node
auto run = System::DynamicCast<Run>(doc->get_Revisions()->idx_get(0)->get_ParentNode());
// Get the parent paragraph
SharedPtr<Paragraph> firstParagraph = run->get_ParentParagraph();
SharedPtr<RunCollection> runs = firstParagraph->get_Runs();
ASSERT_EQ(6, runs->ToArray()->get_Length());
// The text in the run at index #2 was typed after revisions were tracked, so it will count as an insert revision
// The font was changed, so it will also be a format revision
ASSERT_TRUE(runs->idx_get(2)->get_IsInsertRevision());
ASSERT_TRUE(runs->idx_get(2)->get_IsFormatRevision());
// If one node was moved from one place to another while changes were tracked,
// the node will be placed at the departure location as a "move to revision",
// and a "move from revision" node will be left behind at the origin, in case we want to reject changes
// Highlighting text and dragging it to another place with the mouse and cut-and-pasting (but not copy-pasting) both count as "move revisions"
// The node with the "IsMoveToRevision" flag is the arrival of the move operation, and the node with the "IsMoveFromRevision" flag is the departure point
ASSERT_TRUE(runs->idx_get(1)->get_IsMoveToRevision());
ASSERT_TRUE(runs->idx_get(4)->get_IsMoveFromRevision());
// If an Inline node gets deleted while changes are being tracked, it will leave behind a node with the IsDeleteRevision flag set to true until changes are accepted
ASSERT_TRUE(runs->idx_get(5)->get_IsDeleteRevision());

#include <Aspose.Words.Cpp/Model/Text/Inline.h>

+ Inheritance diagram for Aspose::Words::Inline:

Public Member Functions

SharedPtr< Fontget_Font ()
 Provides access to the font formatting of this object. More...
 
bool get_IsDeleteRevision ()
 Returns true if this object was deleted in Microsoft Word while change tracking was enabled. More...
 
bool get_IsFormatRevision ()
 Returns true if formatting of the object was changed in Microsoft Word while change tracking was enabled. More...
 
bool get_IsInsertRevision ()
 Returns true if this object was inserted in Microsoft Word while change tracking was enabled. More...
 
bool get_IsMoveFromRevision ()
 Returns true if this object was moved (deleted) in Microsoft Word while change tracking was enabled. More...
 
bool get_IsMoveToRevision ()
 Returns true if this object was moved (inserted) in Microsoft Word while change tracking was enabled. More...
 
SharedPtr< Paragraphget_ParentParagraph ()
 Retrieves the parent Paragraph of this node. More...
 
virtual const TypeInfoGetType () const override
 
virtual bool Is (const TypeInfo &target) const override
 
- Public Member Functions inherited from Node
virtual bool Accept (SharedPtr< DocumentVisitor > visitor)=0
 Accepts a visitor. More...
 
SharedPtr< NodeClone (bool isCloneChildren)
 
virtual SharedPtr< DocumentBaseget_Document () const
 Gets the document to which this node belongs. More...
 
virtual bool get_IsComposite ()
 Returns true if this node can contain other nodes. More...
 
SharedPtr< Nodeget_NextSibling ()
 Gets the node immediately following this node. More...
 
virtual NodeType get_NodeType () const =0
 Gets the type of this node. More...
 
SharedPtr< CompositeNodeget_ParentNode ()
 Gets the immediate parent of this node. More...
 
SharedPtr< Nodeget_PreviousSibling ()
 Gets the node immediately preceding this node. More...
 
SharedPtr< Rangeget_Range ()
 Returns a Range object that represents the portion of a document that is contained in this node. More...
 
SharedPtr< CompositeNodeGetAncestor (NodeType ancestorType)
 Gets the first ancestor of the specified NodeType. More...
 
template<typename T >
GetAncestorOf ()
 
virtual String GetText ()
 Gets the text of this node and of all its children. More...
 
SharedPtr< NodeNextPreOrder (SharedPtr< Node > rootNode)
 Gets next node according to the pre-order tree traversal algorithm. More...
 
SharedPtr< NodePreviousPreOrder (SharedPtr< Node > rootNode)
 Gets the previous node according to the pre-order tree traversal algorithm. More...
 
void Remove ()
 Removes itself from the parent. 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...
 
- Public Member Functions inherited from Object
ASPOSECPP_SHARED_API Object ()
 
ASPOSECPP_SHARED_API Object (Object const &x)
 
virtual ASPOSECPP_SHARED_API ~Object ()
 
virtual ASPOSECPP_SHARED_API bool Equals (ptr obj)
 
Detail::SmartPtrCounter * GetCounter ()
 
virtual ASPOSECPP_SHARED_API int GetHashCode () const
 
ASPOSECPP_SHARED_API void Lock ()
 
virtual ASPOSECPP_SHARED_API ptr MemberwiseClone () const
 
Objectoperator= (Object const &x)
 
bool ReferenceEquals (String const &str, std::nullptr_t)
 
bool ReferenceEquals (String const &str1, String const &str2)
 
int RemovedSharedRefs (int count)
 
virtual ASPOSECPP_SHARED_API void SetTemplateWeakPtr (unsigned int argument)
 
int SharedCount () const
 
ObjectSharedRefAdded ()
 
int SharedRefRemovedSafe ()
 
virtual ASPOSECPP_SHARED_API String ToString () const
 
ASPOSECPP_SHARED_API void Unlock ()
 
Detail::SmartPtrCounter * WeakRefAdded ()
 
void WeakRefRemoved ()
 

Static Public Member Functions

static const TypeInfoType ()
 
- Static Public Member Functions inherited from Node
static String NodeTypeToString (NodeType nodeType)
 A utility method that converts a node type enum value into a user friendly string. More...
 
static const TypeInfoType ()
 
- Static Public Member Functions inherited from Object
bool Equals (double const &objA, double const &objB)
 
bool Equals (float const &objA, float const &objB)
 
static std::enable_if<!IsSmartPtr< T1 >::value &&!IsSmartPtr< T2 >::value, bool >::type Equals (T1 const &objA, T2 const &objB)
 
static std::enable_if< IsSmartPtr< T1 >::value &&IsSmartPtr< T2 >::value, bool >::type Equals (T1 const &objA, T2 const &objB)
 
static bool ReferenceEquals (ptr const &objA, ptr const &objB)
 
static std::enable_if<!IsSmartPtr< T >::value, bool >::type ReferenceEquals (T const &objA, std::nullptr_t)
 
static std::enable_if<!IsSmartPtr< T >::value, bool >::type ReferenceEquals (T const &objA, T const &objB)
 
static const TypeInfoType ()
 

Additional Inherited Members

- Public Types inherited from Object
typedef SmartPtr< Objectptr
 
typedef System::Details::SharedMembersType shared_members_type
 

Member Function Documentation

◆ get_Font()

System::SharedPtr<Aspose::Words::Font> Aspose::Words::Inline::get_Font ( )

Provides access to the font formatting of this object.

Examples

Shows how to construct an Aspose Words document node by node.

auto doc = MakeObject<Document>();
// A newly created blank document still comes one section, one body and one paragraph
// Calling this method will remove all those nodes to completely empty the document
doc->RemoveAllChildren();
// This document now has no composite nodes that content can be added to
// If we wish to edit it, we will need to repopulate its node collection,
// which we will start to do with by creating a new Section node
auto section = MakeObject<Section>(doc);
// Append the section to the document
doc->AppendChild(section);
// Lets set some properties for the section
section->get_PageSetup()->set_SectionStart(SectionStart::NewPage);
section->get_PageSetup()->set_PaperSize(PaperSize::Letter);
// The section that we created is empty, lets populate it. The section needs at least the Body node
auto body = MakeObject<Body>(doc);
section->AppendChild(body);
// The body needs to have at least one paragraph
// Note that the paragraph has not yet been added to the document,
// but we have to specify the parent document
// The parent document is needed so the paragraph can correctly work
// with styles and other document-wide information
auto para = MakeObject<Paragraph>(doc);
body->AppendChild(para);
// We can set some formatting for the paragraph
para->get_ParagraphFormat()->set_StyleName(u"Heading 1");
para->get_ParagraphFormat()->set_Alignment(ParagraphAlignment::Center);
// So far we have one empty paragraph in the document
// The document is valid and can be saved, but lets add some text before saving
// Create a new run of text and add it to our paragraph
auto run = MakeObject<Run>(doc);
run->set_Text(u"Hello World!");
run->get_Font()->set_Color(System::Drawing::Color::get_Red());
para->AppendChild(run);
ASSERT_EQ(String(u"Hello World!") + ControlChar::SectionBreakChar, doc->GetText());
doc->Save(ArtifactsDir + u"Section.CreateFromScratch.docx");

◆ get_IsDeleteRevision()

bool Aspose::Words::Inline::get_IsDeleteRevision ( )

Returns true if this object was deleted in Microsoft Word while change tracking was enabled.

Examples

Shows how to view revision-related properties of Inline nodes.

auto doc = MakeObject<Document>(MyDir + u"Revision runs.docx");
// This document has 6 revisions
ASSERT_EQ(6, doc->get_Revisions()->get_Count());
// The parent node of a revision is the run that the revision concerns, which is an Inline node
auto run = System::DynamicCast<Run>(doc->get_Revisions()->idx_get(0)->get_ParentNode());
// Get the parent paragraph
SharedPtr<Paragraph> firstParagraph = run->get_ParentParagraph();
SharedPtr<RunCollection> runs = firstParagraph->get_Runs();
ASSERT_EQ(6, runs->ToArray()->get_Length());
// The text in the run at index #2 was typed after revisions were tracked, so it will count as an insert revision
// The font was changed, so it will also be a format revision
ASSERT_TRUE(runs->idx_get(2)->get_IsInsertRevision());
ASSERT_TRUE(runs->idx_get(2)->get_IsFormatRevision());
// If one node was moved from one place to another while changes were tracked,
// the node will be placed at the departure location as a "move to revision",
// and a "move from revision" node will be left behind at the origin, in case we want to reject changes
// Highlighting text and dragging it to another place with the mouse and cut-and-pasting (but not copy-pasting) both count as "move revisions"
// The node with the "IsMoveToRevision" flag is the arrival of the move operation, and the node with the "IsMoveFromRevision" flag is the departure point
ASSERT_TRUE(runs->idx_get(1)->get_IsMoveToRevision());
ASSERT_TRUE(runs->idx_get(4)->get_IsMoveFromRevision());
// If an Inline node gets deleted while changes are being tracked, it will leave behind a node with the IsDeleteRevision flag set to true until changes are accepted
ASSERT_TRUE(runs->idx_get(5)->get_IsDeleteRevision());

◆ get_IsFormatRevision()

bool Aspose::Words::Inline::get_IsFormatRevision ( )

Returns true if formatting of the object was changed in Microsoft Word while change tracking was enabled.

Examples

Shows how to view revision-related properties of Inline nodes.

auto doc = MakeObject<Document>(MyDir + u"Revision runs.docx");
// This document has 6 revisions
ASSERT_EQ(6, doc->get_Revisions()->get_Count());
// The parent node of a revision is the run that the revision concerns, which is an Inline node
auto run = System::DynamicCast<Run>(doc->get_Revisions()->idx_get(0)->get_ParentNode());
// Get the parent paragraph
SharedPtr<Paragraph> firstParagraph = run->get_ParentParagraph();
SharedPtr<RunCollection> runs = firstParagraph->get_Runs();
ASSERT_EQ(6, runs->ToArray()->get_Length());
// The text in the run at index #2 was typed after revisions were tracked, so it will count as an insert revision
// The font was changed, so it will also be a format revision
ASSERT_TRUE(runs->idx_get(2)->get_IsInsertRevision());
ASSERT_TRUE(runs->idx_get(2)->get_IsFormatRevision());
// If one node was moved from one place to another while changes were tracked,
// the node will be placed at the departure location as a "move to revision",
// and a "move from revision" node will be left behind at the origin, in case we want to reject changes
// Highlighting text and dragging it to another place with the mouse and cut-and-pasting (but not copy-pasting) both count as "move revisions"
// The node with the "IsMoveToRevision" flag is the arrival of the move operation, and the node with the "IsMoveFromRevision" flag is the departure point
ASSERT_TRUE(runs->idx_get(1)->get_IsMoveToRevision());
ASSERT_TRUE(runs->idx_get(4)->get_IsMoveFromRevision());
// If an Inline node gets deleted while changes are being tracked, it will leave behind a node with the IsDeleteRevision flag set to true until changes are accepted
ASSERT_TRUE(runs->idx_get(5)->get_IsDeleteRevision());

◆ get_IsInsertRevision()

bool Aspose::Words::Inline::get_IsInsertRevision ( )

Returns true if this object was inserted in Microsoft Word while change tracking was enabled.

Examples

Shows how to view revision-related properties of Inline nodes.

auto doc = MakeObject<Document>(MyDir + u"Revision runs.docx");
// This document has 6 revisions
ASSERT_EQ(6, doc->get_Revisions()->get_Count());
// The parent node of a revision is the run that the revision concerns, which is an Inline node
auto run = System::DynamicCast<Run>(doc->get_Revisions()->idx_get(0)->get_ParentNode());
// Get the parent paragraph
SharedPtr<Paragraph> firstParagraph = run->get_ParentParagraph();
SharedPtr<RunCollection> runs = firstParagraph->get_Runs();
ASSERT_EQ(6, runs->ToArray()->get_Length());
// The text in the run at index #2 was typed after revisions were tracked, so it will count as an insert revision
// The font was changed, so it will also be a format revision
ASSERT_TRUE(runs->idx_get(2)->get_IsInsertRevision());
ASSERT_TRUE(runs->idx_get(2)->get_IsFormatRevision());
// If one node was moved from one place to another while changes were tracked,
// the node will be placed at the departure location as a "move to revision",
// and a "move from revision" node will be left behind at the origin, in case we want to reject changes
// Highlighting text and dragging it to another place with the mouse and cut-and-pasting (but not copy-pasting) both count as "move revisions"
// The node with the "IsMoveToRevision" flag is the arrival of the move operation, and the node with the "IsMoveFromRevision" flag is the departure point
ASSERT_TRUE(runs->idx_get(1)->get_IsMoveToRevision());
ASSERT_TRUE(runs->idx_get(4)->get_IsMoveFromRevision());
// If an Inline node gets deleted while changes are being tracked, it will leave behind a node with the IsDeleteRevision flag set to true until changes are accepted
ASSERT_TRUE(runs->idx_get(5)->get_IsDeleteRevision());

◆ get_IsMoveFromRevision()

bool Aspose::Words::Inline::get_IsMoveFromRevision ( )

Returns true if this object was moved (deleted) in Microsoft Word while change tracking was enabled.

Examples

Shows how to view revision-related properties of Inline nodes.

auto doc = MakeObject<Document>(MyDir + u"Revision runs.docx");
// This document has 6 revisions
ASSERT_EQ(6, doc->get_Revisions()->get_Count());
// The parent node of a revision is the run that the revision concerns, which is an Inline node
auto run = System::DynamicCast<Run>(doc->get_Revisions()->idx_get(0)->get_ParentNode());
// Get the parent paragraph
SharedPtr<Paragraph> firstParagraph = run->get_ParentParagraph();
SharedPtr<RunCollection> runs = firstParagraph->get_Runs();
ASSERT_EQ(6, runs->ToArray()->get_Length());
// The text in the run at index #2 was typed after revisions were tracked, so it will count as an insert revision
// The font was changed, so it will also be a format revision
ASSERT_TRUE(runs->idx_get(2)->get_IsInsertRevision());
ASSERT_TRUE(runs->idx_get(2)->get_IsFormatRevision());
// If one node was moved from one place to another while changes were tracked,
// the node will be placed at the departure location as a "move to revision",
// and a "move from revision" node will be left behind at the origin, in case we want to reject changes
// Highlighting text and dragging it to another place with the mouse and cut-and-pasting (but not copy-pasting) both count as "move revisions"
// The node with the "IsMoveToRevision" flag is the arrival of the move operation, and the node with the "IsMoveFromRevision" flag is the departure point
ASSERT_TRUE(runs->idx_get(1)->get_IsMoveToRevision());
ASSERT_TRUE(runs->idx_get(4)->get_IsMoveFromRevision());
// If an Inline node gets deleted while changes are being tracked, it will leave behind a node with the IsDeleteRevision flag set to true until changes are accepted
ASSERT_TRUE(runs->idx_get(5)->get_IsDeleteRevision());

◆ get_IsMoveToRevision()

bool Aspose::Words::Inline::get_IsMoveToRevision ( )

Returns true if this object was moved (inserted) in Microsoft Word while change tracking was enabled.

Examples

Shows how to view revision-related properties of Inline nodes.

auto doc = MakeObject<Document>(MyDir + u"Revision runs.docx");
// This document has 6 revisions
ASSERT_EQ(6, doc->get_Revisions()->get_Count());
// The parent node of a revision is the run that the revision concerns, which is an Inline node
auto run = System::DynamicCast<Run>(doc->get_Revisions()->idx_get(0)->get_ParentNode());
// Get the parent paragraph
SharedPtr<Paragraph> firstParagraph = run->get_ParentParagraph();
SharedPtr<RunCollection> runs = firstParagraph->get_Runs();
ASSERT_EQ(6, runs->ToArray()->get_Length());
// The text in the run at index #2 was typed after revisions were tracked, so it will count as an insert revision
// The font was changed, so it will also be a format revision
ASSERT_TRUE(runs->idx_get(2)->get_IsInsertRevision());
ASSERT_TRUE(runs->idx_get(2)->get_IsFormatRevision());
// If one node was moved from one place to another while changes were tracked,
// the node will be placed at the departure location as a "move to revision",
// and a "move from revision" node will be left behind at the origin, in case we want to reject changes
// Highlighting text and dragging it to another place with the mouse and cut-and-pasting (but not copy-pasting) both count as "move revisions"
// The node with the "IsMoveToRevision" flag is the arrival of the move operation, and the node with the "IsMoveFromRevision" flag is the departure point
ASSERT_TRUE(runs->idx_get(1)->get_IsMoveToRevision());
ASSERT_TRUE(runs->idx_get(4)->get_IsMoveFromRevision());
// If an Inline node gets deleted while changes are being tracked, it will leave behind a node with the IsDeleteRevision flag set to true until changes are accepted
ASSERT_TRUE(runs->idx_get(5)->get_IsDeleteRevision());

◆ get_ParentParagraph()

System::SharedPtr<Aspose::Words::Paragraph> Aspose::Words::Inline::get_ParentParagraph ( )

Retrieves the parent Paragraph of this node.

Examples

Shows how to view revision-related properties of Inline nodes.

auto doc = MakeObject<Document>(MyDir + u"Revision runs.docx");
// This document has 6 revisions
ASSERT_EQ(6, doc->get_Revisions()->get_Count());
// The parent node of a revision is the run that the revision concerns, which is an Inline node
auto run = System::DynamicCast<Run>(doc->get_Revisions()->idx_get(0)->get_ParentNode());
// Get the parent paragraph
SharedPtr<Paragraph> firstParagraph = run->get_ParentParagraph();
SharedPtr<RunCollection> runs = firstParagraph->get_Runs();
ASSERT_EQ(6, runs->ToArray()->get_Length());
// The text in the run at index #2 was typed after revisions were tracked, so it will count as an insert revision
// The font was changed, so it will also be a format revision
ASSERT_TRUE(runs->idx_get(2)->get_IsInsertRevision());
ASSERT_TRUE(runs->idx_get(2)->get_IsFormatRevision());
// If one node was moved from one place to another while changes were tracked,
// the node will be placed at the departure location as a "move to revision",
// and a "move from revision" node will be left behind at the origin, in case we want to reject changes
// Highlighting text and dragging it to another place with the mouse and cut-and-pasting (but not copy-pasting) both count as "move revisions"
// The node with the "IsMoveToRevision" flag is the arrival of the move operation, and the node with the "IsMoveFromRevision" flag is the departure point
ASSERT_TRUE(runs->idx_get(1)->get_IsMoveToRevision());
ASSERT_TRUE(runs->idx_get(4)->get_IsMoveFromRevision());
// If an Inline node gets deleted while changes are being tracked, it will leave behind a node with the IsDeleteRevision flag set to true until changes are accepted
ASSERT_TRUE(runs->idx_get(5)->get_IsDeleteRevision());

◆ GetType()

◆ Is()

◆ Type()

static const System::TypeInfo& Aspose::Words::Inline::Type ( )
static
String
static constexpr char16_t SectionBreakChar
End of section character: (char)12 or "\f".
Definition: ControlChar.h:1253
@ Letter
8.5 x 11 inches.
@ NewPage
The section starts from a new page.
static ASPOSECPP_SHARED_API Color get_Red()
@ Center
Text is centered horizontally.