1 /**************************************************************************** 2 ** 3 ** DQt - D bindings for the Qt Toolkit 4 ** 5 ** GNU Lesser General Public License Usage 6 ** This file may be used under the terms of the GNU Lesser 7 ** General Public License version 3 as published by the Free Software 8 ** Foundation and appearing in the file LICENSE.LGPL3 included in the 9 ** packaging of this file. Please review the following information to 10 ** ensure the GNU Lesser General Public License version 3 requirements 11 ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. 12 ** 13 ****************************************************************************/ 14 module qt.gui.textdocumentfragment; 15 extern(C++): 16 17 import qt.config; 18 import qt.core.string; 19 import qt.gui.textcursor; 20 import qt.gui.textdocument; 21 import qt.helpers; 22 version(QT_NO_TEXTHTMLPARSER){}else 23 import qt.core.bytearray; 24 25 /+ class QTextStream; 26 class QTextDocument; +/ 27 extern(C++, class) struct QTextDocumentFragmentPrivate; 28 /+ class QTextCursor; +/ 29 30 extern(C++, class) struct /+ Q_GUI_EXPORT +/ QTextDocumentFragment 31 { 32 public: 33 @disable this(); 34 pragma(mangle, defaultConstructorMangling(__traits(identifier, typeof(this)))) 35 ref typeof(this) rawConstructor(); 36 static typeof(this) create() 37 { 38 typeof(this) r = typeof(this).init; 39 r.rawConstructor(); 40 return r; 41 } 42 43 /+ explicit +/this(const(QTextDocument) document); 44 /+ explicit +/this(ref const(QTextCursor) range); 45 @disable this(this); 46 this(ref const(QTextDocumentFragment) rhs); 47 /+ref QTextDocumentFragment operator =(ref const(QTextDocumentFragment) rhs);+/ 48 ~this(); 49 50 bool isEmpty() const; 51 52 QString toPlainText() const; 53 version(QT_NO_TEXTHTMLPARSER){}else 54 { 55 QString toHtml(ref const(QByteArray) encoding = globalInitVar!QByteArray) const; 56 } 57 58 static QTextDocumentFragment fromPlainText(ref const(QString) plainText); 59 version(QT_NO_TEXTHTMLPARSER){}else 60 { 61 static QTextDocumentFragment fromHtml(ref const(QString) html); 62 static QTextDocumentFragment fromHtml(ref const(QString) html, const(QTextDocument) resourceProvider); 63 } 64 65 private: 66 QTextDocumentFragmentPrivate* d; 67 /+ friend class QTextCursor; +/ 68 /+ friend class QTextDocumentWriter; +/ 69 } 70