The model for the Text Layout Framework is defined mainly by the elements package, which includes classes and interfaces that define the data structure that holds the text. The model uses a hierarchical tree to represent text and each node in the tree is an instance of a class in the elements package.
The root node of the tree is always an instance of the TextFlow class. The TextFlow class represents an entire story, which is a collection of text that is treated as one unit, or flow, even if the flow requires more than one column or text container to display. The remaining elements in the hierarchy are loosely based on XHTML elements. For example, the root node can have children of two types, DivElement and ParagraphElement. DivElements and ParagraphElements are similar, but not identical, to the <div /> and <p /> XHTML elements.
DivElements are more narrowly defined than the <div /> XHTML element in that DivElements contain only ParagraphElements and other DivElements whereas the XHTML element can contain a wider variety of elements, including text. ParagraphElements are grouping elements that cannot directly contain text or graphics. ParagraphElements can, however, contain four types of child elements that do directly contain primitive text and graphics:
The following diagram illustrates the node hierarchy in the elements package of the Text Layout Framework:

The abstract base classes FlowElement, FlowGroupElement, and FlowLeafElement define the structure of the tree. All the objects in the tree derive from the FlowElement class. FlowElement objects represent paragraphs, groups of paragraphs and spans of text within paragraphs. The FlowGroupElement class is the base class for classes that can have an array of children. These classes include TextFlow, ParagraphElement, DivElement, and LinkElement. The FlowLeafElement class is the base class for classes at the lowest level of the tree, classes that have no children. These classes include InLineGraphicElement and SpanElement.
The remaining classes in the elements package play supporting roles.
| Interface | Description | |
|---|---|---|
| IConfiguration | Read-only interface to a configuration object. |
| Class | Description | |
|---|---|---|
| BreakElement | The BreakElement class defines a line break, which provides for creating a line break in the text without creating a new paragraph. | |
| Configuration | The Configuration class is a primary point of integration between the Text Layout Framework and an application. | |
| ContainerFormattedElement | ContainerFormattedElement is the root class for all container-level block elements, such as DivElement and TextFlow objects. | |
| DivElement | The DivElement class defines an element for grouping paragraphs (ParagraphElement objects). | |
| FlowElement | The text in a flow is stored in tree form with the elements of the tree representing logical divisions within the text. | |
| FlowGroupElement | The FlowGroupElement class is the base class for FlowElement objects that can have an array of children. | |
| FlowLeafElement | Base class for FlowElements that appear at the lowest level of the flow hierarchy. | |
| InlineGraphicElement | The InlineGraphicElement class handles graphic objects that display inline in the text. | |
| InlineGraphicElementStatus | The InlineGraphicElementStatus class defines a set of constants for checking the value of InLineGraphicElement.status. | |
| LinkElement | The LinkElement class defines a link to a URI, which is executed when the user clicks it. | |
| LinkState | The LinkState class defines a set of constants for the linkState property of the LinkElement class. | |
| ParagraphElement | The ParagraphElement class represents a paragraph in the text flow hierarchy. | |
| ParagraphFormattedElement | The ParagraphFormattedElement is an abstract base class for FlowElement classes that have paragraph properties. | |
| SpanElement | The SpanElement class represents a run of text that has a single set of formatting attributes applied. | |
| SpecialCharacterElement | The SpecialCharacterElement class is an abstract base class for elements that represent special characters. | |
| SubParagraphGroupElement | The SubParagraphGroupElement class groups FlowLeafElements together. | |
| TabElement | The TabElement class represents a <tab/> in the text flow. | |
| TCYElement | The TCYElement (Tatechuuyoko - ta-tae-chu-yo-ko) class is a subclass of SubParagraphGroupElement that causes text to draw horizontally within a vertical line. | |
| TextFlow | The TextFlow class is responsible for managing all the text content of a story. | |
| TextFlowLine | The TextFlowLine class represents a single line of text in a text flow. | |
| TextFlowLineLocation | The TextFlowLineLocation class is an enumeration class that defines constants for specifying the location of a line within a paragraph. |