/* * Copyright 2008 Jason A. Donenfeld */ #ifndef COLLECTIONMODEL_H #define COLLECTIONMODEL_H #include #include #include class Song; class Credentials; class CollectionModel : public QAbstractItemModel { Q_OBJECT; public: CollectionModel(QList songs, Credentials* credentials, QObject* parent = 0); QVariant data(const QModelIndex &index, int role) const; int rowCount(const QModelIndex &parent = QModelIndex()) const; int columnCount(const QModelIndex &parent = QModelIndex()) const; QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const; QModelIndex index(int row, int column, const QModelIndex& parent = QModelIndex()) const; QModelIndex parent(const QModelIndex& index) const; Qt::ItemFlags flags(const QModelIndex&) const; QStringList mimeTypes() const; virtual QMimeData* mimeData(const QModelIndexList& indexes) const; Song* song(const QModelIndex& index) const; int position() const { return m_position; } void setPosition(int position) { m_position = position; } void setFakeBoldState(bool state) { m_fakeBoldState = state; } private: QList m_songs; int m_position; bool m_fakeBoldState; Credentials *m_credentials; }; #endif //COLLECTIONMODEL_H