File indexing completed on 2024-12-01 06:33:12

0001 /*
0002     This file is part of Kiten, a KDE Japanese Reference Tool...
0003     SPDX-FileCopyrightText: 2001 Jason Katz-Brown <jason@katzbrown.com>
0004     SPDX-FileCopyrightText: 2006 Joseph Kerian <jkerian@gmail.com>
0005     SPDX-FileCopyrightText: 2006 Eric Kjeldergaard <kjelderg@gmail.com>
0006 
0007     SPDX-License-Identifier: GPL-2.0-or-later
0008 */
0009 
0010 #ifndef ENTRYLISTMODEL_H
0011 #define ENTRYLISTMODEL_H
0012 
0013 #include "entrylist.h"
0014 
0015 #include <QAbstractTableModel>
0016 #include <QModelIndex>
0017 
0018 class EntryListModel : public QAbstractTableModel
0019 {
0020     Q_OBJECT
0021 
0022 public:
0023     explicit EntryListModel(const EntryList &list);
0024 
0025     int columnCount(const QModelIndex &parent = QModelIndex()) const override;
0026     QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
0027     EntryList entryList() const;
0028     Qt::ItemFlags flags(const QModelIndex &index) const override;
0029     int rowCount(const QModelIndex &parent = QModelIndex()) const override;
0030     bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override;
0031     void setEntryList(const EntryList &list);
0032 
0033 private:
0034     EntryList _list;
0035 };
0036 
0037 #endif