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