#include <QString>
#include <QModelIndexList>
-class QMainWindow;
-class QListView;
+#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 slots:
void onAdd();
-#ifndef Q_WS_MAEMO_5
- void onRemove();
- void onDetails();
- void onRead();
- void onItemSelectionChanged();
-#endif // Q_WS_MAEMO_5
+ void onAddFolder();
void onBookAdded();
void onItemActivated(const QModelIndex &index);
- void onCurrentBookChanged();
+ void onAddFromFolder(const QString &path);
+ void onAddFromFolderDone(int added);
+ void onSearch();
+ void showSearchResults();
+ void onSortByAuthor();
+ void onSortByTitle();
private:
- QString createItemText(const Book *book);
- void select(const QModelIndex &index);
- QListView *list;
+ QString createItemText(Book *book);
+ void setSelected(const QModelIndex &index);
SortedLibrary *sortedLibrary;
-#ifndef Q_WS_MAEMO_5
- QPushButton *detailsButton;
- QPushButton *removeButton;
- QPushButton *readButton;
-#endif // Q_WS_MAEMO_5
- QPushButton *addButton;
+ ProgressDialog *progress;
+ QAction *sortByAuthor;
+ QAction *sortByTitle;
+ SearchDialog *searchDialog;
};
#endif // LIBRARYDIALOG_H