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