Make orientation switch explicit on Symbian, too.
[dorian] / model / sortedlibrary.h
1 #ifndef SORTEDLIBRARY_H
2 #define SORTEDLIBRARY_H
3
4 #include <QSortFilterProxyModel>
5
6 class Book;
7
8 /** Sorted library model. */
9 class SortedLibrary: public QSortFilterProxyModel
10 {
11     Q_OBJECT
12
13 public:
14     enum SortBy {SortByTitle, SortByAuthor};
15     explicit SortedLibrary(QObject *parent = 0);
16     bool lessThan(const QModelIndex &left, const QModelIndex &right) const;
17     void setSortBy(SortBy key);
18     SortBy sortBy();
19
20 signals:
21
22 public slots:
23
24 protected:
25     int compareBy(SortBy key, Book *left, Book *right) const;
26
27 private:
28     SortBy mSortBy;
29 };
30
31 #endif // SORTEDLIBRARY_H