diff options
Diffstat (limited to 'src/backend/bookshelfmodel/btbookshelfmodel.h')
-rw-r--r-- | src/backend/bookshelfmodel/btbookshelfmodel.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/backend/bookshelfmodel/btbookshelfmodel.h b/src/backend/bookshelfmodel/btbookshelfmodel.h index 01fc260..16fdb13 100644 --- a/src/backend/bookshelfmodel/btbookshelfmodel.h +++ b/src/backend/bookshelfmodel/btbookshelfmodel.h @@ -17,6 +17,7 @@ #include "backend/drivers/cswordmoduleinfo.h" + class BtBookshelfModel: public QAbstractListModel { Q_OBJECT public: @@ -26,6 +27,7 @@ class BtBookshelfModel: public QAbstractListModel { ModulePointerRole = Qt::UserRole, ModuleCategoryRole = Qt::UserRole + 1, ModuleLanguageRole = Qt::UserRole + 2, + ModuleHiddenRole = Qt::UserRole + 3, UserRole = Qt::UserRole + 100 }; @@ -33,9 +35,12 @@ class BtBookshelfModel: public QAbstractListModel { virtual ~BtBookshelfModel(); virtual int rowCount(const QModelIndex &parent) const; + virtual QVariant data(CSwordModuleInfo *module, int role) const; virtual QVariant data(const QModelIndex &index, int role) const; virtual QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const; + bool setData(const QModelIndex &index, const QVariant &value, + int role = ModuleHiddenRole); inline CSwordModuleInfo *module(const QModelIndex &index) const { return (CSwordModuleInfo *) @@ -64,6 +69,9 @@ class BtBookshelfModel: public QAbstractListModel { return m_data; } + protected slots: + void moduleHidden(bool hidden); + protected: QList<CSwordModuleInfo *> m_data; }; |