Make selection handling work.
[dorian] / librarydialog.h
1 #ifndef LIBRARYDIALOG_H
2 #define LIBRARYDIALOG_H
3
4 #include <QDialog>
5 #include <QString>
6 #include <QModelIndexList>
7
8 class QMainWindow;
9 class QListView;
10 class QPushButton;
11 class QModelIndex;
12 class Book;
13 class InfoWindow;
14 class SortedLibrary;
15
16 class LibraryDialog: public QDialog
17 {
18     Q_OBJECT
19
20 public:
21     explicit LibraryDialog(QWidget *parent = 0);
22
23 public slots:
24     void onAdd();
25 #ifndef Q_WS_MAEMO_5
26     void onRemove();
27     void onDetails();
28     void onRead();
29     void onItemSelectionChanged();
30 #endif // Q_WS_MAEMO_5
31     void onBookAdded();
32     void onItemActivated(const QModelIndex &index);
33     void onCurrentBookChanged();
34
35 private:
36     QString createItemText(const Book *book);
37     void select(const QModelIndex &index);
38     QListView *list;
39     SortedLibrary *sortedLibrary;
40 #ifndef Q_WS_MAEMO_5
41     QPushButton *detailsButton;
42     QPushButton *removeButton;
43     QPushButton *readButton;
44 #endif // Q_WS_MAEMO_5
45     QPushButton *addButton;
46 };
47
48 #endif // LIBRARYDIALOG_H