4 #include <QAbstractListModel>
12 /** Library of books. */
13 class Library: public QAbstractListModel
18 static Library *instance();
20 int rowCount(const QModelIndex & parent = QModelIndex()) const;
21 QVariant data(const QModelIndex &index, int role) const;
23 int find(QString path) const;
24 int find(const Book *book) const;
25 Book *at(int index) const;
27 Book *current() const;
28 bool add(QString path);
29 void remove(int index);
30 void setCurrent(int index);
34 void bookRemoved(int index);
35 void currentBookChanged();
38 explicit Library(QObject *parent = 0);
42 static Library *mInstance;