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.core.mimedata; 13 extern(C++): 14 15 import qt.config; 16 import qt.core.bytearray; 17 import qt.core.list; 18 import qt.core.metatype; 19 import qt.core.object; 20 import qt.core.string; 21 import qt.core.stringlist; 22 import qt.core.url; 23 import qt.core.variant; 24 import qt.helpers; 25 26 extern(C++, class) struct QMimeDataPrivate; 27 28 /// Binding for C++ class [QMimeData](https://doc.qt.io/qt-6/qmimedata.html). 29 class /+ Q_CORE_EXPORT +/ QMimeData : QObject 30 { 31 mixin(Q_OBJECT); 32 public: 33 this(); 34 ~this(); 35 36 final QList!(QUrl) urls() const; 37 final void setUrls(ref const(QList!(QUrl)) urls); 38 final bool hasUrls() const; 39 40 final QString text() const; 41 final void setText(ref const(QString) text); 42 final bool hasText() const; 43 44 final QString html() const; 45 final void setHtml(ref const(QString) html); 46 final bool hasHtml() const; 47 48 final QVariant imageData() const; 49 final void setImageData(ref const(QVariant) image); 50 final bool hasImage() const; 51 52 final QVariant colorData() const; 53 final void setColorData(ref const(QVariant) color); 54 final bool hasColor() const; 55 56 final QByteArray data(ref const(QString) mimetype) const; 57 final void setData(ref const(QString) mimetype, ref const(QByteArray) data); 58 final void removeFormat(ref const(QString) mimetype); 59 60 /+ virtual +/ bool hasFormat(ref const(QString) mimetype) const; 61 /+ virtual +/ QStringList formats() const; 62 63 final void clear(); 64 65 protected: 66 /+ virtual +/ QVariant retrieveData(ref const(QString) mimetype, QMetaType preferredType) const; 67 68 private: 69 /+ Q_DISABLE_COPY(QMimeData) +/ 70 /+ Q_DECLARE_PRIVATE(QMimeData) +/ 71 } 72