4 #include <QAbstractListModel>
13 /** Library of books. */
14 class Library: public QAbstractListModel
19 static Library *instance();
21 int rowCount(const QModelIndex &parent = QModelIndex()) const;
22 QVariant data(const QModelIndex &index, int role) const;
25 QModelIndex find(QString path) const;
26 QModelIndex find(const Book *book) const;
27 void setNowReading(const QModelIndex &index);
28 QModelIndex nowReading() const;
29 Book *book(const QModelIndex &index);
30 QStringList bookPaths();
34 void nowReadingChanged();
35 void beginUpgrade(int total);
36 void upgrading(const QString &book);
38 void beginLoad(int total);
39 void loading(const QString &book);
43 bool add(const QString &path);
44 void remove(const QString &path);
45 void remove(const QModelIndex &index);
46 void onBookOpened(const QString &path);
49 explicit Library(QObject *parent = 0);
53 QModelIndex mNowReading;