Jump to exact position on page, as identified by TOC entry. Handle
[dorian] / model / sortedlibrary.h
1 #ifndef SORTEDLIBRARY_H
2 #define SORTEDLIBRARY_H
3
4 #include <QSortFilterProxyModel>
5 #include "library.h"
6
7 /** Sorted library model. */
8 class SortedLibrary: public QSortFilterProxyModel
9 {
10     Q_OBJECT
11
12 public:
13     enum SortBy {SortByTitle, SortByAuthor};
14     explicit SortedLibrary(QObject *parent = 0);
15     bool lessThan(const QModelIndex &left, const QModelIndex &right) const;
16     void sortBy(SortBy key);
17
18 signals:
19
20 public slots:
21
22 protected:
23     SortBy mSortBy;
24 };
25
26 #endif // SORTEDLIBRARY_H