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.core.abstractproxymodel; 15 extern(C++): 16 17 import qt.config; 18 import qt.core.abstractitemmodel; 19 import qt.core.itemselectionmodel; 20 import qt.core.map; 21 import qt.core.mimedata; 22 import qt.core.namespace; 23 import qt.core.object; 24 import qt.core.size; 25 import qt.core.stringlist; 26 import qt.core.variant; 27 import qt.helpers; 28 29 /+ QT_REQUIRE_CONFIG(proxymodel); +/ 30 31 32 extern(C++, class) struct QAbstractProxyModelPrivate; 33 /+ class QItemSelection; +/ 34 35 class /+ Q_CORE_EXPORT +/ QAbstractProxyModel : QAbstractItemModel 36 { 37 mixin(Q_OBJECT); 38 /+ Q_PROPERTY(QAbstractItemModel* sourceModel READ sourceModel WRITE setSourceModel NOTIFY sourceModelChanged) +/ 39 40 public: 41 /+ explicit +/this(QObject parent = null); 42 ~this(); 43 44 /+ virtual +/ void setSourceModel(QAbstractItemModel sourceModel); 45 final QAbstractItemModel sourceModel() const; 46 47 /+ virtual +/ @QInvokable abstract QModelIndex mapToSource(ref const(QModelIndex) proxyIndex) const; 48 /+ virtual +/ @QInvokable abstract QModelIndex mapFromSource(ref const(QModelIndex) sourceIndex) const; 49 50 /+ virtual +/ @QInvokable QItemSelection mapSelectionToSource(ref const(QItemSelection) selection) const; 51 /+ virtual +/ @QInvokable QItemSelection mapSelectionFromSource(ref const(QItemSelection) selection) const; 52 53 override bool submit(); 54 override void revert(); 55 56 override QVariant data(ref const(QModelIndex) proxyIndex, int role = /+ Qt:: +/qt.core.namespace.ItemDataRole.DisplayRole) const; 57 override QVariant headerData(int section, /+ Qt:: +/qt.core.namespace.Orientation orientation, int role = /+ Qt:: +/qt.core.namespace.ItemDataRole.DisplayRole) const; 58 override QMap!(int, QVariant) itemData(ref const(QModelIndex) index) const; 59 override /+ Qt:: +/qt.core.namespace.ItemFlags flags(ref const(QModelIndex) index) const; 60 61 override bool setData(ref const(QModelIndex) index, ref const(QVariant) value, int role = /+ Qt:: +/qt.core.namespace.ItemDataRole.EditRole); 62 override bool setItemData(ref const(QModelIndex) index, ref const(QMap!(int, QVariant)) roles); 63 override bool setHeaderData(int section, /+ Qt:: +/qt.core.namespace.Orientation orientation, ref const(QVariant) value, int role = /+ Qt:: +/qt.core.namespace.ItemDataRole.EditRole); 64 /+ #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) 65 bool clearItemData(const QModelIndex &index) override; 66 #endif +/ 67 68 override QModelIndex buddy(ref const(QModelIndex) index) const; 69 override bool canFetchMore(ref const(QModelIndex) parent) const; 70 override void fetchMore(ref const(QModelIndex) parent); 71 override void sort(int column, /+ Qt:: +/qt.core.namespace.SortOrder order = /+ Qt:: +/qt.core.namespace.SortOrder.AscendingOrder); 72 override QSize span(ref const(QModelIndex) index) const; 73 override bool hasChildren(ref const(QModelIndex) parent = globalInitVar!QModelIndex) const; 74 override QModelIndex sibling(int row, int column, ref const(QModelIndex) idx) const; 75 76 override QMimeData mimeData(ref const(QModelIndexList) indexes) const; 77 override bool canDropMimeData(const(QMimeData) data, /+ Qt:: +/qt.core.namespace.DropAction action, 78 int row, int column, ref const(QModelIndex) parent) const; 79 override bool dropMimeData(const(QMimeData) data, /+ Qt:: +/qt.core.namespace.DropAction action, 80 int row, int column, ref const(QModelIndex) parent); 81 override QStringList mimeTypes() const; 82 override /+ Qt:: +/qt.core.namespace.DropActions supportedDragActions() const; 83 override /+ Qt:: +/qt.core.namespace.DropActions supportedDropActions() const; 84 85 /+ Q_SIGNALS +/public: 86 @QSignal final void sourceModelChanged(QPrivateSignal); 87 88 protected /+ Q_SLOTS +/: 89 // @QSlot final void resetInternalData(); 90 91 protected: 92 this(ref QAbstractProxyModelPrivate , QObject parent); 93 94 private: 95 /+ Q_DECLARE_PRIVATE(QAbstractProxyModel) +/ 96 /+ Q_DISABLE_COPY(QAbstractProxyModel) +/ 97 /+ Q_PRIVATE_SLOT(d_func(), void _q_sourceModelDestroyed()) +/ 98 } 99