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.abstractproxymodel;
13 extern(C++):
14 
15 import qt.config;
16 import qt.core.abstractitemmodel;
17 import qt.core.bytearray;
18 import qt.core.hash;
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.property;
25 import qt.core.size;
26 import qt.core.stringlist;
27 import qt.core.variant;
28 import qt.helpers;
29 
30 /+ QT_REQUIRE_CONFIG(proxymodel); +/
31 
32 
33 extern(C++, class) struct QAbstractProxyModelPrivate;
34 
35 /// Binding for C++ class [QAbstractProxyModel](https://doc.qt.io/qt-6/qabstractproxymodel.html).
36 abstract class /+ Q_CORE_EXPORT +/ QAbstractProxyModel : QAbstractItemModel
37 {
38     mixin(Q_OBJECT);
39     /+ Q_PROPERTY(QAbstractItemModel *sourceModel READ sourceModel WRITE setSourceModel
40                NOTIFY sourceModelChanged BINDABLE bindableSourceModel) +/
41 
42 public:
43     mixin(changeItaniumMangling(q{mangleConstructorBaseObject}, q{
44     /+ explicit +/this(QObject parent = null);
45     }));
46     ~this();
47 
48     /+ virtual +/ void setSourceModel(QAbstractItemModel sourceModel);
49     final QAbstractItemModel sourceModel() const;
50     final QBindable!(QAbstractItemModel) bindableSourceModel();
51 
52     /+ virtual +/ @QInvokable abstract QModelIndex mapToSource(ref const(QModelIndex) proxyIndex) const;
53     /+ virtual +/ @QInvokable abstract QModelIndex mapFromSource(ref const(QModelIndex) sourceIndex) const;
54 
55     /+ virtual +/ @QInvokable QItemSelection mapSelectionToSource(ref const(QItemSelection) selection) const;
56     /+ virtual +/ @QInvokable QItemSelection mapSelectionFromSource(ref const(QItemSelection) selection) const;
57 
58     override bool submit();
59     override void revert();
60 
61     override QVariant data(ref const(QModelIndex) proxyIndex, int role = /+ Qt:: +/qt.core.namespace.ItemDataRole.DisplayRole) const;
62     override QVariant headerData(int section, /+ Qt:: +/qt.core.namespace.Orientation orientation, int role = /+ Qt:: +/qt.core.namespace.ItemDataRole.DisplayRole) const;
63     override QMap!(int, QVariant) itemData(ref const(QModelIndex) index) const;
64     override /+ Qt:: +/qt.core.namespace.ItemFlags flags(ref const(QModelIndex) index) const;
65 
66     override bool setData(ref const(QModelIndex) index, ref const(QVariant) value, int role = /+ Qt:: +/qt.core.namespace.ItemDataRole.EditRole);
67     override bool setItemData(ref const(QModelIndex) index, ref const(QMap!(int, QVariant)) roles);
68     override bool setHeaderData(int section, /+ Qt:: +/qt.core.namespace.Orientation orientation, ref const(QVariant) value, int role = /+ Qt:: +/qt.core.namespace.ItemDataRole.EditRole);
69     override bool clearItemData(ref const(QModelIndex) index);
70 
71     override QModelIndex buddy(ref const(QModelIndex) index) const;
72     override bool canFetchMore(ref const(QModelIndex) parent) const;
73     override void fetchMore(ref const(QModelIndex) parent);
74     override void sort(int column, /+ Qt:: +/qt.core.namespace.SortOrder order = /+ Qt:: +/qt.core.namespace.SortOrder.AscendingOrder);
75     override QSize span(ref const(QModelIndex) index) const;
76     override bool hasChildren(ref const(QModelIndex) parent = globalInitVar!QModelIndex) const;
77     override QModelIndex sibling(int row, int column, ref const(QModelIndex) idx) const;
78 
79     override QMimeData mimeData(ref const(QModelIndexList) indexes) const;
80     mixin(changeWindowsMangling(q{mangleClassesTailConst}, q{
81     override bool canDropMimeData(const(QMimeData) data, /+ Qt:: +/qt.core.namespace.DropAction action,
82                              int row, int column, ref const(QModelIndex) parent) const;
83     }));
84     mixin(changeWindowsMangling(q{mangleClassesTailConst}, q{
85     override bool dropMimeData(const(QMimeData) data, /+ Qt:: +/qt.core.namespace.DropAction action,
86                           int row, int column, ref const(QModelIndex) parent);
87     }));
88     override QStringList mimeTypes() const;
89     override /+ Qt:: +/qt.core.namespace.DropActions supportedDragActions() const;
90     override /+ Qt:: +/qt.core.namespace.DropActions supportedDropActions() const;
91     override QHash!(int, QByteArray) roleNames() const;
92 
93 /+ Q_SIGNALS +/public:
94     @QSignal final void sourceModelChanged(QPrivateSignal);
95 
96 protected:
97     final QModelIndex createSourceIndex(int row, int col, void* internalPtr) const;
98     mixin(changeItaniumMangling(q{mangleConstructorBaseObject}, q{
99     this(ref QAbstractProxyModelPrivate , QObject parent);
100     }));
101 
102 private:
103     /+ Q_DECLARE_PRIVATE(QAbstractProxyModel) +/
104     /+ Q_DISABLE_COPY(QAbstractProxyModel) +/
105     /+ Q_PRIVATE_SLOT(d_func(), void _q_sourceModelDestroyed()) +/
106     mixin(CREATE_CONVENIENCE_WRAPPERS);
107 }
108