Add context dependent actions to LibraryDialog. Make folder delete work on non-Maemo.
[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 #endif // Q_WS_MAEMO_5
33     void onBookAdded();
34     void onItemActivated(const QModelIndex &index);
35     void onCurrentBookChanged();
36
37 private:
38     QString createItemText(const Book *book);
39     void setSelected(const QModelIndex &index);
40     QModelIndex selected() const;
41     QListView *list;
42     SortedLibrary *sortedLibrary;
43 };
44
45 #endif // LIBRARYDIALOG_H