<class name="QTextFrame" doc="/** <p>The <a href="QTextFrame.html#QTextFrame(com.trolltech.qt.gui.QTextDocument)"><tt>QTextFrame</tt></a> class represents a frame in a <a href="QTextDocument.html"><tt>QTextDocument</tt></a>.</p> <p>Text frames provide structure for the text in a document. They are used as generic containers for other document elements. Frames are usually created by using QTextCursor::insertFrame().</p> <p>Frames can be used to create hierarchical structures in rich text documents. Each document has a root frame (QTextDocument::rootFrame()), and each frame beneath the root frame has a parent frame and a (possibly empty) list of child frames. The parent frame can be found with <a href="QTextFrame.html#parentFrame()"><tt>parentFrame</tt></a>, and the <a href="QTextFrame.html#childFrames()"><tt>childFrames</tt></a> function provides a list of child frames.</p> <p>Each frame contains at least one text block to enable text cursors to insert new document elements within. As a result, the QTextFrame::iterator class is used to traverse both the blocks and child frames within a given frame. The first and last child elements in the frame can be found with <a href="QTextFrame.html#begin()"><tt>begin</tt></a> and <a href="QTextFrame.html#end()"><tt>end</tt></a>.</p> <p>A frame also has a format (specified using <a href="QTextFrameFormat.html"><tt>QTextFrameFormat</tt></a>) which can be set with <a href="QTextObject.html#setFormat(com.trolltech.qt.gui.QTextFormat)"><tt>setFormat</tt></a> and read with <a href="QTextObject.html#format()"><tt>format</tt></a>.</p> <p>Text cursors can be obtained that point to the first and last valid cursor positions within a frame; use the <a href="QTextFrame.html#firstCursorPosition()"><tt>firstCursorPosition</tt></a> and <a href="QTextFrame.html#lastCursorPosition()"><tt>lastCursorPosition</tt></a> functions for this. The frame's extent in the document can be found with <a href="QTextFrame.html#firstPosition()"><tt>firstPosition</tt></a> and <a href="QTextFrame.html#lastPosition()"><tt>lastPosition</tt></a>.</p> <p>You can iterate over a frame's contents using the QTextFrame::iterator class: this provides read-only access to its internal list of text blocks and child frames.</p> @see <a href="QTextCursor.html"><tt>QTextCursor</tt></a> @see <a href="QTextDocument.html"><tt>QTextDocument</tt></a> */"> <method name="public QTextFrame(com.trolltech.qt.gui.QTextDocument doc)" doc="/** <p>Creates a new empty frame for the text <tt>doc</tt>.</p> */"/> <method name="public final com.trolltech.qt.gui.QTextFrame_iterator begin()" doc="/** <p>Returns an iterator pointing to the first document element inside the frame.</p> @see <a href="QTextFrame.html#end()"><tt>end</tt></a> */"/> <method name="public final java.util.List<com.trolltech.qt.gui.QTextFrame> childFrames()" doc="/** <p>Returns a (possibly empty) list of the frame's child frames.</p> @see <a href="QTextFrame.html#parentFrame()"><tt>parentFrame</tt></a> */"/> <method name="public final com.trolltech.qt.gui.QTextFrame_iterator end()" doc="/** <p>Returns an iterator pointing to the last document element inside the frame.</p> @see <a href="QTextFrame.html#begin()"><tt>begin</tt></a> */"/> <method name="public final com.trolltech.qt.gui.QTextCursor firstCursorPosition()" doc="/** <p>Returns the first cursor position inside the frame.</p> @see <a href="QTextFrame.html#lastCursorPosition()"><tt>lastCursorPosition</tt></a> @see <a href="QTextFrame.html#firstPosition()"><tt>firstPosition</tt></a> @see <a href="QTextFrame.html#lastPosition()"><tt>lastPosition</tt></a> */"/> <method name="public final int firstPosition()" doc="/** <p>Returns the first document position inside the frame.</p> @see <a href="QTextFrame.html#lastPosition()"><tt>lastPosition</tt></a> @see <a href="QTextFrame.html#firstCursorPosition()"><tt>firstCursorPosition</tt></a> @see <a href="QTextFrame.html#lastCursorPosition()"><tt>lastCursorPosition</tt></a> */"/> <method name="public final com.trolltech.qt.gui.QTextFrameFormat frameFormat()" doc="/** <p>Returns the frame's format.</p> @see <a href="QTextFrame.html#setFrameFormat(com.trolltech.qt.gui.QTextFrameFormat)"><tt>setFrameFormat</tt></a> */"/> <method name="public final com.trolltech.qt.gui.QTextCursor lastCursorPosition()" doc="/** <p>Returns the last cursor position inside the frame.</p> @see <a href="QTextFrame.html#firstCursorPosition()"><tt>firstCursorPosition</tt></a> @see <a href="QTextFrame.html#firstPosition()"><tt>firstPosition</tt></a> @see <a href="QTextFrame.html#lastPosition()"><tt>lastPosition</tt></a> */"/> <method name="public final int lastPosition()" doc="/** <p>Returns the last document position inside the frame.</p> @see <a href="QTextFrame.html#firstPosition()"><tt>firstPosition</tt></a> @see <a href="QTextFrame.html#firstCursorPosition()"><tt>firstCursorPosition</tt></a> @see <a href="QTextFrame.html#lastCursorPosition()"><tt>lastCursorPosition</tt></a> */"/> <method name="public final com.trolltech.qt.gui.QTextFrame parentFrame()" doc="/** <p>Returns the frame's parent frame. If the frame is the root frame of a document, this will return 0.</p> @see <a href="QTextFrame.html#childFrames()"><tt>childFrames</tt></a> @see <tt>QTextDocument::rootFrame</tt> */"/> <method name="public final void setFrameFormat(com.trolltech.qt.gui.QTextFrameFormat format)" doc="/** <p>Sets the frame's <tt>format</tt>.</p> @see <a href="QTextFrame.html#frameFormat()"><tt>frameFormat</tt></a> */"/> </class>