<class name="QTextDocumentFragment" doc="/** <p>The <a href="QTextDocumentFragment.html#QTextDocumentFragment(com.trolltech.qt.gui.QTextDocument)"><tt>QTextDocumentFragment</tt></a> class represents a piece of formatted text from a <a href="QTextDocument.html"><tt>QTextDocument</tt></a>.</p> <p>A <a href="QTextDocumentFragment.html#QTextDocumentFragment(com.trolltech.qt.gui.QTextDocument)"><tt>QTextDocumentFragment</tt></a> is a fragment of rich text, that can be inserted into a <a href="QTextDocument.html"><tt>QTextDocument</tt></a>. A document fragment can be created from a <a href="QTextDocument.html"><tt>QTextDocument</tt></a>, from a <a href="QTextCursor.html"><tt>QTextCursor</tt></a>'s selection, or from another document fragment. Document fragments can also be created by the static functions, <a href="QTextDocumentFragment.html#fromPlainText(java.lang.String)"><tt>fromPlainText</tt></a> and <a href="QTextDocumentFragment.html#fromHtml(java.lang.String, com.trolltech.qt.gui.QTextDocument)"><tt>fromHtml</tt></a>.</p> <p>The contents of a document fragment can be obtained as plain text by using the <a href="QTextDocumentFragment.html#toPlainText()"><tt>toPlainText</tt></a> function, or it can be obtained as HTML with <a href="QTextDocumentFragment.html#toHtml()"><tt>toHtml</tt></a>.</p> */"> <method name="public QTextDocumentFragment(com.trolltech.qt.gui.QTextCursor range)" doc="/** <p>Creates a <a href="QTextDocumentFragment.html#QTextDocumentFragment(com.trolltech.qt.gui.QTextDocument)"><tt>QTextDocumentFragment</tt></a> from the <tt>range</tt>'s selection. If the cursor doesn't have a selection, the created fragment is empty.</p> @see <a href="QTextDocumentFragment.html#isEmpty()"><tt>isEmpty</tt></a> @see <tt>QTextCursor::selection</tt> */"/> <method name="public QTextDocumentFragment()" doc="/** <p>Constructs an empty <a href="QTextDocumentFragment.html#QTextDocumentFragment(com.trolltech.qt.gui.QTextDocument)"><tt>QTextDocumentFragment</tt></a>.</p> @see <a href="QTextDocumentFragment.html#isEmpty()"><tt>isEmpty</tt></a> */"/> <method name="public QTextDocumentFragment(com.trolltech.qt.gui.QTextDocumentFragment rhs)" doc="/** <p>Copy constructor. Creates a copy of the <tt>rhs</tt> fragment.</p> */"/> <method name="public QTextDocumentFragment(com.trolltech.qt.gui.QTextDocument document)" doc="/** <p>Converts the given <tt>document</tt> into a <a href="QTextDocumentFragment.html#QTextDocumentFragment(com.trolltech.qt.gui.QTextDocument)"><tt>QTextDocumentFragment</tt></a>. Note that the <a href="QTextDocumentFragment.html#QTextDocumentFragment(com.trolltech.qt.gui.QTextDocument)"><tt>QTextDocumentFragment</tt></a> only stores the document contents, not meta information like the document's title.</p> */"/> <method name="public final boolean isEmpty()" doc="/** <p>Returns true if the fragment is empty; otherwise returns false.</p> */"/> <method name="public final java.lang.String toHtml(com.trolltech.qt.core.QByteArray encoding)" doc="/** <p>Returns the contents of the document fragment as HTML, using the specified <tt>encoding</tt> (e.g&#x2e;, &quot;UTF-8&quot;, &quot;ISO 8859-1&quot;).</p> @see <a href="QTextDocumentFragment.html#toPlainText()"><tt>toPlainText</tt></a> @see <tt>QTextDocument::toHtml</tt> @see <a href="%2E%2E/core/QTextCodec.html"><tt>QTextCodec</tt></a> */"/> <method name="public final java.lang.String toHtml()"/> <method name="public final java.lang.String toPlainText()" doc="/** <p>Returns the document fragment's text as plain text (i.e&#x2e; with no formatting information).</p> @see <a href="QTextDocumentFragment.html#toHtml()"><tt>toHtml</tt></a> */"/> <method name="public native static com.trolltech.qt.gui.QTextDocumentFragment fromHtml(java.lang.String html)" doc="/** <p>Returns a <a href="QTextDocumentFragment.html#QTextDocumentFragment(com.trolltech.qt.gui.QTextDocument)"><tt>QTextDocumentFragment</tt></a> based on the arbitrary piece of HTML in the given <tt>html</tt>. The formatting is preserved as much as possible; for example, &quot;&lt;b&gt;bold&lt;/b&gt;&quot; will become a document fragment with the text &quot;bold&quot; with a bold character format.</p> */"/> <method name="public static com.trolltech.qt.gui.QTextDocumentFragment fromHtml(java.lang.String html, com.trolltech.qt.gui.QTextDocument resourceProvider)" doc="/** <p>Returns a <a href="QTextDocumentFragment.html#QTextDocumentFragment(com.trolltech.qt.gui.QTextDocument)"><tt>QTextDocumentFragment</tt></a> based on the arbitrary piece of HTML in the given <tt>html</tt>. The formatting is preserved as much as possible; for example, &quot;&lt;b&gt;bold&lt;/b&gt;&quot; will become a document fragment with the text &quot;bold&quot; with a bold character format.</p> <p>If the provided HTML contains references to external resources such as imported style sheets, then they will be loaded through the <tt>resourceProvider</tt>.</p> */"/> <method name="public native static com.trolltech.qt.gui.QTextDocumentFragment fromPlainText(java.lang.String plainText)" doc="/** <p>Returns a document fragment that contains the given <tt>plainText</tt>.</p> <p>When inserting such a fragment into a <a href="QTextDocument.html"><tt>QTextDocument</tt></a> the current char format of the <a href="QTextCursor.html"><tt>QTextCursor</tt></a> used for insertion is used as format for the text.</p> */"/> </class>