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.stringlistmodel;
15 extern(C++):
16 
17 import qt.config;
18 import qt.core.abstractitemmodel;
19 import qt.core.map;
20 import qt.core.namespace;
21 import qt.core.object;
22 import qt.core.stringlist;
23 import qt.core.variant;
24 import qt.helpers;
25 
26 /+ QT_REQUIRE_CONFIG(stringlistmodel); +/
27 
28 
29 class /+ Q_CORE_EXPORT +/ QStringListModel : QAbstractListModel
30 {
31     mixin(Q_OBJECT);
32 public:
33     /+ explicit +/this(QObject parent = null);
34     /+ explicit +/this(ref const(QStringList) strings, QObject parent = null);
35 
36     override int rowCount(ref const(QModelIndex) parent = globalInitVar!QModelIndex) const;
37     override QModelIndex sibling(int row, int column, ref const(QModelIndex) idx) const;
38 
39     override QVariant data(ref const(QModelIndex) index, int role = /+ Qt:: +/qt.core.namespace.ItemDataRole.DisplayRole) const;
40     override bool setData(ref const(QModelIndex) index, ref const(QVariant) value, int role = /+ Qt:: +/qt.core.namespace.ItemDataRole.EditRole);
41 /+ #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
42     bool clearItemData(const QModelIndex &index) override;
43 #endif +/
44 
45     override /+ Qt:: +/qt.core.namespace.ItemFlags flags(ref const(QModelIndex) index) const;
46 
47     override bool insertRows(int row, int count, ref const(QModelIndex) parent = globalInitVar!QModelIndex);
48     override bool removeRows(int row, int count, ref const(QModelIndex) parent = globalInitVar!QModelIndex);
49     override bool moveRows(ref const(QModelIndex) sourceParent, int sourceRow, int count, ref const(QModelIndex) destinationParent, int destinationChild);
50 
51     override QMap!(int, QVariant) itemData(ref const(QModelIndex) index) const;
52     override bool setItemData(ref const(QModelIndex) index, ref const(QMap!(int, QVariant)) roles);
53 
54     override void sort(int column, /+ Qt:: +/qt.core.namespace.SortOrder order = /+ Qt:: +/qt.core.namespace.SortOrder.AscendingOrder);
55 
56     final QStringList stringList() const;
57     final void setStringList(ref const(QStringList) strings);
58 
59     override /+ Qt:: +/qt.core.namespace.DropActions supportedDropActions() const;
60 
61 private:
62     /+ Q_DISABLE_COPY(QStringListModel) +/
63     QStringList lst;
64 }
65