Clean up book view decorations code.
[dorian] / librarydialog.h
index 8d22463..a29a093 100644 (file)
@@ -5,42 +5,46 @@
 #include <QString>
 #include <QModelIndexList>
 
-class QMainWindow;
-class QListWidget;
-class QListWidgetItem;
+#include "listwindow.h"
+
 class QPushButton;
+class QModelIndex;
+class QCloseEvent;
+class ProgressDialog;
 class Book;
 class InfoWindow;
+class SortedLibrary;
+class QAction;
+class SearchDialog;
 
-class LibraryDialog: public QDialog
+/** Manage library. */
+class LibraryDialog: public ListWindow
 {
     Q_OBJECT
 
 public:
     explicit LibraryDialog(QWidget *parent = 0);
-    QListWidget *list;
-#ifndef Q_WS_MAEMO_5
-    QPushButton *detailsButton;
-    QPushButton *removeButton;
-    QPushButton *readButton;
-#endif
-    QPushButton *addButton;
-    QString lastDir;
 
 public slots:
     void onAdd();
-#ifndef Q_WS_MAEMO_5
-    void onRemove();
-    void onDetails();
-    void onRead();
-    void onItemSelectionChanged();
-#endif
+    void onAddFolder();
     void onBookAdded();
-    void onItemActivated(QListWidgetItem *item);
-    void onCurrentBookChanged();
+    void onItemActivated(const QModelIndex &index);
+    void onAddFromFolder(const QString &path);
+    void onAddFromFolderDone(int added);
+    void onSearch();
+    void showSearchResults();
+    void onSortByAuthor();
+    void onSortByTitle();
 
 private:
-    QString createItemText(const Book *book);
+    QString createItemText(Book *book);
+    void setSelected(const QModelIndex &index);
+    SortedLibrary *sortedLibrary;
+    ProgressDialog *progress;
+    QAction *sortByAuthor;
+    QAction *sortByTitle;
+    SearchDialog *searchDialog;
 };
 
 #endif // LIBRARYDIALOG_H