Enumerates page layout entities of a document. You can use this class to walk over the page layout model. Available properties are type, geometry, text and page index where entity is rendered, as well as overall structure and relationships. Use combination of GetEntity() and Current move to the entity which corresponds to a document node.
Shows ways of traversing a document's layout entities.
#include <Aspose.Words.Cpp/Layout/LayoutEnumerator.h>
Public Member Functions | |
LayoutEnumerator (SharedPtr< Document > document) | |
Initializes new instance of this class. More... | |
SharedPtr< Object > | get_Current () const |
Gets or sets current position in the page layout model. This property returns an opaque object which corresponds to the current layout entity. More... | |
SharedPtr< Document > | get_Document () const |
Gets document this instance enumerates. More... | |
String | get_Kind () |
Gets the kind of the current entity. This can be an empty string but never null. More... | |
int32_t | get_PageIndex () |
Gets the 1-based index of a page which contains the current entity. More... | |
RectangleF | get_Rectangle () |
Returns the bounding rectangle of the current entity relative to the page top left corner (in points). More... | |
String | get_Text () |
Gets text of the current span entity. Throws for other entity types. More... | |
LayoutEntityType | get_Type () |
Gets the type of the current entity. More... | |
virtual const TypeInfo & | GetType () const override |
virtual bool | Is (const TypeInfo &target) const override |
bool | MoveFirstChild () |
Moves to the first child entity. More... | |
bool | MoveLastChild () |
Moves to the last child entity. More... | |
bool | MoveNext () |
Moves to the next sibling entity in visual order. When iterating lines of a paragraph broken across pages this method will not move to the next page but rather move to the next entity on the same page. More... | |
bool | MoveNextLogical () |
Moves to the next sibling entity in a logical order. When iterating lines of a paragraph broken across pages this method will move to the next line even if it resides on another page. More... | |
bool | MoveParent () |
Moves to the parent entity. More... | |
bool | MoveParent (LayoutEntityType types) |
Moves to the parent entity of the specified type. More... | |
bool | MovePrevious () |
Moves to the previous sibling entity. More... | |
bool | MovePreviousLogical () |
Moves to the previous sibling entity in a logical order. When iterating lines of a paragraph broken across pages this method will move to the previous line even if it resides on another page. More... | |
void | Reset () |
Moves the enumerator to the first page of the document. More... | |
void | set_Current (SharedPtr< Object > value) |
Setter for get_Current. More... | |
Static Public Member Functions | |
static const TypeInfo & | Type () |
Aspose::Words::Layout::LayoutEnumerator::LayoutEnumerator | ( | System::SharedPtr< Aspose::Words::Document > | document | ) |
Initializes new instance of this class.
If page layout model of the document hasn't been built the enumerator calls UpdatePageLayout to build it.
Whenever document is updated and new page layout model is created, a new enumerator must be used to access it.
document | A document whose page layout model to enumerate. |
Shows ways of traversing a document's layout entities.
System::SharedPtr<System::Object> Aspose::Words::Layout::LayoutEnumerator::get_Current | ( | ) | const |
Gets or sets current position in the page layout model. This property returns an opaque object which corresponds to the current layout entity.
Shows how to see the the ranges of pages that a node spans.
System::SharedPtr<Aspose::Words::Document> Aspose::Words::Layout::LayoutEnumerator::get_Document | ( | ) | const |
Gets document this instance enumerates.
Shows ways of traversing a document's layout entities.
System::String Aspose::Words::Layout::LayoutEnumerator::get_Kind | ( | ) |
Gets the kind of the current entity. This can be an empty string but never null.
Shows ways of traversing a document's layout entities.
int32_t Aspose::Words::Layout::LayoutEnumerator::get_PageIndex | ( | ) |
Gets the 1-based index of a page which contains the current entity.
Shows ways of traversing a document's layout entities.
System::Drawing::RectangleF Aspose::Words::Layout::LayoutEnumerator::get_Rectangle | ( | ) |
Returns the bounding rectangle of the current entity relative to the page top left corner (in points).
Shows ways of traversing a document's layout entities.
System::String Aspose::Words::Layout::LayoutEnumerator::get_Text | ( | ) |
Gets text of the current span entity. Throws for other entity types.
Shows ways of traversing a document's layout entities.
Aspose::Words::Layout::LayoutEntityType Aspose::Words::Layout::LayoutEnumerator::get_Type | ( | ) |
Gets the type of the current entity.
Shows ways of traversing a document's layout entities.
|
overridevirtual |
Reimplemented from System::Object.
|
overridevirtual |
Reimplemented from System::Object.
bool Aspose::Words::Layout::LayoutEnumerator::MoveFirstChild | ( | ) |
Moves to the first child entity.
Shows ways of traversing a document's layout entities.
bool Aspose::Words::Layout::LayoutEnumerator::MoveLastChild | ( | ) |
Moves to the last child entity.
Shows ways of traversing a document's layout entities.
bool Aspose::Words::Layout::LayoutEnumerator::MoveNext | ( | ) |
Moves to the next sibling entity in visual order. When iterating lines of a paragraph broken across pages this method will not move to the next page but rather move to the next entity on the same page.
Shows ways of traversing a document's layout entities.
bool Aspose::Words::Layout::LayoutEnumerator::MoveNextLogical | ( | ) |
Moves to the next sibling entity in a logical order. When iterating lines of a paragraph broken across pages this method will move to the next line even if it resides on another page.
Shows ways of traversing a document's layout entities.
bool Aspose::Words::Layout::LayoutEnumerator::MoveParent | ( | ) |
Moves to the parent entity.
Shows ways of traversing a document's layout entities.
bool Aspose::Words::Layout::LayoutEnumerator::MoveParent | ( | Aspose::Words::Layout::LayoutEntityType | types | ) |
Moves to the parent entity of the specified type.
types | The parent entity type to move to. Use bitwise-OR to specify multiple parent types. |
Shows ways of traversing a document's layout entities.
bool Aspose::Words::Layout::LayoutEnumerator::MovePrevious | ( | ) |
Moves to the previous sibling entity.
Shows ways of traversing a document's layout entities.
bool Aspose::Words::Layout::LayoutEnumerator::MovePreviousLogical | ( | ) |
Moves to the previous sibling entity in a logical order. When iterating lines of a paragraph broken across pages this method will move to the previous line even if it resides on another page.
Shows ways of traversing a document's layout entities.
void Aspose::Words::Layout::LayoutEnumerator::Reset | ( | ) |
Moves the enumerator to the first page of the document.
Shows ways of traversing a document's layout entities.
void Aspose::Words::Layout::LayoutEnumerator::set_Current | ( | System::SharedPtr< System::Object > | value | ) |
|
static |